#ifndef ARGV_H #define ARGV_H #ifdef ARGV_USE_UNSIGNED_CHAR #define ARGV_TYPE unsigned char #else #define ARGV_TYPE char #endif /*! * description: turns string into an argc,argv * parameters: * command - input string * command_len - length of input string * argc - pointer to count of arguments. can be NULL not to use. * argv - pointer to a list of strings * line - pointer to everything after the first argument (index into command) * can be NULL not to use. * returns: * count of arguments in argv (same as what is stored in argc pointer) */ int argv_create(const ARGV_TYPE *command, int command_len, int *argc, ARGV_TYPE ***argv, const ARGV_TYPE **line); /*! * frees an argv list */ void argv_free(int argc, ARGV_TYPE **argv); #endif