paul@181 | 1 | /* |
paul@181 | 2 | * argv_parse.h --- header file for the argv parser. |
paul@181 | 3 | * |
paul@181 | 4 | * This file defines the interface for the functions argv_parse() and |
paul@181 | 5 | * argv_free(). |
paul@181 | 6 | * |
paul@181 | 7 | *********************************************************************** |
paul@181 | 8 | * int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv) |
paul@181 | 9 | * |
paul@181 | 10 | * This function takes as its first argument a string which it will |
paul@181 | 11 | * parse into an argv argument vector, with each white-space separated |
paul@181 | 12 | * word placed into its own slot in the argv. This function handles |
paul@181 | 13 | * double quotes and backslashes so that the parsed words can contain |
paul@181 | 14 | * special characters. The count of the number words found in the |
paul@181 | 15 | * parsed string, as well as the argument vector, are returned into |
paul@181 | 16 | * ret_argc and ret_argv, respectively. |
paul@181 | 17 | *********************************************************************** |
paul@181 | 18 | * extern void argv_free(char **argv); |
paul@181 | 19 | * |
paul@181 | 20 | * This function frees the argument vector created by argv_parse(). |
paul@181 | 21 | *********************************************************************** |
paul@181 | 22 | * |
paul@181 | 23 | * Copyright 1999 by Theodore Ts'o. |
paul@181 | 24 | * |
paul@181 | 25 | * Permission to use, copy, modify, and distribute this software for |
paul@181 | 26 | * any purpose with or without fee is hereby granted, provided that |
paul@181 | 27 | * the above copyright notice and this permission notice appear in all |
paul@181 | 28 | * copies. THE SOFTWARE IS PROVIDED "AS IS" AND THEODORE TS'O (THE |
paul@181 | 29 | * AUTHOR) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
paul@181 | 30 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. |
paul@181 | 31 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, |
paul@181 | 32 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER |
paul@181 | 33 | * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION |
paul@181 | 34 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR |
paul@181 | 35 | * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. (Isn't |
paul@181 | 36 | * it sick that the U.S. culture of lawsuit-happy lawyers requires |
paul@181 | 37 | * this kind of disclaimer?) |
paul@181 | 38 | * |
paul@181 | 39 | * Version 1.1, modified 2/27/1999 |
paul@181 | 40 | */ |
paul@181 | 41 | |
paul@181 | 42 | extern int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv); |
paul@181 | 43 | extern void argv_free(char **argv); |