/[ascend]/trunk/test/redirectStdStreams.h
ViewVC logotype

Annotation of /trunk/test/redirectStdStreams.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 607 - (hide annotations) (download) (as text)
Tue May 16 04:19:20 2006 UTC (18 years, 1 month ago) by johnpye
File MIME type: text/x-chdr
File size: 3116 byte(s)
Updated license/doc blocks at start of files.
Added test_ospath.c and test_ospath.h.
1 johnpye 607 /* ASCEND modelling environment
2     Copyright (C) 2005 Jerry St.Clair
3     Copyright (C) 2006 Carnegie Mellon University
4 jds 59
5 johnpye 607 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 2, or (at your option)
8     any later version.
9 jds 59
10 johnpye 607 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, write to the Free Software
17     Foundation, Inc., 59 Temple Place - Suite 330,
18     Boston, MA 02111-1307, USA.
19     *//**
20     @file
21     Centralized redirection of standard streams to file.
22    
23     Many ASCEND routines print messages. In a testing context, it
24     is usually preferable to have output redirected to a file. This
25     module provides a centralized location for this code (which may
26     end up somewhat platform-dependent).
27    
28     Requires:
29     #include <stdio.h>
30     #include "utilities/ascConfig.h"
31     */
32    
33 jds 59 #ifndef REDIRECTSTDSTREAMS_H_SEEN
34     #define REDIRECTSTDSTREAMS_H_SEEN
35    
36 jds 61 FILE *redirect_stderr(CONST char *filename);
37     /**<
38 jds 59 * Redirects stderr to the specified file.
39     * Returns a pointer to the new stream. If stderr was already being
40     * redirected to a file, the previous file is closed before the new
41 jds 61 * redirection is set up. Returns NULL if stderr could not be
42     * redirected.
43 jds 59 */
44    
45 jds 61 FILE *reset_stderr(void);
46     /**<
47 jds 59 * Restores stderr to the console.
48     * This function closes the redirection file (if any) and
49     * restores stderr to console output. It returns a pointer
50 jds 61 * to the new stderr stream. Returns NULL if stderr could not
51     * be reset.
52 jds 59
53     */
54    
55 jds 61 FILE *redirect_stdin(CONST char *filename);
56     /**<
57 jds 59 * Redirects stdin to the specified file.
58     * Returns a pointer to the new stream. If stdin was already being
59     * redirected to a file, the previous file is closed before the new
60 jds 61 * redirection is set up. Returns NULL if stdin could not be
61     * redirected.
62 jds 59 */
63    
64 jds 61 FILE *reset_stdin(void);
65     /**<
66 jds 59 * Restores stdin to the console.
67     * This function closes the redirection file (if any) and
68     * restores stdin to console output. It returns a pointer
69 johnpye 607 * to the new stdin stream. Returns NULL if stdin could not
70 jds 61 * be reset.
71 jds 59 */
72    
73 jds 61 FILE *redirect_stdout(CONST char *filename);
74     /**<
75     * Redirects stdout to the specified file.
76     * Returns a pointer to the new stream. If stdout was already being
77     * redirected to a file, the previous file is closed before the new
78     * redirection is set up. Returns NULL if stdout could not be
79     * redirected.
80     */
81    
82     FILE *reset_stdout(void);
83     /**<
84     * Restores stdout to the console.
85     * This function closes the redirection file (if any) and
86     * restores stdout to console output. It returns a pointer
87     * to the new stdout stream. Returns NULL if stdout could not
88     * be reset.
89     */
90    
91 jds 59 #endif /* REDIRECTSTDSTREAMS_H_SEEN */

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