/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <ctype.h>
#include "s_string.h"
#include <stdlib.h>
/* global to this file */
/* buffer pool for allocating string structures */
typedef struct {
size_t o;
} stralloc;
/* pool of freed strings */
void
{
}
}
/* allocate a string head */
static string *
s_alloc(void)
{
perror("allocating string");
exit(1);
}
}
}
/* create a new `short' string */
string *
s_new(void)
{
/*LINTED*/
return (sp);
}
perror("allocating string");
exit(1);
}
return (sp);
}
/* grow a string's allocation by at least `incr' bytes */
static void
{
char *cp;
/*
* take a larger increment to avoid mallocing too often
*/
else
perror("string:");
exit(1);
}
}
/* grow a string's allocation */
int
{
return (c);
}
/* return a string containing a character array (this had better not grow) */
string *
{
return (sp);
}
/* return a string containing a copy of the passed char array */
{
perror("string:");
exit(1);
}
return (sp);
}
/* convert string to lower case */
void
{
char *cp;
}
void
{
}
/* append a char array to a string */
string *
{
return (to);
return (to);
}
/*
* Append a logical input sequence into a string. Ignore blank and
* comment lines. Backslash preceding newline indicates continuation.
* The `lineortoken' variable indicates whether the sequence to beinput
* is a whitespace delimited token or a whole line.
*
* FILE *fp; stream to read from
* string *to; where to put token
* int lineortoken; how the sequence terminates
*
* Returns a pointer to the string or NULL. Trailing newline is stripped off.
*/
string *
{
int c;
int done = 0;
return (NULL);
/* get rid of leading goo */
do {
switch (c) {
case EOF:
return (NULL);
case '#':
/*LINTED*/
continue;
break;
case ' ':
case '\t':
case '\n':
case '\r':
case '\f':
break;
default:
done = 1;
break;
}
} while (!done);
/* gather up a sequence */
for (;;) {
switch (c) {
case '\\':
if (c != '\n') {
}
break;
case EOF:
case '\r':
case '\f':
case '\n':
return (to);
case ' ':
case '\t':
if (lineortoken == TOKEN) {
return (to);
}
/* fall through */
default:
break;
}
}
}
string *
{
if (splitend) {
}
/* LINT: warning due to lint bug */
return (to);
}
return (to);
}
else
return (NULL);
}
/*
* Append an input line to a string.
*
* Returns a pointer to the string (or NULL).
* Trailing newline is left on.
*/
char *
{
int c;
/* end of input */
return (NULL);
/* gather up a line */
for (; ; ) {
len++;
switch (c) {
case EOF:
case '\n':
default:
break;
}
}
}
/*
* Read till eof
*/
{
for (; ; ) {
break;
/* allocate room for a full buffer */
if (have < 4096UL)
/* get a buffers worth */
break;
/* LINT: warning due to lint bug */
}
/* null terminate the line */
}
/*
* Get the next field from a string. The field is delimited by white space,
* single or double quotes.
*
* string *from; string to parse
* string *to; where to put parsed token
*/
string *
{
return (NULL);
} else {
}
return (to);
}