FACT++  1.0
MemoryNode* findMemoryNode ( void *  addr)

Definition at line 3691 of file feeserver.c.

References firstMemoryNode.

Referenced by command_handler(), and freeMemory().

3691  {
3692  MemoryNode* current = 0;
3693 
3694  if (addr == 0) {
3695  /*
3696  createLogMessage(MSG_WARNING,
3697  "Reqesting MemoryNode with ID \"NULL\", discarding call!", 0);
3698 # ifdef __DEBUG
3699  printf("Reqesting MemoryNode with ID \"NULL\", discarding call!\n");
3700  fflush(stdout);
3701 # endif
3702  */
3703  return 0;
3704  }
3705 
3706  current = firstMemoryNode;
3707  while (current != 0) { // is end of list
3708  if (current->identityAddr == addr) {
3709  // success, give back MemoryNode
3710  return current;
3711  }
3712  current = current->next;
3713  }
3714 
3715 /* // only used for debug output; comment it in if required
3716  if (current == 0) {
3717  char msg[80];
3718  msg[sprintf(msg, "Unable to find MemoryNode with ID \"%p\".",
3719  addr)] = 0;
3720  createLogMessage(MSG_DEBUG, msg, 0);
3721 # ifdef __DEBUG
3722  printf("Unable to find MemoryNode with ID \"%p\".\n", addr);
3723  fflush(stdout);
3724 # endif
3725  }
3726 */
3727 
3728  return 0;
3729 }
static MemoryNode * firstMemoryNode
Definition: feeserver.c:316

+ Here is the caller graph for this function: