lib.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* -*-comment-start: "//";comment-end:""-*-
  2. * GNU Mes --- Maxwell Equations of Software
  3. * Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  4. *
  5. * This file is part of GNU Mes.
  6. *
  7. * GNU Mes is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * GNU Mes is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef __MES_LIB_H
  21. #define __MES_LIB_H
  22. #include <mes/lib-mini.h>
  23. char *cast_intp_to_charp (int const *i);
  24. char *cast_long_to_charp (long i);
  25. long cast_charp_to_long (char const *);
  26. long cast_int_to_long (int i);
  27. long cast_voidp_to_long (void const *);
  28. int __mes_debug ();
  29. void __ungetc_init ();
  30. void __ungetc_clear (int filedes);
  31. void __ungetc_set (int filedes, int c);
  32. int __ungetc_p (int filedes);
  33. double abtod (char const **p, int base);
  34. long abtol (char const **p, int base);
  35. char *dtoab (double number, int base, int signed_p);
  36. char *itoa (int number);
  37. char *ltoa (long number);
  38. char *ltoab (long x, int base);
  39. char *ntoab (long number, unsigned base, int signed_p);
  40. char *ultoa (unsigned long number);
  41. char *utoa (unsigned number);
  42. int eputc (int c);
  43. int fdgetc (int fd);
  44. char * fdgets (char *s, int count, int fd);
  45. int fdputc (int c, int fd);
  46. int fdputs (char const *s, int fd);
  47. int fdungetc (int c, int fd);
  48. char *_getcwd (char *buffer, size_t size);
  49. int ioctl3 (int filedes, size_t command, long data);
  50. int isnumber (int c, int base);
  51. int mes_open (char const *file_name, int flags, int mask);
  52. int _open2 (char const *file_name, int flags);
  53. int _open3 (char const *file_name, int flags, int mask);
  54. int oputc (int c);
  55. int oputs (char const *s);
  56. char *search_path (char const *file_name);
  57. ssize_t _read (int fd, void *buffer, size_t size);
  58. void assert_msg (int check, char *msg);
  59. extern char *__brk;
  60. extern void (*__call_at_exit) (void);
  61. #define __FILEDES_MAX 512
  62. #if !SYSTEM_LIBC
  63. void __assert_fail (char *s);
  64. ssize_t __buffered_read (int filedes, void *buffer, size_t size);
  65. size_t __buffered_read_clear (int filedes);
  66. void _exit (int code);
  67. long brk (void *addr);
  68. #endif // !SYSTEM_LIBC
  69. long __mesabi_imod (long a, long b);
  70. long __mesabi_idiv (long a, long b);
  71. unsigned long __mesabi_umod (unsigned long a, unsigned long b);
  72. unsigned long __mesabi_udiv (unsigned long a, unsigned long b);
  73. unsigned long __mesabi_uldiv (unsigned long a, unsigned long b,
  74. unsigned long *remainder);
  75. void *__memcpy (void *dest, void const *src, size_t n);
  76. void *__memmove (void *dest, void const *src, size_t n);
  77. void *__memset (void *s, int c, size_t n);
  78. #endif //__MES_LIB_H