HPGCC3 Documentation 3.0 R003
|
00001 //& *** (c) 2006-2011 The HPGCC3 Team *** 00002 //& Claudio Lapilli 00003 //& Ingo Blank 00004 //& 00005 //& This file is licensed under the terms and conditions of the 00006 //& HPGCC3 license that is included with the source distribution. 00007 //& *** (c) 2006-2011 The HPGCC3 Team *** 00008 00009 // $Id: stdio.h 514 2007-11-18 03:11:26Z ingo $ 00010 00011 #ifndef __HPSTDIO_H 00012 #define __HPSTDIO_H 00013 00014 // LONG TYPE DEFINITION, ADDED BY CLAUDIO 01/14/05 00015 #ifndef _LONGLONG_DEF 00016 typedef unsigned long long ULONGLONG; 00017 typedef long long LONGLONG; 00018 #define _LONGLONG_DEF 00019 #endif 00020 00021 00022 #include <sys.h> 00023 #include <stdarg.h> 00024 00025 #ifndef _FSYSTEM_H 00026 #include <fsystem.h> 00027 #endif 00028 00029 typedef struct 00030 { 00031 FS_FILE *file; 00032 int cacheused; 00033 char *writecache; 00034 } FILE; 00035 00036 // open file list handling < ibl ; 2005-02-06 > 00037 /* 00038 typedef struct _open_list_entry { 00039 FILE *file; 00040 struct _open_list_entry *next; 00041 } OPEN_LIST_ENTRY; 00042 */ 00043 00044 #define SEEK_SET 0 00045 #define SEEK_CUR 1 00046 #define SEEK_END 2 00047 00048 FILE *fopen(const char *fn, const char *mode); 00049 00050 int fclose(FILE *f); 00051 00052 int fgetc(FILE *f); 00053 00054 char * fgets(char *buf, int n, FILE *f); 00055 00056 int fputc(int c, FILE *f); 00057 00058 int fputs(const char *s, FILE *f); 00059 00060 SIZE_T fread(void *buf, SIZE_T size, SIZE_T cnt, FILE *f); 00061 00062 SIZE_T fwrite(const void *buf, SIZE_T size, SIZE_T cnt, FILE *f); 00063 00064 00065 int fseek (FILE *f, long offset, int whence); 00066 #define rewind(f) fseek((f),0L,SEEK_SET) 00067 int feof(FILE *f); 00068 00069 00071 00076 void *get_minifont(); 00077 00078 // Note: Bigfont is always 8*8 pixels 00079 // Height is for display purposes only 00080 // Width is normally 6 pixels 00081 char *get_bigfont(); 00082 int get_bigfontheight(); 00083 00084 00089 int readint(); 00090 00095 unsigned readuint(); 00096 00101 unsigned readhex(); 00102 00107 LONGLONG readlonglong(); 00108 00113 ULONGLONG readulonglong(); 00114 00119 double readdouble(); 00120 00121 00127 EXTERN int puts(const char *); 00128 00135 EXTERN int putchar(int); 00136 00143 // standard file functions 00144 00145 int write(int fd, const char *buf, size_t count); 00146 int isatty(int fd); 00147 00148 #ifdef NO_ASSEMBLY_GETS 00149 EXTERN char *_gets(char *buf); 00150 #define gets _gets 00151 #else 00152 EXTERN char *gets(char *buf); 00153 #endif 00154 00155 // console io 00156 00162 int printf(const char *fmt, ...); 00163 int sprintf(char *out, const char *fmt, ...); 00164 int vsprintf(char *out,const char *fmt, va_list argp); 00165 int fprintf(FILE *f, const char *fmt, ...); 00166 00167 00168 // Stripped down Integer versions of *printf 00169 // These are lacking floating point formats 00170 00171 int iprintf(const char *fmt, ...); 00172 int isprintf(char *out, const char *fmt, ...); 00173 int ivsprintf(char *out,const char *fmt, va_list argp); 00174 int ifprintf(FILE *f, const char *fmt, ...); 00175 00176 00177 #ifdef TINY_PRINTF 00178 #define printf iprintf 00179 #define sprintf isprintf 00180 #define vsprintf ivsprintf 00181 #define fprintf ifprintf 00182 #endif 00183 00184 00185 // *scanf family 00186 00187 int _vsscanf(const char *str, const char *format, va_list ap); 00188 int _sscanf(const char *s, const char *f, ...); 00189 int _scanf(const char *f, ...); 00190 00191 #define vsscanf _vsscanf 00192 #define sscanf _sscanf 00193 #define scanf _scanf 00194 00195 00196 #ifndef DOXYGEN_SKIP 00197 int get_decimal_digits(); 00198 void set_decimal_digits(int v); 00199 char *get_decimal_separator(); 00200 void set_decimal_separator(char a); 00201 #endif 00202 00203 00204 00205 #endif // __HPSTDIO_H