1 <!-- ##### SECTION ./tmpl/messages.sgml:Long_Description ##### -->
3 These functions provide support for logging error messages or messages
8 There are several built-in levels of messages, defined in #GLogLevelFlags.
9 These can be extended with user-defined levels.
13 <!-- ##### SECTION ./tmpl/messages.sgml:See_Also ##### -->
19 <!-- ##### SECTION ./tmpl/messages.sgml:Short_Description ##### -->
20 versatile support for logging messages with different levels of importance.
23 <!-- ##### SECTION ./tmpl/messages.sgml:Title ##### -->
27 <!-- ##### ENUM GChannelError ##### -->
32 @G_CHANNEL_ERROR_ACCES:
33 @G_CHANNEL_ERROR_BADF:
34 @G_CHANNEL_ERROR_DEADLK:
35 @G_CHANNEL_ERROR_FAULT:
36 @G_CHANNEL_ERROR_INVAL:
38 @G_CHANNEL_ERROR_ISDIR:
39 @G_CHANNEL_ERROR_MFILE:
40 @G_CHANNEL_ERROR_NOLCK:
41 @G_CHANNEL_ERROR_NOSPC:
42 @G_CHANNEL_ERROR_PERM:
43 @G_CHANNEL_ERROR_PIPE:
44 @G_CHANNEL_ERROR_SPIPE:
45 @G_CHANNEL_ERROR_ENCODE_RW:
46 @G_CHANNEL_ERROR_FAILED:
48 <!-- ##### ENUM GChannelStatus ##### -->
53 @G_CHANNEL_STATUS_NORMAL:
54 @G_CHANNEL_STATUS_EOF:
55 @G_CHANNEL_STATUS_PARTIAL_CHARS:
56 @G_CHANNEL_STATUS_AGAIN:
57 @G_CHANNEL_STATUS_INTR:
58 @G_CHANNEL_STATUS_ERROR:
59 @G_CHANNEL_STATUS_BAD_INPUT:
61 <!-- ##### USER_FUNCTION GCompareFuncData ##### -->
71 <!-- ##### USER_FUNCTION GCompletionStrcmpFunc ##### -->
80 <!-- ##### USER_FUNCTION GErrorFunc ##### -->
82 Specifies the type of function passed to g_set_error_handler().
85 @str: the error message.
87 <!-- ##### USER_FUNCTION GHookFreeFunc ##### -->
95 <!-- ##### ENUM GIOFileMode ##### -->
100 @G_IO_FILE_MODE_READ:
101 @G_IO_FILE_MODE_WRITE:
102 @G_IO_FILE_MODE_APPEND:
103 @G_IO_FILE_MODE_READ_WRITE:
104 @G_IO_FILE_MODE_READ_WRITE_TRUNCATE:
105 @G_IO_FILE_MODE_READ_WRITE_APPEND:
107 <!-- ##### USER_FUNCTION GWarningFunc ##### -->
109 Specifies the type of function passed to g_set_warning_handler().
112 @str: the warning message.
114 <!-- ##### MACRO G_CHANNEL_ERROR ##### -->
120 <!-- ##### MACRO G_HOOK_DEFERRED_DESTROY ##### -->
126 <!-- ##### MACRO G_IO_CHANNEL_DEFAULT_LINE_TERM ##### -->
128 One of %G_IO_CHANNEL_UNIX_LINE_TERM, %G_IO_CHANNEL_DOS_LINE_TERM,
129 or %G_IO_CHANNEL_MACINTOSH_LINE_TERM (unimplemented)
130 depending on the system type.
134 <!-- ##### MACRO G_IO_CHANNEL_DOS_LINE_TERM ##### -->
140 <!-- ##### MACRO G_IO_CHANNEL_ENCODE_RAW ##### -->
142 Encoding for nonbuffered IO. With this encoding, data must be
143 read using g_io_channel_read_chars(); the other functions will
148 <!-- ##### MACRO G_IO_CHANNEL_MACINTOSH_LINE_TERM ##### -->
154 <!-- ##### MACRO G_IO_CHANNEL_UNIX_LINE_TERM ##### -->
160 <!-- ##### MACRO access ##### -->
166 <!-- ##### MACRO close ##### -->
172 <!-- ##### MACRO fdopen ##### -->
178 <!-- ##### FUNCTION g_channel_error_from_errno ##### -->
186 <!-- ##### FUNCTION g_channel_error_quark ##### -->
193 <!-- ##### FUNCTION g_convert_error_quark ##### -->
200 <!-- ##### FUNCTION g_main_add_poll ##### -->
202 Adds a file descriptor to be polled.
203 This is usually combined with g_source_add() to add an event source.
204 The event source's check function will typically test the revents
205 field in the #GPollFD struct and return TRUE if events need to be processed.
208 @fd: a #GPollFD, which is a file descriptor together with a bitwise
209 combination of #GIOCondition flags determining which events to poll for.
210 @priority: the priority of the poll, which should be the same as the priority
211 used for g_source_add() to ensure that the file descriptor is polled whenever
212 the results may be needed.
213 See #G_PRIORITY_DEFAULT, #G_PRIORITY_DEFAULT_IDLE, #G_PRIORITY_HIGH,
214 #G_PRIORITY_HIGH_IDLE, and #G_PRIORITY_LOW.
216 <!-- ##### FUNCTION g_main_context_get ##### -->
224 <!-- ##### FUNCTION g_main_loop_destroy ##### -->
231 <!-- ##### FUNCTION g_main_remove_poll ##### -->
233 Removes a file descriptor from the list being polled.
236 @fd: the #GPollFD to remove.
238 <!-- ##### FUNCTION g_main_win32_get_poll_func ##### -->
245 <!-- ##### FUNCTION g_mem_check ##### -->
247 Checks if the given memory has already been freed. If it has it outputs
249 To use this function you must configure glib with the flag
250 '--enable-mem-check=yes' before compiling.
253 @mem: the memory to check.
255 <!-- ##### FUNCTION g_scanner_stat_mode ##### -->
257 Gets the file attributes.
258 This is the <structfield>st_mode</structfield> field from the
259 <structname>stat</structname> structure. See the <function>stat()</function>
263 @filename: the file name.
264 @Returns: the file attributes.
266 <!-- ##### FUNCTION g_set_error_handler ##### -->
268 Sets the function to be called to handle error messages.
269 This function is deprecated in favour of the new logging facilities.
272 @func: the function to be called to handle error messages.
273 @Returns: the old error handler.
275 <!-- ##### FUNCTION g_set_message_handler ##### -->
277 Sets the function to be called to handle messages.
278 This function is deprecated in favour of the new logging facilities.
281 @func: the function to be called to handle normal messages.
282 @Returns: the old message handler.
284 <!-- ##### FUNCTION g_set_warning_handler ##### -->
286 Sets the function to be called to handle warning messages.
287 This function is deprecated in favour of the new logging facilities.
290 @func: the function to be called to handle warning messages.
291 @Returns: the old warning handler.
293 <!-- ##### FUNCTION g_source_add ##### -->
307 <!-- ##### FUNCTION g_source_connect ##### -->
317 <!-- ##### FUNCTION g_source_connect_indirect ##### -->
326 <!-- ##### FUNCTION g_source_remove_by_source_data ##### -->
328 Removes the first event source found with the given source data.
331 Event sources are sorted with the highest priority first. Sources with equal
332 priority are stored in the order in which they were added.
335 @source_data: the source data, which contains information specific to the
337 @Returns: TRUE if an event source was found and removed.
339 <!-- ##### FUNCTION g_static_private_get_for_thread ##### -->
348 <!-- ##### FUNCTION g_static_private_set_for_thread ##### -->
358 <!-- ##### MACRO g_string ##### -->
360 Turns the argument into a string literal by using the '#' stringizing operator.
363 @x: text to convert to a literal string.
365 <!-- ##### MACRO getcwd ##### -->
371 <!-- ##### MACRO getpid ##### -->
377 <!-- ##### MACRO lseek ##### -->
383 <!-- ##### MACRO open ##### -->
389 <!-- ##### MACRO pclose ##### -->
395 <!-- ##### MACRO popen ##### -->
401 <!-- ##### MACRO read ##### -->
407 <!-- ##### MACRO write ##### -->