@DataBase "ANSI-C Keywords"
@Author LouiSe

@Node Main "ANSI-C Keywords"

  ANSI-C Keywords for searching by LouiSe '97

@EndNode


@Node "rand()"
rand()-Generate a random number

Synopsis

   #include <stdlib.h>

   x = rand(void);

   int x;           /*  random number */

Portability

 

Returns

   This function returns an integer value as noted above.

See Also

   @{" drand48() " Link "drand48()"} , @{" srand() " Link "srand()"}
@EndNode
@Node "realloc()"
realloc()-reallocate level 3 memory

Synopsis

   #include <stdlib.h>

   nb = realloc(b,n);

   void *b;       /* block pointer      */
   size_t n;      /* number of bytes    */
   void *nb;      /* new block pointer  */

Portability

 

Returns

   This function returns a null pointer if there is not enough space for
   the requested block.  In this case, the original block b is unchanged.

See Also

   @{" calloc() " Link "calloc()"} , @{" free() " Link "free()"} , @{" getmem() " Link "getmem()"} , @{" malloc() " Link "malloc()"} ,
   @{" rlsmem() " Link "rlsmem()"} , @{" sbrk() " Link "sbrk()"} , @{" rbrk() " Link "rbrk()"}
@EndNode
@Node "remove()"
remove()-remove a file

Synopsis

   #include <stdio.h>

   error = remove(name);

   int error;          /* non-zero if error */
   const char *name;   /* file name */

Portability

 

Returns

   If a non-zero value is returned, some type of error occurred, and
   additional information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.  The most
   common errors occur when you try to remove a file that doesn't exist,
   that is marked as read-only, or is in use.

See Also

   @{" errno " Link "errno"} , @{" _OSERR " Link "_OSERR"} , @{" unlink() " Link "unlink()"}
@EndNode
@Node "rename()"
rename()-rename a file

Synopsis

   #include <stdio.h>

   error = rename(old,new);

   int error;         /* 0 for success, nonzero for error */
   const char *old;   /*  old file name */
   const char *new;   /*  new file name */

Portability

 

Returns

   If the function fails, it returns a nonzero integer and places
   additional error information into @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.
   If it is successful, it returns a 0.
@EndNode
@Node "rewind()"
rewind()-Reset level 2 file position to first byte

Synopsis

   #include <stdio.h>

   void rewind(fp);

   FILE *fp;    /* file pointer */

Portability

 

See Also

   @{" errno " Link "errno"} , @{" fseek() " Link "fseek()"} , @{" fopen() " Link "fopen()"} , @{" _OSERR " Link "_OSERR"} ,
   @{" lseek() " Link "lseek()"} , @{" tell() " Link "tell()"}
@EndNode
@Node "scanf()"
scanf()-Formatted input conversions

Synopsis

   #include <stdio.h>

   n = scanf(fmt,arg1,arg2,...);

   int n;              /* number of input items matched, or EOF */
   const char *fmt;    /* format string */
   ---- *arg<x> ;         /* pointers to input data areas */

Portability

 

Returns

   The function returns the number of assignments that were made.  For
   example, a return value of three indicates that conversion results were
   assigned to arg1, arg2, and arg3.

See Also

   @{" fscanf() " Link "fscanf()"} , @{" sscanf() " Link "sscanf()"} , @{" Formatted Input Specifiers " Link "Formatted Input Specifiers"}
@EndNode
@Node "modf()"
modf()-Split floating point value

Synopsis

   #include <math.h>

   x = modf(y,p);

   double x;  /* fractional part of y */
   double y;  /* number to be broken up */
   double *p; /* integral part of y */

Portability

 

Returns

   The function return value is the fractional part of y, and the integral
   part is placed in the double pointed to by p.

See Also

   @{" fmod() " Link "fmod()"}
@EndNode
@Node "offsetof()"
offsetof()-Get the byte offset of a structure member

Synopsis

   #include <stddef.h>

   size_t offsetof(type, element)

Portability

 

Returns

   This macro returns the byte offset of element, within the structure
   type.
@EndNode
@Node "onexit()"
onexit()-Set an exit trap

Synopsis

   #include <stdlib.h>

   success = onexit(func);

   int success;           /* non-zero for success */
   void (*func)(void);    /* trap function pointer */

Portability

 

Returns

   A zero is returned for success and a non-zero value is returned if an
   error is encountered.

See Also

   @{" exit() " Link "exit()"}
@EndNode
@Node "perror()"
perror()-Print error message

Synopsis

   #include <stdio.h>

   void perror(s);

   const char *s;   /* message prefix */

Portability

 

See Also

   @{" errno " Link "errno"} , @{" poserr() " Link "poserr()"} , @{" __sys_errlist " Link "__sys_errlist"} , @{" __sys_nerr " Link "__sys_nerr"}
@EndNode
@Node "pow()"
pow()-raise a number to a power

Synopsis

   #include <math.h>

   r = pow(x,y);

   double r, x, y;

Portability

 

See Also

   @{" __matherr() " Link "__matherr()"} , @{" pow2() " Link "pow2()"}
@EndNode
@Node "printf()"
printf()-Formatted print to stdout

Synopsis

   #include <stdio.h>

   length = printf(fmt,arg1,arg2,...);

   int length;        /* number of characters generated */
   const char *fmt;   /* format string */
   .... arg<x> ;         /* arguments */

Portability

 

Returns

   This function returns the number of output characters generated.

See Also

   @{" fprintf() " Link "fprintf()"} , @{" sprintf() " Link "sprintf()"} , @{" Formatted Output Specifiers " Link "Formatted Output Specifiers"}
@EndNode
@Node "putc()"
putc()-Put a character to a level 2 file

Synopsis

   #include <stdio.h>

   r = putc(c,fp);

   int r;      /* EOF or c */
   int c;      /* Character to be output */
   FILE *fp;   /* Level 2 file pointer */

Portability

 

Returns

   If successful, this function returns the character to be output;
   otherwise, it returns EOF.  For disk files, an EOF return usually means
   that the disk is full.  However, this type of return can also occur if
   the device is write-protected or if a write error occurs.  In any case,
   additional error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" fopen() " Link "fopen()"} , @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "putchar()"
putchar()-Put a character to stdout

Synopsis

   #include <stdio.h>

   r = putchar(c);

   int r;      /* EOF or c */
   int c;      /* Character to be output */

Portability

 

Returns

   If successful, this function returns the character that was output;
   otherwise, it returns EOF.  For disk files, an EOF return usually means
   that the disk is full.  However, this type of return can also occur if
   the device is write-protected or if a write error occurs.  In any case,
   additional error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" fopen() " Link "fopen()"} , @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "puts()"
puts()-Put string to stdout

Synopsis

   #include <stdio.h>

   error = puts(s);

   int error;       /*non-zero if error*/
   const char *s;   /*string pointer*/

Portability

 

Returns

   If an error occurs, the return value is -1; otherwise, it is 0.
   Additional error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"}, @{" ferror() " Link "ferror()"} , @{" fopen() " Link "fopen()"} , @{" fputc() " Link "fputc()"} ,
   @{" fputs() " Link "fputs()"} , @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "qsort()"
qsort()-Sort a data array

Synopsis

   #include <stdlib.h>

   void qsort(a,n,size,cmp);

   void *a;              /* data array pointer */
   size_t n;             /* number of elements in array */
   size_t size;          /* element size in bytes */
      /* pointer to comparison function */
   int (*cmp)(const void *, const void *);

Portability

 

See Also

   @{" dqsort() " Link "dqsort()"} , @{" fqsort() " Link "fqsort()"} , @{" lqsort() " Link "lqsort()"} , @{" sqsort() " Link "sqsort()"} ,
   @{" tqsort() " Link "tqsort()"}
@EndNode
@Node "raise()"
raise()-Generate a signal

Synopsis

   #include <signal.h>

   ret = raise(sig);

   int ret;         /* 0 if successful, nonzero if failed */
   int sig;         /* signal() to generate                 */

Portability

 

Returns

   A non-zero return value indicates failure.

See Also

   @{" signal() " Link "signal()"} , @{" __matherr() " Link "__matherr()"} , @{" onbreak() " Link "onbreak()"} , @{" _CXBRK() " Link "_CXBRK()"} ,
   @{" _CXFERR() " Link "_CXFERR()"}
@EndNode
@Node "main()"
main()-Your main or principal function

Synopsis

   #include "workbench/startup.h"

   void main(argc,argv);

   int argc;          /* argument count */
   union {
      char *args[];
      struct WBStartup *msg;
   } argv;          /* argument vector */

Portability

 

Returns

   When main() returns to its caller (normally _main.c), the program exits
   to AmigaDOS with a termination code of 0.  If you want to pass a
   non-zero termination code back to AmigaDOS, use the @{" exit() " Link "exit()"} or
   @{" __exit() " Link "__exit()"} function.

See Also

   @{" exit() " Link "exit()"} , @{" __exit() " Link "__exit()"} , @{" __main() " Link "__main()"}
   @{" __tinymain() " Link "__tinymain()"}
@EndNode
@Node "malloc()"
malloc()-Allocate memory

Synopsis

   #include <stdlib.h>

   b = malloc(n);

   void *b;     /*block pointer   */
   size_t n;    /*number of bytes */

Portability

 

Returns

   A null pointer is returned if there is not enough space for the
   requested block.

See Also

   @{" calloc() " Link "calloc()"} , @{" free() " Link "free()"} , @{" getmem() " Link "getmem()"} , @{" rbrk() " Link "rbrk()"} ,
   @{" realloc() " Link "realloc()"} , @{" rlsmem() " Link "rlsmem()"} , @{" sbrk() " Link "sbrk()"}
@EndNode
@Node "mblen()"
mblen()-Determine length of multibyte character

Synopsis

   #include <stdlib.h>

   length = mblen(s, n);

   int length;    /* length or state information */
   const char *s; /* pointer to characters or NULL */
   size_t  n;     /* maximum number of characters to look at */

Portability

 

Returns

   This function returns the amount of storage needed to hold result
   string.

See Also

   @{" mbstowcs() " Link "mbstowcs()"} , @{" mbtowc() " Link "mbtowc()"}
@EndNode
@Node "mbstowcs()"
mbstowcs()-Convert multibyte string to wide character string

Synopsis

   #include <stdlib.h>

   length = mbstowcs(pwcs, s, n);

   size_t length;  /* length or state information             */
   wchar_t *pwcs;  /* pointer to wide character string        */
   const char *s;  /* pointer to characters or NULL           */
   size_t n;       /* maximum number of characters to look at */

Portability

 

Returns

   This function returns the length of the result string.

See Also

   @{" mblen() " Link "mblen()"} , @{" mbtowc() " Link "mbtowc()"}
@EndNode
@Node "mbtowc()"
mbtowc()-Maps a multibyte character to a wide character

Synopsis

   #include <stdlib.h>

   length = mbtowc(pwc, s, n);

   int length;     /* length or state information             */
   wchar_t *pwc;   /* pointer to wide character               */
   const char *s;  /* pointer to characters or NULL           */
   size_t n;       /* maximum number of characters to look at */

Portability

 

Returns

   This function returns the length of the multibyte character defined by
   the locale information.  If s is NULL or if n is equal to zero, this
   function returns a zero.

See Also

   @{" mblen() " Link "mblen()"} , @{" mbtowc() " Link "mbtowc()"}
@EndNode
@Node "memchr()"
memchr()-Find a character in a memory block

Synopsis

   #include <string.h>

   s = memchr(a,c,n);

   void *s;         /* pointer to character in block */
   const void *a;   /* block pointers  */
   int c;           /* character value */
   size_t n;        /* number of bytes */

Portability

 

Returns

   This function returns a pointer to the first occurrence of the
   specified character in the block, or a null pointer if the character is
   not found.
@EndNode
@Node "memcmp()"
memcmp()-Compare two memory blocks

Synopsis

   #include <string.h>

   x = memcmp(a,b,n);

   int x;             /* return value */
   const void *a,*b;  /* block pointers */
   size_t n;          /* number of bytes */

Portability

 

Returns

   This function returns an integral value as follows:

      Return      Meaning
      ------      -------
      Negative    First block sorts below second
      Zero        First block equals second
      Positive    First block sorts above second
@EndNode
@Node "memcpy()"
memcpy()-Copy a memory block

Synopsis

   #include <string.h>

   s = memcpy(to,from,n);

   void *s;           /* return pointer */
   void *to;          /* destination pointer */
   const void *from;  /* source pointer */
   size_t n;          /* number of bytes */

Portability

 

Returns

   This function returns a pointer to the destination block.

See Also

   @{" memccpy() " Link "memccpy()"} , @{" memmove() " Link "memmove()"} , @{" movmem() " Link "movmem()"} , @{" strcpy() " Link "strcpy()"}
@EndNode
@Node "memmove()"
memmove()-Copy bytes in memory

Synopsis

   #include <string.h>

   p = memmove(dest, source, nbytes);

   void *p;                /* same as dest                      */
   void *dest;             /* destination for moved bytes       */
   const void *source;     /* source of bytes for move          */
   size_t nbytes;          /* number of bytes to be transferred */

Portability

 

Returns

   This function returns a pointer to the destination block.

See Also

   @{" memcpy() " Link "memcpy()"} , @{" movmem() " Link "movmem()"} , @{" strcpy() " Link "strcpy()"}
@EndNode
@Node "memset()"
memset()-Set a memory block to a value

Synopsis

   #include <string.h>

   s = memset(to,c,n);

   void *s;    /* return pointer */
   void *to;   /* destination pointer */
   size_t n;   /* number of bytes */
   int c;      /* character value */

Portability

 

Returns

   This function returns a pointer to the destination block.

See Also

   @{" setmem() " Link "setmem()"}
@EndNode
@Node "mktime()"
mktime()-Convert broken down time to time_t value

Synopsis

   #include <time.h>

   t = mktime(ts);

   time_t t;         /* number of seconds since 1/1/70 */
   struct tm *ts;    /* broken down time structure */

Portability

 

Returns

   This function returns the number of seconds since January 1, 1970.

See Also

   @{" time() " Link "time()"}
@EndNode
@Node "isupper()"
isupper()-Test if upper case character

Synopsis

   #include <ctype.h>

   t = isupper(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is an upper case letter,
   and a zero if not.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "isxdigit()"
isxdigit()-Test if hex digit character

Synopsis

   #include <ctype.h>

   t = isxdigit(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is a valid hexidecimal
   digit (including both upper and lower case A-F), and a zero if not.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "labs()"
labs()-Long integer absolute value

Synopsis

   #include <stdlib.h>

   al = labs(l);

   long int al,l;

Portability

 

Returns

   This function returns a long integer holding the absolute value of the
   parameter.

See Also

   @{" abs() " Link "abs()"} , @{" fabs() " Link "fabs()"} , @{" iabs() " Link "iabs()"}
@EndNode
@Node "ldexp()"
ldexp()-Combine float value

Synopsis

   #include <math.h>

   v = ldexp(d,x);

   double v;       /* value */
   double d;       /* fraction */
   int x;          /* exponent */

Portability

 

Returns

   This function returns a double holding the result of the above
   equation.

See Also

   @{" fmod() " Link "fmod()"} , @{" frexp() " Link "frexp()"} , @{" __matherr() " Link "__matherr()"} , @{" modf() " Link "modf()"}
@EndNode
@Node "ldiv()"
ldiv()-Return long quotient and remainder for divide

Synopsis

   #include <stdlib.h>

   res = ldiv(numer, denom);

   ldiv_t res;        /* resulting quotient and remainder */
   long int numer;    /* numerator for the divide         */
   long int denom;    /* denominator for the divide       */

Portability

 

Returns

   This function returns a structure containing both the quotient and
   remainder.  The structure is defined in stdlib.h as follows:

   typedef struct {
      long int quot;
      long int rem;
   } ldiv_t;


See Also

   @{" div() " Link "div()"}
@EndNode
@Node "localeconv()"
localeconv()-Return info on locale formatting conventions

Synopsis

   #include <locale.h>

   lcl = localeconv(void);

   struct lconv *lcl;     /* Locale information structure */

Portability

 

Returns

   This function returns a pointer to the @{" lconv " Link "lconv"} structure for the
   current locale.

See Also

   @{" setlocale() " Link "setlocale()"}
@EndNode
@Node "localtime()"
localtime()-Unpack local time

Synopsis

   #include <time.h>

   ut = localtime(t);

   struct tm *ut;
   const time_t *t;

Portability

 

See Also

   @{" asctime() " Link "asctime()"} , @{" ctime() " Link "ctime()"} , @{" gmtime() " Link "gmtime()"} , @{" time() " Link "time()"}
@EndNode
@Node "log()"
log()-Natural logarithm function

Synopsis

   #include <math.h>

   r = log(x);

   double r, x;

Portability

 

Returns

   This function returns a double that contains the base E logarithm of
   the parameter.

See Also

   @{" log10() " Link "log10()"} , @{" __matherr() " Link "__matherr()"}
@EndNode
@Node "log10()"
log10()-Base 10 logarithm function

Synopsis

   #include <math.h>

   r = log10(x);

   double r, x;

Portability

 

Returns

   This function returns a double the base 10 logarithm of the parameter.

See Also

   @{" log() " Link "log()"} , @{" __matherr() " Link "__matherr()"}
@EndNode
@Node "longjmp()"
longjmp()-Perform long jump

Synopsis

   #include <setjmp.h>

   void longjmp(save,value);

   jmp_buf save;   /* address of save area */
   int value;      /* return value */

Portability

 

See Also

   @{" exit() " Link "exit()"} , @{" setjmp() " Link "setjmp()"}
@EndNode
@Node "gets()"
gets()-Get string from stdin

Synopsis

   #include <stdio.h>

   p = gets(buffer);

   char *p;       /*buffer pointer or NULL */
   char *buffer;  /*buffer pointer */

Portability

 

Returns

   This function returns the buffer argument unless an I/O error occurs,
   in which case a null pointer is returned, and @{" errno " Link "errno"} is set to
   describe the error.

See Also

   @{" errno " Link "errno"} , @{" fopen() " Link "fopen()"} , @{" feof() " Link "feof()"} , @{" ferror() " Link "ferror()"} ,
   @{" fgetc() " Link "fgetc()"} , @{" fgets() " Link "fgets()"} , @{" getc() " Link "getc()"}
@EndNode
@Node "gmtime()"
gmtime()-Unpack Greenwich Mean Time (GMT)

Synopsis

   #include <time.h>

   ut = gmtime(t);

   struct tm *ut;
   const time_t *t;

Portability

 

See Also

   @{" asctime() " Link "asctime()"} , @{" ctime() " Link "ctime()"} , @{" localtime() " Link "localtime()"} , @{" time() " Link "time()"}
@EndNode
@Node "isalnum()"
isalnum()-Test if alphanumeric character

Synopsis

   #include <ctype.h>

   t = isalnum(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is an alphanumeric
   character, zero if not.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "islpha()"
isalpha()-Test if alphabetic character

Synopsis

   #include <ctype.h>

   t = isalpha(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is an alphabetic character,
   and a zero if not.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "iscntrl()"
iscntrl()-Test if control character

Synopsis

   #include <ctype.h>

   t = iscntrl(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is a control character, and
   a zero if not.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "isdigit()"
isdigit()-Test if decimal digit character (0 to 9)

Synopsis

   #include <ctype.h>

   t = isdigit(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is a decimal digit, and a
   zero if not.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "isgraph()"
isgraph()-Test if graphic character (anything but space, ' ')

Synopsis

   #include <ctype.h>

   t = isgraph(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is anything other than a
   space character (' '), and a zero if it is a space.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "islower()"
islower()-Test if lower case character

Synopsis

   #include <ctype.h>

   t = islower(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is a lower case letter, and
   a zero if not.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "isprint()"
isprint()-Test if printable character

Synopsis

   #include <ctype.h>

   t = isprint(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is any printable character
   other than space, and a zero if c is a space or a non-printable
   character (such as a control character).

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "ispunct()"
ispunct()-Test if punctuation character

Synopsis

   #include <ctype.h>

   t = ispunct(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is anything other than a
   space or an alphanumeric character, and a zero if it is a space or an
   alphanumeric character.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "isspace()"
isspace()-Test if space character

Synopsis

   #include <ctype.h>

   t = isspace(c);

   int t;   /* 0 if false, non-zero if true */
   int c:   /* character to test */

Portability

 

Returns

   This function returns a non-zero value if c is a C space character
   (including ' ', '\n', '\f', etc.), and a zero if not.

See Also

   @{" __ctype " Link "__ctype"}
@EndNode
@Node "freopen()"
freopen()-Reopen a level 2 file

Synopsis

   #include <stdio.h>

   fpr = freopen(name, mode, fp);

   FILE *fpr;           /* file pointer after re-opening */
   const char *name;    /* file name */
   const char *mode;    /* access mode */
   FILE *fp;            /* current file pointer */

Portability

 

Returns

   If successful, this function returns the file pointer.

   Check the return code for null; the same errors as defined for
   @{" fopen() " Link "fopen()"} may occur.  Also, for complete portability, do not assume
   that fpr and fp are identical.  Use fpr to access the reopened file,
   not fp.

See Also

   @{" fopen() " Link "fopen()"} , @{" fdopen() " Link "fdopen()"}
@EndNode
@Node "frexp()"
frexp()-Split float value

Synopsis

   #include <math.h>

   f = frexp(v,xp);

   double f;    /* fraction */
   double v;    /* value */
   int *xp;     /* exponent pointer */

Portability

 

Returns

   This function returns the mantissa as a double whose absolute value is
   greater than or equal to 0.5 and less than 1.0.  The exponent is
   returned as an integer whose absolute value is less than 1024.  If the
   value v is zero, both returned values will be zero.

See Also

   @{" fmod() " Link "fmod()"} , @{" ldexp() " Link "ldexp()"} , @{" __matherr() " Link "__matherr()"} , @{" modf() " Link "modf()"}
@EndNode
@Node "fscanf()"
fscanf()-Formatted input conversions

Synopsis

   #include <stdio.h>

   n = fscanf(fp,fmt,arg1,arg2,...);

   int n;            /* number of input items matched, or EOF */
   FILE *fp;         /* file pointer (fscanf() only) */
   const char *fmt;  /* format string */
   ---- *argx;       /* pointers to input data areas */

Portability

 

Returns

   The function returns the number of assignments that were made.  For
   example, a return value of 3 indicates that conversion results were
   assigned to arg1, arg2, and arg3.

See Also

   @{" scanf() " Link "scanf()"} , @{" sscanf() " Link "sscanf()"} , @{" Formatted Input Specifiers() " Link "Formatted Input Specifiers"}
@EndNode
@Node "fseek()"
fseek()-Set level 2 file position

Synopsis

   #include <stdio.h>

   error = fseek(fp,rpos,mode);

   int error;      /* non-zero if error */
   FILE *fp;       /* file pointer returned from fopen() */
   long int rpos;  /* relative file position */
   int mode;       /* seek mode */

Portability

 

Returns

   A value of -1 is returned if an error occurs.  @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}
   contain additional error information.

See Also

   @{" errno " Link "errno"} , @{" fopen() " Link "fopen()"} , @{" ftell() " Link "ftell()"} , @{" lseek() " Link "lseek()"} ,
   @{" _OSERR " Link "_OSERR"} , @{" rewind() " Link "rewind()"}
@EndNode
@Node "fsetpos()"
fsetpos()-Reposition a file

Synopsis

   #include <stdio.h>

   x = fsetpos(fp,pos);

   int x;
   FILE *fp;
   const fpos_t *pos;

Portability

 

Returns

   If successful, fsetpos() returns 0.  If it fails, fsetpos() returns a
   nonzero value and stores an appropriate error code in @{" errno " Link "errno"}.

See Also

   @{" fgetpos() " Link "fgetpos()"} , @{" fopen() " Link "fopen()"} , @{" fseek() " Link "fseek()"} , @{" ftell() " Link "ftell()"} ,
   @{" lseek() " Link "lseek()"}
@EndNode
@Node "ftell()"
ftell()-Get level 2 file position

Synopsis

   #include <stdio.h>

   apos = ftell(fp);

   long int apos;  /* absolute file position */
   FILE *fp;       /* file pointer */

Portability

 

Returns

   For ftell(), an error is indicated by a return value of -1L.  @{" errno " Link "errno"}
   and @{" _OSERR " Link "_OSERR"} contain additional error information.

See Also

   @{" errno " Link "errno"} , @{" fopen() " Link "fopen()"} , @{" _OSERR " Link "_OSERR"} , @{" lseek() " Link "lseek()"} ,
   @{" tell() " Link "tell()"}
@EndNode
@Node "fwrite()"
fwrite()-write blocks to a level 2 file

Synopsis

   #include <stdio.h>

   a = fwrite(b,bsize,n,fp);

   size_t a;      /* actual number of blocks */
   const void *b; /* pointer to first block */
   size_t bsize;  /* size of block in bytes */
   size_t n;      /* maximum number of blocks */
   FILE *fp;      /* file pointer */

Portability

 

Returns

   This function returns the number of complete blocks that were
   processed.

See Also

   @{" fopen() " Link "fopen()"} , @{" fclose() " Link "fclose()"} , @{" ferror() " Link "ferror()"} , @{" feof() " Link "feof()"} ,
   @{" fgetc() " Link "fgetc()"} , @{" fputc() " Link "fputc()"} , @{" fread() " Link "fread()"} , @{" fseek() " Link "fseek()"}
@EndNode
@Node "getc()"
getc()-Get a character from a file

Synopsis

   #include <stdio.h>

   c = getc(fp);

   int c;      /* return character or code */
   FILE *fp;   /* file pointer */

Portability

 

Returns

   If successful, the next input character is returned. Otherwise, this
   function returns EOF, which is defined in <stdio.h>.  In the event of
   an EOF return, error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

   Most programmers treat any EOF return as an indication of end-of-file.
   However, if you want to distinguish errors from an end-of-file
   condition, you should reset @{" errno " Link "errno"} before calling the function and
   then analyze its contents when you receive an EOF return.

See Also

   @{" errno " Link "errno"} , @{" fgetc() " Link "fgetc()"} , @{" fgetchar() " Link "fgetchar()"} , @{" fopen() " Link "fopen()"} ,
   @{" getchar() " Link "getchar()"} , @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "getchar()"
getchar()-Get a character from stdin

Synopsis

   #include <stdio.h>

   c = getchar(void);

   int c;      /* return character or code */

Portability

 

Returns

   If successful, the next input character is returned.  Otherwise, the
   function returns EOF, which is defined in <stdio.h>.  In the event of
   an EOF return, error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" fgetc() " Link "fgetc()"} , @{" fgetchar() " Link "fgetchar()"} ,
   @{" fopen() " Link "fopen()"} , @{" getch() " Link "getch()"} , @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "getenv()"
getenv()-Get environment variable

Synopsis

   #include <stdlib.h>

   var = getenv(name);

   char *var;         /*environment variable pointer or NULL */
   const char *name;  /*environment variable name */

Portability

 

Returns

   NULL is returned if name cannot be located in the current environment.
   NULL is defined in stddef.h.

See Also

   @{" free() " Link "free()"} , @{" malloc() " Link "malloc()"} , @{" putenv() " Link "putenv()"}
@EndNode
@Node "fgets()"
fgets()-Get string from a level 2 file

Synopsis

   #include <stdio.h>

   p = fgets(buffer,length,fp);

   char *p;       /* buffer pointer or NULL */
   char *buffer;  /* buffer pointer */
   int length;    /* buffer length in bytes */
   FILE *fp;      /* file pointer */

Portability

 

Returns

   If the end-of-file is hit before any bytes are read, a NULL pointer is
   returned.  If an I/O error occurs, a NULL pointer is returned and
   additional information is placed in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.  If no I/O
   error occurs and at least one byte was read from the file, the buffer
   argument is returned.

See Also

   @{" errno " Link "errno"} , @{" fopen() " Link "fopen()"} , @{" feof() " Link "feof()"} , @{" ferror() " Link "ferror()"} ,
   @{" fgetc() " Link "fgetc()"} , @{" fread() " Link "fread()"} , @{" getc() " Link "getc()"} , @{" gets() " Link "gets()"} ,
   @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "floor()"
floor()-Get floor of a real number

Synopsis

   #include <math.h>

   x = floor(y);

   double x,y;

Portability

 

Returns

   The result is a real number.

See Also

   @{" ceil() " Link "ceil()"}
@EndNode
@Node "__fmask"
__fmask-Default protection bits for opening a file

Synopsis

   extern unsigned long __fmask;

Description

   This external integer indicates the default protection for any file
 
   routines.  This flag has no effect on AmigaDOS I/O routines such as
   @{" Open() " Link "dos/Open()"}.  The default protection is read, write, and delete.

Portability

   @{" SAS/C " Link "Glossary - SASC"}

See Also

   @{" creat() " Link "creat()"} , @{" fopen() " Link "fopen()"} , @{" open() " Link "open()"} , AmigaDOS @{" Open() " Link "dos/Open()"}
@EndNode
@Node "fmod()"
fmod()-Float modulus operations

Synopsis

   #include <math.h>

   x = fmod(y,z);

   double x,y,z;

Portability

 

Returns

   This function returns y if z is 0.  Otherwise, it returns a value that
   has the same sign as y, is less than z, and satisfies the relationship:

      y = (i * z) + x

   i is an integer.

See Also

   @{" modf() " Link "modf()"}
@EndNode
@Node "fopen()"
fopen()-open a level 2 file

Synopsis

   #include <stdio.h>

   fp = fopen(name,"mode");

   FILE *fp;            /* file pointer */
   const char *name;    /* file name */
   const char *mode;    /* access mode string */

Portability

 

 
 

Returns

   A null pointer is returned if the file cannot be opened.  Consult
   @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"} for detailed error information.

See Also

   @{" fclose() " Link "fclose()"} , @{" fdopen() " Link "fdopen()"} , @{" fgetc() " Link "fgetc()"} , @{" fgets() " Link "fgets()"} ,
   @{" fputc() " Link "fputc()"} , @{" fputs() " Link "fputs()"} , @{" fread() " Link "fread()"} , @{" freopen() " Link "freopen()"} ,
   @{" fwrite() " Link "fwrite()"} , @{" open() " Link "open()"}
@EndNode
@Node "fprintf()"
fprintf()-Formatted print

Synopsis

   #include <stdio.h>

   length = fprintf(fp,fmt,arg1,arg2,...);

   int length;           /* number of characters generated */
   FILE *fp;             /* file pointer */
   const char *fmt;      /* format string */
   <type>  *arg<n>;      /* arguments */

Portability

 

Returns

   This function returns the number of output characters generated.  If an
   error occurs, fprintf() returns a negative value and places additional
   information in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" fscanf() " Link "fscanf()"} , @{" _OSERR " Link "_OSERR"} , @{" printf() " Link "printf()"} ,
   @{" scanf() " Link "scanf()"} , @{" sprintf() " Link "sprintf()"} , @{" sscanf() " Link "sscanf()"} ,
   @{" Formatted Input Specifiers " Link "Formatted Input Specifiers"} , @{" Formatted Output Specifiers " Link "Formatted Output Specifiers"}
@EndNode
@Node "fputc()"
fputc()-Put a character to a level 2 file

Synopsis

   #include <stdio.h>

   r = fputc(c,fp);

   int r;      /* EOF or c */
   int c;      /* character to be output */
   FILE *fp;   /* level 2 file pointer */

Portability

 

Returns

   If successful, this function returns the character c; otherwise, it
   returns EOF.  For disk files, an EOF return usually means that the disk
   is full.  However, this type of return can also occur if the device is
   write-protected or if a write error occurs.  In any case, additional
   error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" fopen() " Link "fopen()"} , @{" fputchar() " Link "fputchar()"} , @{" _OSERR " Link "_OSERR"} ,
   @{" putc() " Link "putc()"} , @{" putchar() " Link "putchar()"}
@EndNode
@Node "fputs()"
fputs()-Put string to level 2 file

Synopsis

   #include <stdio.h>

   error = fputs(s,fp);

   int error;        /* non-zero if error */
   const char *s;    /* string pointer */
   FILE *fp;         /* file pointer */

Portability

 

Returns

   If an error occurs, the return value is EOF; otherwise, it is 0.
   Additional error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" ferror() " Link "ferror()"} , @{" fopen() " Link "fopen()"} , @{" fputc() " Link "fputc()"}
   @{" _OSERR " Link "_OSERR"} , @{" puts() " Link "puts()"}
@EndNode
@Node "fread()"
fread()-read and write blocks

Synopsis

   #include <stdio.h>

   a = fread(b,bsize,n,fp);

   size_t a;      /* actual number of blocks */
   void *b;       /* pointer to first block */
   size_t bsize;  /* size of block in bytes */
   size_t n;      /* maximum number of blocks */
   FILE *fp;      /* file pointer */

Portability

 

Returns

   This function returns the number of complete blocks that were read.

See Also

   @{" fopen() " Link "fopen()"} , @{" fclose() " Link "fclose()"} , @{" ferror() " Link "ferror()"} , @{" feof() " Link "feof()"} ,
   @{" fgetc() " Link "fgetc()"} , @{" fputc() " Link "fputc()"} , @{" fseek() " Link "fseek()"} , @{" fwrite() " Link "fwrite()"}
@EndNode
@Node "free()"
free()-free memory

Synopsis

   #include <stdlib.h>

   void free(b);

   void *b;   /* block pointer */

Portability

 

See Also

   @{" calloc() " Link "calloc()"} , @{" getmem() " Link "getmem()"} , @{" malloc() " Link "malloc()"} , @{" rbrk() " Link "rbrk()"} ,
   @{" realloc() " Link "realloc()"} , @{" rlsmem() " Link "rlsmem()"} , @{" sbrk() " Link "sbrk()"}
@EndNode
@Node "difftime()"
difftime()-Compute the difference of two times

Synopsis

   #include <time.h>

   x = difftime(time2,time1);

   double x;
   time_t time1, time2;

Portability

 

Returns

   difftime() returns the difference between two times, in seconds.

See Also

   @{" time() " Link "time()"}
@EndNode
@Node "div()"
div()-Compute quotient and remainder

Synopsis

   #include <stdlib.h>

   x = div(y, z);

   div_t x;     /* quotient and remainder */
   int y;       /* numerator              */
   int z;       /* denominator            */

Portability

 

Returns

   div() returns a structure of type div_t, which contains both the
   quotient and remainder.

   The return value is such that

      numer = quot * denom + rem

   The sign of rem is the same as the sign of numer.

See Also

   @{" ldiv() " Link "ldiv()"}
@EndNode
@Node "exit()"
exit()-Terminate program execution

Synopsis

   #include <stdlib.h>

   void exit(code);

   int code;

Portability

 

See Also

   @{" longjmp() " Link "longjmp()"}
@EndNode
@Node "exp()"
exp()-exponential function

Synopsis

   #include <math.h>

   r = exp(x);

   double r, x;

Portability

 

Returns

   This function returns a double containing the calculated exponential.

See Also

   @{" log() " Link "log()"}, @{" __matherr() " Link "__matherr()"}
@EndNode
@Node "fabs()"
fabs()-Float/double absolute value

Synopsis

   #include <math.h>

   ad = fabs(d);

   double ad,d;

Portability

 

Returns

   This function returns a double containing the absolute value of the
   argument.

See Also

   @{" abs() " Link "abs()"} , @{" iabs() " Link "iabs()"} , @{" labs() " Link "labs()"}
@EndNode
@Node "fclose()"
fclose()-close a level 2 file

Synopsis

   #include <stdio.h>

   ret = fclose(fp);

   int ret;   /* return code */
   FILE *fp;  /* file pointer for file to be closed */

Portability

 

Returns

   If successful, fclose() returns 0.  This function returns EOF to
   indicate an error.  If EOF is returned, additional error information
   can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" fopen() " Link "fopen()"} , @{" open() " Link "open()"} , @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "feof()"
feof()-Check for level 2 end-of-file

Synopsis

   #include <stdio.h>

   ret = feof(fp);

   int ret;   /* non-zero if condition is true */
   FILE *fp;  /* file pointer */

Portability

 

Returns

   This function returns non-zero value if the specified file pointer is
   at end-of-file.  If not, this function returns a 0.

See Also

   @{" ferror() " Link "ferror()"}
@EndNOde
@Node "ferror()"
ferror()-Check for level 2 error

Synopsis

   #include <stdio.h>

   ret = ferror(fp);

   int ret;   /* non-zero if condition is true */
   FILE *fp;  /* file pointer */

Portability

 

Returns

   The return value is 0 if no error has been set.  If an error indicator
   was set, a non-zero value is returned.

See Also

   @{" clearerr() " Link "clearerr()"} , @{" feof() " Link "feof()"}
@EndNode
@Node "fflush()"
fflush()-Flush level 2 output buffer

Synopsis

   #include <stdio.h>

   ret = fflush(fp);

   int ret;    /* return code */
   FILE *fp;   /* file pointer */

Portability

 

Returns

   If an error occurs, the return value is EOF.  The appropriate error
   code is placed into @{" errno " Link "errno"}, and additional information
   is placed in @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" fclose() " Link "fclose()"} , @{" fcloseall() " Link "fcloseall()"} , @{" flushall() " Link "flushall()"} ,
   @{" fopen() " Link "fopen()"} , @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "fgetpos()"
fgetpos()-Get the current file position

Synopsis

   #include <stdio.h>

   x = fgetpos(f, pos);

   int x;
   FILE *f;
   fpos_t *pos;

Portability

 

Returns

   If successful, fgetpos() returns 0.  If it fails, fgetpos() returns a
   nonzero value and stores an appropriate error code in @{" errno " Link "errno"}.
   See the description of @{" errno " Link "errno"} in Chapter 6 of the library
   reference for the list of possible values.

See Also

   @{" fseek() " Link "fseek()"}, @{" fsetpos() " Link "fsetpos()"}, @{" ftell() " Link "ftell()"} , @{" lseek() " Link "lseek()"}
@EndNode
@Node "fgetc()"
fgetc()-Get a character from a file

Synopsis

   #include <stdio.h>

   c = fgetc(fp);

   int c;      /* return character or code */
   FILE *fp;   /* file pointer */

Portability

 

Returns

   If successful, the next input character is returned.  Otherwise, the
   function returns EOF, which is defined in <stdio.h>.  In the event of
   an EOF return, error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.

See Also

   @{" errno " Link "errno"} , @{" fgetchar() " Link "fgetchar()"} , @{" fputc() " Link "fputc()"} , @{" getc() " Link "getc()"} ,
   @{" getch() " Link "getch()"} , @{" getchar() " Link "getchar()"} , @{" fopen() " Link "fopen()"} , @{" ungetc() " Link "ungetc()"} ,
   @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "abort()"
abort()-abort the current process

Synopsis

   #include <stdlib.h>

   void abort(void);

Portability

 

See Also

   @{" exit() " Link "exit()"} , @{" __exit() " Link "__exit()"} , @{" raise() " Link "raise()"} , @{" _XCEXIT() " Link "_XCEXIT()"}
@EndNode
@Node "abs()"
abs()-absolute value

Synopsis

   #include <stdlib.h>

   ax = abs(x);

   type  x;
   type ax;

Portability

 

Returns

   The return value is the absolute value of the argument.

See Also

   @{" fabs() " Link "fabs()"} , @{" iabs() " Link "iabs()"} , @{" labs() " Link "labs()"}
@EndNode
@Node "acos()"
acos()-Arccosine function

Synopsis

   #include <math.h>

   r = acos(x);

   double r;  /* result */
   double x;  /* angle */

Portability

 

Returns

   This function returns the arccosine of the angle expressed in radians.

See Also

   @{" __matherr() " Link "__matherr()"}, @{" cos() " Link "cos()"}
@EndNode
@Node "asctime()"
asctime()-Generate ASCII time string

Synopsis

   #include <time.h>

   s = asctime(t);

   char *s;                /*points to time string    */
   const struct tm *t;     /*points to time structure */

Portability

 

Returns

   This function returns an ASCII string of exactly
   26 characters having the form:

      "DDD MMM dd hh:mm:ss YYYY\n\0"

   DDD is the day of the week,

   MMM is the month,

   dd is the day of the month,

   hh:mm:ss is the hour:minute:seconds, and

   YYYY is the year.  An example is:

      "Wed Sep 04 15:13:22 1985\n\0"

   The time pointer returned by the function refers to a static data area
   that is shared by both @{" ctime() " Link "ctime()"} and asctime.

See Also

   @{" ctime() " Link "ctime()"}, @{" gmtime() " Link "gmtime()"}, @{" localtime() " Link "localtime()"}, @{" strftime() " Link "strftime()"}
@EndNode
@Node "asin()"
asin()-Arcsine function

Synopsis

   #include <math.h>

   r = asin(x);

   double r;    /* result */
   double x;    /* angle  */

Portability

 

Returns

   This function returns the arcsine of the argument expressed in radians.

See Also

   @{" __matherr() " Link "__matherr()"} , @{" sin() " Link "sin()"}
@EndNode
@Node "assert()"
assert()-assert program validity

Synopsis

   #include <assert.h>

   assert(x);
   __assert(x,file,line);

   int x;
   const char *file;   /* source file name */
   int *line;          /* source line number */

Portability

 

See Also

   @{" stcsma() " Link "stcsma()"} , @{" stcpma() " Link "stcpma()"} , @{" stcpm() " Link "stcpm()"}
@EndNode
@Node "atan()"
atan()-Arctangent function

Synopsis

   #include <math.h>

   r = atan(x);

   double r;    /* result */
   double x;    /* angle */

Portability

 

Returns

   This function returns the arctangent of the argument expressed in
   radians.

See Also

   @{" atan2() " Link "atan2()"} , @{" __matherr() " Link "__matherr()"} , @{" tan() " Link "tan()"}
@EndNode
@Node "atan2()"
atan2()-Arctangent of x/y

Synopsis

   #include <math.h>

   r = atan2(x,y);

   double r;   /* result; */
   double x,y; /* angle */

Portability

 

Returns

   This function returns the arctangent of the argument expressed in
   radians.

See Also

   @{" atan() " Link "atan()"} , @{" __matherr() " Link "__matherr()"} , @{" tan() " Link "tan()"}
@EndNode
@Node "atexit()"
atexit()-Set an exit trap

Synopsis

   #include <stdlib.h>

   error = atexit(func);

   int error;             /* non-zero for success */
   void (*func)(void);    /* trap function pointer */

Portability

 

Returns

   A zero is returned for success and a non-zero value is returned if an
   error is encountered.

See Also

   @{" exit() " Link "exit()"}
@EndNode
@Node "atof()"
atof()-Convert ASCII to float

Synopsis

   #include <stdlib.h>

   d = atof(p);

   double d;        /* floating point result */
   const char *p;   /* input string pointer */

Portability

 

Returns

   This function returns the double equivalent of the ASCII string.

See Also

   @{" atoi() " Link "atoi()"} , @{" atol() " Link "atol()"} , @{" stcd_i() " Link "stcd_i()"} , @{" stcd_l() " Link "stcd_l()"} ,
   @{" strtod() " Link "strtod()"}
@EndNode
@Node "atoi()"
atoi()-Convert ASCII to integer

Synopsis

   #include <stdlib.h>

   x = atoi(s);

   int x;
   const char *s;

Portability

 

Returns

   This function returns the integer equivalent of the ASCII string.

See Also

   @{" atol() " Link "atol()"} , @{" atof() " Link "atof()"} , @{" stcd_i() " Link "stcd_i()"} , @{" stcd_l() " Link "stcd_l()"} ,
   @{" strtod() " Link "strtod()"} , @{" strtol() " Link "strtol()"}
@EndNode
@Node "atol()"
atol()-Convert ASCII to long integer

Synopsis

   #include <stdlib.h>

   y = atol(s);

   long int y;
   const char *s;

Portability

 

Returns

   This function returns the long integer equivalent of the ASCII string.

See Also

   @{" atoi() " Link "atoi()"} , @{" atof() " Link "atof()"} , @{" stcd_i() " Link "stcd_i()"} , @{" stcd_l() " Link "stcd_l()"} , @{" strtod() " Link "strtod()"} ,
   @{" strtol() " Link "strtol()"}
@EndNode
@Node "bsearch()"
bsearch()-Perform a binary search

Synopsis

   #include <stdlib.h>

   void *bsearch(srch, array, n, size,cmp);

   const void *srch;      /* object searched for            */
   const void *array;       /* pointer to array to search     */
   size_t n;              /* number of members of array     */
   size_t size;           /* size of each element           */
   int (*cmp)(const void *, const void *));
                          /* pointer to comparison function */

Portability

 

Returns

   bsearch() returns a pointer to the element that matches the search
   value.  If no match can be found, NULL is returned.

See Also

   @{" qsort() " Link "qsort()"}
@EndNode
@Node "calloc()"
calloc()-Allocate level 3 memory allocation

Synopsis

   #include <stdlib.h>

   b = calloc(nelt,esize);

   void *b;       /* block pointer      */
   size_t nelt;   /* number of elements */
   size_t esize;  /* element size       */

Portability

 

Returns

   A null pointer is returned if there is not enough space for the
   requested block.

See Also

   @{" getmem() " Link "getmem()"} , @{" rlsmem() " Link "rlsmem()"} , @{" sbrk() " Link "sbrk()"} , @{" rbrk() " Link "rbrk()"} ,
   @{" malloc() " Link "malloc()"} ,@{" realloc() " Link "realloc()"} ,@{" free() " Link "free()"}
@EndNode
@Node "ceil()"
ceil()-Get floating point limits

Synopsis

   #include <math.h>

   x = ceil(y);

   double x,y;

Portability

 

Returns

   The result is a real number.

See Also

   @{" floor() " Link "floor()"}
@EndNode
@Node "clearerr()"
clearerr()-Clear level 2 I/O error flag

Synopsis

   #include <stdio.h>

   void clearerr(fp);

   FILE *fp;        /* file pointer */

Portability

 

See Also

   @{" clrerr() " Link "clrerr()"} , @{" ferror() " Link "ferror()"}
@EndNode
@Node "clock()"
clock()-Measure program processor time

Synopsis

   #include <time.h>

   x = clock(void);

   clock_t x;

Portability

 

Returns

   clock() returns the number of seconds since the base time.  If an
   accurate value cannot be returned, (clock_t)-1 is returned.

See Also

   @{" time() " Link "time()"} , @{" system() " Link "system()"}
@EndNode
@Node "cos()"
cos()-cosine function

Synopsis

   #include <math.h>

   r = cos(x);

   double r;  /* result */
   double x;  /* angle */

Portability

 

Returns

   This function returns the cosine of the argument.

See Also

   @{" __matherr() " Link "__matherr()"}
@EndNode
@Node "cosh()"
cosh()-Hyperbolic cosine function

Synopsis

   #include <math.h>

   r = cosh(x);

   double r;   /* result */
   double x;   /* angle */

Portability

 

Returns

   This function returns the hyperbolic cosine of the argument expressed
   in radians.

See Also

   @{" exp() " Link "exp()"} , @{" __matherr() " Link "__matherr()"}
@EndNode
@Node "ctime()"
ctime()-Convert time value to string

Synopsis

   #include <time.h>

   s = ctime(t);

   char *s;          /* points to time string */
   const time_t *t;  /* points to time value  */

Portability

 

Returns

   This function returns an ASCII string of exactly
   26 characters having the form:

      "DDD MMM dd hh:mm:ss YYYY\n\0"

   DDD is the day of the week,

   MMM is the month,

   dd is the day of the month,

   hh:mm:ss is the hour:minute:seconds, and

   YYYY is the year.  An example is:


      "Wed Sep 04 15:13:22 1985\n\0"

   The time pointer returned by the function refers to a static data area
   that is shared by both ctime() and @{" asctime() " Link "asctime()"}.

See Also

   @{" asctime() " Link "asctime()"} , @{" gmtime() " Link "gmtime()"} , @{" localtime() " Link "localtime()"} , @{" strftime() " Link "strftime()"} ,
   @{" time() " Link "time()"}
@EndNode
@Node "ungetc()"
ungetc()-Push input character back

Synopsis

   #include <stdio.h>

   r = ungetc(c, fp);

   int r;      /* return character or code */
   int c;      /* character to be pushed back */
   FILE *fp;   /* file pointer */

Portability

 

Returns

   Normally, ungetc() returns the character that was pushed back.
   However, if the end-of-file has been reached or if no characters have
   been read yet, the value EOF is returned.

See Also

   @{" getc() " Link "getc()"}
@EndNode
@Node "va_arg()"
va_arg()-access an argument from a varying-length argument list

Synopsis

   #include <stdarg.h>

   (arg_type) va_arg(va_list ap, arg_type);

Portability

 

Returns

   This macro returns the value of the next argument in the list.  The
   type is always the same as the second argument to va_arg().

See Also

   @{" va_start() " Link "va_start()"} , @{" va_end() " Link "va_end()"}
@EndNode
@Node "va_end()"
va_end()-End varying-length argument list processing

Synopsis

   #include <stdarg.h>

   void va_end(va_list ap);

Portability

 

See Also

   @{" va_start() " Link "va_start()"} , @{" va_arg() " Link "va_arg()"}
@EndNode
@Node "va_start()"
va_start()-Begin varying-length argument list processing

Synopsis

   #include <stdarg.h>

   void va_start(va_list ap, arg_name);

Portability

 

See Also

   @{" va_arg() " Link "va_arg()"} , @{" va_end() " Link "va_end()"}
@EndNode
@Node "vfprintf()"
vfprintf()-Varargs formatted write to a file

Synopsis

   #include <stdio.h>
   #include <stdarg.h>

   n = vfprintf(fp, ctl, args);

   int n;            /* number of characters written         */
                     /*   or -1 for error                    */
   FILE *fp;         /* file to be written to                */
   const char *ctl;  /* control string specifying formatting */
   va_list args;     /* items to be formatted                */

Portability

 

Returns

   This function returns the number of characters written or, in the case
   of an error, a -1.

See Also

   @{" fprintf() " Link "fprintf()"} , @{" printf() " Link "printf()"} , @{" sprintf() " Link "sprintf()"} , @{" Formatted Output Specifiers " Link "Formatted Output Specifiers"}
@EndNode
@Node "vprintf()"
vprintf()-Varargs formatted write to standard output

Synopsis

   #include <stdio.h>
   #include <stdarg.h>

   x = vprintf(ctl, args);

   int x;            /* number of characters written         */
                     /*   or -1 for error                    */
   const char *ctl;  /* control string specifying formatting */
   va_list args;     /* items to be formatted                */

Portability

 

Returns

   This function returns the number of characters written or, in the case
   of an error, a -1.

See Also

   @{" fprintf() " Link "fprintf()"} , @{" printf() " Link "printf()"} , @{" sprintf() " Link "sprintf()"} , @{" Formatted Output Specifiers " Link "Formatted Output Specifiers"}
@EndNode
@Node "vsprintf()"
vsprintf()-Varargs formatted write to string

Synopsis

   #include <stdio.h>
   #include <stdarg.h>

   x = vsprintf(buf, ctl, args);

   int x;            /* number of characters placed in the   */
                     /*   output buffer                      */
   char *buf;        /* String for resulting image           */
   const char *ctl;  /* control string specifying formatting */
   va_list args;     /* items to be formatted                */

Portability

 

Returns

   This function returns the number of characters placed in the output
   buffer (excluding the terminating null byte).

See Also

   @{" fprintf() " Link "fprintf()"} , @{" printf() " Link "printf()"} , @{" sprintf() " Link "sprintf()"} , @{" Formatted Output Specifiers " Link "Formatted Output Specifiers"}
@EndNode
@Node "wcstombs()"
wcstombs()-Convert a wide-character string to a multibyte string

Synopsis

   #include <stdlib.h>

   length = wcstombs(s, pwcs, n);

   size_t length;          /* length or state information */
   char *s;                /* pointer to characters */
   const wchar_t *pwcs;    /* pointer to wide-character string */
   size_t n;               /* maximum number of characters to look at */

Portability

 

See Also

   @{" wctomb() " Link "wctomb()"} , @{" mblen() " Link "mblen()"}
@EndNode
@Node "wctomb()"
wctomb()-Map wide character to multibyte character

Synopsis

   #include <stdlib.h>

   length = wctomb(s, wc);

   int length;    /* length or state information */
   char *s;       /* pointer to characters or NULL */
   wchar_t wc;    /* wide character */

Portability

 

See Also

   @{" wcstombs() " Link "wcstombs()"} , @{" mblen() " Link "mblen()"}
@EndNode
@Node "Formatted Input Specifiers"
 

   Specifier       Meaning
   ---------       -------
   d,i             signed integer
   o               octal unsigned integer
   u               unsigned integer
   x               hexadecimal unsigned integer
   e,f,g           floating point
   s               any string of non-whitespace characters
   [               any non-empty sequence of characters from specified set;
                   can optionally include leading ^ to specify NOT in set
   c               any character
   p               pointer value
   n               number of characters read from input
   %               exact match for percent (%) character

NOTE:   Input whitespace characters are skipped, unless the specification
        contains a [, c, or n specifier.

See Also

   @{" fscanf() " Link "fscanf()"} , @{" scanf() " Link "scanf()"} , @{" sscanf() " Link "sscanf()"}
@EndNode
@Node "Formatted Output Specifiers"
 

   Specifier       Meaning
   ---------       -------
   d,i             'int' argument is converted to a signed decimal string
   o               'unsigned int' argument is converted to octal string
   u               'unsigned int' argument is converted to decimal string
   x               'unsigned int' argument is converted to lowercase
                   hexadecimal string
   X               'unsigned int' argument is converted to uppercase
                   hexadecimal string
   f               'double' argument is converted to a decimal string
   e,E,g,G         'double' argument is converted to a decimal string using
                   scientific notation
   c               'int' argument is converted to an unsigned char
   s               argument is a pointer to a NULL terminated array of
                   character type (C-style string)
   p               argument is printed as a pointer, using lowercase
                   hexadecimal characters
   P               argument is printed as a pointer, using uppercase
                   hexadecimal characters
   n               argument is a pointer to an integer into which will be
                   written the number of characters output so far
   %               a percent sign (%) will be written

See Also

   @{" fprintf() " Link "fprintf()"} , @{" printf() " Link "printf()"} , @{" sprintf() " Link "sprintf()"} , @{" vfprintf() " Link "vfprintf()"}
   @{" vprintf() " Link "vprintf()"} , @{" vsprintf() " Link "vsprintf()"}
@EndNode
@Node "Glossary"
 
@{" SAS/C " Link "Glossary - SASC"}
@{" UNIX  " Link "Glossary - UNIX"}
@{" XENIX " Link "Glossary - XENIX"}
@EndNode
@Node "Glossary - ANSI"
American National Standards Institute.  Functions with this portability
 
X3J11/90-013.
@EndNode
@Node "strncat()"
strncat()-Concatenate strings, length limited

Synopsis

   #include <string.h>

   p = strncat(to,from,n);

   char *p;           /* same as destination string pointer */
   char *to;          /* destination string pointer */
   const char *from;  /* source string pointer */
   size_t n;          /* maximum source length */

Portability

 

Returns

   This function returns a pointer that is the same as the first argument.

See Also

   @{" stpcpy() " Link "stpcpy()"} , @{" strcat() " Link "strcat()"}
@EndNode
@Node "strncmp()"
strncmp()-Compare strings, length-limited

Synopsis

   #include <string.h>

   x = strncmp(a,b,n);

   int x;               /* comparison result */
   const char *a,*b;    /* strings being compared */
   size_t n;

Portability

 

Returns

   This function returns a 0 if both strings are equal.  If s1 is
   logically less than s2, the return value is less than 0.  If s1 is
   logically greater than s2, the return value is greater than 0.

See Also

   @{" strcmp() " Link "strcmp()"} , @{" strcmpi() " Link "strcmpi()"} , @{" stricmp() " Link "stricmp()"} , @{" strnicmp() " Link "strnicmp()"}
@EndNode
@Node "strncpy()"
strncpy()-Copy string, length-limited

Synopsis

   #include <string.h>

   p = strncpy(to,from,n);

   char *p;           /* same as destination pointer */
   char *to;          /* destination pointer */
   const char *from;  /* source pointer */
   size_t n;          /* maximum source length */

Portability

 

Returns

   This function returns a pointer that is the same as the destination
   pointer.

See Also

   @{" stccpy() " Link "stccpy()"} , @{" stpcpy() " Link "stpcpy()"} , @{" strcpy() " Link "strcpy()"}
@EndNode
@Node "strpbrk()"
strpbrk()-Find break character in string

Synopsis

   #include <string.h>

   p = strpbrk(s,b);

   char *p;        /* points to break character in s */
   const char *s;  /* string to be scanned */
   const char *b;  /* break characters */

Portability

 

Returns

   If no character from b is found in s, a null pointer is returned.
   Otherwise, p is a pointer to the first break character.

See Also

   @{" stpbrk() " Link "stpbrk()"} , @{" strspn() " Link "strspn()"} , @{" strcspn()  " Link "strcspn()"}
@EndNode
@Node "strrchr()"
strrchr()-Locate the last occurrence of a character in a string

Synopsis

   #include <string.h>

   p = strrchr(s,c);

   char *p;        /* updated string pointer */
   const char *s;  /* input string pointer */
   int c;          /* character to be located */

Portability

 

See Also

   @{" stpchr() " Link "stpchr()"} , @{" stpchrn() " Link "stpchrn()"} , @{" strchr() " Link "strchr()"}
@EndNode
@Node "strspn()"
strspn()-Measure span of characters in set

Synopsis

   #include <string.h>

   length = strspn(s,b);

   size_t length;     /* span length in bytes */
   const char *s;     /* points to string being scanned */
   const char *b;     /* points to character set string  */

Portability

 

See Also

   @{" stcis() " Link "stcis()"} , @{" stcisn() " Link "stcisn()"} , @{" strcspn() " Link "strcspn()"}
@EndNode
@Node "strstr()"
strstr()-Locate a substring inside of a string

Synopsis

   #include <string.h>

   p = strstr(s1, s2);

   char *p;         /* pointer to substring in string.*/
   const char *s1;  /* string to search in.           */
   const char *s2;  /* substring to search for.       */

Portability

 

Returns

   This function returns a pointer to substring s2 within s1.  If it
   cannot find the substring, it returns a null pointer.

See Also

   @{" strrchr() " Link "strrchr()"} , @{" strchr() " Link "strchr()"} , @{" strmid() " Link "strmid()"}
@EndNode
@Node "strtod()"
strtod()-Convert string to double

Synopsis

   #include <stdlib.h>

   d = strtod(nptr, endptr);

   double d;                 /* converted number         */
   const char *nptr;         /* string to convert        */
   char **endptr;            /* pointer to end of string */

Portability

 

Returns

   This function returns the converted double.  If it is unable to perform
   conversion on the input source string, it returns a value of 0.  For
   values too large or too small to fit in a double, it returns a value
   than is plus or minus HUGE_VAL and sets @{" errno " Link "errno"} to ERANGE.  In the case
   of an underflow, it returns zero, and @{" errno " Link "errno"} is set to ERANGE.

See Also

   @{" errno " Link "errno"} , @{" scanf() " Link "scanf()"}
@EndNode
@Node "strtok()"
strtok()-Get a token

Synopsis

   #include <string.h>

   t = strtok(s,b);

   char *t;        /* token pointer */
   char *s;        /* input string pointer or NULL */
   const char *b;  /* break character string pointer */

Portability

 

Returns

   A null pointer is returned when there are no more tokens.

See Also

   @{" stptok() " Link "stptok()"} , @{" strcspn() " Link "strcspn()"} , @{" strspn() " Link "strspn()"}
@EndNode
@Node "strtol()"
strtol()-Convert string to long integer

Synopsis

   #include <stdlib.h>

   r = strtol(p,np,base);

   long int r;           /* result */
   const char *p;        /* string pointer */
   char **np;            /* returns updated string pointer */
   int base;             /* conversion base */

Portability

 

Returns

   This function returns the converted value.  If it cannot do the
   conversion, it returns a zero.  If the converted value would have been
   too large or small to fit in a long, it returns LONG_MAX or LONG_MIN
   and sets @{" errno " Link "errno"} to ERANGE.

See Also

   @{" errno " Link "errno"}, @{" strtoul() " Link "strtoul()"}
@EndNode
@Node "strtoul()"
strtoul()-Convert string to unsigned long integer

Synopsis

   #include <stdlib.h>

   r = strtoul(p,np,base);

   unsigned long int r;    /* result */
   const char *p;          /* string pointer   */
   char **np;              /* returns updated string pointer */
   int base;               /* conversion base */

Portability

 

Returns

   This function returns the converted value.  If it cannot do the
   conversion, it returns a zero.  If the converted value would have been
   too large to fit in an unsigned long, it returns ULONG_MAX and sets
   @{" errno " Link "errno"} to ERANGE.

See Also

   @{" errno " Link "errno"}, @{" strtol() " Link "strtol()"}
@EndNode
@Node "strxfrm()"
strxfrm()-Transform a string

Synopsis

   #include <string.h>

   len = strxfrm(s1, s2, n);

   size_t len;         /* length of transformed string         */
   char *s1;           /* pointer to transformed string        */
   const char *s2;     /* string to transform                  */
   size_t n;           /* max() characters in transformed string */

Portability

 

Returns

   This function returns the length of the transformed string (excluding
   the null termination character).  If a value is greater than n, then
   the transformation could not fit in the output array, and the contents
   of the output array is indeterminate.

See Also

   @{" setlocale() " Link "setlocale()"} , @{" strcoll() " Link "strcoll()"}
@EndNode
@Node "_STRICT_ANSI"
 

Synopsis

   #define _STRICT_ANSI

Portibility

   @{" SAS/C " Link "Glossary - SASC"}

Description

 
 
   an underscore followed by a capital letter, or an underscore followed
   by another underscore.

   Defining this symbol will prevent the definition of any symbols from
 
   standard.
@EndNode
@Node "system()"
system()-Call system command processor

Synopsis

   #include <stdlib.h>

   error = system(cmd);

   int error;        /* non-zero if error */
   const char *cmd;  /* command string  */

Portability

 

Returns

   If the command processor cannot be invoked, a value of -1 is returned,
   and additional error information can be found in @{" errno " Link "errno"} and @{" _OSERR " Link "_OSERR"}.
   Otherwise, the function returns the value passed back by the command
   processor.

See Also

   @{" errno " Link "errno"} , @{" _OSERR " Link "_OSERR"}
@EndNode
@Node "tan()"
tan()-tangent function

Synopsis

   #include <math.h>

   r = tan(x);

   double r;  /* result */
   double x;  /* angle */

Portability

 

See Also

   @{" __matherr() " Link "__matherr()"}
@EndNode
@Node "tanh()"
tanh()-Hyperbolic tangent function

Synopsis

   #include <math.h>

   r = tanh(x);

   double r;    /* result */
   double x;    /* angle */

Portability

 

See Also

   @{" __matherr() " Link "__matherr()"}
@EndNode
@Node "time()"
time()-Get system time in seconds

Synopsis

   #include <time.h>

   timeval = time(timeptr);

   time_t timeval;   /* time value */
   time_t *timeptr;  /* pointer to time value storage */

Portability

 

See Also

   @{" asctime() " Link "asctime()"} , @{" ctime() " Link "ctime()"} , @{" gmtime() " Link "gmtime()"} , @{" localtime() " Link "localtime()"} ,
   @{" __tzset() " Link "__tzset()"}
@EndNode
@Node "tmpfile()"
tmpfile()-open a temporary file stream

Synopsis

   #include <stdio.h>

   fp = tmpfile(void);

   FILE *fp;      /* pointer to temporary file stream */

Portability

 

Returns

   This function returns a file handle for a file that can be read or
   written.  When this file is closed, it is automatically deleted.

See Also

   @{" open() " Link "open()"} , @{" close() " Link "close()"} , @{" tmpnam() " Link "tmpnam()"}
@EndNode
@Node "tmpnam()"
tmpnam()-create a temporary file name

Synopsis

   #include <stdio.h>

   name = tmpnam(b);

   char *name;  /* pointer to temporary file name */
   char *b;     /* pointer to name buffer or NULL */

Portability

 

Returns

   This function returns a pointer to a temporary file name.

See Also

   @{" tmpfile() " Link "tmpfile()"}
@EndNode
@Node "tolower()"
tolower()-Convert character to lowercase

Synopsis

   #include <ctype.h>

   cc = tolower(c);

   int cc;  /* converted character */
   int c;   /* character to convert */

Portability

 

See Also

   @{" __ctype " Link "__ctype"} , @{" islower() " Link "islower()"} , @{" strlwr() " Link "strlwr()"}
@EndNode
@Node "toupper()"
toupper()-Convert character to uppercase

Synopsis

   #include <ctype.h>

   cc = toupper(c);

   int cc;  /* converted character */
   int c;   /* character to convert */

Portability

 

See Also

   @{" __ctype " Link "__ctype"} , @{" isupper() " Link "isupper()"} , @{" strupr() " Link "strupr()"}
@EndNode
@Node "setbuf()"
setbuf()-Set buffer mode for a level 2 file

Synopsis

   #include <stdio.h>

   void setbuf(fp,buff);

   FILE *fp;           /*  file pointer */
   const char *buff;   /*  buffer pointer */

Portability

 

See Also

   @{" fopen() " Link "fopen()"} , @{" setnbf() " Link "setnbf()"} , @{" setvbuf() " Link "setvbuf()"}
@EndNode
@Node "setjmp()"
setjmp()-Set long jump parameters

Synopsis

   #include <setjmp.h>

   ret = setjmp(save);

   int ret;          /* return code */
   jmp_buf save;     /* address of save area */

Portability

 

Returns

   A return code of 0 indicates that this is the initial call to save the
   stack.  A non-zero return code indicates that @{" longjmp() " Link "longjmp()"} has been
   executed.

See Also

   @{" longjmp() " Link "longjmp()"}
@EndNode
@Node "setlocale()"
setlocale()-Set locale information for program

Synopsis

   #include <locale.h>

   ret = setlocale(category, locale);

   char *ret;           /* Pointer to the selected locale portion */
   int category;        /* Names the portion of the locale to be  */
                        /*   selected                             */
   const char *locale;  /* Identifies the type of environment     */

Portability

 

Returns

   If it finds the selected environment, this function returns a pointer
   to a string associated with the requested category.  If it cannot find
   the environment, it returns a null, and the program's locale is not
   changed.  This string is considered read-only and is valid until the
   next call to this function.

See Also

   @{" readlocale() " Link "readlocale()"} , @{" localeconv() " Link "localeconv()"}
@EndNode
@Node "setvbuf()"
setvbuf()-Set variable buffer for level 2 file

Synopsis

   #include <stdio.h>

   error = setvbuf(fp,buff,type,size);

   int error;            /*  0 if successful */
   FILE *fp;             /*  file pointer */
   const char *buff;     /*  buffer pointer */
   int type;             /*  type of buffering */
   size_t size;          /*  buffer size in bytes */

Portability

 

Returns

   This function returns a non-zero error code if type or size is invalid.

See Also

   @{" fopen() " Link "fopen()"} , @{" setbuf() " Link "setbuf()"} , @{" setnbf() " Link "setnbf()"}
@EndNode
@Node "signal()"
signal()-Establish event traps

Synopsis

   #include <signal.h>

   oldfun = signal(sig,newfun);

   void (*oldfun)(int);  /* old trap function */
   int sig;              /* signal() number */
   void (*newfun)(int);  /* new trap function */

Portability

 

Returns

   If the trap can be established, the signal() function returns a pointer
   to the previous handler function.  Otherwise, it returns SIG_ERR and
   places error information in @{" errno " Link "errno"}.
@EndNode
@Node "sin()"
sin()-sine function

Synopsis

   #include <math.h>

   r = sin(x);

   double r;   /* result */
   double x;   /* angle */

Portability

 

See Also

   @{" cos() " Link "cos()"} , @{" cosh() " Link "cosh()"} , @{" __matherr() " Link "__matherr()"} , @{" sinh() " Link "sinh()"}
@EndNode
@Node "sinh()"
sinh()-Hyperbolic sine function

Synopsis

   #include <math.h>

   r = sinh(x);

   double r;   /* result */
   double x;   /* angle */

Portability

 

See Also

   @{" cos() " Link "cos()"} , @{" cosh() " Link "cosh()"} , @{" __matherr() " Link "__matherr()"} , @{" sin() " Link "sin()"}
@EndNode
@Node "sprintf()"
sprintf()-Formatted print to a string

Synopsis

   #include <stdio.h>

   length = sprintf(s,fmt,arg1,arg2,...);

   int length;        /* number of characters generated */
   char *s;           /* pointer to a character string */
   const char *fmt;   /* format string */
   <type> arg<x>           /* arguments */

Portability

 

Returns

   This function returns the number of output characters generated.  This
   number does not include the terminating null byte.

See Also

   @{" fprintf() " Link "fprintf()"} , @{" printf() " Link "printf()"} , @{" Formatted Output Specifiers " Link "Formatted Output Specifiers"}
@EndNode
@Node "sqrt()"
sqrt()-Square root function

Synopsis

   #include <math.h>

   r = sqrt(x);

   double r, x;

Portability

 

See Also

   @{" __matherr() " Link "__matherr()"} , @{" pow() " Link "pow()"} , @{" pow2() " Link "pow2()"}
@EndNode
@Node "srand()"
srand()-Set seed for rand() function

Synopsis

   #include <stdlib.h>

   void srand(seed);

   unsigned int seed;  /* random number seed */

Portability

 

See Also

   @{" drand48() " Link "drand48()"} , @{" erand48() " Link "erand48()"} , @{" lrand48() " Link "lrand48()"} , @{" nrand48() " Link "nrand48()"} ,
   @{" jrand48() " Link "jrand48()"} , @{" rand() " Link "rand()"} , @{" srand48() " Link "srand48()"}
@EndNode
@Node "sscanf()"
sscanf()-Formatted input conversions

Synopsis

   #include <stdio.h>

   n = sscanf(ss,fmt,arg1,arg2,...);

   int n;                /*  number of input items matched, or EOF */
   const char *ss;   /*  input string (sscanf() only) */
   const char *fmt;  /*  format string */
   ---- *arg[];      /*  pointers to input data areas */

Portability

 

Returns

   This function returns the number of assignments that were made.  For
   example, a return value of three indicates that conversion results were
   assigned to arg1, arg2, and arg3.

See Also

   @{" fscanf() " Link "fscanf()"} , @{" scanf() " Link "scanf()"} , @{" Formatted Input Specifiers " Link "Formatted Input Specifiers"}
@EndNode
@Node "stpcpy()"
stpcpy()-Copy one string to another

Synopsis

   #include <string.h>

   np = stpcpy(to,from);

   char *np;           /* points to end of destination string */
   char *to;           /* destination pointer */
   const char *from;   /* source pointer */

Portability

   @{" SAS/C " Link "Glossary - SASC"}

Returns

   This function returns a pointer to the end of the destination string,
   which is useful when you are building a string up from several pieces.
 
   function returns a pointer to the null byte after the to string.

See Also

   @{" stccpy() " Link "stccpy()"} , @{" strcpy() " Link "strcpy()"} , @{" strncpy() " Link "strncpy()"}
@EndNode
@Node "strcat()"
strcat()-Concatenate strings

Synopsis

   #include <string.h>

   p = strcat(to,from);

   char *p;             /* same as destination string pointer */
   char *to;            /* destination string pointer */
   const char *from;    /* source string pointer */

Portability

 

Returns

   This function returns a pointer that is the same as the first argument.

See Also

   @{" strncat() " Link "strncat()"} , @{" stpcpy() " Link "stpcpy()"}
@EndNode
@Node "strchr()"
strchr()-Find character in string

Synopsis

   #include <string.h>

   p = strchr(s,c);

   char *p;          /* updated string pointer */
   const char *s;    /* input string pointer */
   int c;            /* character to be located */

Portability

 

Returns

   A null pointer is returned if the input string is empty or if the
   specified character is not found.  Otherwise, this function returns a
   pointer to the first matching character in s.

See Also

   @{" strchr() " Link "strchr()"} , @{" stpchrn() " Link "stpchrn()"} , @{" strrchr() " Link "strrchr()"}
@EndNode
@Node "strcmp()"
strcmp()-Compare strings

Synopsis

   #include <string.h>

   x = strcmp(a,b);

   int x;                /* comparison result */
   const char *a,*b;     /* strings being compared */

Portability

 

Returns

   The sign of the return value indicates the relative collating sequence
   of the strings, as indicated above.

See Also

   @{" strcmpi() " Link "strcmpi()"} , @{" stricmp() " Link "stricmp()"} , @{" strncmp() " Link "strncmp()"} , @{" strnicmp() " Link "strnicmp()"}
@EndNode
@Node "strcoll()"
strcoll()-Compare strings based on locale

Synopsis

   #include <string.h>

   res = strcoll(s1, s2);

   int res;                  /* result of comparison */
   const char *s1,*s2;       /* strings to compare   */

Portability

 

Returns

   This function returns a 0 if both strings are equal.  If s1 is
   logically less than s2, the return value is less than 0.  If s1 is
   logically greater than s2, the return value is greater than 0.

See Also

   @{" setlocale() " Link "setlocale()"}
@EndNode
@Node "strcpy()"
strcpy()-Copy one string to another

Synopsis

   #include <string.h>

   p = strcpy(to,from);

   char *p;            /* same as destination pointer */
   char *to;           /* destination pointer */
   const char *from;   /* source pointer */

Portability

 

Returns

   This function returns a pointer that is the same as the destination
   pointer.

See Also

   @{" stccpy() " Link "stccpy()"} , @{" stpcpy() " Link "stpcpy()"} , @{" strncpy() " Link "strncpy()"}
@EndNode
@Node "strcspn()"
strcspn()-Measure span of characters not in set

Synopsis

   #include <string.h>

   length = strcspn(s,b);

   size_t length;         /* span length in bytes */
   const char *s;      /* points to string being scanned */
   const char *b;      /* points to character set string */

Portability

 

Returns

   This function returns the number of bytes that are not in the specified
   character set.  The scan always stops when the null terminator byte is
   reached.

See Also

   @{" stcis() " Link "stcis()"} , @{" stcisn() " Link "stcisn()"} , @{" strspn() " Link "strspn()"}
@EndNode
@Node "strerror()"
strerror()-Print text for a given error number

Synopsis

   #include <string.h>

   p = strerror(error);

   char *p;             /* Pointer to text string   */
   int error;           /* Error number             */

Portability

 

Returns

   This function returns a pointer to the text of the corresponding error
   message.  If it could not find the error, it returns a null.  The
   string is valid until the next call to strerror() and must not be
   modified by the caller.

See Also

   @{" errno " Link "errno"}
@EndNode
@Node "strftime()"
strftime()-Format time string

Synopsis

   #include <time.h>

   ret = strftime(s, max()size, format, timeptr);

   size_t ret;               /* number of characters in        */
                             /*   formatted string             */
   char *s;                  /* string to place characters in  */
   size_t max()size;           /* maximum string size            */
   const char *format;       /* format instructions for string */
   const struct tm *timeptr; /* broken-down time() information   */

Portability

 

Returns

   This function returns the number of characters placed into the string
   pointed to by s, not including the terminating null character.
   Otherwise, it returns a zero, and the contents of s are indeterminate.

See Also

   @{" asctime() " Link "asctime()"} , @{" gmtime() " Link "gmtime()"} , @{" localtime() " Link "localtime()"} , @{" setlocale() " Link "setlocale()"}
@EndNode
@Node "strlen()"
strlen()-Measure length of a string

Synopsis

   #include <string.h>

   length = strlen(s);

   size_t length;   /* number of bytes in s (before null) */
   const char *s;

Portability

 

Returns

   This function returns the number of bytes in string before the
   terminating null byte.

See Also

   @{" stclen() " Link "stclen()"}
@EndNode
