Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
	int c;
	unsigned int iseed = (unsigned int)time(NULL);
	srand(iseed);

	if(argc == 1){
		list_all();
		return 0;
	}
	while (1)
	{
		static struct option long_options[] =
		{
			{"help",	no_argument,			NULL,	'h'},
			{"add",     	required_argument,		NULL,	'a'},
			{"show",	required_argument,		NULL,	's'},
			{"done",	required_argument,		NULL,	'd'},
			{"list",	required_argument,		NULL,	'l'},
			{0, 0, 0, 0}
		};
		int option_index = 0;
		c = getopt_long(argc, argv, "ha:s:d:l:", long_options, &option_index);

		if(c == -1)
			break;

		switch(c)
		{

			case 'h':
				help();
			break;

			case 'a':
				add_todo(optarg);
			break;

			case 's':
				list_id(optarg); //todo: fix better casting
			break;

			case 'd':
				remove_todo(optarg); // todo: fix better casting
			break;

			case 'l':
				search(optarg);
			break;
			
		}
	}
	return 0;
}
Ejemplo n.º 2
0
Archivo: key.c Proyecto: DINKIN/tuo
static void __ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata,
					int idx)
{
	struct ieee80211_key *key = NULL;

	if (idx >= 0 && idx < NUM_DEFAULT_KEYS)
		key = sdata->keys[idx];

	rcu_assign_pointer(sdata->default_key, key);

	if (key)
		add_todo(key, KEY_FLAG_TODO_DEFKEY);
}
Ejemplo n.º 3
0
static gboolean edit_todo_shortcuts (GtkWidget *widget, GdkEventKey *event, MaintainrProjectbox *item)
{
	if (event->keyval == GDK_KEY_plus) {
		add_todo (item);
		return TRUE;
	}
	else if (event->keyval == GDK_KEY_minus) {
		remove_todo (item);
		return TRUE;
	}

	return FALSE;
}