/* * cleopatre/application/spidinit/src/spidinit.c * * (C) Copyright 2009 SPiDCOM Technologies * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #include #include #include #include "spidinit.h" #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) struct command { char lname[32]; char sname; char desc[64]; char use_arg; int (*func)(char*); }; int do_all_commands(char *arg); int do_update_img_desc(char *arg); struct command cmd_list[] = { { "descupd", 'd', "update image descriptor", 0, &do_update_img_desc }, { "all" , 'a', "start all commands", 0, &do_all_commands } /* must be the last one */ }; static void print_usage(const char *cmd) { int i; fprintf(stderr, "Usage : %s\n", cmd); for(i=0 ; i