home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / elvis22g.zip / lib / ansistub.c next >
C/C++ Source or Header  |  2002-04-10  |  22KB  |  923 lines

  1. /* This file contains stubs of all (I think) ANSI C library functions.
  2.  * This is intended to serve as a reference; there's no point in compiling it.
  3.  * The idea is that you put this file in an accessible but out-of-the-way
  4.  * location, and run ctags on it.  Then you set the TAGPATH environment
  5.  * variable to include this file's directory.  From that point on, you can
  6.  * use the normal tag searching functions to see the declaration for any
  7.  * of these functions.  In particular, the "ref" program distributed with
  8.  * elvis is handy for this.
  9.  */
  10.  
  11. /* <stdlib.h> */
  12. #define NULL 0
  13.  
  14. /* <stdio.h> */
  15. typedef struct _filestruct *FILE;
  16. FILE *stdin, *stdout, *stderr;
  17.  
  18. /* <time.h> time/date breakdown */
  19. struct tm
  20. {
  21.     int    tm_sec;        /* second, 0-59 */
  22.     int    tm_min;        /* minute, 0-59 */
  23.     int    tm_hour;    /* hour, 0-23 */
  24.     int    tm_mday;    /* day of month, 1-31 */
  25.     int    tm_mon;        /* month, 0-11 */
  26.     int    tm_year;    /* year, 1970-2038 */
  27.     int    tm_wday;    /* day of week, 0=sunday - 6=saturday */
  28.     int    tm_yday;    /* day of year, 0-364 (365 on leap years) */
  29.     int    tm_isdst;    /* daylight savings time flag */
  30. };
  31.  
  32. /* <locale.h> formats of numbers and money */
  33. struct lconv
  34. {
  35.     /* NUMERIC */
  36.     char *decimal_point;    /* Decimal point character  */
  37.     char *thousands_sep;    /* Thousands separator  */
  38.     char *grouping;        /* one-byte ints giving groups, end with 0 to
  39.                    repeat or CHAR_MAX to stop grouping */
  40.  
  41.     /* MONETARY */
  42.     char *int_curr_symbol;    /* 3-byte ISO-4217 synbol, 1-byte separator */
  43.     char *currency_symbol;    /* Local currency symbol  */
  44.     char *mon_decimal_point;/* Decimal point character  */
  45.     char *mon_thousands_sep;/* Thousands separator.  */
  46.     char *mon_grouping;    /* Like `grouping' element (above).  */
  47.     char *positive_sign;    /* Sign for positive values.  */
  48.     char *negative_sign;    /* Sign for negative values.  */
  49.     char int_frac_digits;    /* Int'l fractional digits.  */
  50.     char frac_digits;    /* Local fractional digits.  */
  51.     char p_cs_precedes;    /* currency_symbol preceeds positive amount? */
  52.     char p_sep_by_space;    /* space between currency_symbol & positive? */
  53.     char n_cs_precedes;    /* currency_symbol preceeds negative amount? */
  54.     char n_sep_by_space;    /* space between currency_symbol & negative? */
  55.     char p_sign_posn;    /* 0=parentheses, 1=before both, 2=after both,*/
  56.     char n_sign_posn;    /*   3=before cuurency_symbol, 4=after it */
  57. };
  58.  
  59. /* <stdlib.h> Returned by div() */
  60. typedef struct
  61. {
  62.     int quot;        /* Quotient */
  63.     int rem;        /* Remainder */
  64. } div_t;
  65.  
  66. /* <stdlib.h> Returned by ldiv() */
  67. typedef struct
  68. {
  69.     long quot;        /* Quotient */
  70.     long rem;        /* Remainder */
  71. } ldiv_t;
  72.  
  73. /* <stdlib.h> wide characters, typically `unsigned short' */
  74. typedef OPAQUE    wchar_t;
  75.  
  76. /* <stdlib.h> type returned by sizeof operator, traditionally `int' */
  77. typedef OPAQUE    size_t;
  78.  
  79. /* <time.h> type returned by clock(), typically `long int' */
  80. typedef OPAQUE    clock_t;
  81.  
  82. /* <time.h> type returned by time(), traditionally `long int' */
  83. typedef OPAQUE    time_t;
  84.  
  85. /* <stdio.h> type returned by fgetpos(), typically `long int' */
  86. typedef OPAQUE    fpos_t;
  87.  
  88. /* <stdio.h> type returned by ftell(), traditionally `long int'.  Apparently
  89.  * ANSI continues to use `long int' instead of `off_t', but `off_t' is still
  90.  * preferred because 32-bit offsets aren't big enough anymore.  `off_t' may be
  91.  * a larger data type than `long int'.  This doesn't necessarily mean that
  92.  * your libraries and OS support the larger offsets, of course.
  93.  */
  94. typedef OPAQUE    off_t;
  95.  
  96. /* <stdlib.h> Cause a core dump */
  97. void abort(void)
  98. {
  99. }
  100.  
  101. /* <stdlib.h> Return the absolute value of an int */
  102. int abs(int num)
  103. {
  104. }
  105.  
  106. /* <math.h> Return the angle whose cosine is cosvalue */
  107. double acos(double cosvalue)
  108. {
  109. }
  110.  
  111. /* <time.h> Return a date/time string, e.g., "Wed Jun 30 21:49:08 1993\n" */
  112. char *asctime(const struct tm *currtime)
  113. {
  114. }
  115.  
  116. /* <math.h> Return the angle whose sine is sinvalue */
  117. double asin(double sinvalue)
  118. {
  119. }
  120.  
  121. /* <assert.h> If expression is false, abort */
  122. void assert(int expression)
  123. {
  124. }
  125.  
  126. /* <math.h> Return the angle whose tangent is tanvalue */
  127. double atan(double tanvalue)
  128. {
  129. }
  130.  
  131. /* <math.h> Return the angle from (0,0) to (x,y) */
  132. double atan2(double y, double x)
  133. {
  134. }
  135.  
  136. /* <stdlib.h> Arrange for func() to be called when the program exits */
  137. int atexit(void(*func)(void))
  138. {
  139. }
  140.  
  141. /* <stdlib.h> Convert a string to a double */
  142. double atof(const char *string)
  143. {
  144. }
  145.  
  146. /* <stdlib.h> Convert a string to an int */
  147. int atoi(const char *string)
  148. {
  149. }
  150.  
  151. /* <stdlib.h> Convert a string to a long */
  152. long int atol(const char *string)
  153. {
  154. }
  155.  
  156. /* <stdlib.h> Seach through an array for a given item.  There are five
  157.  * arguments: the item to find, the array to find it in, the number of
  158.  * items in the array, the size of each item, and a pointer to a comparison
  159.  * function.  It returns a pointer to the found item, or NULL if it isn't
  160.  * found.
  161.  */
  162. void *bsearch(const void *itemx, const void *array, size_t nitems, size_t itemsize, int (*compare) (const void *itemi, const void *itemj))
  163. {
  164. }
  165.  
  166. /* <stdlib.h> Allocate an array, and initialize it to 0 */
  167. void *calloc(size_t num, size_t length)
  168. {
  169. }
  170.  
  171. /* <math.h> Round upwards to the next integer value (might not fit in "int") */
  172. double ceil(double upwards)
  173. {
  174. }
  175.  
  176. /* <stdio.h> Clear the error flag on a FILE */
  177. void clearerr(FILE *fp)
  178. {
  179. }
  180.  
  181. /* <time.h> Return the approximate CPU time used by this process, in time
  182.  * slices.  To get seconds, divide by CLOCKS_PER_SEC.
  183.  */
  184. clock_t clock(void)
  185. {
  186. }
  187.  
  188. /* <math.h> Return the cosine for a given angle */
  189. double cos(double angle)
  190. {
  191. }
  192.  
  193. /* <math.h> Return the hyperbolic cosine of an angle */
  194. double cosh(double angle)
  195. {
  196. }
  197.  
  198. /* <time.h> Return a date/time string, e.g., "Wed Jun 30 21:49:08 1993\n" */
  199. char *ctime(const time_t *timeval)
  200. {
  201. }
  202.  
  203. /* <time.h> Compute the time difference, in seconds, between two times */
  204. double difftime(time_t end, time_t begin)
  205. {
  206. }
  207.  
  208. /* <stdlib.h> Compute the quotient and remainder of integer division */
  209. div_t div(int number, int divider)
  210. {
  211. }
  212.  
  213. /* <stdlib.h> Terminate this process */
  214. void exit(int exit_code)
  215. {
  216. }
  217.  
  218. /* <math.h> Return e^num */
  219. double exp(double num)
  220. {
  221. }
  222.  
  223. /* <math.h> Return the absolute value of num */
  224. double fabs(double num)
  225. {
  226. }
  227.  
  228. /* <stdio.h> Close a FILE */
  229. int fclose(FILE *fp)
  230. {
  231. }
  232.  
  233. /* <stdio.h> Return a true (non-zero) value if a previous attempt to read
  234.  * from fp resulted in an end-of-file condition; else return false (0).
  235.  * Note that this function doesn't "look ahead" -- you must try to read
  236.  * past the EOF before this function will know you've hit it.
  237.  */
  238. int feof(FILE *fp)
  239. {
  240. }
  241.  
  242. /* <stdio.h> Return a true (non-zero) value if a previos I/O operation on fp
  243.  * failed for any reason.
  244.  */
  245. int ferror(FILE *fp)
  246. {
  247. }
  248.  
  249. /* <stdio.h> Flush any data written to fp, by writing it to the operating
  250.  * system.  Note that this does not necessarily guarantee that the data has
  251.  * been written to disk.
  252.  */
  253. int fflush(FILE *fp)
  254. {
  255. }
  256.  
  257. /* <stdio.h> Read a character or EOF from fp. */
  258. int fgetc(FILE *fp)
  259. {
  260. }
  261.  
  262. /* <stdio.h> Store fp's current record number into the position argument */
  263. int fgetpos(FILE *fp, fpos_t *position)
  264. {
  265. }
  266.  
  267. /* <stdio.h> Read a string from fp.  Returns NULL at end of file. */
  268. char *fgets(char *string, int width, FILE *fp)
  269. {
  270. }
  271.  
  272. /* <math.h> Round a double to the next lower integer (might not fit an "int") */
  273. double floor(double lower)
  274. {
  275. }
  276.  
  277. /* <math.h> Return the remainder of integer division, performed on doubles */
  278. double fmod(double first, double second)
  279. {
  280. }
  281.  
  282. /* <stdio.h> Open a file. */
  283. FILE *fopen(const char *file_name, const char *mode)
  284. {
  285. }
  286.  
  287. /* <stdio.h> Print formatted text out to fp. */
  288. int fprintf(FILE *fp, const char *format, ...)
  289. {
  290. }
  291.  
  292. /* <stdio.h> Write a single character to fp */
  293. int fputc(int ch, FILE *fp)
  294. {
  295. }
  296.  
  297. /* <stdio.h> Write a string to fp, without adding a newline. */
  298. int fputs(const char *string, FILE *fp)
  299. {
  300. }
  301.  
  302. /* <stdio.h> Read an array of items from fp.  "width" is the size of each
  303.  * item, and "count" is the number of items requested.  It returns the
  304.  * number of items actually read.
  305.  */
  306. size_t fread(void *buffer, size_t width, size_t count, FILE *fp)
  307. {
  308. }
  309.  
  310. /* <stdlib.h> Release memory allocated by malloc(), calloc(), or realloc() */
  311. void free(void *memory_ptr)
  312. {
  313. }
  314.  
  315. /* <stdio.h> Force an existing fp to use a different file and/or mode */
  316. FILE *freopen(const char *new_file, const char *mode, FILE *fp)
  317. {
  318. }
  319.  
  320. /* <math.h> Break a double into its exponent and (normalized) mantissa. */
  321. double frexp(double num, int *exp)
  322. {
  323. }
  324.  
  325. /* <stdio.h> Scan a formatted text string from fp */
  326. int fscanf(FILE *fp, const char *format, ...)
  327. {
  328. }
  329.  
  330. /* <stdio.h> Change fp's I/O offset */
  331. int fseek(FILE *fp, long int offset, int whence)
  332. {
  333. }
  334.  
  335. /* <stdio.h> Restore fp's current record number to a position from a previous
  336.  * fgetpos().  Note that the file must remain open between those two calls.
  337.  */
  338. int fsetpos(FILE *fp, const fpos_t *position)
  339. {
  340. }
  341.  
  342. /* <stdio.h> Write an array of items to fp.  "width" is the size of each
  343.  * item, and "count" is the number of items to be written.  Returns the
  344.  * number of items actually written.
  345.  */
  346. size_t fwrite(const void *buffer, size_t width, size_t count, FILE *fp)
  347. {
  348. }
  349.  
  350. /* <stdio.h> Get a single character from fp */
  351. int getc(FILE *fp)
  352. {
  353. }
  354.  
  355. /* <stdio.h> Get a single character from stdin */
  356. int getchar(void)
  357. {
  358. }
  359.  
  360. /* <stdlib.h> Return the value (as a '\0'-terminated string) of an environment
  361.  * variable.
  362.  */
  363. char *getenv(const char *name)
  364. {
  365. }
  366.  
  367. /* <stdio.h> Read a line from stdin, and strip off the terminating '\n'.
  368.  * Return NULL if * the end of the file was encountered.  THIS FUNCTION IS A
  369.  * SECURITY HOLE!  Use the fgets() function instead, and strip off the '\n'
  370.  * from that function's returned value if necessary.
  371.  */
  372. char *gets(char *string)
  373. {
  374. }
  375.  
  376. /* <stdio.h> Return the I/O offset of fp */
  377. long int ftell(FILE *fp)
  378. {
  379. }
  380.  
  381. /* <stdlib.h> Return the absolute value of a long */
  382. long int labs(long int num)
  383. {
  384. }
  385.  
  386. /* <stdlib.h> Convert string to a long int.  This is more versatile than
  387.  * atol(), because it works with various bases (2 through 64, instead of
  388.  * just base 10).  Also, it has the side-effect of setting "end" to point
  389.  * to the character after the number's last digit.
  390.  */
  391. long int strtol(const char *start, char **end, int base)
  392. {
  393. }
  394.  
  395. /* <ctype.h> True for letters and digits */
  396. int isalnum(int ch)
  397. {
  398. }
  399.  
  400. /* <ctype.h> True for letters */
  401. int isalpha(int ch)
  402. {
  403. }
  404.  
  405. /* <ctype.h> True for ASCII control characters */
  406. int iscntrl(int ch)
  407. {
  408. }
  409.  
  410. /* <ctype.h> True for digits */
  411. int isdigit(int ch)
  412. {
  413. }
  414.  
  415. /* <ctype.h> True for printable characters other than whitespace */
  416. int isgraph(int ch)
  417. {
  418. }
  419.  
  420. /* <ctype.h> True for lowercase letters */
  421. int islower(int ch)
  422. {
  423. }
  424.  
  425. /* <ctype.h> True for printable characters including whitespace */
  426. int isprint(int ch)
  427. {
  428. }
  429.  
  430. /* <ctype.h> True for punctuation characters */
  431. int ispunct(int ch)
  432. {
  433. }
  434.  
  435. /* <ctype.h> True for any whitespace character */
  436. int isspace(int ch)
  437. {
  438. }
  439.  
  440. /* <ctype.h> True for uppercase letters */
  441. int isupper(int ch)
  442. {
  443. }
  444.  
  445. /* <ctype.h> True for hexadecimal digits -- 0-9, a-f, A-F */
  446. int isxdigit(int ch)
  447. {
  448. }
  449.  
  450. /* <locale.h> Fetch the locale-specific information for numeric conversions */
  451. struct lconv *localeconv(void)
  452. {
  453. }
  454.  
  455. /* <math.h> Return num * (2 ^ exp) -- i.e., add exp the num's exponent */
  456. double ldexp(double num, int exp)
  457. {
  458. }
  459.  
  460. /* <stdlib.h> Return the quotient and remainder of two longs */
  461. ldiv_t ldiv(long int num, long int divisor)
  462. {
  463. }
  464.  
  465. /* <math.h> Return the natural logarithm of num */
  466. double log(double num)
  467. {
  468. }
  469.  
  470. /* <math.h> Return the base-10 logarithm of num */
  471. double log10(double num)
  472. {
  473. }
  474.  
  475. /* <stdlib.h> Convert a string to an unsigned long int, using a given base */
  476. unsigned long int strtoul(const char *start, char **end, int base)
  477. {
  478. }
  479.  
  480. /* <setjmp.h> Jump to a location set by setjmp().  Note that the function
  481.  * which called setjmp() must not have returned yet.
  482.  */
  483. void longjmp(jmp_buf jmpenv, int value)
  484. {
  485. }
  486.  
  487. /* The entry point of a C program */
  488. int main(void) or (int argc, char *argv[])
  489. {
  490. }
  491.  
  492. /* <stdlib.h> Allocate memory.  The returned memory is NOT initialized */
  493. void *malloc(size_t amount)
  494. {
  495. }
  496.  
  497. /* <string.h> Seach for ch in the first count bytes of string.  String is
  498.  * permitted to contain '\0' bytes.
  499.  */
  500. void *memchr(const void *string, int ch, size_t count)
  501. {
  502. }
  503.  
  504. /* <string.h> Compare two chunks of memory */
  505. int memcmp(const void *area1, const void *area2, size_t width)
  506. {
  507. }
  508.  
  509. /* <string.h> Copy one chunk of memory into another (non-overlapping) chunk of
  510.  * memory.  If the regions might overlap, you should use memmove() instead.
  511.  */
  512. void *memcpy(void *to, const void *from, size_t width)
  513. {
  514. }
  515.  
  516. /* <string.h> Copy one chunk of memory into another.  They are permitted to
  517.  * overlap.
  518.  */
  519. void *memmove(void *to, const void *from, size_t width)
  520. {
  521. }
  522.  
  523. /* <string.h> Set every byte in a chunk of memory to "ch" */
  524. void *memset(void *buffer, int ch, size_t count)
  525. {
  526. }
  527.  
  528. /* <time.h> Convert "local" into a time_t value */
  529. time_t mktime(struct tm *local)
  530. {
  531. }
  532.  
  533. /* <math.h> Return the modulo (remainder of integer division)) of two doubles */
  534. double modf(double num, *double whole)
  535. {
  536. }
  537.  
  538. /* <stdio.h> Print an error message to stderr.  The string should identify
  539.  * what caused the error (e.g., the name of a file that couldn't be opened).
  540.  * The error's description is produced by examining the "errno" global
  541.  * variable.
  542.  */
  543. void perror(const char *string)
  544. {
  545. }
  546.  
  547. /* <math.h> Return base^exp */
  548. double pow(double base, double exp)
  549. {
  550. }
  551.  
  552. /* <stdio.h> Print a formatted string to stdout */
  553. int printf(const char *format, ...)
  554. {
  555. }
  556.  
  557. /* <stdio.h> Write a single character to fp */
  558. int putc(int ch, FILE *fp)
  559. {
  560. }
  561.  
  562. /* <stdio.h> write a single character to stdout */
  563. int putchar(int ch)
  564. {
  565. }
  566.  
  567. /* <stdio.h> Write a string to stdout, and then write a '\n' character */
  568. int puts(const char *string)
  569. {
  570. }
  571.  
  572. /* <stdlib.h> Sort an array.  There are four arguments: the array to sort,
  573.  * the number of items in the array, the size of each item, and a pointer
  574.  * to a comparison function.
  575.  */
  576. void qsort(void *array, size_t nitems, size_t itemsize, int (*compare)(const void *itemi, const void *itemj))
  577. {
  578. }
  579.  
  580. /* <signal.h> Send a single to yourself, like "kill(getpid(), signo)" */
  581. int raise(int signo)
  582. {
  583. }
  584.  
  585. /* <stdlib.h> Return a random number between 0 and RAND_MAX */
  586. int rand(void)
  587. {
  588. }
  589.  
  590. /* <stdlib.h> Change the size of a previously allocated chunk of memory.
  591.  * If possible, leave it in the same location.  If the surrounding memory
  592.  * isn't free, then allocate a totally new chunk of memory, copy the old
  593.  * data into it, and then free the old memory.  Either way, return a
  594.  * pointer to the reallocated chunk.
  595.  */
  596. void *realloc(void *mem, size_t new_size)
  597. {
  598. }
  599.  
  600. /* <stdio.h> Delete a file */
  601. int remove(const char *filename)
  602. {
  603. }
  604.  
  605. /* <stdio.h> Rename a file */
  606. int rename(const char *oldname, const char *newname)
  607. {
  608. }
  609.  
  610. /* <stdio.h> Reset fp to read from the beginning of a file */
  611. void rewind(FILE *fp)
  612. {
  613. }
  614.  
  615. /* <stdio.h> Scan formatted text from stdin */
  616. int scanf(const char *format , ...)
  617. {
  618. }
  619.  
  620. /* <stdio.h> Force fp to use a given buffer */
  621. void setbuf(FILE *fp, char buffer[BUFSIZ])
  622. {
  623. }
  624.  
  625. /* <setjmp.h> Define the destination for a later longjmp() call.  When
  626.  * called initially, setjmp() returns 0.  When longjmp() is called later,
  627.  * setjmp() will appear to return again, this time with the value that was
  628.  * passed into longjmp().
  629.  */
  630. int setjmp(jmp_buf jmpenv)
  631. {
  632. }
  633.  
  634. /* <locale.h> Set the locale */
  635. char *setlocale(int type, const char *locale)
  636. {
  637. }
  638.  
  639. /* <stdio.h> "mode" is one _IONBF for unbuffered, _IOLBF for line buffered,
  640.  * or _IOFBF for fully buffered.  This function must be called before the
  641.  * first I/O operation on the FILE.
  642.  */
  643. int setvbuf(FILE *fp, char *buffer, int mode, size_t width)
  644. {
  645. }
  646.  
  647. /* <signal.h> This one looks trickier than it is.  There are two arguments:
  648.  * a signal number, and a function to call when that signal is received.
  649.  * signal() returns the previous function pointer for that signal.  The
  650.  * catcher functions should accept a signal number argument, and return void.
  651.  */
  652. void (*signal (int signo, void (*fn)(int signo)))(int signo)
  653. {
  654. }
  655.  
  656. /* <math.h> Return the sine of an angle */
  657. double sin(double angle)
  658. {
  659. }
  660.  
  661. /* <math.h> Return the hyperbolic sine of an angle */
  662. double sinh(double angle)
  663. {
  664. }
  665.  
  666. /* <stdio.h> Write formatted text into a buffer. */
  667. int sprintf(char *buffer, const char *format, ...)
  668. {
  669. }
  670.  
  671. /* <math.h> Return the square root of num */
  672. double sqrt(double num)
  673. {
  674. }
  675.  
  676. /* <stdlib.h> Set the seed for the random number generator, rand() */
  677. void srand(unsigned int seed)
  678. {
  679. }
  680.  
  681. /* <stdio.h> Scan formatted text from a buffer */
  682. int sscanf(const char *buffer, const char *format, ...)
  683. {
  684. }
  685.  
  686. /* <string.h> Append rear onto the end of the front string.  It is assumed
  687.  * that the front string's buffer is large enough to hold the combined string.
  688.  */
  689. char *strcat(char *front, const char *rear)
  690. {
  691. }
  692.  
  693. /* <string.h> Return a pointer to the first instance of ch in string.  If it
  694.  * doesn't appear there, then return NULL.
  695.  */
  696. char *strchr(const char *string, int ch)
  697. {
  698. }
  699.  
  700. /* <string.h> Compare two strings, without using the locale */
  701. int strcmp(const char *first, const char *second)
  702. {
  703. }
  704.  
  705. /* <string.h> Compare two strings using the locale */
  706. int strcoll(const char *first, const char *second)
  707. {
  708. }
  709.  
  710. /* <string.h> Copy a string */
  711. char *strcpy(char *dest, const char *source)
  712. {
  713. }
  714.  
  715. /* <string.h> Count the initial chars in `string' which DON'T which appear in
  716.  * the `chars' string.
  717.  */
  718. size_t strcspn(const char *string, const char *chars)
  719. {
  720. }
  721.  
  722. /* <string.h> Return the string describing an error */
  723. char *strerror(int error_num)
  724. {
  725. }
  726.  
  727. /* <time.h> Convert a time from struct tm to a string, using a given format */
  728. size_t strftime(char *date_time, size_t maxsize,const char *format, const struct tm *currtime)
  729. {
  730. }
  731.  
  732. /* <string.h> Return the length of a string */
  733. size_t strlen(const char *string)
  734. {
  735. }
  736.  
  737. /* <string.h> Append the rear string onto the end of the front string, up
  738.  * to an overall length limit.
  739.  */
  740. char *strncat(char *front, const char *rear, size_t length)
  741. {
  742. }
  743.  
  744. /* <string.h> Compare first "length" characters of two strings */
  745. int strncmp(const char *first, const char *second, size_t length)
  746. {
  747. }
  748.  
  749. /* <string.h> Copy the first "length" characters of "from" into "to" */
  750. char *strncpy(char *to, const char *from, size_t length)
  751. {
  752. }
  753.  
  754. /* <string.h> Locate the first instance of in string, of any character in
  755.  * chars, and return a pointer to it.  If no such character can be found,
  756.  * return NULL.
  757.  */
  758. char *strpbrk(const char *string, const char *chars)
  759. {
  760. }
  761.  
  762. /* <string.h> Return a pointer to the last instance of ch in string,
  763.  * or NULL if none.
  764.  */
  765. char *strrchr(const char *string, int ch)
  766. {
  767. }
  768.  
  769. /* <string.h> Count the initial chars in `string' which appear in `chars' */
  770. size_t strspn(const char *string, const char *chars)
  771. {
  772. }
  773.  
  774. /* Return a pointer to the first instance of `target' in `string', or NULL if
  775.  * `target' doesn't appear anywhere in `string'
  776.  */
  777. char *strstr(const char *string, const char *target)
  778. {
  779. }
  780.  
  781. /* <stdlib.h> Convert a string to a double.  Also set *end to point to
  782.  * character after the last digit of the number.
  783.  */
  784. double strtod(const char *start, char **end)
  785. {
  786. }
  787.  
  788. /* <string.h> Return a token from buf.  On the first call, buf should be
  789.  * the start of a buffer; on subsequent calls, it should be NULL.  The
  790.  * delim argument is used as a list of delimiter characters.  Each call
  791.  * will return sequential tokens from buf, until they've all been returned
  792.  * at which point it switches to NULL.  Note that buf is modified as this
  793.  * progresses.
  794.  */
  795. char* strtok(char *buf, const char *delim)
  796. {
  797. }
  798.  
  799. /* <string.h> Transform a string into a form which can be used for
  800.  * locale-dependent comparisons efficiently.
  801.  */
  802. size_t strxfrm(char *first, const char *second, size_t length)
  803. {
  804. }
  805.  
  806. /* <stdlib.h> Run a program, and wait for it to complete.  Return the exit
  807.  * status of that program.
  808.  */
  809. int system(const char *command)
  810. {
  811. }
  812.  
  813. /* <math.h> Return the tangent of an angle */
  814. double tan(double angle)
  815. {
  816. }
  817.  
  818. /* <math.h> Return the hyperbolic tangent of an angle */
  819. double tanh(double angle)
  820. {
  821. }
  822.  
  823. /* <time.h> Return the current system time.  If "tptr" is not NULL, then also
  824.  * copy the current system time into the variable that it points to.
  825.  */
  826. time_t time(time_t *tptr)
  827. {
  828. }
  829.  
  830. /* <time.h> Decompose a time_t value, for the Universal Time zone */
  831. struct tm *gmtime(const time_t *tptr)
  832. {
  833. }
  834.  
  835. /* <time.h> Decompose a time_t value, for the local time zone */
  836. struct tm *localtime(const time_t *tptr)
  837. {
  838. }
  839.  
  840. /* <stdio.h> Create a temporary file */
  841. FILE *tmpfile(void)
  842. {
  843. }
  844.  
  845. /* <stdio.h> Create a name for a temporary file.  If buf is null, then it
  846.  * uses a static variable to store the name.  Note that some other process
  847.  * may create a file with the same name before yours does, so this function
  848.  * is not 100% reliable.
  849.  */
  850. char *tmpnam(char *buf)
  851. {
  852. }
  853.  
  854. /* <ctype.h> Convert ch to lowercase */
  855. int tolower(int ch)
  856. {
  857. }
  858.  
  859. /* <ctype.h> Convert ch to uppercase */
  860. int toupper(int ch)
  861. {
  862. }
  863.  
  864. /* <stdio.h> Stuff ch back into the input stream for fp */
  865. int ungetc(int ch, FILE *fp)
  866. {
  867. }
  868.  
  869. /* <stdarg.h> Return the next varargs value, for a given type */
  870. type va_arg(va_list arg_ptr, type)
  871. {
  872. }
  873.  
  874. /* <stdarg.h> End the varargs processing */
  875. void va_end(va_list arg_ptr)
  876. {
  877. }
  878.  
  879. /* <stdarg.h> Start the varargs processing.  The variable portion of the
  880.  * arguments start immediately after last_fixed_arg.  Note that this is a
  881.  * macro, and its second parameter is simply the identifier of an argument,
  882.  * NOT A REFERENCE TO IT.
  883.  */
  884. void va_start(va_list first_arg, last_fixed_arg)
  885. {
  886. }
  887.  
  888. /* <stdio.h> and <stdarg.h> Print varargs out to fp */
  889. int vfprintf(FILE *fp, const char *format, va_list arg_ptr)
  890. {
  891. }
  892.  
  893. /* <stdio.h> and <stdarg.h> Print varargs out to stdout */
  894. int vprintf(const char *format, va_list arg_ptr)
  895. {
  896. }
  897.  
  898. /* <stdio.h> and <stdarg.h> Print varargs into a buffer */
  899. int vsprintf(char *buffer, const char *format, va_list arg_ptr)
  900. {
  901. }
  902.  
  903. /* <stdlib.h> Convert a string of multibyte characters into a string of wide
  904.  * characters.  Return the number of wide characters.  If pwcs is NULL, then
  905.  * still returns the count but does not store the converted text.
  906.  */
  907. mbstowcs(wchar_t *pwcs, const char *m_byte, size_t length)
  908. {
  909. }
  910.  
  911. /* <stdlib.h> Convert a single wide character into a multibyte character
  912.  * string, and return the number of bytes required for the multibyte text
  913.  * (including a terminating NUL byte, if appropriate).  Note that there is
  914.  * no way to predict how large the m_byte buffer must be, but you're
  915.  * responsible for making it large enough anyway.
  916.  * 
  917.  * If m_byte is NULL then it resets its internal shift state and returns 1
  918.  * if that state was complex, or 0 if trivial.
  919.  */
  920. int wctomb(char* m_byte, wchar_t wide_char)
  921. {
  922. }
  923.