xdrprocedure.c

Go to the documentation of this file.
00001 #include "xdr.h"
00002 #include "macros.h"
00003 
00004 /******** client only ***************/
00005 
00006 db__start_procedure_call (procnum)
00007     int procnum;
00008 {
00009     int reply;
00010 
00011     DB_SEND_INT (procnum);
00012     DB_RECV_INT (&reply);
00013     if (reply != procnum)
00014     {
00015         if (reply == 0)
00016         {
00017             db_noproc_error(procnum);
00018         }
00019         else
00020         {
00021             db_protocol_error();
00022         }
00023         return DB_PROTOCOL_ERR;
00024     }
00025     return DB_OK;
00026 }
00027 
00028 /***** driver only *******************/
00029 
00030 /* return codes:
00031  * DB_OK  ok
00032  * DB_EOF eof from client
00033  */
00034 db__recv_procnum (n)
00035     int *n;
00036 {
00037     XDR xdrs;
00038     int stat;
00039 
00040     stat = DB_OK;
00041 
00042     xdr_begin_recv (&xdrs);
00043     if(!xdr_int (&xdrs, n))
00044         stat = DB_EOF;
00045     xdr_end_recv (&xdrs);
00046 
00047     return stat;
00048 }
00049 
00050 db__send_procedure_ok(n)
00051     int n;
00052 {
00053     return db__send_int (n);
00054 }
00055 
00056 db__send_procedure_not_implemented(n)
00057     int n;
00058 {
00059     return db__send_int (n?0:-1);
00060 }

Generated on Sun Apr 6 17:31:38 2008 for GRASS by  doxygen 1.5.5