1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gnome-vfs-utils</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
2 .synopsis, .classsynopsis {
4 border: solid 1px #aaaaaa;
9 border: solid 1px #aaaaff;
18 border: solid 1px #ffaaaa;
25 .navigation a:visited {
31 </style><link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library"><link rel="up" href="ch08.html" title="Other Stuff"><link rel="previous" href="ch08.html" title="Other Stuff"><link rel="next" href="gnome-vfs-20-gnome-vfs-standard-callbacks.html" title="gnome-vfs-standard-callbacks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="ch08.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch08.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th><td><a accesskey="n" href="gnome-vfs-20-gnome-vfs-standard-callbacks.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gnome-vfs-20-gnome-vfs-utils"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">gnome-vfs-utils</span></h2><p>gnome-vfs-utils — various utilities functions to manipulate uris</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
35 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-format-file-size-for-display">gnome_vfs_format_file_size_for_display</a>
36 (<a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> size);
37 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-escape-string">gnome_vfs_escape_string</a> (const char *string);
38 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-escape-path-string">gnome_vfs_escape_path_string</a> (const char *path);
39 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-escape-host-and-path-string">gnome_vfs_escape_host_and_path_string</a>
41 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-escape-slashes">gnome_vfs_escape_slashes</a> (const char *string);
42 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-escape-set">gnome_vfs_escape_set</a> (const char *string,
43 const char *match_set);
44 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-unescape-string">gnome_vfs_unescape_string</a> (const char *escaped_string,
45 const char *illegal_characters);
46 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-make-uri-canonical">gnome_vfs_make_uri_canonical</a> (const char *uri);
47 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-make-path-name-canonical">gnome_vfs_make_path_name_canonical</a>
49 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-expand-initial-tilde">gnome_vfs_expand_initial_tilde</a> (const char *path);
50 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-unescape-string-for-display">gnome_vfs_unescape_string_for_display</a>
51 (const char *escaped);
52 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-get-local-path-from-uri">gnome_vfs_get_local_path_from_uri</a>
54 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-get-uri-from-local-path">gnome_vfs_get_uri_from_local_path</a>
55 (const char *local_full_path);
57 href="../glib/glib-Basic-Types.html#gboolean"
58 >gboolean</a> <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-is-executable-command-string">gnome_vfs_is_executable_command_string</a>
59 (const char *command_string);
60 void <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-list-deep-free">gnome_vfs_list_deep_free</a> (<a
61 href="../glib/glib-Doubly-Linked-Lists.html#GList"
63 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-get-volume-free-space">gnome_vfs_get_volume_free_space</a>
64 (const GnomeVFSURI *vfs_uri,
65 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *size);
66 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-icon-path-from-filename">gnome_vfs_icon_path_from_filename</a>
67 (const char *filename);
69 href="../glib/glib-Basic-Types.html#gboolean"
70 >gboolean</a> <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-is-primary-thread">gnome_vfs_is_primary_thread</a> (void);
71 char* <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-get-uri-scheme">gnome_vfs_get_uri_scheme</a> (const char *uri);
73 href="../glib/glib-Basic-Types.html#gboolean"
74 >gboolean</a> <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-uris-match">gnome_vfs_uris_match</a> (const char *uri_1,
76 #define <a href="gnome-vfs-20-gnome-vfs-utils.html#GNOME-VFS-ASSERT-PRIMARY-THREAD-CAPS">GNOME_VFS_ASSERT_PRIMARY_THREAD</a>
77 #define <a href="gnome-vfs-20-gnome-vfs-utils.html#GNOME-VFS-ASSERT-SECONDARY-THREAD-CAPS">GNOME_VFS_ASSERT_SECONDARY_THREAD</a>
78 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-utils.html#gnome-vfs-read-entire-file">gnome_vfs_read_entire_file</a> (const char *uri,
80 char **file_contents);
81 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
83 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="gnome-vfs-format-file-size-for-display"></a>gnome_vfs_format_file_size_for_display ()</h3><a class="indexterm" name="id2992268"></a><pre class="programlisting">char* gnome_vfs_format_file_size_for_display
84 (<a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> size);</pre><p>
85 Formats the file size passed in <i class="parameter"><tt>bytes</tt></i> in a way that is easy for
86 the user to read. Gives the size in bytes, kilobytes, megabytes or
87 gigabytes, choosing whatever is appropriate.</p><p>
89 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td>
90 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string with the size ready to be shown.
91 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-escape-string"></a>gnome_vfs_escape_string ()</h3><a class="indexterm" name="id2992366"></a><pre class="programlisting">char* gnome_vfs_escape_string (const char *string);</pre><p>
92 Escapes <i class="parameter"><tt>string</tt></i>, replacing any and all special characters
93 with equivalent escape sequences.</p><p>
95 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> string to be escaped
96 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string equivalent to <i class="parameter"><tt>string</tt></i>
97 but with all special characters escaped
98 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-escape-path-string"></a>gnome_vfs_escape_path_string ()</h3><a class="indexterm" name="id2992470"></a><pre class="programlisting">char* gnome_vfs_escape_path_string (const char *path);</pre><p>
99 Escapes <i class="parameter"><tt>path</tt></i>, replacing only special characters that would not
100 be found in paths (so '/', '&', '=', and '?' will not be escaped by
101 this function).</p><p>
103 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>path</tt></i> :</span></td><td> string to be escaped
104 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string equivalent to <i class="parameter"><tt>path</tt></i> but
105 with non-path characters escaped
106 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-escape-host-and-path-string"></a>gnome_vfs_escape_host_and_path_string ()</h3><a class="indexterm" name="id2992575"></a><pre class="programlisting">char* gnome_vfs_escape_host_and_path_string
107 (const char *path);</pre><p>
108 Escapes <i class="parameter"><tt>path</tt></i>, replacing only special characters that would not
109 be found in paths or host name (so '/', '&', '=', ':', '@'
110 and '?' will not be escaped by this function).</p><p>
112 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>path</tt></i> :</span></td><td> string to be escaped
113 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string equivalent to <i class="parameter"><tt>path</tt></i> but
114 with non-path/host characters escaped
115 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-escape-slashes"></a>gnome_vfs_escape_slashes ()</h3><a class="indexterm" name="id2992681"></a><pre class="programlisting">char* gnome_vfs_escape_slashes (const char *string);</pre><p>
116 Escapes only '/' and '%' characters in <i class="parameter"><tt>string</tt></i>, replacing
117 them with their escape sequence equivalents.</p><p>
119 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> string to be escaped
120 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string equivalent to <i class="parameter"><tt>string</tt></i>,
121 but with no unescaped '/' or '%' characters
122 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-escape-set"></a>gnome_vfs_escape_set ()</h3><a class="indexterm" name="id2992784"></a><pre class="programlisting">char* gnome_vfs_escape_set (const char *string,
123 const char *match_set);</pre><p>
125 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td>
126 </td></tr><tr><td><span class="term"><i class="parameter"><tt>match_set</tt></i> :</span></td><td>
127 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
130 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-unescape-string"></a>gnome_vfs_unescape_string ()</h3><a class="indexterm" name="id2992892"></a><pre class="programlisting">char* gnome_vfs_unescape_string (const char *escaped_string,
131 const char *illegal_characters);</pre><p>
132 Decodes escaped characters (i.e. PERCENTxx sequences) in <i class="parameter"><tt>escaped_string</tt></i>.
133 Characters are encoded in PERCENTxy form, where xy is the ASCII hex code
134 for character 16x+y.</p><p>
136 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>escaped_string</tt></i> :</span></td><td> an escaped URI, path, or other string
137 </td></tr><tr><td><span class="term"><i class="parameter"><tt>illegal_characters</tt></i> :</span></td><td> a string containing a sequence of characters
138 considered "illegal", '\0' is automatically in this list.
139 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string with the unescaped equivalents,
140 or <tt class="literal">NULL</tt> if <i class="parameter"><tt>escaped_string</tt></i> contained one of the characters
141 in <i class="parameter"><tt>illegal_characters</tt></i>.
142 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-make-uri-canonical"></a>gnome_vfs_make_uri_canonical ()</h3><a class="indexterm" name="id2993039"></a><pre class="programlisting">char* gnome_vfs_make_uri_canonical (const char *uri);</pre><p>
143 Standarizes the format of the uri being passed, so that it can be used
144 later in other functions that expect a canonical URI.</p><p>
146 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> and absolute or relative URI, it might have scheme.
147 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string that contains the canonical
148 representation of <i class="parameter"><tt>uri</tt></i>.
150 </td></tr></tbody></table></div><p>Since 2.2
151 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-make-path-name-canonical"></a>gnome_vfs_make_path_name_canonical ()</h3><a class="indexterm" name="id2993140"></a><pre class="programlisting">char* gnome_vfs_make_path_name_canonical
152 (const char *path);</pre><p>
153 Calls _gnome_vfs_canonicalize_pathname, allocating storage for the
154 result and providing for a cleaner memory management.</p><p>
156 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>path</tt></i> :</span></td><td> a file path, relative or absolute
157 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a canonical version of <i class="parameter"><tt>path</tt></i>
158 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-expand-initial-tilde"></a>gnome_vfs_expand_initial_tilde ()</h3><a class="indexterm" name="id2993237"></a><pre class="programlisting">char* gnome_vfs_expand_initial_tilde (const char *path);</pre><p>
159 If <i class="parameter"><tt>path</tt></i> starts with a ~, representing the user's home
160 directory, expand it to the actual path location.</p><p>
162 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>path</tt></i> :</span></td><td> a local file path which may start with a '~'
163 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string with the initial
164 tilde (if there was one) converted to an actual path
165 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-unescape-string-for-display"></a>gnome_vfs_unescape_string_for_display ()</h3><a class="indexterm" name="id2993336"></a><pre class="programlisting">char* gnome_vfs_unescape_string_for_display
166 (const char *escaped);</pre><p>
168 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>escaped</tt></i> :</span></td><td>
169 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
172 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-local-path-from-uri"></a>gnome_vfs_get_local_path_from_uri ()</h3><a class="indexterm" name="id2993420"></a><pre class="programlisting">char* gnome_vfs_get_local_path_from_uri
173 (const char *uri);</pre><p>
174 Create a local path for a file:/// URI. Do not use with URIs
175 of other methods.</p><p>
177 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> URI to convert to a local path
178 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string containing the local path
179 NULL is returned on error or if the uri isn't a file: URI
180 without a fragment identifier (or chained URI).
181 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-uri-from-local-path"></a>gnome_vfs_get_uri_from_local_path ()</h3><a class="indexterm" name="id2993513"></a><pre class="programlisting">char* gnome_vfs_get_uri_from_local_path
182 (const char *local_full_path);</pre><p>
183 Returns a file:/// URI for the local path <i class="parameter"><tt>local_full_path</tt></i>.</p><p>
185 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>local_full_path</tt></i> :</span></td><td> a full local filesystem path (i.e. not relative)
186 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string containing the URI corresponding
187 to <i class="parameter"><tt>local_full_path</tt></i> (NULL for some bad errors).
188 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-is-executable-command-string"></a>gnome_vfs_is_executable_command_string ()</h3><a class="indexterm" name="id2993619"></a><pre class="programlisting"><a
189 href="../glib/glib-Basic-Types.html#gboolean"
190 >gboolean</a> gnome_vfs_is_executable_command_string
191 (const char *command_string);</pre><p>
192 Checks if <i class="parameter"><tt>command_string</tt></i> starts with the full path of an executable file
193 or an executable in $PATH.</p><p>
195 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>command_string</tt></i> :</span></td><td>
196 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE if command_string started with and executable file,
198 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-list-deep-free"></a>gnome_vfs_list_deep_free ()</h3><a class="indexterm" name="id2993716"></a><pre class="programlisting">void gnome_vfs_list_deep_free (<a
199 href="../glib/glib-Doubly-Linked-Lists.html#GList"
200 >GList</a> *list);</pre><p>
201 Free <i class="parameter"><tt>list</tt></i>, and call <a
202 href="../glib/glib-Memory-Allocation.html#g-free"
203 ><tt class="function">g_free()</tt></a> on all data members.</p><p>
205 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>list</tt></i> :</span></td><td> list to be freed
206 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-volume-free-space"></a>gnome_vfs_get_volume_free_space ()</h3><a class="indexterm" name="id2993811"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_get_volume_free_space
207 (const GnomeVFSURI *vfs_uri,
208 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *size);</pre><p>
209 Stores in <i class="parameter"><tt>size</tt></i> the amount of free space on a volume.
210 This only works for local file systems with the file: scheme.</p><p>
212 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>vfs_uri</tt></i> :</span></td><td>
213 </td></tr><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td>
214 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GNOME_VFS_OK on success, otherwise an error code
215 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-icon-path-from-filename"></a>gnome_vfs_icon_path_from_filename ()</h3><a class="indexterm" name="id2993934"></a><pre class="programlisting">char* gnome_vfs_icon_path_from_filename
216 (const char *filename);</pre><p>
218 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td>
219 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
222 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-is-primary-thread"></a>gnome_vfs_is_primary_thread ()</h3><a class="indexterm" name="id2994017"></a><pre class="programlisting"><a
223 href="../glib/glib-Basic-Types.html#gboolean"
224 >gboolean</a> gnome_vfs_is_primary_thread (void);</pre><p>
225 Check if the current thread is the thread with the main glib event loop.</p><p>
227 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if the current thread is the thread with the
229 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-uri-scheme"></a>gnome_vfs_get_uri_scheme ()</h3><a class="indexterm" name="id2994088"></a><pre class="programlisting">char* gnome_vfs_get_uri_scheme (const char *uri);</pre><p>
230 Retrieve the scheme used in <i class="parameter"><tt>uri</tt></i></p><p>
232 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> a stringified URI
233 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> A newly allocated string containing the scheme, NULL
234 if <i class="parameter"><tt>uri</tt></i> it doesn't seem to contain a scheme
236 </td></tr></tbody></table></div><p>Since 2.2
237 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-uris-match"></a>gnome_vfs_uris_match ()</h3><a class="indexterm" name="id2994192"></a><pre class="programlisting"><a
238 href="../glib/glib-Basic-Types.html#gboolean"
239 >gboolean</a> gnome_vfs_uris_match (const char *uri_1,
240 const char *uri_2);</pre><p>
241 Compare two URIs.</p><p>
243 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri_1</tt></i> :</span></td><td> stringified URI to compare with <i class="parameter"><tt>uri_2</tt></i>.
244 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri_2</tt></i> :</span></td><td> stringified URI to compare with <i class="parameter"><tt>uri_1</tt></i>.
245 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE if they are the same, FALSE otherwise.
247 </td></tr></tbody></table></div><p>Since 2.2
248 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GNOME-VFS-ASSERT-PRIMARY-THREAD-CAPS"></a>GNOME_VFS_ASSERT_PRIMARY_THREAD</h3><a class="indexterm" name="id2994324"></a><pre class="programlisting">#define GNOME_VFS_ASSERT_PRIMARY_THREAD g_assert (gnome_vfs_is_primary_thread())
250 Asserts that the current thread is the thread with
251 the main glib event loop</p><p>
253 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GNOME-VFS-ASSERT-SECONDARY-THREAD-CAPS"></a>GNOME_VFS_ASSERT_SECONDARY_THREAD</h3><a class="indexterm" name="id2994364"></a><pre class="programlisting">#define GNOME_VFS_ASSERT_SECONDARY_THREAD g_assert (!gnome_vfs_is_primary_thread())
255 Asserts that the current thread is NOT the thread with
256 the main glib event loop</p><p>
258 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-read-entire-file"></a>gnome_vfs_read_entire_file ()</h3><a class="indexterm" name="id2994402"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_read_entire_file (const char *uri,
260 char **file_contents);</pre><p>
261 Reads an entire file into memory for convenience. Beware accidentally
262 loading large files into memory with this function.</p><p>
264 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> URI of the file to read
265 </td></tr><tr><td><span class="term"><i class="parameter"><tt>file_size</tt></i> :</span></td><td> after reading the file, contains the size of the file read
266 </td></tr><tr><td><span class="term"><i class="parameter"><tt>file_contents</tt></i> :</span></td><td> contains the file_size bytes, the contents of the file at <i class="parameter"><tt>uri</tt></i>.
267 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> An integer representing the result of the operation
269 </td></tr></tbody></table></div><p>Since 2.2
270 </p></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="ch08.html"><b><< Other Stuff</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-20-gnome-vfs-standard-callbacks.html"><b>gnome-vfs-standard-callbacks >></b></a></td></tr></table></body></html>