FACT++  1.0
char* marshallHeader ( CommandHeader *  pHeader)

Definition at line 2389 of file feeserver.c.

References cleanUp(), createLogMessage(), and Memory::malloc().

Referenced by command_handler().

2389  {
2390  char* tempHeader = 0;
2391 
2392  tempHeader = (char*) malloc(HEADER_SIZE);
2393  if (tempHeader == 0) {
2394  //no memory available!
2395 # ifdef __DEBUG
2396  printf("no memory available!\n");
2397  fflush(stdout);
2398 # endif
2399  createLogMessage(MSG_ALARM,
2400  "No more memory available, unable to continue serving - exiting.",
2401  0);
2402  cleanUp();
2403  exit(201);
2404  }
2405 
2406  memcpy(tempHeader, &(pHeader->id), HEADER_SIZE_ID);
2407  memcpy(tempHeader + HEADER_OFFSET_ID, &(pHeader->errorCode), HEADER_SIZE_ERROR_CODE);
2408  memcpy(tempHeader + HEADER_OFFSET_ERROR_CODE, &(pHeader->flags), HEADER_SIZE_FLAGS);
2409  memcpy(tempHeader + HEADER_OFFSET_FLAGS, &(pHeader->checksum), HEADER_SIZE_CHECKSUM);
2410 
2411  return tempHeader;
2412 }
void cleanUp()
Definition: feeserver.c:3159
void * malloc()
Definition: EventBuilder.cc:99
void createLogMessage(unsigned int type, char *description, char *origin)
Definition: feeserver.c:1530

+ Here is the call graph for this function:

+ Here is the caller graph for this function: