1 /****************************************************************************
2 * Copyright (c) 1998 Free Software Foundation, Inc. *
4 * Permission is hereby granted, free of charge, to any person obtaining a *
5 * copy of this software and associated documentation files (the *
6 * "Software"), to deal in the Software without restriction, including *
7 * without limitation the rights to use, copy, modify, merge, publish, *
8 * distribute, distribute with modifications, sublicense, and/or sell *
9 * copies of the Software, and to permit persons to whom the Software is *
10 * furnished to do so, subject to the following conditions: *
12 * The above copyright notice and this permission notice shall be included *
13 * in all copies or substantial portions of the Software. *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 * Except as contained in this notice, the name(s) of the above copyright *
24 * holders shall not be used in advertising or otherwise to promote the *
25 * sale, use or other dealings in this Software without prior written *
27 ****************************************************************************/
29 /****************************************************************************
30 * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
31 * and: Eric S. Raymond <esr@snark.thyrsus.com> *
32 ****************************************************************************/
36 * parse_entry.c -- compile one terminfo or termcap entry
38 * Get an exact in-core representation of an entry. Don't
39 * try to resolve use or tc capabilities, that is someone
40 * else's job. Depends on the lexical analyzer to get tokens
41 * from the input stream.
44 #include <curses.priv.h>
48 #define __INTERNAL_CAPS_VISIBLE
50 #include <term_entry.h>
52 MODULE_ID("$Id: parse_entry.c,v 1.22 1998/02/11 12:13:59 tom Exp $")
55 static short const parametrized[] = { 0 };
57 #include <parametrized.h>
60 struct token _nc_curr_token;
62 static void postprocess_termcap(TERMTYPE *, bool);
63 static void postprocess_terminfo(TERMTYPE *);
64 static struct name_table_entry const * lookup_fullname(const char *name);
68 * _nc_parse_entry(entry, literal, silent)
70 * Compile one entry. Doesn't try to resolve use or tc capabilities.
72 * found-forward-use = FALSE
73 * re-initialise internal arrays
75 * if the token was not a name in column 1, complain and die
76 * save names in entry's string table
77 * while (get_token() is not EOF and not NAMES)
78 * check for existance and type-correctness
79 * enter cap into structure
81 * save string in entry's string table
85 int _nc_parse_entry(struct entry *entryp, int literal, bool silent)
88 struct name_table_entry const *entry_ptr;
89 char *ptr, namecpy[MAX_NAME_SIZE+1];
91 token_type = _nc_get_token();
93 if (token_type == EOF)
95 if (token_type != NAMES)
96 _nc_err_abort("Entry does not start with terminal names in column one");
98 _nc_init_entry(&entryp->tterm);
100 entryp->cstart = _nc_comment_start;
101 entryp->cend = _nc_comment_end;
102 entryp->startline = _nc_start_line;
103 DEBUG(2, ("Comment range is %ld to %ld", entryp->cstart, entryp->cend));
105 /* junk the 2-character termcap name, if present */
106 ptr = _nc_curr_token.tk_name;
109 ptr = _nc_curr_token.tk_name + 3;
110 _nc_curr_token.tk_name[2] = '\0';
113 entryp->tterm.str_table = entryp->tterm.term_names = _nc_save_str(ptr);
115 DEBUG(1, ("Starting '%s'", ptr));
118 * We do this because the one-token lookahead in the parse loop
119 * results in the terminal type getting prematurely set to correspond
120 * to that of the next entry.
122 _nc_set_type(_nc_first_name(entryp->tterm.term_names));
124 /* check for overly-long names and aliases */
125 (void) strncpy(namecpy, entryp->tterm.term_names, MAX_NAME_SIZE);
126 namecpy[MAX_NAME_SIZE] = '\0';
127 if ((ptr = strrchr(namecpy, '|')) != (char *)NULL)
129 ptr = strtok(namecpy, "|");
130 if (strlen(ptr) > MAX_ALIAS)
131 _nc_warning("primary name may be too long");
132 while ((ptr = strtok((char *)NULL, "|")) != (char *)NULL)
133 if (strlen(ptr) > MAX_ALIAS)
134 _nc_warning("alias `%s' may be too long", ptr);
138 for (token_type = _nc_get_token();
139 token_type != EOF && token_type != NAMES;
140 token_type = _nc_get_token())
142 if (strcmp(_nc_curr_token.tk_name, "use") == 0
143 || strcmp(_nc_curr_token.tk_name, "tc") == 0) {
144 entryp->uses[entryp->nuses].parent = (void *)_nc_save_str(_nc_curr_token.tk_valstring);
145 entryp->uses[entryp->nuses].line = _nc_curr_line;
148 /* normal token lookup */
149 entry_ptr = _nc_find_entry(_nc_curr_token.tk_name,
150 _nc_syntax ? _nc_cap_hash_table : _nc_info_hash_table);
153 * Our kluge to handle aliasing. The reason it's done
154 * this ugly way, with a linear search, is so the hashing
155 * machinery doesn't have to be made really complicated
156 * (also we get better warnings this way). No point in
157 * making this case fast, aliased caps aren't common now
158 * and will get rarer.
160 if (entry_ptr == NOTFOUND)
162 const struct alias *ap;
164 if (_nc_syntax == SYN_TERMCAP)
166 for (ap = _nc_capalias_table; ap->from; ap++)
167 if (strcmp(ap->from, _nc_curr_token.tk_name) == 0)
169 if (ap->to == (char *)NULL)
171 _nc_warning("%s (%s termcap extension) ignored",
172 ap->from, ap->source);
176 entry_ptr = _nc_find_entry(ap->to, _nc_cap_hash_table);
177 if (entry_ptr && !silent)
178 _nc_warning("%s (%s termcap extension) aliased to %s", ap->from, ap->source, ap->to);
182 else /* if (_nc_syntax == SYN_TERMINFO) */
184 for (ap = _nc_infoalias_table; ap->from; ap++)
185 if (strcmp(ap->from, _nc_curr_token.tk_name) == 0)
187 if (ap->to == (char *)NULL)
189 _nc_warning("%s (%s terminfo extension) ignored",
190 ap->from, ap->source);
194 entry_ptr = _nc_find_entry(ap->to, _nc_info_hash_table);
195 if (entry_ptr && !silent)
196 _nc_warning("%s (%s terminfo extension) aliased to %s", ap->from, ap->source, ap->to);
200 /* last chance: a full-name */
201 if (entry_ptr == NOTFOUND) {
202 entry_ptr = lookup_fullname(_nc_curr_token.tk_name);
207 /* can't find this cap name, not even as an alias */
208 if (entry_ptr == NOTFOUND) {
210 _nc_warning("unknown capability '%s'",
211 _nc_curr_token.tk_name);
215 /* deal with bad type/value combinations. */
216 if (token_type != CANCEL && entry_ptr->nte_type != token_type)
219 * Nasty special cases here handle situations in which type
220 * information can resolve name clashes. Normal lookup
221 * finds the last instance in the capability table of a
222 * given name, regardless of type. find_type_entry looks
223 * for a first matching instance with given type. So as
224 * long as all ambiguous names occur in pairs of distinct
225 * type, this will do the job.
228 /* tell max_attributes from arrow_key_map */
229 if (token_type == NUMBER && !strcmp("ma", _nc_curr_token.tk_name))
230 entry_ptr = _nc_find_type_entry("ma", NUMBER,
231 _nc_get_table(_nc_syntax != 0));
233 /* map terminfo's string MT to MT */
234 else if (token_type==STRING &&!strcmp("MT",_nc_curr_token.tk_name))
235 entry_ptr = _nc_find_type_entry("MT", STRING,
236 _nc_get_table(_nc_syntax != 0));
238 /* treat strings without following "=" as empty strings */
239 else if (token_type==BOOLEAN && entry_ptr->nte_type==STRING)
241 /* we couldn't recover; skip this token */
246 const char *type_name;
247 switch (entry_ptr->nte_type)
250 type_name = "boolean";
253 type_name = "string";
256 type_name = "numeric";
259 type_name = "unknown";
262 _nc_warning("wrong type used for %s capability '%s'",
263 type_name, _nc_curr_token.tk_name);
269 /* now we know that the type/value combination is OK */
270 switch (token_type) {
272 switch (entry_ptr->nte_type) {
274 entryp->tterm.Booleans[entry_ptr->nte_index] = CANCELLED_BOOLEAN;
278 entryp->tterm.Numbers[entry_ptr->nte_index] = CANCELLED_NUMERIC;
282 entryp->tterm.Strings[entry_ptr->nte_index] = CANCELLED_STRING;
288 entryp->tterm.Booleans[entry_ptr->nte_index] = TRUE;
292 entryp->tterm.Numbers[entry_ptr->nte_index] =
293 _nc_curr_token.tk_valnumber;
297 ptr = _nc_curr_token.tk_valstring;
298 if (_nc_syntax==SYN_TERMCAP)
299 ptr = _nc_captoinfo(_nc_curr_token.tk_name,
301 parametrized[entry_ptr->nte_index]);
302 entryp->tterm.Strings[entry_ptr->nte_index] = _nc_save_str(ptr);
307 _nc_warning("unknown token type");
308 _nc_panic_mode((_nc_syntax==SYN_TERMCAP) ? ':' : ',');
311 } /* end else cur_token.name != "use" */
313 continue; /* cannot have a label w/o statement */
314 } /* endwhile (not EOF and not NAMES) */
316 _nc_push_token(token_type);
317 _nc_set_type(_nc_first_name(entryp->tterm.term_names));
320 * Try to deduce as much as possible from extension capabilities
321 * (this includes obsolete BSD capabilities). Sigh...it would be more
322 * space-efficient to call this after use resolution, but it has
323 * to be done before entry allocation is wrapped up.
326 if (_nc_syntax == SYN_TERMCAP)
328 bool has_base_entry = FALSE;
332 * Don't insert defaults if this is a `+' entry meant only
333 * for inclusion in other entries (not sure termcap ever
334 * had these, actually).
336 if (strchr(entryp->tterm.term_names, '+'))
337 has_base_entry = TRUE;
340 * Otherwise, look for a base entry that will already
341 * have picked up defaults via translation.
343 for (i = 0; i < entryp->nuses; i++)
344 if (!strchr(entryp->uses[i].parent, '+'))
345 has_base_entry = TRUE;
347 postprocess_termcap(&entryp->tterm, has_base_entry);
350 postprocess_terminfo(&entryp->tterm);
352 _nc_wrap_entry(entryp);
357 int _nc_capcmp(const char *s, const char *t)
358 /* compare two string capabilities, stripping out padding */
367 if (s[0] == '$' && s[1] == '<')
370 if (!(isdigit(*s) || *s=='.' || *s=='*' || *s=='/' || *s=='>'))
374 if (t[0] == '$' && t[1] == '<')
377 if (!(isdigit(*t) || *t=='.' || *t=='*' || *t=='/' || *t=='>'))
381 /* we've now pushed s and t past any padding they were pointing at */
383 if (*s == '\0' && *t == '\0')
389 /* else *s == *t but one is not NUL, so continue */
395 * The ko capability, if present, consists of a comma-separated capability
396 * list. For each capability, we may assume there is a keycap that sends the
397 * string which is the value of that capability.
399 typedef struct {const char *from; const char *to;} assoc;
400 static assoc const ko_xlate[] =
402 {"al", "kil1"}, /* insert line key -> KEY_IL */
403 {"bt", "kcbt"}, /* back tab -> KEY_BTAB */
404 {"cd", "ked"}, /* clear-to-eos key -> KEY_EOL */
405 {"ce", "kel"}, /* clear-to-eol key -> KEY_EOS */
406 {"cl", "kclr"}, /* clear key -> KEY_CLEAR */
407 {"ct", "tbc"}, /* clear all tabs -> KEY_CATAB */
408 {"dc", "kdch1"}, /* delete char -> KEY_DC */
409 {"dl", "kdl1"}, /* delete line -> KEY_DL */
410 {"do", "kcud1"}, /* down key -> KEY_DOWN */
411 {"ei", "krmir"}, /* exit insert key -> KEY_EIC */
412 {"ho", "khome"}, /* home key -> KEY_HOME */
413 {"ic", "kich1"}, /* insert char key -> KEY_IC */
414 {"im", "kIC"}, /* insert-mode key -> KEY_SIC */
415 {"le", "kcub1"}, /* le key -> KEY_LEFT */
416 {"nd", "kcuf1"}, /* nd key -> KEY_RIGHT */
417 {"nl", "kent"}, /* new line key -> KEY_ENTER */
418 {"st", "khts"}, /* set-tab key -> KEY_STAB */
419 {"ta", CANCELLED_STRING},
420 {"up", "kcuu1"}, /* up-arrow key -> KEY_UP */
421 {(char *)NULL, (char *)NULL},
425 * This routine fills in string caps that either had defaults under
426 * termcap or can be manufactured from obsolete termcap capabilities.
427 * It was lifted from Ross Ridge's mytinfo package.
430 static const char C_CR[] = "\r";
431 static const char C_LF[] = "\n";
432 static const char C_BS[] = "\b";
433 static const char C_HT[] = "\t";
436 * Note that WANTED and PRESENT are not simple inverses! If a capability
437 * has been explicitly cancelled, it's not considered WANTED.
439 #define WANTED(s) ((s) == (char *)NULL)
440 #define PRESENT(s) (((s) != (char *)NULL) && ((s) != CANCELLED_STRING))
443 * This bit of legerdemain turns all the terminfo variable names into
444 * references to locations in the arrays Booleans, Numbers, and Strings ---
445 * precisely what's needed.
452 void postprocess_termcap(TERMTYPE *tp, bool has_base)
454 char buf[MAX_LINE * 2 + 2];
457 * TERMCAP DEFAULTS AND OBSOLETE-CAPABILITY TRANSLATIONS
459 * This first part of the code is the functional inverse of the
460 * fragment in capdefaults.c.
461 * ----------------------------------------------------------------------
464 /* if there was a tc entry, assume we picked up defaults via that */
467 if (WANTED(init_3string) && termcap_init2)
468 init_3string = _nc_save_str(termcap_init2);
470 if (WANTED(reset_1string) && termcap_reset)
471 reset_1string = _nc_save_str(termcap_reset);
473 if (WANTED(carriage_return)) {
474 if (carriage_return_delay > 0) {
475 sprintf(buf, "%s$<%d>", C_CR, carriage_return_delay);
476 carriage_return = _nc_save_str(buf);
478 carriage_return = _nc_save_str(C_CR);
480 if (WANTED(cursor_left)) {
481 if (backspace_delay > 0) {
482 sprintf(buf, "%s$<%d>", C_BS, backspace_delay);
483 cursor_left = _nc_save_str(buf);
484 } else if (backspaces_with_bs == 1)
485 cursor_left = _nc_save_str(C_BS);
486 else if (PRESENT(backspace_if_not_bs))
487 cursor_left = backspace_if_not_bs;
489 /* vi doesn't use "do", but it does seems to use nl (or '\n') instead */
490 if (WANTED(cursor_down)) {
491 if (PRESENT(linefeed_if_not_lf))
492 cursor_down = linefeed_if_not_lf;
493 else if (linefeed_is_newline != 1) {
494 if (new_line_delay > 0) {
495 sprintf(buf, "%s$<%d>", C_LF, new_line_delay);
496 cursor_down = _nc_save_str(buf);
498 cursor_down = _nc_save_str(C_LF);
501 if (WANTED(scroll_forward) && crt_no_scrolling != 1) {
502 if (PRESENT(linefeed_if_not_lf))
503 cursor_down = linefeed_if_not_lf;
504 else if (linefeed_is_newline != 1) {
505 if (new_line_delay > 0) {
506 sprintf(buf, "%s$<%d>", C_LF, new_line_delay);
507 scroll_forward = _nc_save_str(buf);
509 scroll_forward = _nc_save_str(C_LF);
512 if (WANTED(newline)) {
513 if (linefeed_is_newline == 1) {
514 if (new_line_delay > 0) {
515 sprintf(buf, "%s$<%d>", C_LF, new_line_delay);
516 newline = _nc_save_str(buf);
518 newline = _nc_save_str(C_LF);
519 } else if (PRESENT(carriage_return) && PRESENT(scroll_forward)) {
520 strncpy(buf, carriage_return, MAX_LINE-2);
521 buf[MAX_LINE-1] = '\0';
522 strncat(buf, scroll_forward, MAX_LINE-strlen(buf)-1);
523 buf[MAX_LINE] = '\0';
524 newline = _nc_save_str(buf);
525 } else if (PRESENT(carriage_return) && PRESENT(cursor_down)) {
526 strncpy(buf, carriage_return, MAX_LINE-2);
527 buf[MAX_LINE-1] = '\0';
528 strncat(buf, cursor_down, MAX_LINE-strlen(buf)-1);
529 buf[MAX_LINE] = '\0';
530 newline = _nc_save_str(buf);
536 * Inverse of capdefaults.c code ends here.
537 * ----------------------------------------------------------------------
539 * TERMCAP-TO TERMINFO MAPPINGS FOR SOURCE TRANSLATION
541 * These translations will *not* be inverted by tgetent().
547 * We wait until now to decide if we've got a working cr because even
548 * one that doesn't work can be used for newline. Unfortunately the
549 * space allocated for it is wasted.
551 if (return_does_clr_eol == 1 || no_correctly_working_cr == 1)
552 carriage_return = NULL;
555 * Supposedly most termcap entries have ta now and '\t' is no longer a
556 * default, but it doesn't seem to be true...
559 if (horizontal_tab_delay > 0) {
560 sprintf(buf, "%s$<%d>", C_HT, horizontal_tab_delay);
561 tab = _nc_save_str(buf);
563 tab = _nc_save_str(C_HT);
565 if (init_tabs == ABSENT_NUMERIC && has_hardware_tabs == TRUE)
569 * Assume we can beep with ^G unless we're given bl@.
572 bell = _nc_save_str("\007");
576 * Translate the old termcap :pt: capability to it#8 + ht=\t
578 if (has_hardware_tabs == TRUE)
579 if (init_tabs != 8 && init_tabs != ABSENT_NUMERIC)
580 _nc_warning("hardware tabs with a width other than 8: %d", init_tabs);
583 if (tab && _nc_capcmp(tab, C_HT))
584 _nc_warning("hardware tabs with a non-^I tab string %s",
589 tab = _nc_save_str(C_HT);
595 * Now translate the ko capability, if there is one. This
596 * isn't from mytinfo...
598 if (PRESENT(other_non_function_keys))
600 char *dp, *cp = strtok(other_non_function_keys, ",");
601 struct name_table_entry const *from_ptr;
602 struct name_table_entry const *to_ptr;
604 char buf2[MAX_TERMINFO_LENGTH];
607 /* we're going to use this for a special case later */
608 dp = strchr(other_non_function_keys, 'i');
609 foundim = dp && dp[1] == 'm';
611 /* look at each comma-separated capability in the ko string... */
613 for (ap = ko_xlate; ap->from; ap++)
614 if (strcmp(ap->from, cp) == 0)
618 _nc_warning("unknown capability `%s' in ko string", cp);
621 else if (ap->to == CANCELLED_STRING) /* ignore it */
624 /* now we know we found a match in ko_table, so... */
626 from_ptr = _nc_find_entry(ap->from, _nc_cap_hash_table);
627 to_ptr = _nc_find_entry(ap->to, _nc_info_hash_table);
629 if (!from_ptr || !to_ptr) /* should never happen! */
630 _nc_err_abort("ko translation table is invalid, I give up");
632 if (WANTED(tp->Strings[from_ptr->nte_index]))
634 _nc_warning("no value for ko capability %s", ap->from);
638 if (tp->Strings[to_ptr->nte_index])
640 /* There's no point in warning about it if it's the same
641 * string; that's just an inefficiency.
644 tp->Strings[from_ptr->nte_index],
645 tp->Strings[to_ptr->nte_index]) != 0)
646 _nc_warning("%s (%s) already has an explicit value %s, ignoring ko",
648 _nc_visbuf(tp->Strings[to_ptr->nte_index]) );
653 * The magic moment -- copy the mapped key string over,
654 * stripping out padding.
657 for (cp = tp->Strings[from_ptr->nte_index]; *cp; cp++)
659 if (cp[0] == '$' && cp[1] == '<')
661 while (*cp && *cp != '>')
672 tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2);
674 ((cp = strtok((char *)NULL, ",")) != 0);
677 * Note: ko=im and ko=ic both want to grab the `Insert'
678 * keycap. There's a kich1 but no ksmir, so the ic capability
679 * got mapped to kich1 and im to kIC to avoid a collision.
680 * If the description has im but not ic, hack kIC back to kich1.
682 if (foundim && WANTED(key_ic) && key_sic)
685 key_sic = ABSENT_STRING;
691 if (WANTED(key_backspace))
692 key_backspace = _nc_save_str(C_BS);
693 if (WANTED(key_left))
694 key_left = _nc_save_str(C_BS);
695 if (WANTED(key_down))
696 key_down = _nc_save_str(C_LF);
700 * Translate XENIX forms characters.
702 if (PRESENT(acs_ulcorner) ||
703 PRESENT(acs_llcorner) ||
704 PRESENT(acs_urcorner) ||
705 PRESENT(acs_lrcorner) ||
710 PRESENT(acs_hline) ||
711 PRESENT(acs_vline) ||
714 char buf2[MAX_TERMCAP_LENGTH], *bp = buf2;
718 (void)strcpy(bp, acs_chars);
722 if (acs_ulcorner && acs_ulcorner[1] == '\0')
725 *bp++ = *acs_ulcorner;
727 if (acs_llcorner && acs_llcorner[1] == '\0')
730 *bp++ = *acs_llcorner;
732 if (acs_urcorner && acs_urcorner[1] == '\0')
735 *bp++ = *acs_urcorner;
737 if (acs_lrcorner && acs_lrcorner[1] == '\0')
740 *bp++ = *acs_lrcorner;
742 if (acs_ltee && acs_ltee[1] == '\0')
747 if (acs_rtee && acs_rtee[1] == '\0')
752 if (acs_btee && acs_btee[1] == '\0')
757 if (acs_ttee && acs_ttee[1] == '\0')
762 if (acs_hline && acs_hline[1] == '\0')
767 if (acs_vline && acs_vline[1] == '\0')
775 strcpy(bp, acs_plus);
776 bp = buf2 + strlen(buf2);
782 acs_chars = _nc_save_str(buf2);
783 _nc_warning("acsc string synthesized from XENIX capabilities");
789 void postprocess_terminfo(TERMTYPE *tp)
792 * TERMINFO-TO-TERMINFO MAPPINGS FOR SOURCE TRANSLATION
793 * ----------------------------------------------------------------------
797 * Translate AIX forms characters.
799 if (PRESENT(box_chars_1))
801 char buf2[MAX_TERMCAP_LENGTH], *bp = buf2;
805 (void)strcpy(bp, acs_chars);
809 if (box_chars_1[0]) /* ACS_ULCORNER */
812 *bp++ = box_chars_1[0];
814 if (box_chars_1[1]) /* ACS_HLINE */
817 *bp++ = box_chars_1[1];
819 if (box_chars_1[2]) /* ACS_URCORNER */
822 *bp++ = box_chars_1[2];
824 if (box_chars_1[3]) /* ACS_VLINE */
827 *bp++ = box_chars_1[3];
829 if (box_chars_1[4]) /* ACS_LRCORNER */
832 *bp++ = box_chars_1[4];
834 if (box_chars_1[5]) /* ACS_LLCORNER */
837 *bp++ = box_chars_1[5];
839 if (box_chars_1[6]) /* ACS_TTEE */
842 *bp++ = box_chars_1[6];
844 if (box_chars_1[7]) /* ACS_RTEE */
847 *bp++ = box_chars_1[7];
849 if (box_chars_1[8]) /* ACS_BTEE */
852 *bp++ = box_chars_1[8];
854 if (box_chars_1[9]) /* ACS_LTEE */
857 *bp++ = box_chars_1[9];
859 if (box_chars_1[10]) /* ACS_PLUS */
862 *bp++ = box_chars_1[10];
868 acs_chars = _nc_save_str(buf2);
869 _nc_warning("acsc string synthesized from AIX capabilities");
870 box_chars_1 = ABSENT_STRING;
874 * ----------------------------------------------------------------------
879 * Do a linear search through the terminfo tables to find a given full-name.
880 * We don't expect to do this often, so there's no hashing function.
882 * In effect, this scans through the 3 lists of full-names, and looks them
883 * up in _nc_info_table, which is organized so that the nte_index fields are
884 * sorted, but the nte_type fields are not necessarily grouped together.
887 struct name_table_entry const * lookup_fullname(const char *find)
893 NCURSES_CONST char *const *names;
909 for (count = 0; names[count] != 0; count++) {
910 if (!strcmp(names[count], find)) {
911 struct name_table_entry const *entry_ptr = _nc_get_table(FALSE);
912 while (entry_ptr->nte_type != state
913 || entry_ptr->nte_index != count)
921 /* parse_entry.c ends here */