/*****************************************************************
**
** tcap.c -- termcap color capabilities
**
** (c) Jan 1991 - Feb 2010 by hoz
**
** Feb 2002 max line size increased to 512 byte
** default terminal "html" added
** Feb 2010 color capabilities added
**
*****************************************************************/
#include <stdio.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
# include "config_zkt.h"
# ifdef HAVE_TERM_H
# include <term.h>
# endif
# ifdef HAVE_CURSES_H
# include <curses.h>
# endif
#endif
#define extern
# include "tcap.h"
#undef extern
/*****************************************************************
** global vars
*****************************************************************/
/* termcap strings */
/* termcap numbers */
static int maxcolor;
/* function declaration */
static int html = 0;
/*****************************************************************
** global functions
*****************************************************************/
{
int i;
/* clear all color strings */
for ( i = 0; i < 8; i++ )
colortab[i][0] = '\0';
return 0;
{
bold_on = "<B>";
bold_off = "</B>";
italic_on = "<I>";
italic_off = "</I>";
af = "";
maxcolor = 8;
html = 1;
return 0;
}
#if 0
return 0;
#endif
{
return -1;
return -1;
}
is1 = "";
is2 = "";
r1 = "";
r2 = "";
/* if bold is not present */
/* use standout mode */
else
else
/* if italic not present */
/* use underline mode */
else
else
if ( maxcolor < 0 ) /* no colors ? */
return 0;
if ( maxcolor > 8 )
maxcolor = 8;
{
for ( i = 0; i < maxcolor; i++ )
}
{
}
#if 0
#endif
return 0;
}
#else
{
int i;
is1 = "";
is2 = "";
r1 = "";
r2 = "";
bold_on = "";
bold_off = "";
italic_on = "";
italic_off = "";
for ( i = 0; i < 8; i++ )
colortab[i][0] = '\0';
maxcolor = 0;
html = 0;
return 0;
}
#endif
{
#if 0
if ( term )
{
// if ( r1 && *r1 ) tc_printattr (fp, r1);
}
#endif
return 0;
}
#else
{
return 0;
}
#endif
{
int len;
len = 0;
if ( on ) /* turn attributes on ? */
{
if ( attr & 0xFF )
}
else /* turn attributes off */
{
if ( html )
else
}
return len;
}
#else
{
return 0;
}
#endif
/*****************************************************************
** internal functions
*****************************************************************/
static int put (int c)
{
}
{
}
#else
{
return 0;
}
#endif
{
return 0;
}
#else
{
return 0;
}
#endif
#ifdef TEST
static const char *progname;
/*****************************************************************
** test main()
*****************************************************************/
{
extern char *getenv ();
int i;
const char *text;
// printattr (is); /* Initialisierungsstring ausgeben */
text = "Test";
if ( argc > 1 )
printf ("Bold Headline\n");
for ( i = 0; i < 8; i++ )
{
#if 0
#endif
printf ("\n");
}
printf ("now back to black\n");
// printattr (r2); /* Zuruecksetzen */
return (0);
}
#endif