/ * ExtractObjectList: Get a list of objects from ptr, allocate space * for the objects, and return the list. * Len should be the remaining bytes at the beginning of the list, * and the list should be the last component of the message. * Return LIST_ERROR on error. */
| 412 | * Return LIST_ERROR on error. |
| 413 | */ |
| 414 | list_type ExtractObjectList(char **ptr, long len) |
| 415 | { |
| 416 | WORD list_len, i; |
| 417 | char *start; |
| 418 | list_type list = NULL; |
| 419 | |
| 420 | if (len < SIZE_LIST_LEN) |
| 421 | return LIST_ERROR; |
| 422 | len -= SIZE_LIST_LEN; |
| 423 | |
| 424 | Extract(ptr, &list_len, SIZE_LIST_LEN); |
| 425 | |
| 426 | start = *ptr; |
| 427 | |
| 428 | for (i=0; i < list_len; i++) |
| 429 | list = list_add_item(list, ExtractNewObject(ptr)); |
| 430 | len -= (*ptr - start); |
| 431 | if (len != 0) |
| 432 | { |
| 433 | ObjectListDestroy(list); |
| 434 | return LIST_ERROR; |
| 435 | } |
| 436 | return list; |
| 437 | } |
| 438 | /********************************************************************/ |
| 439 | /* |
| 440 | * ExtractNewBackgroundOverlay: Allocate a new background overlay, |
no test coverage detected