Path: blob/main/crypto/krb5/src/util/profile/argv_parse.h
34878 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/*2* Copyright 1999 by Theodore Ts'o.3*4* Permission to use, copy, modify, and distribute this software for5* any purpose with or without fee is hereby granted, provided that6* the above copyright notice and this permission notice appear in all7* copies. THE SOFTWARE IS PROVIDED "AS IS" AND THEODORE TS'O (THE8* AUTHOR) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,9* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.10* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,11* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER12* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION13* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR14* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. (Isn't15* it sick that the U.S. culture of lawsuit-happy lawyers requires16* this kind of disclaimer?)17*/1819/*20* Version 1.1, modified 2/27/199921*22* argv_parse.h --- header file for the argv parser.23*24* This file defines the interface for the functions argv_parse() and25* argv_free().26*27***********************************************************************28* int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv)29*30* This function takes as its first argument a string which it will31* parse into an argv argument vector, with each white-space separated32* word placed into its own slot in the argv. This function handles33* double quotes and backslashes so that the parsed words can contain34* special characters. The count of the number words found in the35* parsed string, as well as the argument vector, are returned into36* ret_argc and ret_argv, respectively.37***********************************************************************38* extern void argv_free(char **argv);39*40* This function frees the argument vector created by argv_parse().41***********************************************************************42*/4344extern int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv);45extern void argv_free(char **argv);464748