aboutsummaryrefslogtreecommitdiff
path: root/e2fsck/argv_parse.h
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2005-12-30 23:57:32 -0500
committerTheodore Ts'o <tytso@mit.edu>2005-12-30 23:57:32 -0500
commit2fa9ba98337b07d6acfac52b5ee5dc8116dda866 (patch)
tree9e7e7a8f1102d0931432eeb2ea9cf2c36a4e62bb /e2fsck/argv_parse.h
parent02ef19621032044c1488931b3f970e11dca0afe0 (diff)
downloade2fsprogs-2fa9ba98337b07d6acfac52b5ee5dc8116dda866.tar.gz
Add the profile library code to e2fsck
The profile library was originally written by Theodore Ts'o in 1995 for use in the MIT Kerberos v5 library. It has been modified/enhanced/bug-fixed over time by other members of the MIT Kerberos team. This version was originally taken from the Kerberos v5 distribution, version 1.4.2, and radically simplified for use in e2fsprogs. (Support for locking for multi-threaded operations, being able to modify and update the configuration file programmatically, and Mac/Windows portability have been removed. It has been folded into a single C source file to make it easier to fold into an application program.) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck/argv_parse.h')
-rw-r--r--e2fsck/argv_parse.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/e2fsck/argv_parse.h b/e2fsck/argv_parse.h
new file mode 100644
index 00000000..84568e7b
--- /dev/null
+++ b/e2fsck/argv_parse.h
@@ -0,0 +1,43 @@
+/*
+ * argv_parse.h --- header file for the argv parser.
+ *
+ * This file defines the interface for the functions argv_parse() and
+ * argv_free().
+ *
+ ***********************************************************************
+ * int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv)
+ *
+ * This function takes as its first argument a string which it will
+ * parse into an argv argument vector, with each white-space separated
+ * word placed into its own slot in the argv. This function handles
+ * double quotes and backslashes so that the parsed words can contain
+ * special characters. The count of the number words found in the
+ * parsed string, as well as the argument vector, are returned into
+ * ret_argc and ret_argv, respectively.
+ ***********************************************************************
+ * extern void argv_free(char **argv);
+ *
+ * This function frees the argument vector created by argv_parse().
+ ***********************************************************************
+ *
+ * Copyright 1999 by Theodore Ts'o.
+ *
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose with or without fee is hereby granted, provided that
+ * the above copyright notice and this permission notice appear in all
+ * copies. THE SOFTWARE IS PROVIDED "AS IS" AND THEODORE TS'O (THE
+ * AUTHOR) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. (Isn't
+ * it sick that the U.S. culture of lawsuit-happy lawyers requires
+ * this kind of disclaimer?)
+ *
+ * Version 1.1, modified 2/27/1999
+ */
+
+extern int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv);
+extern void argv_free(char **argv);