- public delegate int PollFunc (PollFD[] ufds, int timeout_)
- public delegate void ChildWatchFunc (Pid pid, int status)
Prototype of a GChildWatchSource
callback, called when
a child process has exited.
- public delegate void SourceDummyMarshal ()
This is just a placeholder for
ClosureMarshal, which cannot be used here for dependency
reasons.
- public delegate bool SourcePrepareFunc (Source source, out int timeout_)
- public delegate bool SourceCheckFunc (Source source)
- public delegate bool SourceDispatchFunc (Source source, SourceFunc _callback)
- public delegate void SourceFinalizeFunc (Source source)
- public delegate void SourceCallbackRefFunc (void* cb_data)
- public delegate void SourceCallbackUnrefFunc (void* cb_data)
- public delegate void SourceCallbackGetFunc (void* cb_data, Source source, SourceFunc func)
- public delegate bool SourceFunc ()
Specifies the type of function passed to g_timeout_add
,
add_full, g_idle_add
, and
add_full.
- public delegate G ThreadFunc ()
- public delegate void Func (G data)
- public delegate G OnceFunc ()
Specifies the type of the func
functions passed to
g_thread_new
or g_thread_try_new
.
- public delegate void ThreadPoolFunc (owned G data)
- public delegate bool IOFunc (IOChannel source, IOCondition condition)
- public delegate void PrintFunc (string text)
Specifies the type of the print handler functions.
- public delegate void LogFunc (string? log_domain, LogLevelFlags log_levels, string message)
Specifies the prototype of log handler functions.
- public delegate void FreeFunc (void* data)
Declares a type of function which takes an arbitrary data pointer
argument and has no return value.
- public delegate void VoidFunc ()
Declares a type of function which takes no arguments and has no
return value.
- public delegate void ScannerMsgFunc (Scanner scanner, string message, bool error)
Specifies the type of the message handler function.
- public delegate string CompletionFunc (void* item)
- public delegate int CompletionStrncmpFunc (string s1, string s2, size_t n)
- public delegate void SpawnChildSetupFunc ()
- public delegate void SignalHandlerFunc (int signum)
- public delegate unowned string TranslateFunc (string str)
The type of functions which are used to translate user-visible
strings, for <option>--help</option> output.
- public delegate bool OptionParseFunc (OptionContext context, OptionGroup group, void* data) throws OptionError
The type of function that can be called before and after parsing.
- public delegate void OptionErrorFunc (OptionContext context, OptionGroup group, void* data, ref Error error)
The type of function to be used as callback when a parse error
occurs.
- public delegate bool RegexEvalCallback (MatchInfo match_info, StringBuilder result)
- public delegate void MarkupParserStartElementFunc (MarkupParseContext context, string element_name, string[] attribute_names, string[] attribute_values) throws MarkupError
- public delegate void MarkupParserEndElementFunc (MarkupParseContext context, string element_name) throws MarkupError
- public delegate void MarkupParserTextFunc (MarkupParseContext context, string text, size_t text_len) throws MarkupError
- public delegate void MarkupParserPassthroughFunc (MarkupParseContext context, string passthrough_text, size_t text_len) throws MarkupError
- public delegate void MarkupParserErrorFunc (MarkupParseContext context, Error error)
- public delegate bool LogFatalFunc (string? log_domain, LogLevelFlags log_levels, string message)
- public delegate void TestFunc (void* fixture)
The type used for test case functions.
- public delegate void TestDataFunc ()
The type used for test case functions that take an extra pointer
argument.
- public delegate int CompareFunc (G a, G b)
- public delegate int CompareDataFunc (G a, G b)
Specifies the type of a comparison function used to compare two
values.
- public delegate int SearchFunc (G a, T b)
Specifies the type of a comparison function used to compare two
values.
- public delegate int SequenceIterCompareFunc (SequenceIter<G> a, SequenceIter<G> b)
A SequenceIterCompareFunc is a
function used to compare iterators.
- public delegate uint HashFunc (K key)
Specifies the type of the hash function which is passed to
g_hash_table_new
when a GenericSet is created.
- public delegate bool EqualFunc (G a, G b)
Specifies the type of a function used to test two values for
equality.
- public delegate void HFunc (K key, V value)
Specifies the type of the function passed to
for_each.
- public delegate bool HRFunc (K key, V value)
- public delegate void DestroyNotify (void* data)
Specifies the type of function which is called when a data element
is destroyed.
- public delegate bool NodeTraverseFunc (Node node)
Specifies the type of function passed to
traverse.
- public delegate void NodeForeachFunc (Node node)
- public delegate void DataForeachFunc (Quark key_id, G data)
Specifies the type of function passed to g_dataset_foreach
.
- public delegate bool TraverseFunc (K key, V value)
Specifies the type of function passed to g_tree_traverse
.
- public delegate int TreeSearchFunc (K key)
- public uint get_num_processors ()
Determine the approximate number of threads that the system will
schedule simultaneously for this process.
- public void* malloc (size_t n_bytes)
Allocates n_bytes
bytes of memory.
- public void* malloc0 (size_t n_bytes)
Allocates n_bytes
bytes of memory, initialized to 0's.
- public void* realloc (void* mem, size_t n_bytes)
Reallocates the memory pointed to by mem
, so that it
now has space for n_bytes
bytes of memory.
- public void* try_malloc (size_t n_bytes)
Attempts to allocate n_bytes
, and returns
null on failure.
- public void* try_malloc0 (size_t n_bytes)
Attempts to allocate n_bytes
, initialized to 0's, and
returns null on failure.
- public void* try_realloc (void* mem, size_t n_bytes)
Attempts to realloc mem
to a new size, n_bytes
, and returns null on failure.
- public void free (void* mem)
- public void mem_set_vtable (MemVTable vtable)
Sets the MemVTable
to use for memory allocation.
- public void mem_profile ()
Outputs a summary of memory usage.
- public void print (string format, ...)
Outputs a formatted message via the print handler.
- public void set_print_handler (PrintFunc func)
Sets the print handler.
- public void printerr (string format, ...)
Outputs a formatted message via the error message handler.
- public void set_printerr_handler (PrintFunc func)
Sets the handler for printing error messages.
- public void return_if_fail (bool expr)
- public void return_val_if_fail (bool expr, ...)
- public void return_if_reached ()
- public void return_val_if_reached (...)
- public void warn_if_fail (bool expr)
- public void warn_if_reached ()
- public void assert (bool expr)
- public void assert_false (bool expr)
- public void assert_true (bool expr)
- public void assert_null (void* expr)
- public void assert_nonnull (void* expr)
- public void assert_not_reached ()
- public void on_error_query (string? prg_name = null)
Prompts the user with `[E]xit, [H]alt, show [S]tack trace or [P]
roceed`.
- public void on_error_stack_trace (string? prg_name = null)
Invokes gdb, which attaches to the current process and shows a stack
trace.
- public void breakpoint ()
- public void logv (string? log_domain, LogLevelFlags log_level, string format, va_list args)
Logs an error or debugging message.
- public void log (string? log_domain, LogLevelFlags log_level, string format, ...)
Logs an error or debugging message.
- public void message (string format, ...)
- public void warning (string format, ...)
- public void critical (string format, ...)
- public void error (string format, ...)
- public void debug (string format, ...)
- public void info (string format, ...)
- public uint parse_debug_string (string? debug_string, DebugKey[] keys)
Parses a string containing debugging options into a
guint containing bit flags.
- public void strfreev (unowned string** str_array)
Frees a null-terminated
array of strings, and the array itself.
- public uint strv_length (string[] str_array)
Returns the length of the given
null-terminated string array str_array
.
- public bool strv_contains (string[] str_array, string str)
- public unowned string strerror (int errnum)
Returns a string corresponding to the given error code, e.
- public string convert (string str, ssize_t len, string to_codeset, string from_codeset, out size_t bytes_read = null, out size_t bytes_written = null) throws ConvertError
Converts a string from one character set to another.
- public bool get_charset (out string charset)
Obtains the character set for the current locale; you might
use this character set as an argument to convert, to convert from the current
locale's encoding to some other encoding.
- public bool get_filename_charsets (out string[] charsets)
Determines the preferred character sets used for filenames.
- public int64 get_monotonic_time ()
Queries the system monotonic time.
- public int64 get_real_time ()
Queries the system wall-clock time.
- public string format_size_for_display (int64 size)
Formats a size (for example the size of a file) into a human
readable string.
- public string format_size (uint64 size, FormatSizeFlags flags = DEFAULT)
Formats a size.
- public unowned string strsignal (int signum)
Returns a string describing the given signal, e.
- public unowned string _ (string str)
- public unowned string Q_ (string str)
- public unowned string N_ (string str)
- public unowned string C_ (string context, string str)
- public unowned string NC_ (string context, string str)
- public unowned string ngettext (string msgid, string msgid_plural, ulong n)
- public unowned string dgettext (string? domain, string msgid)
This function is a wrapper of dgettext
which does not translate the message if the default domain as set with textdomain
has no translations for the current locale.
- public unowned string dcgettext (string? domain, string msgid, int category)
This is a variant of
dgettext that allows specifying a locale category instead of always using `LC_MESSAGES`.
- public unowned string dngettext (string? domain, string msgid, string msgid_plural, ulong n)
This function is a wrapper of dngettext
which does not
translate the message if the default domain as set with textdomain has no
translations for the current locale.
- public unowned string dpgettext (string? domain, string msgctxid, size_t msgidoffset)
This function is a variant of
dgettext which supports a disambiguating message context.
- public unowned string dpgettext2 (string? domain, string context, string msgid)
This function is a variant of
dgettext which supports a disambiguating message context.
- public bool likely (bool expression)
- public bool unlikely (bool expression)
- public void static_assert (bool expression)
- public void qsort_with_data<T> (T[] elems, size_t size, CompareDataFunc<T> compare_func)
- public void minimized_result (double minimized_quantity, string format, ...)
Report the result of a performance or measurement test.
- public void maximized_result (double maximized_quantity, string format, ...)
Report the result of a performance or measurement test.
- public void init (ref string[] args, ...)
Initialize the GLib testing framework, e.
- public bool quick ()
- public bool slow ()
- public bool thorough ()
- public bool perf ()
- public bool verbose ()
- public bool quiet ()
- public int run ()
Runs all tests under the toplevel suite which can be retrieved with
get_root.
- public void add_func (string testpath, Callback test_funcvoid)
Create a new test case, similar to
TestCase.
- public void add_data_func (string testpath, TestDataFunc test_funcvoid)
Create a new test case, similar to
TestCase.
- public string build_filename (FileType file_type, string[] path_segments)
Creates the pathname to a data file that is required for a test.
- public void fail ()
Indicates that a test failed.
- public bool failed ()
Returns whether a test has already failed.
- public unowned string get_dir (FileType file_type)
Gets the pathname of the directory containing test files of the type
specified by file_type
.
- public unowned string get_filename (FileType file_type, string[] path_segments)
Gets the pathname to a data file that is required for a test.
- public void incomplete (string msg)
Indicates that a test failed because of some incomplete
functionality.
- public void message (string format, ...)
Add a message to the test report.
- public void set_nonfatal_assertions ()
Changes the behaviour of g_assert_cmpstr
,
g_assert_cmpint
, g_assert_cmpuint
, g_assert_cmphex
, g_assert_cmpfloat
,
assert_true, assert_false,
assert_null, g_assert_no_error
, g_assert_error
,
g_test_assert_expected_messages
and the various g_test_trap_assert_*() macros to not abort to program, but instead call
fail and continue.
- public void skip (string msg)
Indicates that a test was skipped.
- public bool subprocess ()
Returns true (after
init has been called) if the test program is running under
trap_subprocess.
- public void bug_base (string uri_pattern)
Specify the base URI for bug reports.
- public void bug (string bug_uri_snippet)
This function adds a message to test reports that associates a bug
URI with a test case.
- public void timer_start ()
Start a timing test.
- public double timer_elapsed ()
Get the time since the last start of the timer with
timer_start.
- public double timer_last ()
- public bool trap_fork (uint64 usec_timeout, TestTrapFlags test_trap_flags)
Fork the current test program to execute a test case that might not
return or that might abort.
- public bool trap_has_passed ()
- public bool trap_reached_timeout ()
- public void trap_subprocess (string test_path, uint64 usec_timeout, TestSubprocessFlags test_flags)
Respawns the test program to run only test_path
in a
subprocess.
- public void trap_assert_passed ()
- public void trap_assert_failed ()
- public void trap_assert_stdout (string soutpattern)
- public void trap_assert_stdout_unmatched (string soutpattern)
- public void trap_assert_stderr (string serrpattern)
- public void trap_assert_stderr_unmatched (string serrpattern)
- public bool rand_bit ()
- public int32 rand_int ()
Get a reproducible random integer number.
- public int32 rand_int_range (int32 begin, int32 end)
Get a reproducible random integer number out of a specified range,
see rand_int for details on test case random numbers.
- public double rand_double ()
Get a reproducible random floating point number, see
rand_int for details on test case random numbers.
- public double rand_double_range (double begin, double end)
Get a reproducible random floating pointer number out of a specified
range, see rand_int for details on test case random numbers.
- public void log_set_fatal_handler (LogFatalFunc log_func)
Installs a non-error fatal log handler which can be used to decide
whether log messages which are counted as fatal abort the program.