]> Pileus Git - ~andy/gtk/blob - docs/glib.texi
1bf23e191b5fe51789bc4db9fcfbebd8d2e6fdc8
[~andy/gtk] / docs / glib.texi
1 \input texinfo @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename glib.info
4 @settitle GLIB
5 @setchapternewpage odd
6
7 @set edition 1.0
8 @set update-date 3 Feburary 1998
9 @set update-month Feburary 1998
10 @c %**end of header
11
12 @ifinfo
13 This file documents GLIB, A library of useful routines for C programming
14
15 Copyright (C) 1998 Gregory A McLean
16
17 Permission is granted to make and distributed verbatim copies of this
18 manual, provided the copyright notice and this permission notice are
19 preserved on all copies. 
20
21 @ignore
22 Permission is granted to process this file throught TeX and print the 
23 results, provided the printed document carries copying permission notice 
24 identical to this one except for the removal of this paragraph (this 
25 paragraph not being relevant to the printed manual).
26
27 @end ignore
28 Permission is granted to copy and distribute modified versions of this
29 manual under the conditions for verbatim copying, provided that the
30 entire resulting derived work is distributed under the terms of a
31 permission notice identical to this one.
32
33 Permission is granted to copy and distribute translations of this manual
34 into another language, under the above conditions for modified versions,
35 except that this permission notice may be stated in a translation
36 approved by Gregory McLean.
37 @end ifinfo
38
39 @titlepage
40 @title GLIB, Useful routines for C programming 
41 @subtitle Version 1.0
42 @subtitle @value{update-month}
43 @author by Gregory McLean
44
45 @page
46 @vskip 0pt plus 1filll
47 Copyright @copyright{} 1998 Gregory McLean
48
49 Permission is granted to make and distribute verbatim copies of this
50 manual provided the copyright notice and this permission notice are
51 preserved on all copies.
52
53 Permission is granted to copy and distribute modified versions of this
54 manual under the conditions for verbatim copying, provided that the
55 entire resulting derived work is distributed under the terms of a
56 permission notice identical to this one.
57
58 Permission is granted to copy and distribute translations of this manual
59 into another language, under the above conditions for modified versions,
60 except that this permission notice may be stated in a translation
61 approved by Gregory McLean.
62 @end titlepage
63
64 @dircategory Library of useful routines for 'C' programing
65 @direntry
66 * GLIB: (glib).        useful routines for 'C' programming
67 @end direntry
68
69 @node Top, Copying, (dir), (dir)
70 @top useful routines for 'C' programming
71 @ifinfo
72 This is edition @value{edition} of the GLIB documentation,
73 @w{@value{update-date}}.
74 @end ifinfo
75
76 @menu
77 * Copying::                     Your rights.
78 * Overview::                    What is GLIB?
79 * Doubly linked lists::         Doubly linked lists
80 * Signly linked lists::         Singly linked lists
81 * List allocators::             List Allocators
82 * Hash tables::                 Hash tables
83 * Caches::                      Cache handling
84 * Trees::                       Tree handling
85 * Memory::                      Memory handling
86 * Timers::                      Timer functions
87 * Output::                      Output handling
88 * Utilities::                   Utilitiy functions
89 * Errors::                      Error handling
90 * String Chunks::               String Chunks
91 * Strings::                     String handling
92 * Resizable arrays::            Resizeable arrays
93 * GScanner::                    Flexible lexical scanner
94 * Miscellany::                  Other stuff
95 * Function Index::              Index of functions
96 * Concept Index::               Index of concepts
97 @end menu
98
99 @node Copying, Overview, Top, Top
100 @comment node-name, next, previous, up
101 @chapter Copying
102
103 @node Overview, Doubly linked lists, Copying, Top
104 @comment node-name, next, previous, up
105 @chapter What is GLIB
106
107 @node Doubly linked lists, Signly linked lists, Overview, Top
108 @comment node-name, next, previous, up
109 @chapter Doubly linked lists
110
111 @subsection Functions
112
113 @deftypefun GList* g_list_alloc (void)
114 @end deftypefun
115
116 @deftypefun void g_list_free (GList *@var{list})
117 @end deftypefun
118
119 @deftypefun void g_list_free_1 (GList *@var{list})
120 @end deftypefun
121
122 @deftypefun GList* g_list_append (GList *@var{list}, gpointer @var{data})
123 @end deftypefun
124
125 @deftypefun GList* g_list_prepend (GList *@var{list}, gpointer @var{data})
126 @end deftypefun
127
128 @deftypefun GList* g_list_insert (GList *@var{list}, gpointer @var{data}, gint @var{position})
129 @end deftypefun
130
131 @deftypefun GList* g_list_insert_sorted (GList *@var{list}, gpointer @var{data}, GCompareFunc @var{func})
132 @end deftypefun
133
134 @deftypefun GList* g_list_concat (GList *@var{list1}, GList *@var{list2})
135 @end deftypefun
136
137 @deftypefun GList* g_list_remove (GList *@var{list}, gpointer @var{data})
138 @end deftypefun
139
140 @deftypefun GList* g_list_remove_link (GList *@var{list}, GList *@var{link})
141 @end deftypefun
142
143 @deftypefun GList* g_list_reverse (GList *@var{list})
144 @end deftypefun
145
146 @deftypefun GList* g_list_nth (GList *@var{list}, gint @var{n})
147 @end deftypefun
148
149 @deftypefun GList* g_list_find (GList *@var{list}, gpointer @var{data})
150 @end deftypefun
151
152 @deftypefun GList* g_list_last (GList *@var{list})
153 @end deftypefun
154
155 @deftypefun GList* g_list_first (GList *@var{list})
156 @end deftypefun
157
158 @deftypefun gint g_list_length (GList *@var{list})
159 @end deftypefun
160
161 @deftypefun void g_list_foreach (GList *@var{list}, GFunc @var{func}, gpointer @var{user_data})
162 @end deftypefun
163
164 @node Signly linked lists, List allocators, Doubly linked lists, Top
165 @comment node-name, next, previous, up
166 @chapter Signly linked lists
167
168 @subsection Functions
169 @deftypefun GSList* g_slist_alloc (void)
170 @end deftypefun
171
172 @deftypefun void g_slist_free (GSList *@var{list})
173 @end deftypefun
174
175 @deftypefun void g_slist_free_1 (GSList *@var{list})
176 @end deftypefun
177
178 @deftypefun GSList* g_slist_append (GSList *@var{list}, gpointer @var{data})
179 @end deftypefun
180
181 @deftypefun GSList* g_slist_prepend (GSList *@var{list}, gpointer @var{data})
182 @end deftypefun
183
184 @deftypefun GSList* g_slist_insert (GSList *@var{list}, gpointer @var{data}, gint @var{position})
185 @end deftypefun
186
187 @deftypefun GSList* g_slist_insert_sorted (GSList *@var{list}, gpointer @var{data}, GCompareFunc @var{func})
188 @end deftypefun
189
190 @deftypefun GSList* g_slist_concat (GSList *@var{list1}, GSList *@var{list2})
191 @end deftypefun
192
193 @deftypefun GSList* g_slist_remove (GSList *@var{list}, gpointer @var{data})
194 @end deftypefun
195
196 @deftypefun GSList* g_slist_remove_link (GSList *@var{list}, GSList *@var{link})
197 @end deftypefun
198
199 @deftypefun GSList* g_slist_reverse (GSList *@var{list})
200 @end deftypefun
201
202 @deftypefun GSList* g_slist_nth (GSList *@var{list}, gint @var{n})
203 @end deftypefun
204
205 @deftypefun GSList* g_slist_find (GSList *@var{list}, gpointer @var{data})
206 @end deftypefun
207
208 @deftypefun GSList* g_slist_last (GSList *@var{list})
209 @end deftypefun
210
211 @deftypefun gint g_slist_length (GSList *@var{list})
212 @end deftypefun
213
214 @deftypefun void g_slist_foreach (GSList *@var{list}, GFunc @var{func}, gpointer @var{user_data})
215 @end deftypefun
216
217 @node List allocators, Hash tables, Signly linked lists, Top
218 @comment node-name, next, previous, up
219 @chapter List allocators
220
221 @subsection Functions
222
223 @deftypefun GListAllocator* g_list_allocator_new (void)
224 @end deftypefun
225
226 @deftypefun void g_list_allocator_free (GListAllocator *@var{allocator})
227 @end deftypefun
228
229 @deftypefun GListAllocator* g_slist_set_allocator (GListAllocator *@var{allocator})
230 @end deftypefun
231
232 @deftypefun GListAllocator* g_list_set_allocator (GListAllocator *@var{allocator})
233 @end deftypefun
234
235 @node Hash tables, Caches, List allocators, Top
236 @comment node-name, next, previous, up
237 @chapter Hash tables
238
239 @subsection Functions
240
241 @deftypefun GHashTable* g_hash_table_new (GHashFunc @var{hash_func}, GCompareFunc @var{key_compare_func})
242 @end deftypefun
243
244 @deftypefun void g_hash_table_destroy (GHashTable *@var{hash_table})
245 @end deftypefun
246
247 @deftypefun void g_hash_table_insert (GHashTable *@var{hash_table}, gpointer @var{key}, gpointer @var{value})
248 @end deftypefun
249
250 @deftypefun void g_hash_table_remove (GHashTable *@var{hash_table}, gpointer @var{key})
251 @end deftypefun
252
253 @deftypefun gpointer g_hash_table_lookup (GHashTable *@var{hash_table}, gpointer @var{key})
254 @end deftypefun
255
256 @deftypefun void g_hash_table_freeze (GHashTable *@var{hash_table})
257 @end deftypefun
258
259 @deftypefun void g_hash_table_thaw (GHashTable *@var{hash_table})
260 @end deftypefun
261
262 @deftypefun void g_hash_table_foreach (GHashTable *@var{hash_table}, GHFunc @var{func}, gpointer @var{user_data})
263 @end deftypefun
264
265 @node Caches, Trees, Hash tables, Top
266 @comment node-name, next, previous, up
267 @chapter Cache handling
268
269 @subsection Functions
270
271 @deftypefun GCache* g_cache_new (GCacheNewFunc @var{value_new_func}, GCacheDestroyFunc @var{value_destroy_func}, GCacheDupFunc @var{key_dup_func}, GCacheDestroyFunc @var{key_destroy_func}, GHashFunc @var{hash_key_func}, GHashFunc @var{hash_value_func}, GCompareFunc @var{key_compare_func})
272 @end deftypefun
273
274 @deftypefun void g_cache_destroy (GCache *@var{cache})
275 @end deftypefun
276
277 @deftypefun gpointer g_cache_insert (GCache *@var{cache}, gpointer @var{key})
278 @end deftypefun
279
280 @deftypefun void g_cache_remove (GCache *@var{cache}, gpointer @var{key})
281 @end deftypefun
282
283 @deftypefun void g_cache_key_foreach (GCache *@var{cache}, GHFunc @var{func}, gpointer @var{user_data})
284 @end deftypefun
285
286 @deftypefun void g_cache_value_foreach (GCache *@var{cache}, GHFunc @var{func}, gpointer @var{user_data})
287 @end deftypefun
288
289 @node Trees, Memory, Caches, Top
290 @comment node-name, next, previous, up
291 @chapter Tree handling
292
293 @subsection Functions
294
295 @deftypefun GTree* g_tree_new (GCompareFunc @var{key_compare_func})
296 @end deftypefun
297
298 @deftypefun void g_tree_destroy (GTree *@var{tree})
299 @end deftypefun
300
301 @deftypefun void g_tree_remove (GTree *@var{tree}, gpointer @var{key}, gpointer @var{value})
302 @end deftypefun
303
304 @deftypefun gpointer g_tree_lookup (GTree *@var{tree}, gpointer @var{key})
305 @end deftypefun
306
307 @deftypefun void g_tree_traverse (GTree *@var{tree}, GTraverseFunc @var{traverse_func}, GTraverseType @var{traverse_type}, gpointer @var{data}
308 @end deftypefun
309
310 @deftypefun gpointer g_tree_search (GTree *@var{tree}, GSearchFunc @var{search_func}, gpointer @var{data})
311 @end deftypefun
312
313 @deftypefun gint g_tree_height (GTree *@var{tree})
314 @end deftypefun
315
316 @deftypefun gint g_tree_nnodes (GTree *@var{tree})
317 @end deftypefun
318
319 @node Memory, Timers, Trees, Top
320 @comment node-name, next, previous, up
321 @chapter Memory handling
322
323 @subsection Functions
324
325 @deftypefun gpointer g_malloc (gulong @var{size})
326 @end deftypefun
327
328 @deftypefun gpointer g_malloc0 (gulong @var{size})
329 @end deftypefun
330
331 @deftypefun gpointer g_realloc (gpointer @var{mem}, gulong @var{size})
332 @end deftypefun
333
334 @deftypefun void g_mem_profile (void)
335 @end deftypefun
336
337 @deftypefun void g_mem_check (gpointer @var{mem})
338 @end deftypefun
339
340 @deftypefun GMemChunk* g_mem_chunk_new (gchar *@var{name}, gint @var{atom_size}, gulong @var{area_size}, gint @var{type})
341 @end deftypefun
342
343 @deftypefun void g_mem_chunk_destroy (GMemChunk *@var{mem_chunk})
344 @end deftypefun
345
346 @deftypefun gpointer g_mem_chunk_alloc (GMemChunk *@var{mem_chunk})
347 @end deftypefun
348
349 @deftypefun void g_mem_chunk_free (GMemChunk *@var{mem_chunk}, gpointer @var{mem})
350 @end deftypefun
351
352 @deftypefun void g_mem_chunk_clean (GMemChunk *@var{mem_chunk})
353 @end deftypefun
354
355 @deftypefun void g_mem_chunk_reset (GMemChunk *@var{mem_chunk})
356 @end deftypefun
357
358 @deftypefun void g_mem_chunk_print (GMemChunk *@var{mem_chunk})
359 @end deftypefun
360
361 @deftypefun void g_mem_chunk_info (void)
362 @end deftypefun
363
364 @deftypefun void g_blow_chunks (void)
365 Not what you might be thinking, @code{g_blow_chunks()} simply compresses all 
366 the chunks. This operation consists of freeing every memory area that should
367 be freed (but which we haven't gotten around to doing yet).
368 @end deftypefun
369
370 @node Timers, Output, Memory, Top
371 @comment node-name, next, previous, up
372 @chapter Timer functions
373
374 @subsection Functions
375
376 @deftypefun GTimer* g_timer_new (void)
377 @end deftypefun
378
379 @deftypefun void g_timer_destroy (GTimer *@var{timer})
380 @end deftypefun
381
382 @deftypefun void g_timer_start (GTimer *@var{timer})
383 @end deftypefun
384
385 @deftypefun void g_timer_stop (GTimer *@var{timer})
386 @end deftypefun
387
388 @deftypefun void g_timer_reset (GTimer *@var{timer})
389 @end deftypefun
390
391 @deftypefun gdouble g_timer_elapsed (GTimer *@var{timer}, gulong *@var{microseconds})
392 @end deftypefun
393
394 @node Output, Utilities, Timers, Top
395 @comment node-name, next, previous, up
396 @chapter Output functions
397
398 @subsection Functions
399
400 @deftypefun void g_error (gchar *@var{format}, @dots{})
401 @end deftypefun
402
403 @deftypefun void g_warning (gchar *@var{format}, @dots{})
404 @end deftypefun
405
406 @deftypefun void g_message (gchar *@var{format}, @dots{})
407 @end deftypefun
408
409 @deftypefun void g_print (gchar *@var{format}, @dots{})
410 @end deftypefun
411
412 @node Utilities, Errors, Output, Top
413 @comment node-name, next, previous, up
414 @chapter Utility functions
415
416 @node Errors, String Chunks, Utilities, Top
417 @comment node-name, next, previous, up
418 @chapter Error handling
419
420 @node String Chunks, Strings, Errors, Top
421 @comment node-name, next, previous, up
422 @chapter String chunks
423
424 @node Strings, Resizable arrays, String Chunks, Top
425 @comment node-name, next, previous, up
426 @chapter String handling
427
428 @node Resizable arrays, GScanner, Strings, Top
429 @comment node-name, next, previous, up
430 @chapter Resizable arrays
431
432 @node GScanner, Miscellany, Resizable arrays, Top
433 @comment node-name, next, previous, up
434 @chapter Flexible lexical scanner
435
436 @node Miscellany, Function Index, GScanner, Top
437 @comment node-name, next, previous, up
438 @chapter Other stuff
439
440 @node Function Index, Concept Index, Miscellany, Top
441 @comment node-name, next, previous, up
442 @unnumbered Function Index
443
444 @printindex fn
445
446 @node Concept Index, , Function Index, Top
447 @comment node-name, next, previous, up
448 @unnumbered Concept Index
449
450 @printindex cp
451
452 @summarycontents
453 @contents 
454 @bye
455