"Fossies" - the Fresh Open Source Software Archive

Member "gretl-2020e/lib/src/gretl_prn.h" (22 Oct 2020, 4192 Bytes) of package /linux/misc/gretl-2020e.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "gretl_prn.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2020d_vs_2020e.

    1 /* 
    2  *  gretl -- Gnu Regression, Econometrics and Time-series Library
    3  *  Copyright (C) 2001 Allin Cottrell and Riccardo "Jack" Lucchetti
    4  * 
    5  *  This program is free software: you can redistribute it and/or modify
    6  *  it under the terms of the GNU General Public License as published by
    7  *  the Free Software Foundation, either version 3 of the License, or
    8  *  (at your option) any later version.
    9  * 
   10  *  This program is distributed in the hope that it will be useful,
   11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  *  GNU General Public License for more details.
   14  * 
   15  *  You should have received a copy of the GNU General Public License
   16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
   17  * 
   18  */
   19 
   20 #ifndef GRETL_PRN_H
   21 #define GRETL_PRN_H
   22 
   23 /**
   24  * PRN:
   25  *
   26  * An opaque structure accessed only via gretl_print functions.
   27  */
   28 
   29 typedef struct PRN_ PRN;
   30 
   31 typedef enum {
   32     GRETL_PRINT_STDOUT,
   33     GRETL_PRINT_STDERR,
   34     GRETL_PRINT_FILE,
   35     GRETL_PRINT_BUFFER,
   36     GRETL_PRINT_TEMPFILE,
   37     GRETL_PRINT_STREAM,
   38     GRETL_PRINT_GZFILE
   39 } PrnType;
   40 
   41 typedef enum {
   42     GRETL_FORMAT_TXT       = 1 << 0,
   43     GRETL_FORMAT_TEX       = 1 << 1,
   44     GRETL_FORMAT_DOC       = 1 << 2,
   45     GRETL_FORMAT_RTF       = 1 << 3,
   46     GRETL_FORMAT_RTF_TXT   = 1 << 4,
   47     GRETL_FORMAT_EQN       = 1 << 5,
   48     GRETL_FORMAT_SELECTION = 1 << 6,
   49     GRETL_FORMAT_CSV       = 1 << 7,
   50     GRETL_FORMAT_TAB       = 1 << 8,
   51     GRETL_FORMAT_MODELTAB  = 1 << 9,
   52     GRETL_FORMAT_LANDSCAPE = 1 << 10,
   53     GRETL_FORMAT_HAS_MINUS = 1 << 11
   54 } PrnFormat;
   55 
   56 /* functions follow */
   57 
   58 PRN *gretl_print_new (PrnType ptype, int *err);
   59 
   60 void gretl_print_destroy (PRN *prn);
   61 
   62 PRN *gretl_print_new_with_filename (const char *fname, int *err);
   63 
   64 PRN *gretl_gzip_print_new (const char *fname, int comp_level,
   65                int *err);
   66 
   67 PRN *gretl_print_new_with_tempfile (int *err);
   68 
   69 int gretl_print_has_tempfile (PRN *prn);
   70 
   71 const char *gretl_print_get_tempfile_name (PRN *prn);
   72 
   73 PRN *gretl_print_new_with_buffer (char *buf);
   74 
   75 PRN *gretl_print_new_with_gchar_buffer (gchar *buf);
   76 
   77 PRN *gretl_print_new_with_stream (FILE *fp);
   78 
   79 void gretl_print_detach_stream (PRN *prn);
   80 
   81 int gretl_print_reset_buffer (PRN *prn);
   82 
   83 int gretl_print_rename_file (PRN *prn, const char *oldpath, 
   84                  const char *newpath);
   85 
   86 const char *gretl_print_get_buffer (PRN *prn);
   87 
   88 const char *gretl_print_get_trimmed_buffer (PRN *prn);
   89 
   90 char *gretl_print_steal_buffer (PRN *prn);
   91 
   92 int gretl_print_replace_buffer (PRN *prn, char *buf);
   93 
   94 void gretl_print_get_size (PRN *prn, int *width, int *height);
   95 
   96 int gretl_print_set_save_position (PRN *prn);
   97 
   98 void gretl_print_unset_save_position (PRN *prn);
   99 
  100 char *gretl_print_get_chunk (PRN *prn);
  101 
  102 char *gretl_print_get_chunk_at (PRN *prn, int pos);
  103 
  104 int gretl_print_tell (PRN *prn);
  105 
  106 void gretl_print_set_format (PRN *prn, PrnFormat format);
  107 
  108 void gretl_print_toggle_doc_flag (PRN *prn);
  109 
  110 void gretl_print_set_has_minus (PRN *prn);
  111 
  112 int gretl_print_has_minus (PRN *prn);
  113 
  114 void gretl_print_set_delim (PRN *prn, char delim);
  115 
  116 int pprintf (PRN *prn, const char *format, ...);
  117 
  118 void pprintf2 (PRN *prn, const char *format, ...);
  119 
  120 int pputs (PRN *prn, const char *s);
  121 
  122 int pputc (PRN *prn, int c);
  123 
  124 void gretl_print_ensure_vspace (PRN *prn);
  125 
  126 void gretl_prn_newline (PRN *prn);
  127 
  128 void gretl_print_flush_stream (PRN *prn);
  129 
  130 void gretl_print_close_stream (PRN *prn);
  131 
  132 int printing_to_standard_stream (PRN *prn);
  133 
  134 int print_redirection_level (PRN *prn);
  135 
  136 const char *print_redirection_filename (PRN *prn);
  137 
  138 int print_redirected_at_level (PRN *prn, int level);
  139 
  140 int print_start_redirection (PRN *prn, FILE *fp,
  141                  const char *fname,
  142                  const char *strvar);
  143 
  144 int print_end_redirection (PRN *prn);
  145 
  146 int plain_format (PRN *prn);
  147 
  148 int rtf_format (PRN *prn);
  149 
  150 int rtf_doc_format (PRN *prn);
  151 
  152 int tex_format (PRN *prn);
  153 
  154 int tex_doc_format (PRN *prn);
  155 
  156 int tex_eqn_format (PRN *prn);
  157 
  158 int csv_format (PRN *prn);
  159 
  160 int prn_format (PRN *prn);
  161 
  162 char prn_delim (PRN *prn);
  163 
  164 int gretl_print_has_buffer (PRN *prn);
  165 
  166 int gretl_print_alloc (PRN *prn, size_t s);
  167 
  168 char *gretl_print_read_tempfile (PRN *prn, int *err);
  169 
  170 #endif /* GRETL_PRN_H */