Cobalt Framework
beta
Console application support
|
00001 00008 #ifndef CBARGV_H 00009 #define CBARGV_H 00010 00011 #include <string.h> 00012 00017 struct CBArgv 00018 { 00020 unsigned int argc ; 00022 const char ** argv ; 00023 00025 const char * currentWord ; 00027 size_t currentLength ; 00029 unsigned int currentIndex ; 00030 } ; 00031 00038 void 00039 CBInitArgv(struct CBArgv * dst, unsigned int argc, const char ** argv) ; 00040 00046 static inline unsigned int 00047 CBIsEndOfArgv(const struct CBArgv * src) 00048 { 00049 return !(src->currentIndex < src->argc) ; 00050 } 00051 00058 unsigned int 00059 CBHasLongNameOption(const struct CBArgv * src) ; 00060 00067 unsigned int 00068 CBHasShortNameOption(const struct CBArgv * src) ; 00069 00074 void 00075 CBSkipDashesInArgv(struct CBArgv * src) ; 00076 00082 static inline const char * 00083 CBCurrentWordInArgv(const struct CBArgv * src) 00084 { 00085 return src->currentWord ; 00086 } 00087 00092 void 00093 CBPopWordInArgv(struct CBArgv * src) ; 00094 00099 char 00100 CBCurrentCharInArgv(struct CBArgv * src) ; 00101 00106 void 00107 CBPopCharInArgv(struct CBArgv * src) ; 00108 00109 #endif /* CBARGV_H */