Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.46 KB | None | 0 0
  1. /********************************************
  2. **
  3. ** Full libc content.
  4. **
  5. ** Legend
  6. ** - entry : to do
  7. ** entry : done
  8. ** * entry : see notes
  9. **
  10. ********************************************/
  11.  
  12. assert.h
  13. - void assert (int expression)
  14.  
  15. ctype.h
  16. int isalnum (int c)
  17. int isalpha (int c)
  18. int iscntrl (int c)
  19. int isdigit (int c)
  20. int isgraph (int c)
  21. int islower (int c)
  22. int isprint (int c)
  23. int ispunct (int c)
  24. int isspace (int c)
  25. int isupper (int c)
  26. int isxdigit (int c)
  27. int tolower (int c)
  28. int toupper (int c)
  29.  
  30. errno.h
  31. - errno {int}
  32. - EDOM {int}
  33. - ERANGE {int}
  34. - EILSEQ {int}
  35.  
  36. float.h
  37. FLT_RADIX {macro}
  38. FLT_MANT_DIG {macro}
  39. DBL_MANT_DIG {macro}
  40. FLT_DIG {macro}
  41. DBL_DIG {macro}
  42. FLT_MIN_EXP {macro}
  43. DBL_MIN_EXP {macro}
  44. FLT_MAX_EXP {macro}
  45. DBL_MAX_EXP {macro}
  46. - FLT_MAX {macro}
  47. - DBL_MAX {macro}
  48. - FLT_EPSILON {macro}
  49. - DBL_EPSILON {macro}
  50. - FLT_MIN {macro}
  51. - DBL_MIN {macro}
  52. FLT_ROUNDS {macro}
  53. FLT_EVAL_METHOD {macro},C99
  54. DECIMAL_DIG {macro},C99
  55.  
  56. iso646.h
  57. and {macro}
  58. and_eq {macro}
  59. bitand {macro}
  60. bitor {macro}
  61. compl {macro}
  62. not {macro}
  63. not_eq {macro}
  64. or {macro}
  65. or_eq {macro}
  66. xor {macro}
  67. xor_eq {macro}
  68.  
  69. limits.h
  70. CHAR_BIT {macro}
  71. SCHAR_MIN {macro}
  72. SCHAR_MAX {macro}
  73. UCHAR_MAX {macro}
  74. CHAR_MIN {macro}
  75. CHAR_MAX {macro}
  76. SHRT_MIN {macro}
  77. SHRT_MAX {macro}
  78. USHRT_MAX {macro}
  79. INT_MIN {macro}
  80. INT_MAX {macro}
  81. UINT_MAX {macro}
  82. LONG_MIN {macro}
  83. LONG_MAX {macro}
  84. ULONG_MAX {macro}
  85.  
  86. locale.h
  87. - lconv {struct}
  88. - char *setlocale (int category, const char *locale)
  89. - lconv *localeconv (void)
  90.  
  91. math.h
  92. - double cos (double x)
  93. - double sin (double x)
  94. - double tan (double x)
  95. - double acos (double x)
  96. - double asin (double x)
  97. - double atan (double x)
  98. - double atan2 (double x, double y)
  99. - double cosh (double x)
  100. - double sinh (double x)
  101. - double tanh (double x)
  102. - double acosh (double x)
  103. - double asinh (double x)
  104. - double atanh (double x)
  105. - double exp (double x)
  106. - double frexp (double x, int *exp)
  107. - double ldexp (double x, int exp)
  108. - double log (double x)
  109. - double log10 (double x)
  110. - double modf (double x, double *intpart)
  111. - double exp2 (double x)
  112. - double expm1 (double x)
  113. - int ilogb (double x)
  114. - double log1p (double x)
  115. - double log2 (double x)
  116. - double logb (double x)
  117. - double scalbn (double x, int n)
  118. - double pow (double base, double exponent)
  119. - double sqrt (double x)
  120. - double cbrt (double x)
  121. - double hypot (double x, double y)
  122. - double erf (double x)
  123. - double erfc (double x)
  124. - double tgamma (double x)
  125. - double lgamma (double x)
  126. - double ceil (double x)
  127. - double floor (double x)
  128. - double fmod (double numer, double denom)
  129. - double trunc (double x)
  130. - double round (double x)
  131. - double rint (double x)
  132. - double nearbyint (double x)
  133. - double remainder (double numer, double denom)
  134. - double remquo (double numer, double denom, int *quot)
  135. - double copysign (double x, double y)
  136. - double nan (const char *tagp)
  137. - double nextafter (double x, double y)
  138. - double fdim (double x, double y)
  139. - double fmax (double x, double y)
  140. - double fmin (double x, double y)
  141. - double fabs (double x)
  142. - double abs (double x)
  143. * double fma (double x, double y, double z)
  144. - fpclassify {macro}
  145. - isfinite {macro}
  146. - isinf {macro}
  147. - isnan {macro}
  148. - isnormal {macro}
  149. - signibit {macro}
  150. - isgreater {macro}
  151. - isgreaterequal {macro}
  152. - isless {macro}
  153. - islessequal {macro}
  154. - islessgreater {macro}
  155. - isunordered {macro}
  156. - NAN {float}
  157. - HUGE_VAL {double}
  158. - FP_FAST_FMA {macro}
  159. - FP_INFINITE {macro}
  160. - FP_NAN {macro}
  161. - FP_NORMAL {macro}
  162. - FP_SUBNORMAL {macro}
  163. - FP_ZERO {macro}
  164. - FP_ILOGB0 {macro}
  165. - FP_ILOGBNAN {macro}
  166. - float_t {float+}
  167.  
  168. setjmp.h
  169. - void longjmp (jmp_buf env, int val)
  170. - setjmp {macro}
  171. - jmp_buf {type}
  172.  
  173. signal.h
  174.  
  175. stdarg.h
  176. void va_start (va_list list, {parameter})
  177. T va_arg (va_list list, T)
  178. void va_end (va_list list)
  179. void va_copy (va_list dest, va_list src)
  180. va_list {builtin-type}
  181.  
  182. stddef.h
  183. ptrdiff_t {signed int}
  184. size_t {unsigned int}
  185. ssize_t {signed int}
  186. size_t offsetof (type{struct,union},member)
  187. NULL 0L, (void *)(0L)
  188.  
  189. stdio.h
  190. - int remove (const char *filename)
  191. - int rename (const char *oldname, const char *newname)
  192. - FILE *tmpfile (void)
  193. - char *tmpnam (char *str)
  194. - int fclose (FILE *)
  195. - int fflush (FILE *)
  196. - FILE *fopen (const char *filename, const char *mode)
  197. - FILE *freopen (const char *filename, const char *mode, FILE *stream)
  198. - void setbuf (FILE *stream, char *buffer)
  199. - int setvbuf (FILE *stream, char *buffer, int mode, size_t size)
  200. - int fprintf (FILE *stream, const char *format, ...)
  201. - int fscanf (FILE *stream, const char *format, ...)
  202. - int printf (const char *format, ...)
  203. - int scanf (const char *format, ...)
  204. int sprintf (char *str, const char *format, ...)
  205. int snprintf (char *str, size_t size, const char *format, ...),C99
  206. - int sscanf (const char *str, const char *format, ...)
  207. int vsnprintf (char *str, size_t size, const char *format, va_list args),C99
  208. - int vfprintf (FILE *stream, const char *format, va_list args)
  209. int vsprintf (char *str, const char *format, va_list args)
  210. - int fgetc (FILE *stream)
  211. - char *fgets (char *str, int max, FILE *stream)
  212. - int fputc (int character, FILE *stream)
  213. - int fputs (const char *str, FILE *stream)
  214. * int getc (FILE *stream)
  215. - int getchar (void)
  216. - char *gets (char *str)
  217. - int putc (int character, FILE *stream)
  218. - int putchar (int character)
  219. - int puts (const char *str)
  220. - int ungetc (int character, FILE *stream)
  221. - size_t fread (void *ptr, size_t size, size_t count, FILE *stream)
  222. - size_t fwrite (const void *ptr, size_t size, size_t count, FILE *stream)
  223. - int fgetpos (FILE *stream, fpos_t *pos)
  224. - int fseek (FILE *stream, int offset, int origin)
  225. - int fsetpos (FILE *stream, const fpos_t *pos)
  226. - int ftell (FILE *stream)
  227. - void rewind (FILE *stream)
  228. - void clearerr (FILE *stream)
  229. - int feof (FILE *stream)
  230. - int ferror (FILE *stream)
  231. - void perror (const char *str)
  232. - BUFSIZ {macro}
  233. - EOF {macro}
  234. - FILENAME_MAX {macro}
  235. - FOPEN_MAX {macro}
  236. - L_tmpnam {macro}
  237. NULL 0L, (void *)(0L)
  238. - TMP_MAX {macro}
  239. - _IOFBF {macro}
  240. - _IOLBF {macro}
  241. - _IONBF {macro}
  242. - SEEK_SET {enum member}
  243. - SEEK_CUR {enum member}
  244. - SEEK_END {enum member}
  245. - FILE {struct}
  246. - fpos_t {type}
  247. size_t {unsigned int}
  248.  
  249. stdlib.h
  250. - double atof (const char *str)
  251. int atoi (const char *str)
  252. - double strtod (const char *str)
  253. int rand (void)
  254. void srand (unsigned int)
  255. void *calloc (size_t num, size_t size)
  256. void free (void *ptr)
  257. void *malloc (size_t size)
  258. void *realloc (void *ptr, size_t size)
  259. - void abort (void)
  260. - int atexit (void (*func)(void))
  261. - void exit (int status)
  262. - char *getenv (const char *name)
  263. - int system (const char *command)
  264. - void *bsearch (const void *key, const void *base, size_t num, size_t size, int (*compare)(const void *,const void *))
  265. - void qsort (void *base, size_t num, size_t size, int (*compare)(const void *,const void *))
  266. int abs (int n)
  267. div_t div (int numer, int denom)
  268. EXIT_FAILURE {macro}
  269. EXIT_SUCCESS {macro}
  270. NULL 0L, (void *)(0L)
  271. RAND_MAX {macro}
  272. div_t {struct}
  273. size_t {unsigned int}
  274.  
  275. string.h
  276. - memcpy
  277. - memmove
  278. - strcpy
  279. - strncpy
  280. - strcat
  281. - strncat
  282. - memcmp
  283. - strcmp
  284. - strcoll
  285. - strncmp
  286. - strxfrm
  287. - memchr
  288. - strchr
  289. - strcspn
  290. - strpbrk
  291. - strrchr
  292. - strspn
  293. - strstr
  294. - strtok
  295. - memset
  296. - strerror
  297. - strlen
  298.  
  299. time.h
  300. - clock_t clock (void)
  301. - double difftime (time_t end, time_t beginning)
  302. - time_t mktime (struct tm *timeptr)
  303. - time_t time (time_t *timer)
  304. - char *asctime (const struct tm *timeptr)
  305. - char *ctime (const time_t *timer)
  306. - struct tm *gmtime (const time_t *timer)
  307. - struct tm *localtime (const time_t *timer)
  308. - size_t strftime (char *ptr, size_t maxsize, const char *format, const struct tm *timeptr)
  309. - CLOCKS_PER_SEC {macro}
  310. - NULL 0L, (void *)(0L)
  311. - clock_t {signed int}
  312. - size_t {unsigned int}
  313. - time_t {unsigned int}
  314. - struct tm {struct}
  315.  
  316. (Main source : C++ Reference at cplusplus.com/reference)
  317.  
  318. /********************************************
  319. **
  320. ** Notes.
  321. **
  322. ********************************************/
  323.  
  324. math.h
  325. - fma() shoud use a specific Asm instruction that is made for this operation.
  326.  
  327. stdio.h
  328. - getc() and putc() should be implemented as macros. If not, they become the same as fgetc() and fputc().
  329.  
  330. /********************************************
  331. **
  332. ** Other notes.
  333. **
  334. ********************************************/
  335.  
  336. Lists of macros shared between all the headers.
  337. :: Standard macros
  338. __cplusplus Shall be used in every header to insert 'extern "C" {' and '}' if needed, in order to make headers C++-compatible.
  339.  
  340. :: Types and generic macros for definitions
  341. Every type definition shall test if the type hasn't already be defined. Therefore, it must test the definition of the corresponding
  342. macro, and define it if it's not as well.
  343. _PTRDIFF_T
  344. _SIZE_T
  345. _SSIZE_T
  346. _NULL
  347. _DIV_T
  348.  
  349. :: Internal macros
  350. __NEED___BASE_PRINTF Used in printf() family functions. If defined, defines __base_printf(). If not, __base_printf() cannot be used.
  351. __NO_ABS Prevents the abs() macro to be defined. Used in stdlib/abs.c.
  352.  
  353. Header macro format.
  354. Each header must be associated a macro, that shall use the following pattern :
  355. _HEADERNAME_EXTENSION
  356. For example, the macro matching 'stdlib.h' is '_STDLIB_H'.
  357.  
  358. Macro symbols definition.
  359. Every defined symbol should be matched a value of 1.
  360. #define _PTRDIFF_T 1
  361. It allows the user program to make test on these symbols, as it is replaced.
  362.  
  363. Other conventions
  364. Parameters names must be defined in the function prototype, in the header
  365.  
  366. Things to do.
  367. Finish __base_printf().
  368. Reimplement calloc() and realloc() using malloc(), removing two system calls.
  369. Reimplement as many functions as possible in Asm if faster.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement