SAMP Gitlab CI Test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

  1. /* File input/output functions
  2. *
  3. * (c) Copyright 2004-2005, ITB CompuPhase
  4. * This file is provided as is (no warranties).
  5. */
  6. #if defined _file_included
  7. #endinput
  8. #endif
  9. #define _file_included
  10. #pragma library File
  11. enum filemode
  12. {
  13. io_read, /* file must exist */
  14. io_write, /* creates a new file */
  15. io_readwrite, /* opens an existing file, or creates a new file */
  16. io_append, /* appends to file (write-only) */
  17. }
  18. enum seek_whence
  19. {
  20. seek_start,
  21. seek_current,
  22. seek_end,
  23. }
  24. const EOF = -1;
  25. native File:fopen(const name[], filemode: mode = io_readwrite);
  26. native bool:fclose(File: handle);
  27. native File:ftemp();
  28. native bool:fremove(const name[]);
  29. native fwrite(File: handle, const string[]);
  30. native fread(File: handle, string[], size = sizeof string, bool: pack = false);
  31. native bool:fputchar(File: handle, value, bool: utf8 = true);
  32. native fgetchar(File: handle, value, bool: utf8 = true);
  33. native fblockwrite(File: handle, const buffer[], size = sizeof buffer);
  34. native fblockread(File: handle, buffer[], size = sizeof buffer);
  35. native fseek(File: handle, position = 0, seek_whence: whence = seek_start);
  36. native flength(File: handle);
  37. native fexist(const pattern[]);
  38. native bool:fmatch(name[], const pattern[], index = 0, size = sizeof name);