C struct static -


i through c source (pjsip) , find sctucture. don't know how conceive.

static struct user_agent {     pjsip_module     mod;     pj_pool_t       *pool;     pjsip_endpoint  *endpt;     pj_mutex_t      *mutex;     pj_hash_table_t *dlg_table;     pjsip_ua_init_param  param;     struct dlg_set   free_dlgset_nodes;  } mod_ua =  {   {     null, null,         /* prev, next.          */     { "mod-ua", 6 },        /* name.                */     -1,             /* id               */     pjsip_mod_priority_ua_proxy_layer,  /* priority     */     &mod_ua_load,       /* load()               */     null,           /* start()              */     null,           /* stop()               */     &mod_ua_unload,     /* unload()             */     &mod_ua_on_rx_request,  /* on_rx_request()          */     &mod_ua_on_rx_response, /* on_rx_response()         */     null,           /* on_tx_request.           */     null,           /* on_tx_response()         */     &mod_ua_on_tsx_state,   /* on_tsx_state()           */   } }; 

not particularly clear question think you're having problem struct being declared , used in same statement. how about:

struct user_agent {     .... }  static struct user_agent mod_ua = .... 

that clearer?

k


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -