2013-05-05 18:24:05 +04:00
|
|
|
/* $NetBSD: setterm.c,v 1.50 2013/05/05 14:24:05 jdc Exp $ */
|
1997-07-22 11:36:20 +04:00
|
|
|
|
1993-08-07 09:51:11 +04:00
|
|
|
/*
|
1994-08-18 01:51:41 +04:00
|
|
|
* Copyright (c) 1981, 1993, 1994
|
1993-11-09 06:34:01 +03:00
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-08-07 09:51:11 +04:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 20:42:00 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-08-07 09:51:11 +04:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1997-07-22 11:36:20 +04:00
|
|
|
#include <sys/cdefs.h>
|
1993-08-07 09:51:11 +04:00
|
|
|
#ifndef lint
|
1997-07-22 11:36:20 +04:00
|
|
|
#if 0
|
1998-01-30 07:33:32 +03:00
|
|
|
static char sccsid[] = "@(#)setterm.c 8.8 (Berkeley) 10/25/94";
|
1997-07-22 11:36:20 +04:00
|
|
|
#else
|
2013-05-05 18:24:05 +04:00
|
|
|
__RCSID("$NetBSD: setterm.c,v 1.50 2013/05/05 14:24:05 jdc Exp $");
|
1997-07-22 11:36:20 +04:00
|
|
|
#endif
|
1993-08-07 09:51:11 +04:00
|
|
|
#endif /* not lint */
|
|
|
|
|
1994-08-18 01:51:41 +04:00
|
|
|
#include <sys/ioctl.h> /* TIOCGWINSZ on old systems. */
|
1993-08-07 09:51:11 +04:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
1994-08-18 01:51:41 +04:00
|
|
|
#include <termios.h>
|
1993-08-07 09:51:11 +04:00
|
|
|
#include <unistd.h>
|
|
|
|
|
1994-08-18 01:51:41 +04:00
|
|
|
#include "curses.h"
|
2000-04-13 01:45:30 +04:00
|
|
|
#include "curses_private.h"
|
1994-08-18 01:51:41 +04:00
|
|
|
|
2010-02-03 18:34:37 +03:00
|
|
|
static int does_esc_m(const char *cap);
|
2013-05-05 18:24:05 +04:00
|
|
|
static int does_ctrl_o(const char *exit_cap, const char *acs_cap);
|
2001-12-02 12:14:20 +03:00
|
|
|
|
2000-12-20 00:34:24 +03:00
|
|
|
attr_t __mask_op, __mask_me, __mask_ue, __mask_se;
|
1993-08-07 09:51:11 +04:00
|
|
|
|
|
|
|
int
|
2000-04-15 17:17:02 +04:00
|
|
|
setterm(char *type)
|
1993-08-07 09:51:11 +04:00
|
|
|
{
|
2001-12-02 12:14:20 +03:00
|
|
|
return _cursesi_setterm(type, _cursesi_screen);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
_cursesi_setterm(char *type, SCREEN *screen)
|
|
|
|
{
|
2010-02-03 18:34:37 +03:00
|
|
|
int unknown, r;
|
1993-08-07 09:51:11 +04:00
|
|
|
struct winsize win;
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
if (type[0] == '\0')
|
|
|
|
type = "xx";
|
|
|
|
unknown = 0;
|
2010-02-03 18:34:37 +03:00
|
|
|
(void)ti_setupterm(&screen->term, type, fileno(screen->outfd), &r);
|
|
|
|
if (screen->term == NULL) {
|
1993-08-07 09:51:11 +04:00
|
|
|
unknown++;
|
2010-02-03 18:34:37 +03:00
|
|
|
(void)ti_setupterm(&screen->term, "dumb",
|
|
|
|
fileno(screen->outfd), &r);
|
|
|
|
/* No dumb term? We can't continue */
|
|
|
|
if (screen->term == NULL)
|
|
|
|
return ERR;
|
1993-08-07 09:51:11 +04:00
|
|
|
}
|
|
|
|
#ifdef DEBUG
|
2007-01-21 16:25:36 +03:00
|
|
|
__CTRACE(__CTRACE_INIT, "setterm: tty = %s\n", type);
|
1993-08-07 09:51:11 +04:00
|
|
|
#endif
|
|
|
|
|
2012-04-21 16:27:24 +04:00
|
|
|
/* Try TIOCGWINSZ, and, if it fails, the terminfo entry. */
|
2001-12-02 12:14:20 +03:00
|
|
|
if (ioctl(fileno(screen->outfd), TIOCGWINSZ, &win) != -1 &&
|
1993-08-07 09:51:11 +04:00
|
|
|
win.ws_row != 0 && win.ws_col != 0) {
|
2001-12-02 12:14:20 +03:00
|
|
|
screen->LINES = win.ws_row;
|
|
|
|
screen->COLS = win.ws_col;
|
1993-08-07 09:51:11 +04:00
|
|
|
} else {
|
2000-04-19 17:52:39 +04:00
|
|
|
if (unknown) {
|
2001-12-02 12:14:20 +03:00
|
|
|
screen->LINES = -1;
|
|
|
|
screen->COLS = -1;
|
2000-04-19 17:52:39 +04:00
|
|
|
} else {
|
2010-02-03 18:34:37 +03:00
|
|
|
screen->LINES = t_lines(screen->term);
|
|
|
|
screen->COLS = t_columns(screen->term);
|
2000-04-19 17:52:39 +04:00
|
|
|
}
|
|
|
|
|
1993-08-07 09:51:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* POSIX 1003.2 requires that the environment override. */
|
1994-01-24 11:36:38 +03:00
|
|
|
if ((p = getenv("LINES")) != NULL)
|
2009-02-22 23:05:48 +03:00
|
|
|
screen->LINES = (int) strtol(p, NULL, 0);
|
1993-08-07 09:51:11 +04:00
|
|
|
if ((p = getenv("COLUMNS")) != NULL)
|
2009-02-22 23:05:48 +03:00
|
|
|
screen->COLS = (int) strtol(p, NULL, 0);
|
|
|
|
if ((p = getenv("ESCDELAY")) != NULL)
|
|
|
|
ESCDELAY = (int) strtol(p, NULL, 0);
|
|
|
|
|
1993-08-07 09:51:11 +04:00
|
|
|
/*
|
1993-11-09 06:34:01 +03:00
|
|
|
* Want cols > 4, otherwise things will fail.
|
1993-08-07 09:51:11 +04:00
|
|
|
*/
|
2001-12-02 12:14:20 +03:00
|
|
|
if (screen->COLS <= 4)
|
1993-08-07 09:51:11 +04:00
|
|
|
return (ERR);
|
|
|
|
|
2002-12-05 20:04:25 +03:00
|
|
|
LINES = screen->LINES;
|
|
|
|
COLS = screen->COLS;
|
|
|
|
|
1993-08-07 09:51:11 +04:00
|
|
|
#ifdef DEBUG
|
2007-05-28 19:01:53 +04:00
|
|
|
__CTRACE(__CTRACE_INIT, "setterm: LINES = %d, COLS = %d\n",
|
|
|
|
LINES, COLS);
|
1993-08-07 09:51:11 +04:00
|
|
|
#endif
|
|
|
|
|
2007-05-28 19:01:53 +04:00
|
|
|
/*
|
2001-12-02 12:14:20 +03:00
|
|
|
* set the pad char, only take the first char of the pc capability
|
|
|
|
* as this is all we can use.
|
|
|
|
*/
|
2010-02-03 18:34:37 +03:00
|
|
|
screen->padchar = t_pad_char(screen->term) ?
|
|
|
|
t_pad_char(screen->term)[0] : 0;
|
2002-01-02 13:38:27 +03:00
|
|
|
|
1994-08-18 01:51:41 +04:00
|
|
|
/* If no scrolling commands, no quick change. */
|
2001-12-02 12:14:20 +03:00
|
|
|
screen->noqch =
|
2010-02-03 18:34:37 +03:00
|
|
|
(t_change_scroll_region(screen->term) == NULL ||
|
|
|
|
t_cursor_home(screen->term) == NULL ||
|
|
|
|
(t_parm_index(screen->term) == NULL &&
|
|
|
|
t_scroll_forward(screen->term) == NULL) ||
|
|
|
|
(t_parm_rindex(screen->term) == NULL &&
|
|
|
|
t_scroll_reverse(screen->term) == NULL)) &&
|
|
|
|
((t_parm_insert_line(screen->term) == NULL &&
|
|
|
|
t_insert_line(screen->term) == NULL) ||
|
|
|
|
(t_parm_delete_line(screen->term) == NULL &&
|
|
|
|
t_delete_line(screen->term) == NULL));
|
1993-11-09 06:34:01 +03:00
|
|
|
|
2002-09-11 19:23:24 +04:00
|
|
|
/*
|
|
|
|
* Precalculate conflict info for color/attribute end commands.
|
|
|
|
*/
|
2007-05-28 19:01:53 +04:00
|
|
|
#ifndef HAVE_WCHAR
|
2001-12-02 12:14:20 +03:00
|
|
|
screen->mask_op = __ATTRIBUTES & ~__COLOR;
|
2007-05-28 19:01:53 +04:00
|
|
|
#else
|
|
|
|
screen->mask_op = WA_ATTRIBUTES & ~__COLOR;
|
|
|
|
#endif /* HAVE_WCHAR */
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_orig_pair(screen->term) != NULL) {
|
|
|
|
if (does_esc_m(t_orig_pair(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_op &=
|
|
|
|
~(__STANDOUT | __UNDERSCORE | __TERMATTR);
|
|
|
|
else {
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_standout_mode(screen->term) != NULL &&
|
|
|
|
!strcmp(t_orig_pair(screen->term),
|
|
|
|
t_exit_standout_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_op &= ~__STANDOUT;
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_underline_mode(screen->term) != NULL &&
|
|
|
|
!strcmp(t_orig_pair(screen->term),
|
|
|
|
t_exit_underline_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_op &= ~__UNDERSCORE;
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_attribute_mode(screen->term) != NULL &&
|
|
|
|
!strcmp(t_orig_pair(screen->term),
|
|
|
|
t_exit_attribute_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_op &= ~__TERMATTR;
|
|
|
|
}
|
2000-04-29 04:42:26 +04:00
|
|
|
}
|
2003-02-02 20:54:38 +03:00
|
|
|
/*
|
|
|
|
* Assume that "me" turns off all attributes apart from ACS.
|
|
|
|
* It might turn off ACS, so check for that.
|
|
|
|
*/
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_attribute_mode(screen->term) != NULL &&
|
2013-05-05 18:24:05 +04:00
|
|
|
does_ctrl_o(t_exit_attribute_mode(screen->term),
|
|
|
|
t_exit_alt_charset_mode(screen->term)))
|
2003-02-02 20:54:38 +03:00
|
|
|
screen->mask_me = 0;
|
|
|
|
else
|
|
|
|
screen->mask_me = __ALTCHARSET;
|
|
|
|
|
|
|
|
/* Check what turning off the attributes also turns off */
|
2007-05-28 19:01:53 +04:00
|
|
|
#ifndef HAVE_WCHAR
|
2001-12-02 12:14:20 +03:00
|
|
|
screen->mask_ue = __ATTRIBUTES & ~__UNDERSCORE;
|
2007-05-28 19:01:53 +04:00
|
|
|
#else
|
|
|
|
screen->mask_ue = WA_ATTRIBUTES & ~__UNDERSCORE;
|
|
|
|
#endif /* HAVE_WCHAR */
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_underline_mode(screen->term) != NULL) {
|
|
|
|
if (does_esc_m(t_exit_underline_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_ue &=
|
|
|
|
~(__STANDOUT | __TERMATTR | __COLOR);
|
|
|
|
else {
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_standout_mode(screen->term) != NULL &&
|
|
|
|
!strcmp(t_exit_underline_mode(screen->term),
|
|
|
|
t_exit_standout_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_ue &= ~__STANDOUT;
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_attribute_mode(screen->term) != NULL &&
|
|
|
|
!strcmp(t_exit_underline_mode(screen->term),
|
|
|
|
t_exit_attribute_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_ue &= ~__TERMATTR;
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_orig_pair(screen->term) != NULL &&
|
|
|
|
!strcmp(t_exit_underline_mode(screen->term),
|
|
|
|
t_orig_pair(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_ue &= ~__COLOR;
|
|
|
|
}
|
2000-04-29 04:42:26 +04:00
|
|
|
}
|
2007-05-28 19:01:53 +04:00
|
|
|
#ifndef HAVE_WCHAR
|
2001-12-02 12:14:20 +03:00
|
|
|
screen->mask_se = __ATTRIBUTES & ~__STANDOUT;
|
2007-05-28 19:01:53 +04:00
|
|
|
#else
|
|
|
|
screen->mask_se = WA_ATTRIBUTES & ~__STANDOUT;
|
|
|
|
#endif /* HAVE_WCHAR */
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_standout_mode(screen->term) != NULL) {
|
|
|
|
if (does_esc_m(t_exit_standout_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_se &=
|
2003-02-02 20:54:38 +03:00
|
|
|
~(__UNDERSCORE | __TERMATTR | __COLOR);
|
2003-01-28 00:12:29 +03:00
|
|
|
else {
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_underline_mode(screen->term) != NULL &&
|
|
|
|
!strcmp(t_exit_standout_mode(screen->term),
|
|
|
|
t_exit_underline_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_se &= ~__UNDERSCORE;
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_exit_attribute_mode(screen->term) != NULL &&
|
|
|
|
!strcmp(t_exit_standout_mode(screen->term),
|
|
|
|
t_exit_attribute_mode(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_se &= ~__TERMATTR;
|
2010-02-03 18:34:37 +03:00
|
|
|
if (t_orig_pair(screen->term) != NULL &&
|
|
|
|
!strcmp(t_exit_standout_mode(screen->term),
|
|
|
|
t_orig_pair(screen->term)))
|
2003-01-28 00:12:29 +03:00
|
|
|
screen->mask_se &= ~__COLOR;
|
|
|
|
}
|
2000-04-29 04:42:26 +04:00
|
|
|
}
|
|
|
|
|
1993-08-07 09:51:11 +04:00
|
|
|
return (unknown ? ERR : OK);
|
|
|
|
}
|
|
|
|
|
2001-12-02 12:14:20 +03:00
|
|
|
/*
|
|
|
|
* _cursesi_resetterm --
|
|
|
|
* Copy the terminal instance data for the given screen to the global
|
|
|
|
* variables.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
_cursesi_resetterm(SCREEN *screen)
|
|
|
|
{
|
|
|
|
|
|
|
|
LINES = screen->LINES;
|
|
|
|
COLS = screen->COLS;
|
|
|
|
__GT = screen->GT;
|
2002-01-02 13:38:27 +03:00
|
|
|
|
2001-12-02 12:14:20 +03:00
|
|
|
__noqch = screen->noqch;
|
|
|
|
__mask_op = screen->mask_op;
|
|
|
|
__mask_me = screen->mask_me;
|
|
|
|
__mask_ue = screen->mask_ue;
|
|
|
|
__mask_se = screen->mask_se;
|
|
|
|
|
2010-02-03 18:34:37 +03:00
|
|
|
set_curterm(screen->term);
|
1993-08-07 09:51:11 +04:00
|
|
|
}
|
2003-01-28 00:12:29 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* does_esc_m --
|
|
|
|
* A hack for xterm-like terminals where "\E[m" or "\E[0m" will turn off
|
|
|
|
* other attributes, so we check for this in the capability passed to us.
|
|
|
|
* Note that we can't just do simple string comparison, as the capability
|
|
|
|
* may contain multiple, ';' separated sequence parts.
|
|
|
|
*/
|
|
|
|
static int
|
2010-02-03 18:34:37 +03:00
|
|
|
does_esc_m(const char *cap)
|
2003-01-28 00:12:29 +03:00
|
|
|
{
|
2003-02-02 20:54:38 +03:00
|
|
|
#define WAITING 0
|
|
|
|
#define PARSING 1
|
|
|
|
#define NUMBER 2
|
|
|
|
#define FOUND 4
|
2010-02-03 18:34:37 +03:00
|
|
|
const char *capptr;
|
2003-02-02 20:54:38 +03:00
|
|
|
int seq;
|
2003-01-28 00:12:29 +03:00
|
|
|
|
2003-02-02 20:54:38 +03:00
|
|
|
#ifdef DEBUG
|
2007-01-21 16:25:36 +03:00
|
|
|
__CTRACE(__CTRACE_INIT, "does_esc_m: Checking %s\n", cap);
|
2003-02-02 20:54:38 +03:00
|
|
|
#endif
|
2003-01-28 00:12:29 +03:00
|
|
|
/* Is it just "\E[m" or "\E[0m"? */
|
|
|
|
if (!strcmp(cap, "\x1b[m") || !strcmp(cap, "\x1b[0m"))
|
|
|
|
return 1;
|
|
|
|
|
2003-02-02 20:54:38 +03:00
|
|
|
/* Does it contain a "\E[...m" sequence? */
|
|
|
|
if (strlen(cap) < 4)
|
|
|
|
return 0;
|
|
|
|
capptr = cap;
|
|
|
|
seq = WAITING;
|
2003-10-21 04:30:05 +04:00
|
|
|
while (*capptr != 0) {
|
2003-02-02 20:54:38 +03:00
|
|
|
switch (seq) {
|
|
|
|
/* Start of sequence */
|
|
|
|
case WAITING:
|
|
|
|
if (!strncmp(capptr, "\x1b[", 2)) {
|
|
|
|
capptr+=2;
|
|
|
|
if (*capptr == 'm')
|
|
|
|
return 1;
|
|
|
|
else {
|
|
|
|
seq=PARSING;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
/* Looking for '0' */
|
|
|
|
case PARSING:
|
|
|
|
if (*capptr == '0')
|
|
|
|
seq=FOUND;
|
|
|
|
else if (*capptr > '0' && *capptr <= '9')
|
|
|
|
seq=NUMBER;
|
|
|
|
else if (*capptr != ';')
|
|
|
|
seq=WAITING;
|
|
|
|
break;
|
|
|
|
/* Some other number */
|
|
|
|
case NUMBER:
|
|
|
|
if (*capptr == ';')
|
|
|
|
seq=PARSING;
|
|
|
|
else if (!(*capptr >= '0' && *capptr <= '9'))
|
|
|
|
seq=WAITING;
|
|
|
|
break;
|
|
|
|
/* Found a '0' */
|
|
|
|
case FOUND:
|
|
|
|
if (*capptr == 'm')
|
2003-01-28 00:12:29 +03:00
|
|
|
return 1;
|
2003-02-02 20:54:38 +03:00
|
|
|
else if (!((*capptr >= '0' && *capptr <= '9') ||
|
|
|
|
*capptr == ';'))
|
|
|
|
seq=WAITING;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2003-01-28 00:12:29 +03:00
|
|
|
}
|
2003-02-02 20:54:38 +03:00
|
|
|
capptr++;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* does_ctrl_o --
|
|
|
|
* A hack for vt100/xterm-like terminals where the "me" capability also
|
2013-05-05 18:24:05 +04:00
|
|
|
* unsets acs.
|
2003-02-02 20:54:38 +03:00
|
|
|
*/
|
|
|
|
static int
|
2013-05-05 18:24:05 +04:00
|
|
|
does_ctrl_o(const char *exit_cap, const char *acs_cap)
|
2003-02-02 20:54:38 +03:00
|
|
|
{
|
2013-05-05 18:24:05 +04:00
|
|
|
const char *eptr = exit_cap, *aptr = acs_cap;
|
|
|
|
int l;
|
2003-02-02 20:54:38 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
2013-05-05 18:24:05 +04:00
|
|
|
__CTRACE(__CTRACE_INIT, "does_ctrl_o: Testing %s for %s\n", eptr, aptr);
|
2003-02-02 20:54:38 +03:00
|
|
|
#endif
|
2013-05-05 18:24:05 +04:00
|
|
|
l = strlen(acs_cap);
|
|
|
|
while (*eptr != 0) {
|
|
|
|
if (!strncmp(eptr, aptr, l))
|
2003-02-02 20:54:38 +03:00
|
|
|
return 1;
|
2013-05-05 18:24:05 +04:00
|
|
|
eptr++;
|
2003-01-28 00:12:29 +03:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|