File indexing completed on 2025-01-17 09:55:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _FCGI_STDIO
0016 #define _FCGI_STDIO 1
0017
0018 #include <stdio.h>
0019 #include <sys/types.h>
0020 #include "fcgiapp.h"
0021
0022 #if defined (c_plusplus) || defined (__cplusplus)
0023 extern "C" {
0024 #endif
0025
0026 #ifndef DLLAPI
0027 #if defined (_WIN32) && defined (_MSC_VER)
0028 #define DLLAPI __declspec(dllimport)
0029 #else
0030 #define DLLAPI
0031 #endif
0032 #endif
0033
0034
0035
0036
0037
0038 typedef struct {
0039 FILE *stdio_stream;
0040 FCGX_Stream *fcgx_stream;
0041 } FCGI_FILE;
0042
0043
0044
0045
0046
0047 DLLAPI int FCGI_Accept(void);
0048 DLLAPI void FCGI_Finish(void);
0049 DLLAPI int FCGI_StartFilterData(void);
0050 DLLAPI void FCGI_SetExitStatus(int status);
0051
0052 #define FCGI_ToFILE(fcgi_file) (fcgi_file->stdio_stream)
0053 #define FCGI_ToFcgiStream(fcgi_file) (fcgi_file->fcgx_stream)
0054
0055
0056
0057
0058
0059 DLLAPI extern FCGI_FILE _fcgi_sF[];
0060 #define FCGI_stdin (&_fcgi_sF[0])
0061 #define FCGI_stdout (&_fcgi_sF[1])
0062 #define FCGI_stderr (&_fcgi_sF[2])
0063
0064
0065
0066
0067
0068
0069
0070 DLLAPI void FCGI_perror(const char *str);
0071
0072 DLLAPI FCGI_FILE *FCGI_fopen(const char *path, const char *mode);
0073 DLLAPI int FCGI_fclose(FCGI_FILE *fp);
0074 DLLAPI int FCGI_fflush(FCGI_FILE *fp);
0075 DLLAPI FCGI_FILE *FCGI_freopen(const char *path, const char *mode, FCGI_FILE *fp);
0076
0077 DLLAPI int FCGI_setvbuf(FCGI_FILE *fp, char *buf, int bufmode, size_t size);
0078 DLLAPI void FCGI_setbuf(FCGI_FILE *fp, char *buf);
0079
0080 DLLAPI int FCGI_fseek(FCGI_FILE *fp, long offset, int whence);
0081 DLLAPI int FCGI_ftell(FCGI_FILE *fp);
0082 DLLAPI void FCGI_rewind(FCGI_FILE *fp);
0083 #ifdef HAVE_FPOS
0084 DLLAPI int FCGI_fgetpos(FCGI_FILE *fp, fpos_t *pos);
0085 DLLAPI int FCGI_fsetpos(FCGI_FILE *fp, const fpos_t *pos);
0086 #endif
0087 DLLAPI int FCGI_fgetc(FCGI_FILE *fp);
0088 DLLAPI int FCGI_getchar(void);
0089 DLLAPI int FCGI_ungetc(int c, FCGI_FILE *fp);
0090
0091 DLLAPI char *FCGI_fgets(char *str, int size, FCGI_FILE *fp);
0092 DLLAPI char *FCGI_gets(char *str);
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102 DLLAPI int FCGI_fputc(int c, FCGI_FILE *fp);
0103 DLLAPI int FCGI_putchar(int c);
0104
0105 DLLAPI int FCGI_fputs(const char *str, FCGI_FILE *fp);
0106 DLLAPI int FCGI_puts(const char *str);
0107
0108 DLLAPI int FCGI_fprintf(FCGI_FILE *fp, const char *format, ...);
0109 DLLAPI int FCGI_printf(const char *format, ...);
0110
0111 DLLAPI int FCGI_vfprintf(FCGI_FILE *fp, const char *format, va_list ap);
0112 DLLAPI int FCGI_vprintf(const char *format, va_list ap);
0113
0114 DLLAPI size_t FCGI_fread(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp);
0115 DLLAPI size_t FCGI_fwrite(void *ptr, size_t size, size_t nmemb, FCGI_FILE *fp);
0116
0117 DLLAPI int FCGI_feof(FCGI_FILE *fp);
0118 DLLAPI int FCGI_ferror(FCGI_FILE *fp);
0119 DLLAPI void FCGI_clearerr(FCGI_FILE *fp);
0120
0121 DLLAPI FCGI_FILE *FCGI_tmpfile(void);
0122
0123 DLLAPI int FCGI_fileno(FCGI_FILE *fp);
0124 DLLAPI FCGI_FILE *FCGI_fdopen(int fd, const char *mode);
0125 DLLAPI FCGI_FILE *FCGI_popen(const char *cmd, const char *type);
0126 DLLAPI int FCGI_pclose(FCGI_FILE *);
0127
0128
0129
0130
0131
0132
0133 #ifndef NO_FCGI_DEFINES
0134
0135
0136
0137
0138
0139
0140 #undef FILE
0141 #define FILE FCGI_FILE
0142
0143 #undef stdin
0144 #define stdin FCGI_stdin
0145 #undef stdout
0146 #define stdout FCGI_stdout
0147 #undef stderr
0148 #define stderr FCGI_stderr
0149
0150 #undef perror
0151 #define perror FCGI_perror
0152
0153 #undef fopen
0154 #define fopen FCGI_fopen
0155 #undef fclose
0156 #define fclose FCGI_fclose
0157 #undef fflush
0158 #define fflush FCGI_fflush
0159 #undef freopen
0160 #define freopen FCGI_freopen
0161
0162 #undef setvbuf
0163 #define setvbuf FCGI_setvbuf
0164 #undef setbuf
0165 #define setbuf FCGI_setbuf
0166
0167 #undef fseek
0168 #define fseek FCGI_fseek
0169 #undef ftell
0170 #define ftell FCGI_ftell
0171 #undef rewind
0172 #define rewind FCGI_rewind
0173 #undef fgetpos
0174 #define fgetpos FCGI_fgetpos
0175 #undef fsetpos
0176 #define fsetpos FCGI_fsetpos
0177
0178 #undef fgetc
0179 #define fgetc FCGI_fgetc
0180 #undef getc
0181 #define getc FCGI_fgetc
0182 #undef getchar
0183 #define getchar FCGI_getchar
0184 #undef ungetc
0185 #define ungetc FCGI_ungetc
0186
0187 #undef fgets
0188 #define fgets FCGI_fgets
0189 #undef gets
0190 #define gets FCGI_gets
0191
0192 #undef fputc
0193 #define fputc FCGI_fputc
0194 #undef putc
0195 #define putc FCGI_fputc
0196 #undef putchar
0197 #define putchar FCGI_putchar
0198
0199 #undef fputs
0200 #define fputs FCGI_fputs
0201 #undef puts
0202 #define puts FCGI_puts
0203
0204 #undef fprintf
0205 #define fprintf FCGI_fprintf
0206 #undef printf
0207 #define printf FCGI_printf
0208
0209 #undef vfprintf
0210 #define vfprintf FCGI_vfprintf
0211 #undef vprintf
0212 #define vprintf FCGI_vprintf
0213
0214 #undef fread
0215 #define fread FCGI_fread
0216 #undef fwrite
0217 #define fwrite FCGI_fwrite
0218
0219 #undef feof
0220 #define feof FCGI_feof
0221 #undef ferror
0222 #define ferror FCGI_ferror
0223 #undef clearerr
0224 #define clearerr FCGI_clearerr
0225
0226 #undef tmpfile
0227 #define tmpfile FCGI_tmpfile
0228
0229 #undef fileno
0230 #define fileno FCGI_fileno
0231 #undef fdopen
0232 #define fdopen FCGI_fdopen
0233 #undef popen
0234 #define popen FCGI_popen
0235 #undef pclose
0236 #define pclose FCGI_pclose
0237
0238 #endif
0239
0240 #if defined (__cplusplus) || defined (c_plusplus)
0241 }
0242 #endif
0243
0244 #endif
0245