misc.h
Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  *---------------------           WMPSNIFFER          --------------------
00003  *------------------------------------------------------------------------
00004  *                                                         V7.0B  11/05/10
00005  *
00006  *
00007  *  File: misc.h
00008  *  Authors: Danilo Tardioli
00009  *  ----------------------------------------------------------------------
00010  *  Copyright (C) 2000-2012, Universidad de Zaragoza, SPAIN
00011  *
00012  *  Contact Addresses: Danilo Tardioli                   dantard@unizar.es
00013  *
00014  *  RT-WMP is free software; you can  redistribute it and/or  modify it
00015  *  under the terms of the GNU General Public License  as published by the
00016  *  Free Software Foundation;  either  version 2, or (at  your option) any
00017  *  later version.
00018  *
00019  *  RT-WMP  is distributed  in the  hope  that  it will be   useful, but
00020  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
00021  *  MERCHANTABILITY  or  FITNESS FOR A  PARTICULAR PURPOSE.    See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received  a  copy of  the  GNU General Public  License
00025  *  distributed with RT-WMP;  see file COPYING.   If not,  write to the
00026  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
00027  *  02111-1307, USA.
00028  *
00029  *  As a  special exception, if you  link this  unit  with other  files to
00030  *  produce an   executable,   this unit  does  not  by  itself cause  the
00031  *  resulting executable to be covered by the  GNU General Public License.
00032  *  This exception does  not however invalidate  any other reasons why the
00033  *  executable file might be covered by the GNU Public License.
00034  *
00035  *----------------------------------------------------------------------*/
00036 
00037 #ifndef MISC_H_
00038 #define MISC_H_
00039 #include "pthread.h"
00040 
00041 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
00042 
00043 #define mBits(x,m) ((x)&(m))
00044 #define mBitsExcept(x,m,be) (((x)&(m))& ~(be))
00045 #define mTestBits(x,m,b) (mBits(x,m)==(b)))
00046 #define mTestBitsExcept(x,m,b,be) (mBitsExcept(x,m,be)==(b))
00047 
00048 #define mBitsOn(lvx,by) ((lvx)|=(by))
00049 #define mBitsOnExcept(lvx,by,be) ((lvx)|=(by)&~(be))
00050 #define mBitsOff(lvx,bn) ((lvx)&= ~(bn))
00051 #define mBitsOffExcept(lvx,bn,be) ((lvx)&= ~((bn)&~(be)))
00052 #define mBitsToggle(lvx,b) ((lvx)^= (b))
00053 #define mBitsToggleExcept(lvx,b,be) ((lvx)^= ((b)&~(be)))
00054 
00055 #define mBitsOnOff(lvx,by,bn) {mBitsOff(lvx,bn);mBitsOn(lvx,by);}
00056 #define mBitsOnOffExcept(lvx,by,bn,be) {mBitsOffExcept(lvx,bn,be);mBitsOnExcept(lvx,by,be);}
00057 
00058 #define mBitsSet(x,n) mBitsOn(x, (int) (1<<n))
00059 #define mBitsUnset(x,n) mBitsOff(x, (int) (1<<n))
00060 #define mBitsTogg(x,n) mBitsToggle(x, (int) (1<<n))
00061 
00062 #define mBitsIsSet(x,n) mBits(x, (int) (1<<n))
00063 
00064 #define WAIT(p)  //pthread_mutex_lock(p)
00065 #define SIGNAL(p) //pthread_mutex_unlock(p)
00066 
00067 unsigned long getActualTimeus();
00068 unsigned long long getRawActualTimeus();
00069 
00070 struct Status_t {
00071         int n_nodes;
00072         int rec_type;
00073 
00074 };
00075 
00076 
00077 #endif /*MISC_H_*/


ros_rt_wmp_sniffer
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Mon Oct 6 2014 08:27:57