| 209 | } |
| 210 | |
| 211 | static 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 | |
| 244 | int register_pre_raw_processing_cb(raw_processing_func f, int type, char freeable) |
| 245 | { |
no outgoing calls
no test coverage detected