CWB
Macros | Functions | Variables
ascii-print.c File Reference
#include <stdio.h>
#include <string.h>
#include "../cl/macros.h"
#include "../cl/corpus.h"
#include "../cl/attributes.h"
#include "../cl/cdaccess.h"
#include <sys/time.h>
#include <time.h>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include "ascii-print.h"
#include "cqp.h"
#include "output.h"
#include "print_align.h"
#include "options.h"
#include "corpmanag.h"
#include "concordance.h"
#include "attlist.h"
#include "print-modes.h"

Macros

#define USE_OLD_COMPOSE
 [TODO get rid?] doesn't currently appear to be used anywhere? More...
 

Functions

char * ascii_convert_string (char *s)
 Convert string function for ASCII mode. More...
 
char * ascii_print_field (FieldType field, int at_end)
 
char * get_colour_escape (char colour, int foreground)
 Dummy function. More...
 
char * get_typeface_escape (char typeface)
 Dummy function. More...
 
void get_screen_escapes (void)
 Dummy function. More...
 
void ascii_print_aligned_line (FILE *stream, int highlighting, char *attribute_name, char *line)
 Prints a line of text (which will have been previously exrtracted from a corfpus linked to the present corpus by an a-attribute) with a brief character-mode start-of-line flag ("-->$att_name: "). More...
 
void print_concordance_line (FILE *outfd, CorpusList *cl, int element, int apply_highlighting, AttributeList *strucs)
 Prints a concordance line. More...
 
void ascii_print_corpus_header (CorpusList *cl, FILE *stream)
 
void ascii_print_output (CorpusList *cl, FILE *outfd, int interactive, ContextDescriptor *cd, int first, int last)
 
void ascii_print_group (Group *group, int expand, FILE *fd)
 

Variables

PrintDescriptionRecord ASCIIPrintDescriptionRecord
 Print description record for ASCII print mode. More...
 
PrintDescriptionRecord ASCIIHighlightedPrintDescriptionRecord
 Print description record for Highlighted-ASCII print mode. More...
 
static int escapes_initialized = 0
 Boolean: have escapes been initialised? More...
 
static char * sc_s_in
 Enter standout (highlighted) mode. More...
 
static char * sc_s_out
 Exit standout mode. More...
 
static char * sc_u_in
 Enter underline mode. More...
 
static char * sc_u_out
 Exit underline mode. More...
 
static char * sc_b_in
 Enter bold mode. More...
 
static char * sc_b_out
 Exit bold mode (doesn't exist; this code turns off all attributes) More...
 
static char * sc_bl_in
 Enter blink mode. More...
 
static char * sc_bl_out
 Exit blink mode. More...
 
static char * sc_all_out
 Turn off all display attributes. More...
 
int sc_s_mode = 0
 Boolean: following tokens will be shown in standout mode. More...
 
int sc_u_mode = 0
 Boolean: following tokens will be shown in underline mode. More...
 
int sc_b_mode = 0
 Boolean: following tokens will be shown in bold mode. More...
 
char sc_before_token [256]
 < 'static' return value of ascii_print_field() More...
 

Macro Definition Documentation

#define USE_OLD_COMPOSE

[TODO get rid?] doesn't currently appear to be used anywhere?

Function Documentation

char* ascii_convert_string ( char *  s)

Convert string function for ASCII mode.

This is used for the "printToken" function in the relevant PDR.

Parameters
sThe string to convert.
Returns
s (ie no change).
void ascii_print_aligned_line ( FILE *  stream,
int  highlighting,
char *  attribute_name,
char *  line 
)

Prints a line of text (which will have been previously exrtracted from a corfpus linked to the present corpus by an a-attribute) with a brief character-mode start-of-line flag ("-->$att_name: ").

Parameters
streamDestination for the output.
highlightingBoolean: if true, use colour/bold highlighting for the leading indicator on the line.
attribute_nameThe name of the aligned corpus: printed in the leading indicator
lineCharacter data of the line of aligned-corpus data to print. This is treated as opaque.

References get_colour_escape(), and get_typeface_escape().

Referenced by printAlignedStrings().

void ascii_print_corpus_header ( CorpusList cl,
FILE *  stream 
)
char * ascii_print_field ( FieldType  field,
int  at_end 
)
void ascii_print_group ( Group group,
int  expand,
FILE *  fd 
)
void ascii_print_output ( CorpusList cl,
FILE *  outfd,
int  interactive,
ContextDescriptor cd,
int  first,
int  last 
)
char* get_colour_escape ( char  colour,
int  foreground 
)

Dummy function.

Referenced by ascii_print_aligned_line(), ascii_print_field(), and main().

void get_screen_escapes ( void  )
char* get_typeface_escape ( char  typeface)

Dummy function.

Referenced by ascii_print_aligned_line(), and main().

void print_concordance_line ( FILE *  outfd,
CorpusList cl,
int  element,
int  apply_highlighting,
AttributeList strucs 
)

Variable Documentation

PrintDescriptionRecord ASCIIHighlightedPrintDescriptionRecord
Initial value:
= {
"%9d: ",
NULL,
" ",
": ",
"<",
">",
" ",
"</",
">",
NULL,
" ",
"/",
NULL,
NULL,
NULL,
NULL,
NULL,
"\n",
NULL,
NULL,
}
char * ascii_convert_string(char *s)
Convert string function for ASCII mode.
Definition: ascii-print.c:72
char * ascii_print_field(FieldType field, int at_end)
Definition: ascii-print.c:384

Print description record for Highlighted-ASCII print mode.

Referenced by print_concordance_line().

PrintDescriptionRecord ASCIIPrintDescriptionRecord
Initial value:
= {
"%9d: ",
NULL,
" ",
": ",
"<",
">",
" ",
"</",
">",
NULL,
" ",
"/",
NULL,
NULL,
NULL,
NULL,
NULL,
"\n",
NULL,
NULL,
NULL
}
char * ascii_convert_string(char *s)
Convert string function for ASCII mode.
Definition: ascii-print.c:72

Print description record for ASCII print mode.

Referenced by print_concordance_line(), and printAlignedStrings().

int escapes_initialized = 0
static

Boolean: have escapes been initialised?

Referenced by get_screen_escapes(), and print_concordance_line().

char * sc_all_out
static

Turn off all display attributes.

Referenced by ascii_print_field(), and get_screen_escapes().

char * sc_b_in
static

Enter bold mode.

Referenced by ascii_print_field(), and get_screen_escapes().

int sc_b_mode = 0

Boolean: following tokens will be shown in bold mode.

Referenced by ascii_print_field(), and print_concordance_line().

char * sc_b_out
static

Exit bold mode (doesn't exist; this code turns off all attributes)

Referenced by get_screen_escapes().

char sc_before_token[256]

< 'static' return value of ascii_print_field()

Referenced by ascii_print_field().

char * sc_bl_in
static

Enter blink mode.

Referenced by get_screen_escapes().

char * sc_bl_out
static

Exit blink mode.

Referenced by get_screen_escapes().

char* sc_s_in
static

Enter standout (highlighted) mode.

Referenced by ascii_print_field(), and get_screen_escapes().

int sc_s_mode = 0

Boolean: following tokens will be shown in standout mode.

Referenced by ascii_print_field(), and print_concordance_line().

char * sc_s_out
static

Exit standout mode.

Referenced by get_screen_escapes().

char * sc_u_in
static

Enter underline mode.

Referenced by ascii_print_field(), and get_screen_escapes().

int sc_u_mode = 0

Boolean: following tokens will be shown in underline mode.

Referenced by ascii_print_field(), and print_concordance_line().

char * sc_u_out
static

Exit underline mode.

Referenced by get_screen_escapes().