MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / insert_raw_processing_cb

Function insert_raw_processing_cb

script_cb.c:211–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211static inline int insert_raw_processing_cb(raw_processing_func f, int type, struct raw_processing_cb_list* list, char freeable)
212{
213 struct raw_processing_cb_list *elem;
214
215 if (f == NULL) {
216 LM_ERR("null callback\n");
217 return -1;
218 }
219
220 elem = pkg_malloc(sizeof(struct raw_processing_cb_list));
221 if (elem == NULL) {
222 LM_ERR("no more pkg mem\n");
223 return -1;
224 }
225
226 elem->f = f;
227 elem->freeable = freeable;
228 elem->next = NULL;
229
230 if (list == NULL) {
231 list = elem;
232 return !(type==PRE_RAW_PROCESSING ? (pre_processing_cb_list=list)
233 : (post_processing_cb_list=list));
234 } else {
235 while (list->next != NULL)
236 list = list->next;
237 list->next=elem;
238 }
239
240 return 0;
241
242}
243
244int register_pre_raw_processing_cb(raw_processing_func f, int type, char freeable)
245{

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected