/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2015 Gary Mills
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/* EMACS_MODES: !fill, lnumb, !overwrite, !nodelete, !picture */
#include "string.h"
#include "errno.h"
#include "stdlib.h"
#include "lp.h"
#if defined(__STDC__)
static char *unq_strdup ( char * , char * );
#else
static char *unq_strdup();
#endif
/**
** getlist() - CONSTRUCT LIST FROM STRING
**/
/*
* Any number of characters from "ws", or a single
* character from "hardsep", can separate items in the list.
*/
char **
#if defined(__STDC__)
getlist (
char * str,
char * ws,
char * hardsep
)
#else
register char *str,
*ws;
char *hardsep;
#endif
{
register char **list,
*p,
*sep,
c;
int n,
len;
char *copy,
*begin;
return (0);
/*
* Construct in "sep" the full list of characters that
* can separate items in the list. Avoid a "malloc()"
* if possible.
*/
return (0);
}
} else
/*
* Copy the input string because getlist() sometimes writes to it.
*/
return (0);
}
/*
* Skip leading white-space.
*/
if (!*copy) {
return (0);
}
/*
* Strip trailing white-space.
*/
;
*++p = 0;
/*
* Pass 1: Count the number of items in the list.
*/
for (n = 0, p = copy; *p; ) {
if ((c = *p++) == '\\')
p++;
else
n++;
if (
) {
p++;
}
}
}
/*
* Pass 2: Create the list.
*/
/*
* Pass 1 counted the number of list separaters, so
* add 2 to the count (includes 1 for terminating null).
*/
goto Done;
}
/*
* This loop will copy all but the last item.
*/
for (n = 0, p = copy; *p; )
if ((c = *p++) == '\\')
p++;
else
p[-1] = 0;
p[-1] = c;
if (
) {
p++;
}
copy = p;
}
list[n] = 0;
return (list);
}
/**
** unq_strdup()
**/
static char *
#if defined(__STDC__)
char * str,
char * sep
)
#else
char *str,
*sep;
#endif
{
register int len = 0;
register char *p,
*q,
*ret;
for (p = str; *p; p++)
len++;
return (0);
for (p = str; *p; p++)
*q++ = *p;
*q = 0;
return (ret);
}