CHRPAKC - Strings and Characters
CHRPAKC is a (very small) collection of C routines for character
and string manipulation.
CHRPAKC is a C version of a subset of the
FORTRAN CHRPAK collection.
Files you may copy include:
The list of routines includes:
-
BYTE2INT converts 4 bytes into an unsigned integer.
-
CHAR_INDEX_LAST finds the last occurrence of a character in a string.
-
CHAR_PAD "pads" a character with a blank on either side.
-
CHRMON returns an abbreviated month name.
-
DIGTEN returns the integer value of a base 10 digit.
-
GETBITS returns N bits from an unsigned int X, beginning at position P.
-
INT2BYTE converts an unsigned integer into 4 bytes.
-
INTMAX returns the maximum of two integers.
-
INTMIN returns the smaller of two integers.
-
PRINT_SIZES reports the size in bytes of various data types.
-
REVERSE_BYTES_FLOAT reverses the four bytes in a float.
-
REVERSE_BYTES_INT reverses the four bytes in an int.
-
S_EQI reports whether two strings are equal, ignoring case.
-
STRING_CAP capitalizes all the characters in a string.
-
STRING_LOW lowercases a string.
-
SWAP_BYTES_FLOAT swaps pairs of bytes in a float.
-
SWAP_BYTES_INT swaps pairs of bytes in an int.
Back to the C software page.
Last revised on 16 November 2001.