/[ascend]/trunk/base/generic/utilities/ascPrint.h
ViewVC logotype

Diff of /trunk/base/generic/utilities/ascPrint.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 585 by johnpye, Fri Apr 21 10:41:45 2006 UTC revision 586 by johnpye, Thu May 11 00:47:54 2006 UTC
# Line 14  Line 14 
14   *  Copyright 2005, Benjamin Andrew Allan   *  Copyright 2005, Benjamin Andrew Allan
15   *   *
16   *  The ASCEND utilities is free software; you can redistribute   *  The ASCEND utilities is free software; you can redistribute
17   *  it and/or modify it under the terms of the GNU General Public License as       *  it and/or modify it under the terms of the GNU General Public License as
18   *  published by the Free Software Foundation; either version 2 of the   *  published by the Free Software Foundation; either version 2 of the
19   *  License, or (at your option) any later version.   *  License, or (at your option) any later version.
20   *   *
# Line 33  Line 33 
33   *  ASCEND Printf stdout/stderr substitutes dispatcher.   *  ASCEND Printf stdout/stderr substitutes dispatcher.
34   *  These routines redirect output to stdout and stdin to other   *  These routines redirect output to stdout and stdin to other
35   *  functions defined by the user.  This is not required when you   *  functions defined by the user.  This is not required when you
36   *  desire to send output to an available console, which is normally   *  desire to send output to an available console, which is normally
37   *  the case on Linux/unix.  However, in cases where a console is   *  the case on Linux/unix.  However, in cases where a console is
38   *  not available (e.g. Win32 gui) or you prefer to redirect output   *  not available (e.g. Win32 gui) or you prefer to redirect output
39   *  for other reasons, these routines make it possible.<br><br>   *  for other reasons, these routines make it possible.<br><br>
40   */   */
41    
# Line 48  Line 48 
48   * Output functions interceptor vtable. This should be constructed   * Output functions interceptor vtable. This should be constructed
49   * and the functions fully operational before it is   * and the functions fully operational before it is
50   * pushed on the stack of output tables.   * pushed on the stack of output tables.
51   *   *
52   * This should be constructed and the functions fully operational   * This should be constructed and the functions fully operational
53   * before it is pushed on the stack of output tables.<br><br>   * before it is pushed on the stack of output tables.<br><br>
54   */   */
# Line 58  struct Asc_PrintVTable { Line 58  struct Asc_PrintVTable {
58    int (*fflush)(FILE *);                                    /**< Flush function. */    int (*fflush)(FILE *);                                    /**< Flush function. */
59    struct Asc_PrintVTable *next;                             /**< Next vtable in linked list. */    struct Asc_PrintVTable *next;                             /**< Next vtable in linked list. */
60  };  };
61                                                
62    
63  extern int Asc_PrintPushVTable(struct Asc_PrintVTable *vtable);  extern int Asc_PrintPushVTable(struct Asc_PrintVTable *vtable);
64  /**<  /**<
65   *  Adds a vtable to the ASCEND output interceptor list.   *  Adds a vtable to the ASCEND output interceptor list.
66   *  Each registered vtable defines print and flush functions that are   *  Each registered vtable defines print and flush functions that are
67   *  called by the internal ASCEND print functions to do the actual output.   *  called by the internal ASCEND print functions to do the actual output.
# Line 108  extern int Asc_Printf(CONST char *format Line 108  extern int Asc_Printf(CONST char *format
108   *  function prints the `variable_number_args' to stdout using the print   *  function prints the `variable_number_args' to stdout using the print
109   *  functions defined in the registered vtables.  The same output is   *  functions defined in the registered vtables.  The same output is
110   *  printed using all registered vtables.  If no vtables are registered,   *  printed using all registered vtables.  If no vtables are registered,
111   *  nothing will be output.  Returns the number of bytes printed from   *  nothing will be output.  Returns the number of bytes printed from
112   *  the final vtable that is called.<br><br>   *  the final vtable that is called.<br><br>
113   *   *
114   *  This is needed under Windows to redirect stdout to the TkConsole   *  This is needed under Windows to redirect stdout to the TkConsole
# Line 119  extern int Asc_Printf(CONST char *format Line 119  extern int Asc_Printf(CONST char *format
119   *  @return Returns the number of bytes printed from the final vtable called.   *  @return Returns the number of bytes printed from the final vtable called.
120   */   */
121    
122  extern int Asc_FPrintf(FILE *fileptr, CONST char *format, ...);  ASC_DLLSPEC(int) Asc_FPrintf(FILE *fileptr, CONST char *format, ...);
123  /**<  /**<
124   *  Prints the specified variables to fileptr using all registered print   *  Prints the specified variables to fileptr using all registered print
125   *  vtables.  Using the sprintf-style format string `format', this   *  vtables.  Using the sprintf-style format string `format', this
126   *  function prints the `variable_number_args' to the file handle   *  function prints the `variable_number_args' to the file handle
127   *  'fileptr' using the print functions defined in the registered vtables.   *  'fileptr' using the print functions defined in the registered vtables.
128   *  The same output is  printed using all registered vtables.  If no vtables   *  The same output is  printed using all registered vtables.  If no vtables
129   *  are registered, nothing will be output.  Returns the number of bytes   *  are registered, nothing will be output.  Returns the number of bytes
130   *  printed from the final vtable that is called.<br><br>   *  printed from the final vtable that is called.<br><br>
131   *   *
132   *  This is needed under Windows to redirect stdout to the TkConsole   *  This is needed under Windows to redirect stdout to the TkConsole
# Line 150  extern int Asc_FFlush(FILE *fileptr); Line 150  extern int Asc_FFlush(FILE *fileptr);
150   *  Flushes output to fileptr.   *  Flushes output to fileptr.
151   *  This function loops over all registered print vtables, flushing   *  This function loops over all registered print vtables, flushing
152   *  output to the file pointed to by `fileptr'.  If no vtables are   *  output to the file pointed to by `fileptr'.  If no vtables are
153   *  registered, no streams will be flushed.  Returns 0 for success   *  registered, no streams will be flushed.  Returns 0 for success
154   *  and EOF for failure.<br><br>   *  and EOF for failure.<br><br>
155   *   *
156   *  This is needed for consistency with Asc_FPrintf() and Asc_Printf().   *  This is needed for consistency with Asc_FPrintf() and Asc_Printf().
# Line 166  extern int Asc_FPutc(int c, FILE *filept Line 166  extern int Asc_FPutc(int c, FILE *filept
166   *  all registered print vtables.  For other file streams, the standard   *  all registered print vtables.  For other file streams, the standard
167   *  fputc() function is used.  Returns non-zero for success and EOF for   *  fputc() function is used.  Returns non-zero for success and EOF for
168   *  failure.<br><br>   *  failure.<br><br>
169   *                               *
170   *  This is needed under Windows to redirect stdout and stderr to the   *  This is needed under Windows to redirect stdout and stderr to the
171   *  TkConsole instead of into the bit bucket.   *  TkConsole instead of into the bit bucket.
172   *   *
# Line 178  extern int Asc_FPutc(int c, FILE *filept Line 178  extern int Asc_FPutc(int c, FILE *filept
178  extern int Asc_Putchar(int c);  extern int Asc_Putchar(int c);
179  /**<  /**<
180   *  Prints c to stdout.   *  Prints c to stdout.
181   *  This function loops over all registered print vtables.     *  This function loops over all registered print vtables.
182   *  Returns 1 for success and EOF for failure.<br><br>   *  Returns 1 for success and EOF for failure.<br><br>
183   *   *
184   *  This is needed under Windows to redirect stdout and stderr to the   *  This is needed under Windows to redirect stdout and stderr to the
# Line 188  extern int Asc_Putchar(int c); Line 188  extern int Asc_Putchar(int c);
188   *  @return Returns 1 for success, EOF otherwise.   *  @return Returns 1 for success, EOF otherwise.
189   */   */
190    
191    ASC_DLLSPEC(int) color_on(FILE *f, const char *colorcode);
192    ASC_DLLSPEC(int) color_off(FILE *f);
193    
194  #endif /* _ASCPRINT_H */  #endif /* _ASCPRINT_H */
195    
196    

Legend:
Removed from v.585  
changed lines
  Added in v.586

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22