| 1 | /* |
| 2 | * Copyright (c) 1998 by Christopher Nebel. All Rights Reserved. |
| 3 | * |
| 4 | * Please see the accompanying license file, LICENSE.TXT, for information |
| 5 | * on using and copying this software. |
| 6 | */ |
| 7 | /* |
| 8 | Name |
| 9 | argize.h |
| 10 | |
| 11 | Function |
| 12 | Break a string into argc/argv-style arguments. |
| 13 | |
| 14 | Notes |
| 15 | none |
| 16 | |
| 17 | Modified |
| 18 | 07/04/98 CNebel - Created based on older Mac-specific argize source. |
| 19 | */ |
| 20 | |
| 21 | |
| 22 | #ifndef _ARGIZE_ |
| 23 | #define _ARGIZE_ |
| 24 | |
| 25 | #include <stddef.h> |
| 26 | |
| 27 | |
| 28 | /* |
| 29 | * Return what argc would be if this string were fed to argize. |
| 30 | */ |
| 31 | int countargs(const char *cmdline); |
| 32 | |
| 33 | /* |
| 34 | * Break a string <cmdline> into argc/argv arguments, removing quotes in |
| 35 | * the process. Returns 0 on success, 1 if there were too many |
| 36 | * arguments to fit into argv. |
| 37 | */ |
| 38 | int argize(char *cmdline, int * const argc, char *argv[], |
| 39 | const size_t argvlen); |
| 40 | |
| 41 | #endif |