/*
* 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 (c) 1988 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1997, by Sun Mircrosystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.13 */
/*LINTLIBRARY*/
#include <ctype.h>
#include "private.h"
static int
{
if (IgnoreCase(m)) {
return (FALSE);
}
}
} else {
return (FALSE);
}
}
}
if (*s1) {
return (FALSE);
}
return (TRUE);
}
int
{
int i, j;
int found;
/*
* Indicates search has cycled past the current item. If the current
* item is matched after cycled is true then NO_MATCH results.
*/
int cycled;
/* If a backspace is encountered then search backward from the */
/* current item. Otherwise, search forward from the current item. */
if (c && c != '\b') { /* c could be null */
return (E_NO_MATCH);
}
IthPattern(m, Pindex(m)) = c;
if (--i < 0) {
i = Nitems(m)-1;
}
}
j = i;
do {
if (c == '\b') {
if (--i < 0) {
i = Nitems(m)-1;
}
} else {
if (++i >= Nitems(m)) {
i = 0;
}
}
break;
}
} while (i != j);
if (found) {
return (E_NO_MATCH);
}
} else {
if (c && c != '\b') {
Pindex(m) -= 1;
}
return (E_NO_MATCH);
}
return (E_OK);
}
char *
{
if (m) {
if (Pattern(m)) {
return (Pattern(m));
} else {
return ("");
}
} else {
return (NULL);
}
}
int
{
int top;
if (!m || !s) {
return (E_BAD_ARGUMENT);
}
if (!Items(m)) {
return (E_NOT_CONNECTED);
}
if (Indriver(m)) {
return (E_BAD_STATE);
}
IthPattern(m, 0) = '\0';
Pindex(m) = 0;
if (*s == '\0') {
_position_cursor(m);
return (E_OK);
}
if (LinkNeeded(m)) {
_link_items(m);
}
for (; *s; s++) {
IthPattern(m, 0) = '\0';
Pindex(m) = 0;
_position_cursor(m);
return (E_NO_MATCH);
}
}
return (E_OK);
}