Main Page   Modules   Alphabetical List   Compound List   File List   Compound Members   File Members  

psstream.h

Go to the documentation of this file.
00001 /*  $Id: psstream.h,v 1.2 2000/11/30 07:37:40 dbryson Exp $
00002 **
00003 **  Copyright (c) 2000 Derry Bryson <derry@techass.com>
00004 **
00005 **  Description:
00006 **  
00007 **    Postscript Library
00008 **
00009 **
00010 **  License:
00011 **
00012 **    This library is free software; you can redistribute it and/or
00013 **    modify it under the terms of the GNU Lesser General Public
00014 **    License as published by the Free Software Foundation; either
00015 **    version 2.1 of the License, or (at your option) any later version.
00016 **
00017 **    This library is distributed in the hope that it will be useful,
00018 **    but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 **    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 **    Lesser General Public License for more details.
00021 **
00022 **    You should have received a copy of the GNU Lesser General Public
00023 **    License along with this library; if not, write to the Free Software
00024 **    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 **
00026 **
00027 **  Contact:
00028 **
00029 **      Mail:
00030 **
00031 **        Technology Associates, Inc.
00032 **        LIBPS Project
00033 **        1455 Deming Way #11
00034 **        Sparks, NV  89431
00035 **        USA
00036 **
00037 **      Email:
00038 **
00039 **        libps@techass.com
00040 **
00041 **      See our website at:
00042 **
00043 **        libps.sourceforge.net
00044 **
00045 */
00046 
00051 #ifndef INCLUDE_FILE
00052 #define INCLUDE_FILE
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057 
00058 /******************************************************************************
00059 ****  DEFINES  ****************************************************************
00060 ******************************************************************************/
00061 
00065 #define PS_PRINTF_BUF_LEN       1024
00066 
00067 /******************************************************************************
00068 ****  TYPEDEFS  ***************************************************************
00069 ******************************************************************************/
00070 
00074 typedef size_t (*psFileRead)(void* ptr, size_t size, size_t nmemb, void* stream);
00075 
00079 typedef size_t (*psFileWrite)(const void* ptr, size_t size, size_t nmemb, void* stream);
00080 
00084 typedef long (*psFileTell)(void* stream);
00085 
00089 typedef int (*psFileSeek)(void* stream, long offset, int whence);
00090 
00098 typedef struct psStreamFuncs
00099 {
00100   psFileRead
00101     read;                               
00103   psFileWrite
00104     write;                              
00106   psFileTell
00107     tell;                               
00109   psFileSeek
00110     seek;                               
00111 } PSStreamFuncs;
00124 typedef struct psStream
00125 {
00126   void
00127     *stream;                            
00129   int
00130     ungetchar,                          
00131     eof;                                
00133   PSStreamFuncs
00134     *funcs;                             
00135 } PSStream;
00140 /******************************************************************************
00141 ****  GLOBALS  ****************************************************************
00142 ******************************************************************************/
00143 
00144 extern PSStreamFuncs
00145   psStandardStreamFuncs;
00146   
00147 /******************************************************************************
00148 ****  FUNCTION PROTOTYPES  ****************************************************
00149 ******************************************************************************/
00150 
00151 PSStreamFuncs* psStreamFuncsAlloc(void);
00152 void psStreamFuncsFree(PSStreamFuncs* funcs);
00153 PSStream* psStreamAlloc(void* stream, PSStreamFuncs* funcs);
00154 void psStreamFree(PSStream *str);
00155 
00156 size_t psRead(void* ptr, size_t size, size_t nmemb, PSStream* str);
00157 size_t psWrite(const void* ptr, size_t size, size_t nmemb, PSStream* str);
00158 long psTell(PSStream* str);
00159 int psSeek(PSStream* str, long offset, int whence);
00160 int psGetC(PSStream* str);
00161 int psUngetC(int c, PSStream* str);
00162 int psPutC(int c, PSStream* str);
00163 char* psGetS(char* s, int size, PSStream* str);
00164 int psPutS(char* s, PSStream* str);
00165 int psEof(PSStream* str);
00166 int psPrintf(PSStream* str, char *format, ...);
00167 
00168 #ifdef __cplusplus
00169 }
00170 #endif
00171 
00172 #endif /* INCLUDE_FILE */

Generated at Mon Dec 11 22:46:27 2000 for Postscript Utility Library by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000