printout

printout

Functions

void session_time ()
void logo ()
void lib_logo ()
void gui_script_logo ()
void gui_logo ()
void text_print_model_confints ()
void print_freq ()
void print_freq_test ()
void print_xtab ()
void print_smpl ()
void print_contemp_covariance_matrix ()
int outcovmx ()
int max_obs_marker_length ()
void print_obs_marker ()
char * maybe_trim_varname ()
int max_namelen_in_list ()
void varlist ()
void maybe_list_vars ()
int printdata ()
int print_data_in_columns ()
int print_series_with_format ()
int text_print_fit_resid ()
int print_fit_resid ()
int text_print_forecast ()
void print_iter_info ()
void text_print_vmatrix ()
void gretl_sprint_fullwidth_double ()
void gretl_print_fullwidth_double ()
void gretl_print_value ()
char * gretl_fix_exponent ()
void bufspace ()
void print_centered ()
void gretl_printxn ()
int in_usa ()
char * bufgets ()
size_t bufgets_peek_line_length ()
int bufgets_init ()
int query_bufgets_init ()
void bufgets_finalize ()
void buf_rewind ()
int bufseek ()
long buftell ()
void bufgets_cleanup ()

Types and Values

#define GRETL_DIGITS
#define GRETL_MP_DIGITS
#define NAMETRUNC

Object Hierarchy


Description

Functions

session_time ()

void
session_time (PRN *prn);

Print the current time to the specified printing object, or to stdout if prn is NULL.

Parameters

prn

where to print.

 

logo ()

void
logo (int quiet);

Print to stdout gretl version information.

Parameters

quiet

if non-zero, just print version ID, else print copyright info also.

 

lib_logo ()

void
lib_logo (void);

Print gretl library version information to stdout.


gui_script_logo ()

void
gui_script_logo (PRN *prn);

Print to prn a header for script output in gui program.

Parameters

prn

gretl printing struct.

 

gui_logo ()

void
gui_logo (PRN *prn);

Print gretl GUI version information to the specified printing object, or to stdout if prn is NULL.

Parameters

prn

where to print.

 

text_print_model_confints ()

void
text_print_model_confints (const CoeffIntervals *cf,
                           PRN *prn);

Print to prn the 95 percent confidence intervals for parameter estimates contained in cf .

Parameters

cf

pointer to confidence intervals.

 

prn

gretl printing struct.

 

print_freq ()

void
print_freq (const FreqDist *freq,
            int varno,
            const DATASET *dset,
            PRN *prn);

Print frequency distribution to prn .

Parameters

freq

gretl frequency distribution struct.

 

varno

ID number of the series in question.

 

dset

pointer to dataset.

 

prn

gretl printing struct.

 

print_freq_test ()

void
print_freq_test (const FreqDist *freq,
                 PRN *prn);


print_xtab ()

void
print_xtab (const Xtab *tab,
            gretlopt opt,
            PRN *prn);

Print crosstab to prn .

Parameters

tab

gretl cross-tabulation struct.

 

opt

may contain OPT_R to print row percentages, OPT_C to print column percentages, OPT_Z to display zero entries.

 

prn

gretl printing struct.

 

print_smpl ()

void
print_smpl (const DATASET *dset,
            int fulln,
            PRN *prn);

Prints the current sample information to prn .

Parameters

dset

data information struct

 

fulln

full length of data series, if dataset is subsampled, or 0 if not applicable/known.

 

prn

gretl printing struct.

 

print_contemp_covariance_matrix ()

void
print_contemp_covariance_matrix (const gretl_matrix *m,
                                 double ldet,
                                 PRN *prn);


outcovmx ()

int
outcovmx (MODEL *pmod,
          const DATASET *dset,
          PRN *prn);

Print to prn the variance-covariance matrix for the parameter estimates in pmod .

Parameters

pmod

pointer to model.

 

dset

data information struct.

 

prn

gretl printing struct.

 

Returns

0 on successful completion, error code on error.


max_obs_marker_length ()

int
max_obs_marker_length (const DATASET *dset);

Parameters

dset

dataset information.

 

Returns

the length of the longest observation marker within the current sample range.


print_obs_marker ()

void
print_obs_marker (int t,
                  const DATASET *dset,
                  int len,
                  PRN *prn);

Print a string (label, date or obs number) representing the given t .

Parameters

t

observation number.

 

dset

data information struct.

 

len

width to which to print.

 

prn

gretl printing struct.

 

maybe_trim_varname ()

char *
maybe_trim_varname (char *targ,
                    const char *src);

Returns


max_namelen_in_list ()

int
max_namelen_in_list (const int *list,
                     const DATASET *dset);

Returns


varlist ()

void
varlist (const DATASET *dset,
         PRN *prn);

Prints a list of the names of the variables currently defined.

Parameters

dset

data information struct.

 

prn

gretl printing struct

 

maybe_list_vars ()

void
maybe_list_vars (const DATASET *dset,
                 PRN *prn);

Prints a list of the names of the variables currently defined, unless gretl messaging is turned off.

Parameters

dset

data information struct.

 

prn

gretl printing struct

 

printdata ()

int
printdata (const int *list,
           const char *mstr,
           const DATASET *dset,
           gretlopt opt,
           PRN *prn);

Print the data for the variables in list over the currently defined sample range.

Parameters

list

list of variables to print.

 

mstr

optional string holding names of non-series objects to print.

 

dset

dataset struct.

 

opt

if OPT_O, print the data by observation (series in columns); if OPT_N, use simple obs numbers, not dates.

 

prn

gretl printing struct.

 

Returns

0 on successful completion, 1 on error.


print_data_in_columns ()

int
print_data_in_columns (const int *list,
                       const int *obsvec,
                       const DATASET *dset,
                       gretlopt opt,
                       PRN *prn);

Print the data for the variables in list . If obsvec is not NULL, it should specify a sort order; the first element of obsvec must contain the number of observations that follow. By default, printing is plain text, formatted in columns using space characters, but if the prn format is set to GRETL_FORMAT_CSV then printing respects the user's choice of column delimiter, and if the format is set to GRETL_FORMAT_RTF the data are printed as an RTF table.

Parameters

list

list of variables to print.

 

obsvec

list of observation numbers (or NULL)

 

dset

dataset struct.

 

opt

may include OPT_X to exclude the observations column that is usually printed first.

 

prn

gretl printing struct.

 

Returns

0 on successful completion, non-zero code on error.


print_series_with_format ()

int
print_series_with_format (const int *list,
                          const DATASET *dset,
                          char fmt,
                          int digits,
                          PRN *prn);

Returns


text_print_fit_resid ()

int
text_print_fit_resid (const FITRESID *fr,
                      const DATASET *dset,
                      PRN *prn);

Returns


print_fit_resid ()

int
print_fit_resid (const MODEL *pmod,
                 const DATASET *dset,
                 PRN *prn);

Print to prn the fitted values and residuals from pmod .

Parameters

pmod

pointer to gretl model.

 

dset

dataset struct.

 

prn

gretl printing struct.

 

Returns

0 on successful completion, 1 on error.


text_print_forecast ()

int
text_print_forecast (const FITRESID *fr,
                     DATASET *dset,
                     gretlopt opt,
                     PRN *prn);

Prints the forecasts in fr to prn , and also plots the forecasts if OPT_P is given. If a plot is requested and fr includes forecast standard errors, then the options OPT_F or OPT_L may be given to use "fill" style or lines, respectively, for the confidence bands (the default style being vertical bars per observation).

Parameters

fr

pointer to structure containing forecasts.

 

dset

dataset information.

 

opt

if includes OPT_P, make a plot of the forecasts; if includes OPT_N, skip printing of the forecast evaluation statistics.

 

prn

printing struct.

 

Returns

0 on success, non-zero error code on error.


print_iter_info ()

void
print_iter_info (int iter,
                 double crit,
                 int type,
                 int k,
                 const double *b,
                 const double *g,
                 double sl,
                 PRN *prn);

Print to prn information pertaining to step iter of an iterative estimation process.

Parameters

iter

iteration number.

 

crit

criterion (e.g. log-likelihood).

 

type

type of criterion (C_LOGLIK or C_OTHER)

 

k

number of parameters.

 

b

parameter array.

 

g

gradient array.

 

sl

step length.

 

prn

gretl printing struct.

 

text_print_vmatrix ()

void
text_print_vmatrix (VMatrix *vmat,
                    PRN *prn);


gretl_sprint_fullwidth_double ()

void
gretl_sprint_fullwidth_double (double x,
                               int digits,
                               char *targ,
                               PRN *prn);


gretl_print_fullwidth_double ()

void
gretl_print_fullwidth_double (double x,
                              int digits,
                              PRN *prn);


gretl_print_value ()

void
gretl_print_value (double x,
                   PRN *prn);


gretl_fix_exponent ()

char *
gretl_fix_exponent (char *s);

Some C libraries (e.g. MS) print an "extra" zero in the exponent when using scientific notation, e.g. "1.45E-002". This function checks for this and cuts it out if need be.

Parameters

s

string representation of floating-point number.

 

Returns

the corrected numeric string.


bufspace ()

void
bufspace (int n,
          PRN *prn);


print_centered ()

void
print_centered (const char *s,
                int width,
                PRN *prn);

If the string s is shorter than width, print it centered in a field of the given width (otherwise just print it straight).

Parameters

s

string to print.

 

width

width of field.

 

prn

gretl printing struct.

 

gretl_printxn ()

void
gretl_printxn (double x,
               int n,
               PRN *prn);

Print a string representation of the double-precision value x in a format that depends on n .

Parameters

x

number to print.

 

n

controls width of output.

 

prn

gretl printing struct.

 

in_usa ()

int
in_usa (void);

Returns


bufgets ()

char *
bufgets (char *s,
         size_t size,
         const char *buf);

This function works much like fgets, reading successive lines from a buffer rather than a file. Important note: use of bufgets() on a particular buffer must be preceded by a call to bufgets_init() on the same buffer, and must be followed by a call to bufgets_finalize(), again on the same buffer.

Parameters

s

target string (must be pre-allocated).

 

size

maximum number of characters to read.

 

buf

source buffer.

 

Returns

s (or NULL if nothing more can be read from buf ).


bufgets_peek_line_length ()

size_t
bufgets_peek_line_length (const char *buf);

Returns


bufgets_init ()

int
bufgets_init (const char *buf);

Initializes a text buffer for use with bufgets().

Parameters

buf

source buffer.

 

Returns

0 on success, non-zero on error.


query_bufgets_init ()

int
query_bufgets_init (const char *buf);

Returns


bufgets_finalize ()

void
bufgets_finalize (const char *buf);

Signals that we are done reading from buf .

Parameters

buf

source buffer.

 

buf_rewind ()

void
buf_rewind (const char *buf);

Buffer equivalent of rewind(). Note that buf must first be initialized using bufgets_init().

Parameters

buf

char buffer.

 

bufseek ()

int
bufseek (const char *buf,
         long int offset);

Buffer equivalent of fseek(), with SEEK_SET. Note that buf must first be initialized via bufgets_init().

Parameters

buf

char buffer.

 

offset

offset from start of buf .

 

Returns

0 on success, 1 on error.


buftell ()

long
buftell (const char *buf);

Buffer equivalent of ftell. Note that buf must first be initialized via bufgets_init().

Parameters

buf

char buffer.

 

Returns

offset from start of buffer.


bufgets_cleanup ()

void
bufgets_cleanup (void);

Types and Values

GRETL_DIGITS

#define GRETL_DIGITS 6


GRETL_MP_DIGITS

#define GRETL_MP_DIGITS 12


NAMETRUNC

#define NAMETRUNC 18