1cdk_misc(3)                Library Functions Manual                cdk_misc(3)
2
3
4

NAME

6       cdk_misc - Curses Development Kit Miscellaneous Routines
7

SYNOPSIS

9       cc [ flag ... ] file ...  -lcdk [ library ... ]
10
11       #include <cdk.h>
12
13       void Beep(void);
14
15       unsigned CDKallocStrings(
16                      char ***list/,
17                      char *item/,
18                      unsigned length/,
19                      unsigned used/);
20
21       unsigned CDKcountStrings (
22                      char **list);
23
24       void CDKfreeChtypes(
25                      chtype **list);
26
27       void CDKfreeStrings (
28                      char **list);
29
30       char ** CDKsplitString (
31                      char *string,
32                      int splitChar);
33
34       char * baseName (
35                      char *string);
36
37       int ceilCDK(   doublevalue);
38
39       int chlen (    chtype *string);
40
41       void chstrncpy(
42                      char *dest,
43                      chtype *src,
44                      int maxcount);
45
46       char *chtype2Char (
47                      chtype *string);
48
49       void cleanChar (
50                      char *string,
51                      int length,
52                      char character);
53
54       void cleanChtype (
55                      chtype *string,
56                      int length,
57                      chtype character);
58
59       int cmpStrChstr(
60                      char *str,
61                      chtype *chstr);
62
63       char *copyChar (
64                      char *string);
65
66       char **copyCharList (
67                      char **list);
68
69       chtype *copyChtype (
70                      chtype *string);
71
72       chtype **copyChtypeList (
73                      chtype **list);
74
75       char *dirName (
76                      char *filename);
77
78       int floorCDK(  double value);
79
80       void freeChar (
81                      char *string);
82
83       void freeCharList (
84                      char **list,
85                      unsigned size);
86
87       void freeChtype (
88                      chtype *string);
89
90       void freeChtypeList ("
91                      chtype **list,
92                      unsigned size);
93
94       int intlen (   int value);
95
96       int lenCharList (
97                      char **list);
98
99       int lenChtypeList (
100                      chtype **list);
101
102       int mode2Char (
103                      char *string,
104                      mode_t fileMode);
105
106       int searchList (
107                      char **list,
108                      int listSize,
109                      char *pattern);
110
111       void sortList (
112                      char **list,
113                      int length);
114

DESCRIPTION

116       These are miscellaneous functions which may be useful with the Cdk wid‐
117       get set.
118

AVAILABLE FUNCTIONS

120       Beep makes an audible beep.  The standard curses beep() does not  flush
121            the  stream,  so  it  will  only beep until a force is made.  This
122            forces a flush after issuing the beep command.
123
124       CDKallocStrings
125            Add a new string item to a list.  Keep a null pointer on  the  end
126            so one may use CDKfreeStrings() to deallocate the whole list.  The
127            caller is responsible for updating the length of  the  list.   The
128            return value is the updated number of chars used.
129
130       CDKcountStrings
131            Count  the  number of items in a null-terminated list of character
132            strings.  Return the count.
133
134       CDKfreeChtypes
135            Free a list of  chtype-strings  which  is  terminated  by  a  null
136            pointer.
137
138       CDKfreeStrings
139            Free  a  list  of  character strings which is terminated by a null
140            pointer.  Also free list itself.
141
142       CDKsplitString
143            split the string at each  occurrence  of  separator,  returning  a
144            pointer to a dynamically allocated array of the pieces.  The orig‐
145            inal string is unmodified.  The caller is responsible for  freeing
146            the result.
147
148       baseName
149            returns  a  pointer  to the first character of the filename in the
150            given pathname.  The result should be freed by the caller.
151
152       ceilCDK
153            Return an integer like the math library ceil(),  which  returns  a
154            double.
155
156       chlen
157            returns the length of the (null-terminated) string of chtype's.
158
159       chstrncpy
160            Extract  the  characters  from a null-terminated array of chtype's
161            src.  The size of the destination dest is given in maxcount.
162
163       chtype2Char
164            Extract the characters from a null-terminated  array  of  chtype's
165            string.   A  dynamically allocated string is returned.  The caller
166            is responsible for freeing the result.
167
168       cleanChar
169            is analogous to memset.  Set the characters in string to the given
170            character.   The  length  of string is given by length.  character
171            which will be written.
172
173       cleanChtype
174            is analogous to memset.  Set the chtype's in string to  the  given
175            character.  The length of string is given by length.
176
177       cmpStrChstr
178            Compare  a char string str to a chtype string chstr.  Return -1, 0
179            or 1 according to whether str is less than, equal  to  to  greater
180            than chstr.
181
182       copyChar
183            copies  the string passed in.  Unlike strdup this checks to see if
184            the string is NULL before copying.
185
186       copyCharList
187            copies the given list.
188
189       copyChtype
190            function copies the string passed in, analogous to  copyChar,  but
191            for chtype strings.
192
193       copyChtypeList
194            copies the given list.
195
196       dirName
197            Returns  the  directory  for  the  given  filename, i.e., the part
198            before the * last slash.  The return value should be freed by  the
199            caller.
200
201       floorCDK
202            Return  an integer like the math function floor(), which returns a
203            double.
204
205       freeChar
206            is a wrapper for free.  It checks to see if  the  string  is  NULL
207            before trying to free the string.
208
209       freeCharList
210            Free  the memory used by the given list of strings.  The number of
211            strings to free is given by size.
212
213       freeChtype
214            is a wrapper for free, like freeChar.
215
216       freeChtypeList
217            Free the memory used by the given list  of  chtype  strings.   The
218            number of strings to free is given by size.
219
220       intlen
221            returns  the  length of an integer, i.e., the number of characters
222            needed to represent it.
223
224       lenCharList
225            returns the length of the given list.
226
227       lenChtypeList
228            returns the length of the given list.
229
230       mode2Char
231            Given a file protection mode fileMode, store a  printable  version
232            of the permissions in string, formatted as if by "ls -l").  Return
233            the corresponding permissions data, i.e., ignoring  the  file-type
234            bits.
235
236       searchList
237            Search  the  given list of listSize strings for a subset of a word
238            pattern in the given list.  Return the index in the list if it  is
239            found, or -1 if not found.
240
241       sortList
242            performs  a  quick  sort of the given list.  This is a wrapper for
243            qsort, used to sort the list of strings.  The number of strings in
244            list  is  given  by  length.  The list is sorted alphabetically in
245            increasing order.
246

SEE ALSO

248       cdk(3), cdk_screen(3), cdk_display(3), cdk_binding(3), cdk_util(3)
249
250
251
252                                                                   cdk_misc(3)
Impressum