00001 /*============================================================================ 00002 00003 WCSLIB 4.7 - an implementation of the FITS WCS standard. 00004 Copyright (C) 1995-2011, Mark Calabretta 00005 00006 This file is part of WCSLIB. 00007 00008 WCSLIB is free software: you can redistribute it and/or modify it under the 00009 terms of the GNU Lesser General Public License as published by the Free 00010 Software Foundation, either version 3 of the License, or (at your option) 00011 any later version. 00012 00013 WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY 00014 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00016 more details. 00017 00018 You should have received a copy of the GNU Lesser General Public License 00019 along with WCSLIB. If not, see <http://www.gnu.org/licenses/>. 00020 00021 Correspondence concerning WCSLIB may be directed to: 00022 Internet email: mcalabre@atnf.csiro.au 00023 Postal address: Dr. Mark Calabretta 00024 Australia Telescope National Facility, CSIRO 00025 PO Box 76 00026 Epping NSW 1710 00027 AUSTRALIA 00028 00029 Author: Mark Calabretta, Australia Telescope National Facility 00030 http://www.atnf.csiro.au/~mcalabre/index.html 00031 $Id: wcsprintf_8h-source.html,v 1.1 2011/03/14 11:59:37 pteuben Exp $ 00032 *============================================================================= 00033 * 00034 * WCSLIB 4.7 - C routines that implement the FITS World Coordinate System 00035 * (WCS) standard. 00036 * 00037 * Summary of the wcsprintf routines 00038 * ------------------------------ 00039 * These routines allow diagnostic output from celprt(), linprt(), prjprt(), 00040 * spcprt(), tabprt(), and wcsprt() to be redirected to a file or captured in 00041 * a string buffer. These routines use wcsprintf() for output. 00042 * 00043 * 00044 * wcsprintf() - Print function used by WCSLIB diagnostic routines 00045 * --------------------------------------------------------------- 00046 * wcsprintf() is used by the celprt(), linprt(), prjprt(), spcprt(), tabprt(), 00047 * and wcsprt() routines. Its output may be redirected to a file or string 00048 * buffer via wcsprintf_set(). 00049 * 00050 * Given: 00051 * format char* Format string, passed to one of the printf(3) family 00052 * of stdio library functions. 00053 * ... mixed Argument list matching format, as per printf(3). 00054 * 00055 * Function return value: 00056 * int Number of bytes written. 00057 * 00058 * 00059 * wcsprintf_set() - Set output disposition for wcsprintf() 00060 * -------------------------------------------------------- 00061 * wcsprintf_set() sets the output disposition for wcsprintf() which is used by 00062 * the celprt(), linprt(), prjprt(), spcprt(), tabprt(), and wcsprt() routines. 00063 * 00064 * Given: 00065 * wcsout FILE* Pointer to an output stream that has been opened for 00066 * writing, e.g. by the fopen() stdio library function, 00067 * or one of the predefined stdio output streams - stdout 00068 * and stderr. If zero (NULL), output is written to an 00069 * internally-allocated string buffer, the address of 00070 * which may be obtained by wcsprintf_buf(). 00071 * 00072 * Function return value: 00073 * int Status return value: 00074 * 0: Success. 00075 * 00076 * 00077 * wcsprintf_buf() - Get the address of the internal string buffer 00078 * --------------------------------------------------------------- 00079 * wcsprintf_buf() returns the address of the internal string buffer created 00080 * when wcsprintf_set() is invoked with its FILE* argument set to zero. 00081 * 00082 * Function return value: 00083 * const char * 00084 * Address of the internal string buffer. The user may 00085 * free this buffer by calling wcsprintf_set() with a 00086 * valid FILE*, e.g. stdout. The free() stdlib library 00087 * function must NOT be invoked on this const pointer. 00088 * 00089 *===========================================================================*/ 00090 00091 #ifndef WCSLIB_WCSPRINTF 00092 #define WCSLIB_WCSPRINTF 00093 00094 #ifdef __cplusplus 00095 extern "C" { 00096 #endif 00097 00098 int wcsprintf_set(FILE *wcsout); 00099 int wcsprintf(const char *format, ...); 00100 const char *wcsprintf_buf(void); 00101 00102 #ifdef __cplusplus 00103 } 00104 #endif 00105 00106 #endif /* WCSLIB_WCSPRINTF */