Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

io.h

00001 /*
00002  *  libFreiburg - src/LibFreiburg/include/msgque/io.h
00003  *  
00004  *  (C) 2004 - Freiburg - Project - Group
00005  *  ------------------------------------------------------
00006  *  EMail: freiburg AT compiler-factory DOT de
00007  *  ------------------------------------------------------
00008  *  all rights reserved
00009  */
00010 
00011 #ifndef MQ_IO_H
00012 #define MQ_IO_H
00013 
00014 /* ####################################################################### */
00015 /* ###                                                                 ### */
00016 /* ###                           I O - A P I                           ### */
00017 /* ###                                                                 ### */
00018 /* ####################################################################### */
00019 
00034 /*****************************************************************************/
00035 /*                                                                           */
00036 /*                                 io_misc                                   */
00037 /*                                                                           */
00038 /*****************************************************************************/
00039 
00041 typedef enum { IO_UDS, IO_TCP } MqIoComE;
00043 typedef enum { IO_COM, IO_N_TCP, IO_N_UDS, IO_N_GENERIC } MqIoOptE;
00045 typedef enum { TCP_HOST, TCP_PORT } MqTcpOptE;
00047 typedef enum { UDS_FILE } MqUdsOptE;
00049 typedef enum { GENERIC_ID, GENERIC_BUFFERSIZE, GENERIC_SOERROR,
00050   GENERIC_INETD
00051 } MqGenericOptE;
00052 
00054 MQ_EXTERN MQ_PTR MqIoGetOpt (
00055   MqIoSP const io,              
00056   MqIoOptE opt,                 
00057   MQ_INT2 opt2                  
00058 );
00059 
00061 #define MqIoGetId(io)           ((MQ_STR)MqIoGetOpt(io,IO_N_GENERIC,GENERIC_ID))
00062 
00063 #define MqIoGetCom(io)          (*((MqIoComE*)MqIoGetOpt(io,IO_COM,0)))
00064 
00065 #define MqIoGetInted(io)        (*((MQ_INT2*)MqIoGetOpt(io,IO_N_GENERIC,GENERIC_INETD)))
00066 
00067 #define MqIoGetBufferSize(io)   (*((MQ_INT4*)MqIoGetOpt(io,IO_N_GENERIC,GENERIC_BUFFERSIZE)))
00068 
00071 /* ####################################################################### */
00072 /* ###                                                                 ### */
00073 /* ###                        R E A D - A P I                          ### */
00074 /* ###                                                                 ### */
00075 /* ####################################################################### */
00076 
00090 /*****************************************************************************/
00091 /*                                                                           */
00092 /*                                read_reference                             */
00093 /*                                                                           */
00094 /*****************************************************************************/
00095 
00098 MQ_EXTERN void MqReadCreate_LST_Ref (
00099   MqReadSP const in,
00100   const MqBufferSP buf,
00101   MqReadSP *out
00102 );
00103 
00106 MQ_EXTERN void MqReadDelete_LST_Ref (
00107   MqReadSP *readP
00108 );
00109 
00112 MQ_EXTERN void MqReadCreate_RET_Ref (
00113   MqReadSP const in,
00114   MqReadSP *out
00115 );
00116 
00119 MQ_EXTERN void MqReadDelete_RET_Ref (
00120   MqReadSP *readP
00121 );
00122 
00123 /*****************************************************************************/
00124 /*                                                                           */
00125 /*                                read_native                                */
00126 /*                                                                           */
00127 /*****************************************************************************/
00128 
00130 MQ_EXTERN MqErrorE MqReadRET (
00131   MqReadSP const read,
00132   MqBufferSP const buf
00133 );
00134 
00135 /*****************************************************************************/
00136 /*                                                                           */
00137 /*                                read_atom                                  */
00138 /*                                                                           */
00139 /*****************************************************************************/
00140 
00142 MQ_EXTERN MqErrorE MqReadU (
00143   MqReadSP const read,
00144   MqBufferSP *out
00145 );
00146 
00148 MQ_EXTERN void MqReadUDecr (
00149   MqReadSP const read,
00150   const MqBufferSP buf
00151 );
00152 
00154 MQ_EXTERN MqErrorE MqRead2 (
00155   MqReadSP const read,
00156   MQ_INT2 *out
00157 );
00158 
00160 MQ_EXTERN MqErrorE MqRead4 (
00161   MqReadSP const read,
00162   MQ_INT4 *out
00163 );
00164 
00166 MQ_EXTERN MqErrorE MqRead8 (
00167   MqReadSP const read,
00168   MQ_INT8 *out
00169 );
00170 
00172 MQ_EXTERN MqErrorE MqReadF (
00173   MqReadSP const read,
00174   MQ_FLT4 *out
00175 );
00176 
00178 MQ_EXTERN MqErrorE MqReadD (
00179   MqReadSP const read,
00180   MQ_FLT8 *out
00181 );
00182 
00184 MQ_EXTERN MqErrorE MqReadP (
00185   MqReadSP const read,
00186   MQ_PTR *out
00187 );
00188 
00190 MQ_EXTERN MqErrorE MqReadC (
00191   MqReadSP const read,
00192   MQ_STR *out
00193 );
00194 
00200 MQ_EXTERN MqErrorE MqReadArgv (
00201   MqReadSP const read,          
00202   int *argc,                    
00203   char ***argv                  
00204 );
00205 
00206 /*****************************************************************************/
00207 /*                                                                           */
00208 /*                                read_high                                  */
00209 /*                                                                           */
00210 /*****************************************************************************/
00211 
00213 MQ_EXTERN inline MQ_SIZE MqReadGetNumItems (
00214   MqReadSP const read
00215 );
00216 
00218 MQ_EXTERN char MqReadGetReturnCode (
00219   MqReadSP const read
00220 );
00221 
00223 MQ_EXTERN inline MQ_INT2 MqReadGetReturnNum (
00224   MqReadSP const read
00225 );
00226 
00228 MQ_EXTERN inline MqSP MqReadGetMsgque (
00229   MqReadSP const read
00230 );
00233 /* ####################################################################### */
00234 /* ###                                                                 ### */
00235 /* ###                        S E N D - A P I                          ### */
00236 /* ###                                                                 ### */
00237 /* ####################################################################### */
00238 
00263 /*****************************************************************************/
00264 /*                                                                           */
00265 /*                              send_atom                                    */
00266 /*                                                                           */
00267 /*****************************************************************************/
00268 
00270 MQ_EXTERN inline void MqSendC (
00271   MqSendSP const send,
00272   const MQ_STR in
00273 );
00274 
00276 MQ_EXTERN void MqSendV (
00277   MqSendSP const send,
00278   const char *fmt,
00279   ...
00280 );
00281 
00283 MQ_EXTERN inline void MqSendVL (
00284   MqSendSP const send,
00285   const char *fmt,
00286   va_list ap
00287 );
00288 
00290 MQ_EXTERN void MqSend2 (
00291   MqSendSP const send,
00292   const MQ_INT2 in
00293 );
00294 
00296 MQ_EXTERN void MqSend4 (
00297   MqSendSP const send,
00298   const MQ_INT4 in
00299 );
00300 
00302 MQ_EXTERN void MqSend8 (
00303   MqSendSP const send,
00304   const MQ_INT8 in
00305 );
00306 
00308 MQ_EXTERN void MqSendF (
00309   MqSendSP const send,
00310   const MQ_FLT4 in
00311 );
00312 
00314 MQ_EXTERN void MqSendD (
00315   MqSendSP const send,
00316   const MQ_FLT8 in
00317 );
00318 
00320 MQ_EXTERN void MqSendP (
00321   MqSendSP const send,
00322   const MQ_PTR in
00323 );
00324 
00326 MQ_EXTERN void MqSendB (
00327   MqSendSP const send,
00328   const MQ_BIN in,
00329   const MQ_SIZE len
00330 );
00331 
00333 MQ_EXTERN void MqSendU (
00334   MqSendSP send,
00335   const MqBufferSP buf
00336 );
00337 
00338 /*****************************************************************************/
00339 /*                                                                           */
00340 /*                            send_header_value                              */
00341 /*                                                                           */
00342 /*****************************************************************************/
00343 
00345 MQ_EXTERN inline void MqSendH2 (
00346   register MqSendSP const send,
00347   const MQ_STR header,
00348   const MQ_INT2 value
00349 );
00350 
00352 MQ_EXTERN inline void MqSendH4 (
00353   register MqSendSP const send,
00354   const MQ_STR header,
00355   const MQ_INT4 value
00356 );
00357 
00359 MQ_EXTERN inline void MqSendH8 (
00360   register MqSendSP const send,
00361   const MQ_STR header,
00362   const MQ_INT8 value
00363 );
00364 
00366 MQ_EXTERN inline void MqSendHF (
00367   register MqSendSP const send,
00368   const MQ_STR header,
00369   const MQ_FLT4 value
00370 );
00371 
00373 MQ_EXTERN inline void MqSendHD (
00374   register MqSendSP const send,
00375   const MQ_STR header,
00376   const MQ_FLT8 value
00377 );
00378 
00380 MQ_EXTERN inline void MqSendHP (
00381   register MqSendSP const send,
00382   const MQ_STR header,
00383   const MQ_PTR value
00384 );
00385 
00387 MQ_EXTERN inline void MqSendHC (
00388   register MqSendSP const send,
00389   const MQ_STR header,
00390   const MQ_STR value
00391 );
00392 
00393 /*****************************************************************************/
00394 /*                                                                           */
00395 /*                              send_compose                                 */
00396 /*                                                                           */
00397 /*****************************************************************************/
00398 
00400 MQ_EXTERN void MqSendSTART (
00401   MqSendSP const send
00402 );
00403 
00405 MQ_EXTERN inline MqErrorE MqSendEND_RETR (
00406   MqSendSP const send,
00407   MqTransSP const trans
00408 );
00409 
00417 MQ_EXTERN MqErrorE MqSendEND (
00418   MqSendSP const send,
00419   const MQ_STR token,
00420   MqTransSP const trans
00421 );
00422 
00431 MQ_EXTERN MqErrorE MqSendEND_AND_WAIT (
00432   MqSendSP const send,
00433   const MQ_STR token,
00434   const time_t timeout
00435 );
00436 
00444 MQ_EXTERN MqErrorE MqSendRETURN (
00445   MqSendSP const send,
00446   const char *const fmt,
00447   const char *const proc
00448 );
00449 
00457 MQ_EXTERN MqErrorE MqSendOK (
00458   MqSendSP const send
00459 );
00460 
00470 MQ_EXTERN MqErrorE MqSendPING (
00471   MqSendSP const send
00472 );
00473 
00474 /*****************************************************************************/
00475 /*                                                                           */
00476 /*                              send_list                                    */
00477 /*                                                                           */
00478 /*****************************************************************************/
00479 
00487 MQ_EXTERN void MqSend_LST_START (
00488   MqSendSP const send
00489 );
00490 
00493 MQ_EXTERN void MqSend_LST_END (
00494   MqSendSP const send
00495 );
00496 
00497 /*****************************************************************************/
00498 /*                                                                           */
00499 /*                               send_RET                                    */
00500 /*                                                                           */
00501 /*****************************************************************************/
00502 
00514 MQ_EXTERN void MqSend_RET_START (
00515   MqSendSP const send,
00516   const char code,
00517   const MQ_INT4 num
00518 );
00519 
00521 MQ_EXTERN void MqSend_RET_END (
00522   MqSendSP const send
00523 );
00524 
00526 MQ_EXTERN void MqSend_RET_OK (
00527   MqSendSP const send
00528 );
00529 
00532 #endif /* MQ_IO_H */

Generated on Tue Nov 23 16:13:06 2004 for libFreiburg by  doxygen 1.3.8-20040928