DEC C
Language Reference Manual


Previous Contents Index

char *getenv(const char *name);

int *system(const char *string);

Searching and Sorting Utilities


void *bsearch(const void *key, const void *base,   
  size_t nmemb, size_t size, int (*compar) 
  (const void *, const void *)); 


void qsort(void *base, size_t nmemb, 
size_t size, int (*compar) (const void *, 
const void *)); 

Integer Arithmetic Functions

int abs(int j);

div_t div(int numer, int denom);

long int labs(long int j);

ldiv_t ldiv(long int numer, long int denom);

Multibyte Character Functions

int mblen(const char *s, size_t n);

int mbtowc(wchar_t *pwc, const char *s, size_t n);

int wctomb(char *s, wchar_t wchar);

Multibyte String Functions

size_t mbstowcs(wchar_t *pwcs, const char *s, size_t n);

size_t wcstombs(char *s, const wchar_t *pwcs, size_t n);

9.13 String Processing (<string.h>)

The <string.h> header file declares one type and several functions, and defines one macro useful for manipulating character arrays that other objects treat as character arrays.

There are two kinds of string functions declared. The first, with names beginning with str, manipulate character arrays; the second, with names beginning with mem, manipulate other objects treated as character arrays. Except for memmove, function behavior is undefined if copying takes place between overlapping objects.

Type

size_t

Macro

NULL

Functions

void *memcpy(void *s1, const void *s2, size_t n);

void *memmove(void *s1, const void *s2, size_t n);

void *memchr(const void *s, int c, size_t n);

int memcmp(const void *s1, const void *s2, size_t n);

void *memset(void *s, int c, size_t n);

char *strcpy(char *s1, const char *s2);

char *strncpy(char *s1, const char *s2, size_t n);

char *strcat(char *s1, const char *s2);

char *strncat(char *s1, const char *s2, size_t n);

int strcmp(const char *s1, const char *s2);

int strcoll(const char *s1, const char *s2);

int strncmp(const char *s1, const char *s2, size_t n);

size_t strxfrm(char *s1, const char *s2, size_t n);

char *strchr(const char *s, int c);

size_t strcspn(const char *s1, const char *s2);

char *strpbrk(const char *s1, const char *s2);

char *strrchr(const char *s, int c);

size_t strspn(const char *s1, const char *s2);

char *strstr(const char *s1, const char *s2);

char *strtok(const char *s1, char *s2);

char *strerror(int errnum);

size_t strlen(const char *s);

9.14 Date and Time (<time.h>)

The <time.h> header file defines two macros, and declares four types and several functions for manipulating time and date information. Some functions process local time, which may differ from calendar time because of time zone.

Types

size_t


clock_t 
time_t 

struct tm

Macros

NULL

CLOCKS_PER_SEC

Time Conversion Functions

char *asctime(const struct tm *timeptr);

char *ctime(const time_t *timer);

struct tm *gmtime(const time_t *timer);

struct tm *localtime(const time_t *timer);

size_t strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr);


Previous Next Contents Index