FACT++  1.0
void add_char_item_node ( unsigned int  _id,
CharItem *  _char_item 
)

Definition at line 4056 of file feeserver.c.

References charNodesAmount, cleanUp(), lastCharNode, and Memory::malloc().

Referenced by publishChar().

4056  {
4057  //create new node with enough memory
4058  CharItemNode* newNode = 0;
4059 
4060  newNode = (CharItemNode*) malloc(sizeof(CharItemNode));
4061  if (newNode == 0) {
4062  //no memory available!
4063 # ifdef __DEBUG
4064  printf("no memory available while adding CharItemNode!\n");
4065  fflush(stdout);
4066 # endif
4067  cleanUp();
4068  exit(201);
4069  }
4070  //initialize "members" of node
4071  newNode->prev = 0;
4072  newNode->next = 0;
4073  newNode->id = _id;
4074  newNode->charItem = _char_item;
4075 
4076 # ifdef __DEBUG
4077  // complete debug display of added charItem
4078 /*
4079  printf("CharItem ID: %d\n", _id);
4080  printf("CharItem name: %s\n", _char_item->name);
4081  printf("CharItem user_routine: %p\n", _char_item->user_routine);
4082  printf("CharItem tag: %d\n", _char_item->tag);
4083 */
4084 # endif
4085 
4086 # ifdef __DEBUG
4087  // short debug display of added Item
4088  printf("init of %s (char) with ID %d; user_routine at: %p\n",
4089  newNode->charItem->name, newNode->id,
4090  newNode->charItem->user_routine);
4091  fflush(stdout);
4092 # endif
4093 
4094  ++charNodesAmount;
4095  //redirect pointers of doubly linked list (char)
4096  if (firstCharNode != 0) {
4097  lastCharNode->next = newNode;
4098  newNode->prev = lastCharNode;
4099  lastCharNode = newNode;
4100  } else {
4101  firstCharNode = newNode;
4102  lastCharNode = newNode;
4103  }
4104 }
static unsigned int charNodesAmount
-— NEW FEATURE SINCE VERSION 0.8.2b [Char Channel] (2007-07-28) –— ///
Definition: feeserver.c:331
void cleanUp()
Definition: feeserver.c:3159
void * malloc()
Definition: EventBuilder.cc:99
static CharItemNode * lastCharNode
Definition: feeserver.c:343
static CharItemNode * firstCharNode
Definition: feeserver.c:337

+ Here is the call graph for this function:

+ Here is the caller graph for this function: