Macintosh Development |
[Home]
[About Us]
[People]
[Information Systems]
[Kerberos for Macintosh]
[Applications]
[Miscellaneous Documentation]
Utilities Library API Functions |
int strcasecmp (const char *s1, const char *s2);
int strncasecmp (const char *s1, const char *s2, int n);
strcasecmp and strncasecmp compare C strings case-insensitively. strcasecmp compares the entire string and strncasecmp comparesn
characters of each string.If the strings are equal, both functions return 0. If
s1
is greater thans2
then both functions return a number greater than 0. Ifs1
is less thans2
then both functions return a number less than 0.char *strtoken (const char *s, const char *delim, int index);
strtoken allows you to break the strings
into a sequence of tokens delimited by the stringdelim
.index
is the index of the token you want (ie: ifindex
is 2, you will get the second token). Ifs
starts withdelim
, the first token will be an empty string. If there is no token at the index you provide, strtoken will return NULL.char *strdup (const char *s);
strdup duplicates a string and returns a pointer to the copy. It allocates memory for the new string usingmalloc()
, so use the MIT Support Libraryfree()
function to dispose of the duplicated string.void swab (register char *src, register char *dest, register int n);
swab is a byte manipulation function. It copiesn
bytes fromsrc
todest
, exchanging adjacent bytes.n
should be even. If it is odd, swab copies and exchangesn - 1
bytes and the disposition of the last byte is undefined.src
anddest
should not overlap.int gettimeofday (struct timeval *tp, struct timezone *tz);
int settimeofday (struct timeval *tp, struct timezone *tz);
gettimeofday returns the current time of day in Unix time. settimeofday sets the time on the Macintosh, giventp
in Unix time. Both functions properly convert between Macintosh and Unix time.Currently neither function gets or sets
tz
, the timezone structure.void mac_time_to_unix_time (time_t *time);
void unix_time_to_mac_time (time_t *time);
mac_time_to_unix_time and unix_time_to_mac_time converttime
between Mac and Unix time. (The Unix epoch is 1/1/1970, the Mac epoch is 1/1/1904.)void msl_time_to_unix_time (time_t *time);
void unix_time_to_msl_time (time_t *time);
msl_time_to_unix_time and unix_time_to_msl_time converttime
between MSL and Unix time. (The Unix epoch is 1/1/1970, the MSL epoch is 1/1/1900.)
Questions or comments? Send mail to macdev@mit.edu
Last updated on $Date: 2003/11/19 20:50:38 $
Last modified by $Author: smcguire $