Exemplo n.º 1
0
Arquivo: kb.c Projeto: OPSF/uClinux
int kb_item_get_int(struct kb_item ** kb, char * name)
{
 struct kb_item * item = kb_item_get_single(kb, name, KB_TYPE_INT);
 if(item == NULL) 
	return -1;
 else 
	return item->v.v_int;
}
Exemplo n.º 2
0
Arquivo: kb.c Projeto: OPSF/uClinux
char * kb_item_get_str(struct kb_item ** kb, char * name)
{
 struct kb_item * item = kb_item_get_single(kb, name, KB_TYPE_STR);

 if(item == NULL) 
	return NULL;
 else 
	return item->v.v_str;
}
Exemplo n.º 3
0
/**
 * @brief Returns the name of the first key which is not \ref kb.
 */
static char *
key_missing (kb_t kb, struct arglist *keys)
{
  if (kb == NULL || keys == NULL)
    return NULL;
  else
    {
      while (keys->next != NULL)
        {
          if (kb_item_get_single (kb, keys->name, 0) == NULL)
            return keys->name;
          else
            keys = keys->next;
        }
    }
  return NULL;
}