Lines Matching refs:cmdLine
119 deCommandLine* cmdLine = (deCommandLine*)deCalloc(sizeof(deCommandLine)); in deCommandLine_parse() local
121 …if (!cmdLine || !(cmdLine->args = (char**)deCalloc(sizeof(char*)*(size_t)CharPtrArray_getNumElemen… in deCommandLine_parse()
123 deFree(cmdLine); in deCommandLine_parse()
129 cmdLine->numArgs = CharPtrArray_getNumElements(args); in deCommandLine_parse()
130 cmdLine->argBuf = buf; in deCommandLine_parse()
132 for (argNdx = 0; argNdx < cmdLine->numArgs; argNdx++) in deCommandLine_parse()
133 cmdLine->args[argNdx] = CharPtrArray_get(args, argNdx); in deCommandLine_parse()
136 return cmdLine; in deCommandLine_parse()
140 void deCommandLine_destroy (deCommandLine* cmdLine) in deCommandLine_destroy() argument
142 deFree(cmdLine->argBuf); in deCommandLine_destroy()
143 deFree(cmdLine); in deCommandLine_destroy()
146 static void testParse (const char* cmdLine, const char* const* refArgs, int numArgs) in testParse() argument
148 deCommandLine* parsedCmdLine = deCommandLine_parse(cmdLine); in testParse()
163 const char* cmdLine = "hello"; in deCommandLine_selfTest() local
165 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
168 const char* cmdLine = "hello world"; in deCommandLine_selfTest() local
170 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
173 const char* cmdLine = "hello/world"; in deCommandLine_selfTest() local
175 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
178 const char* cmdLine = "hello/world --help"; in deCommandLine_selfTest() local
180 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
183 const char* cmdLine = "hello/world --help foo"; in deCommandLine_selfTest() local
185 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
188 const char* cmdLine = "hello\\world --help foo"; in deCommandLine_selfTest() local
190 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
193 const char* cmdLine = "\"hello/worl d\" --help --foo=\"bar\" \"ba z\\\"\""; in deCommandLine_selfTest() local
195 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
198 const char* cmdLine = "'hello/worl d' --help --foo='bar' 'ba z\\\''"; in deCommandLine_selfTest() local
200 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
203 const char* cmdLine = "hello \"'world'\""; in deCommandLine_selfTest() local
205 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
208 const char* cmdLine = "hello '\"world\"'"; in deCommandLine_selfTest() local
210 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()
213 const char* cmdLine = "hello \"world\\n\""; in deCommandLine_selfTest() local
215 testParse(cmdLine, ref, DE_LENGTH_OF_ARRAY(ref)); in deCommandLine_selfTest()