示例#1
0
void simpleinput(list *head)
{
   list *temp;
   temp = findtable(head);
   if (temp != NULL)
   {
      temp->current = makevarnode();
      putvar(&temp->head, &temp->tail, temp->current, head);
      temp->current->current = makedatanode();
      putnode(&temp->current->head, &temp->current->tail, temp->current->current, head);
   }
}
/* rrd interface to the variable function putvar() */
char*
rrdsetvarconst(long argc, const char **args)
{
	if (argc >= 2)
	{
		const char* result = putvar(args[0], args[1], 1 /* const */);
		if (result) {
			/* setvar does not return the value set */
			return stralloc("");
		}
		return stralloc("[ERROR: putvar failed]");
	}
	return stralloc("[ERROR: putvar failed because not enough arguments "
					"were defined]");
}