va_list


Object Hierarchy:

va_list va_list va_list

Description:

[ SimpleType ]
[ CCode ( cprefix = "va_" , destroy_function = "va_end" , has_type_id = false , lvalue_access = false ) ]
public struct va_list

Struct to hold information about variadic function arguments

It is legal to pass a pointer to a va_list object to another function and then use that object after the function returns.

Example: Variable Arguments:

public void print_linesv (string fst_str, va_list list) {
print (fst_str);
print ("\n");

for (string? str = list.arg<string?> (); str != null ; str = list.arg<string?> ()) {
print (str);
print ("\n");
}
}

public void print_lines (string fst_str, ...) {
var list = va_list();
print_linesv (fst_str, list);
}

public static int main (string[] args) {
// Output:
// ``first line``
// ``second line``
// ``third line``

print_lines ("first line", "second line", "third line");
return 0;
}

valac --pkg glib-2.0 va_list.vala


Package: glib-2.0

Content:

Creation methods:

Methods: