| 90 | |
| 91 | |
| 92 | int insert_tmcb(struct tmcb_head_list *cb_list, int types, |
| 93 | transaction_cb f, void *param, release_tmcb_param release_func ) |
| 94 | { |
| 95 | struct tm_callback *cbp; |
| 96 | |
| 97 | /* build a new callback structure */ |
| 98 | if (!(cbp=shm_malloc( sizeof( struct tm_callback)))) { |
| 99 | LM_ERR("no more shared memory\n"); |
| 100 | return E_OUT_OF_MEM; |
| 101 | } |
| 102 | |
| 103 | /* link it into the proper place... */ |
| 104 | cbp->next = cb_list->first; |
| 105 | cb_list->first = cbp; |
| 106 | cb_list->reg_types |= types; |
| 107 | /* ... and fill it up */ |
| 108 | cbp->callback = f; |
| 109 | cbp->param = param; |
| 110 | cbp->release = release_func; |
| 111 | cbp->types = types; |
| 112 | if (cbp->next) |
| 113 | cbp->id = cbp->next->id+1; |
| 114 | else |
| 115 | cbp->id = 0; |
| 116 | |
| 117 | return 1; |
| 118 | } |
| 119 | |
| 120 | |
| 121 |
no test coverage detected