odikey.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 1992 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include "wish.h"
#include "typetab.h"
#include "var_arrays.h"
#include "moremacros.h"
#include "sizes.h"
#define NULLSTR ""
int
{
register length;
register char *p, *q;
char *copy_to_key(), *skip_to_key();
return(O_FAIL);
return(O_FAIL);
q = value;
switch (*q) {
case ';':
case '=':
case '\\':
*p++ = '\\';
/* no break */
default:
*p = *q;
}
}
*p = '\0';
return(O_OK);
}
/* copy the new value onto beginning of odibuf, then copy all of
* the old odibuf onto the end, leaving out the original key if
* it exists.
*/
q = skip_to_key(q);
else {
*p++ = ';';
p = p + strlen(p);
}
}
*p = '\0';
return(O_OK);
}
char *
char *key;
{
register int length;
register char *p;
char *copy_to_key(), *skip_to_key();
break;
}
}
if (p && *p)
return(keybuf);
else
return(NULL);
}
/* copy from src to dst one keyword's value, of maximum size sizedst.
* If unquote is TRUE, then the copy should also remove a level of backslashes.
*/
static char *
int sizedst;
bool unquote;
{
register char *p = dst;
switch (*src) {
case ';':
break;
case '\\':
if (src[1]) {
src++;
}
/* no break! continue with next case */
default:
break;
}
}
*dst = '\0';
}
static char *
char *src;
{
}
/* return the first entry in the current ott which has key set to
* value.
*/
struct ott_entry *
{
register int i;
register char *p;
for (i = 0; i < size; i++)
return(Cur_entry + i);
return(NULL);
}