blob: e2b24e9bd36f429e9547c523f16fd6e1c2934146 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
// included by glib2.pas
{$IFDEF read_forward_definitions}
{$ENDIF read_forward_definitions}
//------------------------------------------------------------------------------
{$IFDEF read_interface_types}
{$ENDIF read_interface_types}
//------------------------------------------------------------------------------
{$IFDEF read_interface_rest}
{$ifdef WINDOWS}
{ On native Win32, directory separator is the backslash, and search path
separator is the semicolon.
}
const
G_DIR_SEPERATOR = '\';
G_DIR_SEPARATOR_S = '\';
G_SEARCHPATH_SEPARATOR = ';';
G_SEARCHPATH_SEPARATOR_S = ';';
{$else}
{ !WIN32 }
{ Unix }
const
G_DIR_SEPARATOR = '/';
G_DIR_SEPARATOR_S = '/';
G_SEARCHPATH_SEPARATOR = ':';
G_SEARCHPATH_SEPARATOR_S = ':';
{$endif}
function g_get_user_name:Pgchar;cdecl;external gliblib name 'g_get_user_name';
function g_get_real_name:Pgchar;cdecl;external gliblib name 'g_get_real_name';
function g_get_home_dir:Pgchar;cdecl;external gliblib name 'g_get_home_dir';
function g_get_tmp_dir:Pgchar;cdecl;external gliblib name 'g_get_tmp_dir';
function g_get_prgname:Pgchar;cdecl;external gliblib name 'g_get_prgname';
procedure g_set_prgname(prgname:Pgchar);cdecl;external gliblib name 'g_set_prgname';
type
PGDebugKey = ^TGDebugKey;
TGDebugKey = record
key : Pgchar;
value : guint;
end;
{ Miscellaneous utility functions
}
function g_parse_debug_string(_string:Pgchar; keys:PGDebugKey; nkeys:guint):guint;cdecl;external gliblib name 'g_parse_debug_string';
{$IFNDEF KYLIX}
function g_snprintf(_string:Pgchar; n:gulong; format:Pgchar; args:array of const):gint;cdecl;overload;external gliblib name 'g_snprintf';
function g_snprintf(_string:Pgchar; n:gulong; format:Pgchar):gint;cdecl;overload;varargs;external gliblib name 'g_snprintf';
function g_vsnprintf(_string:Pgchar; n:gulong; format:Pgchar; args:array of const):gint;cdecl;external gliblib name 'g_vsnprintf';
{$ELSE}
function g_snprintf(_string:Pgchar; n:gulong; format:Pgchar):gint;varargs;cdecl;external gliblib name 'g_snprintf';
function g_vsnprintf(_string:Pgchar; n:gulong; format:Pgchar):gint;varargs;cdecl;external gliblib name 'g_vsnprintf';
{$ENDIF}
{ Check if a file name is an absolute path }
function g_path_is_absolute(file_name:Pgchar):gboolean;cdecl;external gliblib name 'g_path_is_absolute';
{ In case of absolute paths, skip the root part }
function g_path_skip_root(file_name:Pgchar):Pgchar;cdecl;external gliblib name 'g_path_skip_root';
{DEPRECATED}
{ These two functions are deprecated and will be removed in the next
major release of GLib. Use g_path_get_dirname/g_path_get_basename
instead. Whatch out! The string returned by g_path_get_basename
must be g_freed, while the string returned by g_basename must not. }
function g_basename(file_name:Pgchar):Pgchar;cdecl;external gliblib name 'g_basename';
function g_dirname(file_name:Pgchar):Pgchar;cdecl;external gliblib name 'g_path_get_dirname';
{ The returned strings are newly allocated with g_malloc() }
function g_get_current_dir:Pgchar;cdecl;external gliblib name 'g_get_current_dir';
function g_path_get_basename(file_name:Pgchar):Pgchar;cdecl;external gliblib name 'g_path_get_basename';
function g_path_get_dirname(file_name:Pgchar):Pgchar;cdecl;external gliblib name 'g_path_get_dirname';
{ Set the pointer at the specified location to NULL }
procedure g_nullify_pointer(nullify_location:Pgpointer);cdecl;external gliblib name 'g_nullify_pointer';
{ Get the codeset for the current locale }
{ gchar g_get_codeset (void); }
{ return the environment string for the variable. The returned memory
must not be freed. }
function g_getenv(variable:Pgchar):Pgchar;cdecl;external gliblib name 'g_getenv';
{ we try to provide a useful equivalent for ATEXIT if it is
not defined, but use is actually abandoned. people should
use g_atexit() instead.
}
type
TGVoidFunc = procedure;cdecl;
{ we use a GLib function as a replacement for ATEXIT, so
the programmer is not required to check the return value
(if there is any in the implementation) and doesn't encounter
missing include files.
}
procedure g_atexit(func:TGVoidFunc);cdecl;external gliblib name 'g_atexit';
{ Look for an executable in PATH, following execvp() rules }
function g_find_program_in_path(_program:Pgchar):Pgchar;cdecl;external gliblib name 'g_find_program_in_path';
{ Bit tests
}
function g_bit_nth_lsf(mask:gulong; nth_bit:gint):gint;cdecl;external gliblib name 'g_bit_nth_lsf';
function g_bit_nth_msf(mask:gulong; nth_bit:gint):gint;cdecl;external gliblib name 'g_bit_nth_msf';
function g_bit_storage(number:gulong):guint;cdecl;external gliblib name 'g_bit_storage';
{ Trash Stacks
elements need to be >= sizeof (gpointer)
}
type
PPGTrashStack = ^PGTrashStack;
PGTrashStack = ^TGTrashStack;
TGTrashStack = record
next : PGTrashStack;
end;
procedure g_trash_stack_push(stack_p:PPGTrashStack; data_p:gpointer);cdecl;external gliblib name 'g_trash_stack_push';
function g_trash_stack_pop(stack_p:PPGTrashStack):gpointer;cdecl;external gliblib name 'g_trash_stack_pop';
function g_trash_stack_peek(stack_p:PPGTrashStack):gpointer;cdecl;external gliblib name 'g_trash_stack_peek';
function g_trash_stack_height(stack_p:PPGTrashStack):guint;cdecl;external gliblib name 'g_trash_stack_height';
{$IFNDEF KYLIX}
{ Glib version.
we prefix variable declarations so they can
properly get exported in windows dlls.
}
var
glib_major_version : guint;external gliblib name 'glib_major_version';
glib_minor_version : guint;external gliblib name 'glib_minor_version';
glib_micro_version : guint;external gliblib name 'glib_micro_version';
glib_interface_age : guint;external gliblib name 'glib_interface_age';
glib_binary_age : guint;external gliblib name 'glib_binary_age';
function GLIB_CHECK_VERSION (major, minor, micro: guint):boolean;
{$ENDIF}
{$ENDIF read_interface_rest}
|