sys.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. // sys.h -- non-portable functions
  16. //
  17. // file IO
  18. //
  19. // returns the file size
  20. // return -1 if file is not present
  21. // the file should be in BINARY mode for stupid OSs that care
  22. int Sys_FileOpenRead (char *path, int *hndl);
  23. int Sys_FileOpenWrite (char *path);
  24. void Sys_FileClose (int handle);
  25. void Sys_FileSeek (int handle, int position);
  26. int Sys_FileRead (int handle, void *dest, int count);
  27. int Sys_FileWrite (int handle, void *data, int count);
  28. int Sys_FileTime (char *path);
  29. void Sys_mkdir (char *path);
  30. //
  31. // memory protection
  32. //
  33. void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length);
  34. //
  35. // system IO
  36. //
  37. void Sys_DebugLog(char *file, char *fmt, ...);
  38. void Sys_Error (char *error, ...);
  39. // an error will cause the entire program to exit
  40. void Sys_Printf (char *fmt, ...);
  41. // send text to the console
  42. void Sys_Quit (void);
  43. double Sys_DoubleTime (void);
  44. char *Sys_ConsoleInput (void);
  45. void Sys_Sleep (void);
  46. // called to yield for a little bit so as
  47. // not to hog cpu when paused or debugging
  48. void Sys_SendKeyEvents (void);
  49. // Perform Key_Event () callbacks until the input que is empty
  50. void Sys_LowFPPrecision (void);
  51. void Sys_HighFPPrecision (void);
  52. void Sys_SetFPCW (void);