home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 December / PCWorld_2005-12_cd.bin / software / topware / partlogic / partlogic-0.57-iso.exe / partlogic-0.57.iso / system / headers / stdlib.h < prev    next >
C/C++ Source or Header  |  2005-08-29  |  2KB  |  81 lines

  1. // 
  2. //  Visopsys
  3. //  Copyright (C) 1998-2005 J. Andrew McLaughlin
  4. //  
  5. //  This library is free software; you can redistribute it and/or modify it
  6. //  under the terms of the GNU Lesser General Public License as published by
  7. //  the Free Software Foundation; either version 2.1 of the License, or (at
  8. //  your option) any later version.
  9. //
  10. //  This library is distributed in the hope that it will be useful, but
  11. //  WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
  13. //  General Public License for more details.
  14. //
  15. //  You should have received a copy of the GNU Lesser General Public License
  16. //  along with this library; if not, write to the Free Software Foundation,
  17. //  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. //
  19. //  stdlib.h
  20. //
  21.  
  22. // This is the Visopsys version of the standard header file stdlib.h
  23.  
  24. #if !defined(_STDLIB_H)
  25.  
  26. #include <stddef.h>
  27. #include <limits.h>
  28.  
  29. #define EXIT_FAILURE  -1
  30. #define EXIT_SUCCESS  0
  31. #define MB_CUR_MAX    MB_LEN_MAX
  32. #define RAND_MAX      UINT_MAX
  33.  
  34. #ifndef NULL
  35. #define NULL 0
  36. #endif
  37.  
  38. typedef struct {
  39.   int quot;
  40.   int rem;
  41.  
  42. } div_t;
  43.  
  44. typedef struct {
  45.   long quot;
  46.   long rem;
  47.  
  48. } ldiv_t;
  49.  
  50.  
  51. // We're supposed to define size_t here???  Same with wchar_t???  I thought
  52. // they were defined in stddef.h.  Oh well, we're including stddef.h anyway.
  53.  
  54. // Functions
  55. void abort(void);
  56. int abs(int);
  57. int atoi(const char *);
  58. void *calloc(size_t, size_t);
  59. div_t div(int, int);
  60. void exit(int);
  61. void free(void *);
  62. long int labs(long int);
  63. ldiv_t ldiv(long int, long int);
  64. void *malloc(size_t);
  65. int rand(void);
  66. void srand(unsigned int);
  67. int system(const char *);
  68.  
  69. // Not sure where else to put these
  70. #define max(a, b) ((a) > (b) ? (a) : (b))
  71. #define min(a, b) ((a) < (b) ? (a) : (b))
  72.  
  73. // Argh.  Isn't there a function that does these?  These are andy-special.
  74. void itoa(int, char *);
  75. void itox(int, char *);
  76. int xtoi(const char *);
  77. void utoa(unsigned int, char *);
  78.  
  79. #define _STDLIB_H
  80. #endif
  81.