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