static int set_client_protocol(struct conn_table_st *ct, int i, int protocol){ struct appdata_st *p; size_t n; int status = 0; n = sizeof(struct appdata_st); p = malloc(n); if(p == NULL) return(-1); p->protocol = protocol; conn_table_set_element_appdata(ct, i, p, free_appdata_st); return(status); }
static int set_client_protocol(struct conn_table_st *ct, int i, int protocol){ /* * This function calls conn_table_set_element_appdata() which does * the same job as conn_element_init2(). */ struct appdata_st *p; size_t n; int status = 0; n = sizeof(struct appdata_st); p = malloc(n); if(p == NULL) return(-1); p->protocol = protocol; conn_table_set_element_appdata(ct, i, p, free_appdata_st); return(status); }