xref: /freebsd/contrib/nvi/common/args.h (revision f7c32ed617858bcd22f8d1b03199099d50125721)
1 /*-
2  * Copyright (c) 1993, 1994
3  *	The Regents of the University of California.  All rights reserved.
4  * Copyright (c) 1993, 1994, 1995, 1996
5  *	Keith Bostic.  All rights reserved.
6  *
7  * See the LICENSE file for redistribution information.
8  */
9 
10 /*
11  * Structure for building "argc/argv" vector of arguments.
12  *
13  * !!!
14  * All arguments are nul terminated as well as having an associated length.
15  * The argument vector is NOT necessarily NULL terminated.  The proper way
16  * to check the number of arguments is to use the argc value in the EXCMDARG
17  * structure or to walk the array until an ARGS structure with a length of 0
18  * is found.
19  */
20 typedef struct _args {
21 	CHAR_T	*bp;		/* Argument. */
22 	size_t	 blen;		/* Buffer length. */
23 	size_t	 len;		/* Argument length. */
24 
25 #define	A_ALLOCATED	0x01	/* If allocated space. */
26 	u_int8_t flags;
27 } ARGS;
28