home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 419b.lha / TERMLIB / tgetflag.c < prev    next >
C/C++ Source or Header  |  1990-10-05  |  890b  |  42 lines

  1. /* The following software is (C) 1984 Peter da Silva,
  2.    the Mad Australian, in the public domain. It may
  3.    be re-distributed for any purpose with the inclusion
  4.    of this notice. */
  5. /* TERMLIB: Terminal independant database.
  6.  *
  7.  * Module: tgetflag
  8.  *
  9.  * Purpose: returns flag true or false as to the existence of a given
  10.  *        entry. used with 'bs', 'am', etc...
  11.  *
  12.  * Calling conventions: id is the 2 character capability id.
  13.  *
  14.  * Returned values: 1 for success, 0 for failure.
  15.  */
  16. #include <stdio.h>
  17. #include <ctype.h>
  18. #include "termlib.h"
  19.  
  20. /* tgetflag.c (libtermlib.a)
  21.  *
  22. BUILD
  23. OBJS=tinit.o tutil.o tvars.o \
  24.      tgoto.o tputs.o tgetent.o tgetflag.o tgetnum.o tgetstr.o
  25. CFLAGS=-O
  26.  
  27. libtermlib.a: $(OBJS) termlib.h
  28.     ar cr libtermlib.a $(OBJS)
  29.     ranlib libtermlib.a
  30.  
  31. $(OBJS):: termlib.h
  32. END
  33. */
  34.  
  35. tgetflag(id)
  36. char *id;
  37. {
  38.     char    buf[256], *ptr = buf;
  39.  
  40.     return tgetstr(id, &ptr) ? 1 : 0;
  41. }
  42.