Diff for /libaitrpc/inc/aitrpc.h between versions 1.3.2.5 and 1.3.2.6

version 1.3.2.5, 2011/09/01 11:39:26 version 1.3.2.6, 2011/09/03 12:39:27
Line 79  SUCH DAMAGE. Line 79  SUCH DAMAGE.
 /* RPC types */  /* RPC types */
   
 typedef enum {  typedef enum {
        disable, enable, kill,         /* for blob.state */        disable, enable, running, kill,         /* for blob.state */
        ok, error,              /* for blob reply */        ok, error,                              /* for blob reply */
        get, set, unset         /* for blob request */        get, set, unset                         /* for blob request */
 } cmd_type_t;  } cmd_type_t;
   
   
Line 247  rpc_srv_t *rpc_srv_initServer(u_int regProgID, u_int r Line 247  rpc_srv_t *rpc_srv_initServer(u_int regProgID, u_int r
  */   */
 void rpc_srv_endServer(rpc_srv_t * __restrict srv);  void rpc_srv_endServer(rpc_srv_t * __restrict srv);
 /*  /*
 * rpc_srv_execServer() Execute Main server loop and wait for clients requests * rpc_srv_loopServer() Execute Main server loop and wait for clients requests
  * @srv = RPC Server instance   * @srv = RPC Server instance
  * return: -1 error or 0 ok, infinite loop ...   * return: -1 error or 0 ok, infinite loop ...
  */   */
int rpc_srv_execServer(rpc_srv_t * __restrict srv);int rpc_srv_loopServer(rpc_srv_t * __restrict srv);
 #define rpc_srv_execServer(_srv, _sync) do { assert((_srv)); pthread_t __tid; \
                                                 pthread_create(&__tid, NULL, (void*(*)(void*)) \
                                                                 rpc_srv_loopServer, (_srv)); \
                                                 if ((_sync)) \
                                                         pthread_join(__tid, (void**) (_sync)); \
                                                 else \
                                                         pthread_detach(__tid); \
                                         } while (0)
   
 /*  /*
  * rpc_srv_initBLOBServer() Init & create BLOB Server   * rpc_srv_initBLOBServer() Init & create BLOB Server
Line 268  int rpc_srv_initBLOBServer(rpc_srv_t * __restrict srv, Line 276  int rpc_srv_initBLOBServer(rpc_srv_t * __restrict srv,
  */   */
 void rpc_srv_endBLOBServer(rpc_srv_t * __restrict srv);  void rpc_srv_endBLOBServer(rpc_srv_t * __restrict srv);
 /*  /*
 * rpc_srv_execBLOBServer() Execute Main BLOB server loop and wait for clients requests * rpc_srv_loopBLOB() Execute Main BLOB server loop and wait for clients requests
  * @srv = RPC Server instance   * @srv = RPC Server instance
  * return: -1 error or 0 ok, infinite loop ...   * return: -1 error or 0 ok, infinite loop ...
  */   */
int rpc_srv_execBLOBServer(rpc_srv_t * __restrict srv);int rpc_srv_loopBLOB(rpc_srv_t * __restrict srv);
 #define rpc_srv_execBLOBServer(_srv)    do { assert((_srv)); pthread_t __tid; \
                                                 if ((_srv)->srv_blob.state == enable) { \
                                                         pthread_create(&__tid, NULL, (void*(*)(void*)) \
                                                                         rpc_srv_loopBLOB, (_srv)); \
                                                         pthread_detach(__tid); \
                                                         (_srv)->srv_blob.state = running; \
                                                 } \
                                         } while (0)
   
 /*  /*
  * rpc_srv_registerCall() Register call to RPC server   * rpc_srv_registerCall() Register call to RPC server

Removed from v.1.3.2.5  
changed lines
  Added in v.1.3.2.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>