• Home
  • Raw
  • Download

Lines Matching refs:cmdLine

125         deCommandLine *cmdLine = (deCommandLine *)deCalloc(sizeof(deCommandLine));  in deCommandLine_parse()  local
127 if (!cmdLine || in deCommandLine_parse()
128 … !(cmdLine->args = (char **)deCalloc(sizeof(char *) * (size_t)CharPtrArray_getNumElements(args)))) in deCommandLine_parse()
130 deFree(cmdLine); in deCommandLine_parse()
136 cmdLine->numArgs = CharPtrArray_getNumElements(args); in deCommandLine_parse()
137 cmdLine->argBuf = buf; in deCommandLine_parse()
139 for (argNdx = 0; argNdx < cmdLine->numArgs; argNdx++) in deCommandLine_parse()
140 cmdLine->args[argNdx] = CharPtrArray_get(args, argNdx); in deCommandLine_parse()
143 return cmdLine; in deCommandLine_parse()
147 void deCommandLine_destroy(deCommandLine *cmdLine) in deCommandLine_destroy() argument
149 deFree(cmdLine->argBuf); in deCommandLine_destroy()
150 deFree(cmdLine); in deCommandLine_destroy()
153 static void testParse(const char *cmdLine, const char *const *refArgs, int numArgs) in testParse() argument
155 deCommandLine *parsedCmdLine = deCommandLine_parse(cmdLine); in testParse()
170 const char *cmdLine = "hello"; in deCommandLine_selfTest() local
172 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
175 const char *cmdLine = "hello world"; in deCommandLine_selfTest() local
177 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
180 const char *cmdLine = "hello/world"; in deCommandLine_selfTest() local
182 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
185 const char *cmdLine = "hello/world --help"; in deCommandLine_selfTest() local
187 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
190 const char *cmdLine = "hello/world --help foo"; in deCommandLine_selfTest() local
192 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
195 const char *cmdLine = "hello\\world --help foo"; in deCommandLine_selfTest() local
197 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
200 const char *cmdLine = "\"hello/worl d\" --help --foo=\"bar\" \"ba z\\\"\""; in deCommandLine_selfTest() local
202 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
205 const char *cmdLine = "'hello/worl d' --help --foo='bar' 'ba z\\\''"; in deCommandLine_selfTest() local
207 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
210 const char *cmdLine = "hello \"'world'\""; in deCommandLine_selfTest() local
212 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
215 const char *cmdLine = "hello '\"world\"'"; in deCommandLine_selfTest() local
217 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
220 const char *cmdLine = "hello \"world\\n\""; in deCommandLine_selfTest() local
222 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()