TSP: The Transport Sample Protocol



Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

libUTIL.h

Go to the documentation of this file.
00001 
00038 #ifndef _RES_INTERFACE_H
00039 #define _RES_INTERFACE_H
00040 
00041 extern int _use_dbl;
00042 
00043 #define RES_COM_NUM     20
00044 #define RES_COM_LEN     256
00045 
00046 #define RES_VAR_NUM     3000
00047 #define RES_NAME_LEN    100
00048 #define RES_DESC_LEN    256
00049 
00050 typedef void* d_rhandle;
00051 typedef void* d_whandle;
00052 
00053 
00054 
00055 #if defined(_LIBUTIL_REENTRANT) || defined(_LIBUTIL_COMPIL)
00056 
00057 d_rhandle d_ropen_r(char *name, int* use_dbl);
00058 int     d_rval_r(d_rhandle h, int c);
00059 void    d_rnam_r(d_rhandle h,char *nam, char *desc, int i);
00060 void    d_rcom_r(d_rhandle h,char *com, int i);
00061 int     d_read_r(d_rhandle h,void *buf);
00062 int     d_restart_r(d_rhandle h);
00063 int     d_dread_r(d_rhandle h,void *buf, int i);
00064 void    d_rclos_r(d_rhandle h);
00065 
00066 
00067 d_whandle       d_wopen_r(char *name, int use_dbl);
00068 void    d_wcom_r(d_whandle h,char *com);
00069 void    d_wnam_r(d_whandle h,char *nam, char *des);
00070 void    d_writ_r(d_whandle h,void *buf);
00071 void    d_wclos_r(d_whandle h);
00072 
00073 #endif
00074 
00075 #if !defined(_LIBUTIL_REENTRANT) || defined(_LIBUTIL_COMPIL)
00076 
00077 void     d_ropen(char *name);
00078 int     d_rval(int c);
00079 void    d_rnam(char *nam, char *desc, int i);
00080 void    d_rcom(char *com, int i);
00081 int     d_read(void *buf);
00082 int     d_dread(void *buf, int i);
00083 
00084 void    d_wopen (char *name);
00085 void    d_wcom(char *com);
00086 void    d_wnam(char *nam, char *des);
00087 void    d_writ(void *buf);
00088 
00089 void    d_clos(void);
00090 
00091 #endif
00092 
00093 /*-----------------------------------------------------*\
00094 |                                                       |
00095 | Macros for endianity, taken from TSP                  |
00096 |                                                       |
00097 \*-----------------------------------------------------*/
00098 #include <tsp_abs_types.h>
00099 
00100 #if TSP_BYTE_ORDER == TSP_BIG_ENDIAN
00101 #define FLOAT_TO_BE(pval)   
00102 #define DOUBLE_TO_BE(pval)  
00103 #define FLOAT_FROM_BE(pval)   
00104 #define DOUBLE_FROM_BE(pval)  
00105 #endif
00106 
00107 #if TSP_BYTE_ORDER == TSP_LITTLE_ENDIAN
00108 #define FLOAT_TO_BE(pval) *(uint32_t*)(pval) = TSP_UINT32_TO_BE(*(uint32_t*)(pval))
00109 
00110 #define DOUBLE_TO_BE(pval) *(uint64_t*)(pval) = TSP_UINT64_TO_BE(*(uint64_t*)(pval))
00111 
00112 #define FLOAT_FROM_BE(pval)   FLOAT_TO_BE(pval)
00113 #define DOUBLE_FROM_BE(pval)  DOUBLE_TO_BE(pval)
00114 
00115 #endif
00116 
00117 #endif /* _RES_INTERFACE_H */
Framework Home Page.

Beware !! TSP wave is coming...