Scroll to navigation

cdk_misc(3) Library calls cdk_misc(3)

NAME

cdk_misc - Cdk miscellaneous routines

SYNOPSIS

cc [ flag ... ] file ... -lcdk [ library ... ]

#include <cdk.h>

char ***list/,
char *item/,
unsigned length/,
unsigned used/);
CDK_CONST char **list);
chtype **list);
char **list);
const char *string,
int splitChar);
char *string);
doublevalue);
const chtype *string);
char *dest,
const chtype *src,
int maxcount);
const chtype *string);
char *string,
int length,
char character);
chtype *string,
int length,
chtype character);
const char *str,
const chtype *chstr);
const char *string);
const char **list);
const chtype *string);
const chtype **list);
char *filename);
double value);
char *string);
char **list,
unsigned size);
chtype *string);
chtype **list,
unsigned size);
int value);
const char **list);
const chtype **list);
char *string,
mode_t fileMode);
CDK_CONST char * CDK_CONST *list,
int listSize,
const char *pattern);
CDK_CONST char **list,
int length);

DESCRIPTION

These are miscellaneous functions which may be useful with the Cdk widget set.

AVAILABLE FUNCTIONS

makes an audible beep. The standard curses beep() does not flush the stream, so it will only beep until a force is made. This forces a flush after issuing the beep command.
Add a new string item to a list. Keep a null pointer on the end so one may use CDKfreeStrings() to deallocate the whole list. The caller is responsible for updating the length of the list. The return value is the updated number of chars used.
Count the number of items in a null-terminated list of character strings. Return the count.
Free a list of chtype-strings which is terminated by a null pointer.
Free a list of character strings which is terminated by a null pointer. Also free list itself.
split the string at each occurrence of separator, returning a pointer to a dynamically allocated array of the pieces. The original string is unmodified. The caller is responsible for freeing the result.
returns a pointer to the first character of the filename in the given pathname. The result should be freed by the caller.
Return an integer like the math library ceil(), which returns a double.
returns the length of the (null-terminated) string of chtype's.
Extract the characters from a null-terminated array of chtype's src. The size of the destination dest is given in maxcount.
Extract the characters from a null-terminated array of chtype's string. A dynamically allocated string is returned. The caller is responsible for freeing the result.
is analogous to memset. Set the characters in string to the given character. The length of string is given by length. character which will be written.
is analogous to memset. Set the chtype's in string to the given character. The length of string is given by length.
Compare a char string str to a chtype string chstr. Return -1, 0 or 1 according to whether str is less than, equal to to greater than chstr.
copies the string passed in. Unlike strdup this checks to see if the string is NULL before copying.
copies the given list.
function copies the string passed in, analogous to copyChar, but for chtype strings.
copies the given list.
Returns the directory for the given filename, i.e., the part before the * last slash. The return value should be freed by the caller.
Return an integer like the math function floor(), which returns a double.
is a wrapper for free. It checks to see if the string is NULL before trying to free the string.
Free the memory used by the given list of strings. The number of strings to free is given by size.
is a wrapper for free, like freeChar.
Free the memory used by the given list of chtype strings. The number of strings to free is given by size.
returns the length of an integer, i.e., the number of characters needed to represent it.
returns the length of the given list.
returns the length of the given list.
Given a file protection mode fileMode, store a printable version of the permissions in string, formatted as if by "ls -l"). Return the corresponding permissions data, i.e., ignoring the file-type bits.
Search the given list of listSize strings for a subset of a word pattern in the given list. Return the index in the list if it is found, or -1 if not found.
performs a quick sort of the given list. This is a wrapper for qsort, used to sort the list of strings. The number of strings in list is given by length. The list is sorted alphabetically in increasing order.

SEE ALSO

cdk(3), cdk_screen(3), cdk_display(3), cdk_binding(3), cdk_util(3)

2024-03-28