/usr/share/gtk-doc/html/libgda-4.0/libgda-4.0-Utility-functions.html is in libgda-4.0-doc 4.2.8-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Utility functions</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GNOME Data Access 4 manual">
<link rel="up" href="misc.html" title="Miscellaneous">
<link rel="prev" href="misc.html" title="Miscellaneous">
<link rel="next" href="libgda-4.0-Logging.html" title="Logging">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="misc.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="misc.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">GNOME Data Access 4 manual</th>
<td><a accesskey="n" href="libgda-4.0-Logging.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libgda-4.0-Utility-functions.synopsis" class="shortcut">Top</a>
|
<a href="#libgda-4.0-Utility-functions.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libgda-4.0-Utility-functions"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgda-4.0-Utility-functions.top_of_page"></a>Utility functions</span></h2>
<p>Utility functions</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libgda-4.0-Utility-functions.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libgda-4.0-Utility-functions.html#gda-g-type-to-string" title="gda_g_type_to_string ()">gda_g_type_to_string</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>);
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> <a class="link" href="libgda-4.0-Utility-functions.html#gda-g-type-from-string" title="gda_g_type_from_string ()">gda_g_type_from_string</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *str</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libgda-4.0-Utility-functions.html#gda-default-escape-string" title="gda_default_escape_string ()">gda_default_escape_string</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libgda-4.0-Utility-functions.html#gda-default-unescape-string" title="gda_default_unescape_string ()">gda_default_unescape_string</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="libgda-4.0-Utility-functions.html#gda-identifier-hash" title="gda_identifier_hash ()">gda_identifier_hash</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-Utility-functions.html#gda-identifier-equal" title="gda_identifier_equal ()">gda_identifier_equal</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id1</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id2</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> ** <a class="link" href="libgda-4.0-Utility-functions.html#gda-completion-list-get" title="gda_completion_list_get ()">gda_completion_list_get</a> (<em class="parameter"><code><a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> *cnc</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sql</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> start</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> end</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libgda-4.0-Utility-functions.html#gda-rfc1738-encode" title="gda_rfc1738_encode ()">gda_rfc1738_encode</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-Utility-functions.html#gda-rfc1738-decode" title="gda_rfc1738_decode ()">gda_rfc1738_decode</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgda-4.0-Utility-functions.html#gda-dsn-split" title="gda_dsn_split ()">gda_dsn_split</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_dsn</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_username</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_password</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgda-4.0-Utility-functions.html#gda-connection-string-split" title="gda_connection_string_split ()">gda_connection_string_split</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_cnc_params</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_provider</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_username</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_password</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-Utility-functions.html#gda-parse-iso8601-date" title="gda_parse_iso8601_date ()">gda_parse_iso8601_date</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> *gdate</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *value</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-Utility-functions.html#gda-parse-iso8601-time" title="gda_parse_iso8601_time ()">gda_parse_iso8601_time</a> (<em class="parameter"><code><a class="link" href="libgda-4.0-Gda-Value.html#GdaTime"><span class="type">GdaTime</span></a> *timegda</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *value</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-Utility-functions.html#gda-parse-iso8601-timestamp" title="gda_parse_iso8601_timestamp ()">gda_parse_iso8601_timestamp</a> (<em class="parameter"><code><a class="link" href="libgda-4.0-Gda-Value.html#GdaTimestamp"><span class="type">GdaTimestamp</span></a> *timestamp</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *value</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libgda-4.0-Utility-functions.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="libgda-4.0-Utility-functions.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="gda-g-type-to-string"></a><h3>gda_g_type_to_string ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gda_g_type_to_string (<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>);</pre>
<p>
Converts a GType to its string representation (use <a class="link" href="libgda-4.0-Utility-functions.html#gda-g-type-from-string" title="gda_g_type_from_string ()"><code class="function">gda_g_type_from_string()</code></a> for the
operation in the other direction).
</p>
<p>
This function wraps <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#g-type-name"><code class="function">g_type_name()</code></a> but for common types it provides an easier to
understand and remember name. For Example the G_TYPE_STRING is converted to "string"
whereas <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#g-type-name"><code class="function">g_type_name()</code></a> converts it to "gchararray".
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>Type to convert from.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the GDA's string representing the given <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> or the name
returned by <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#g-type-name"><span class="type">g_type_name</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-g-type-from-string"></a><h3>gda_g_type_from_string ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> gda_g_type_from_string (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *str</code></em>);</pre>
<p>
Converts a named type to ts GType type (also see the <a class="link" href="libgda-4.0-Utility-functions.html#gda-g-type-to-string" title="gda_g_type_to_string ()"><code class="function">gda_g_type_to_string()</code></a> function).
</p>
<p>
This function is a wrapper around the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#g-type-from-name"><code class="function">g_type_from_name()</code></a> function, but also recognizes
some type synonyms such as:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>"int" for G_TYPE_INT</p></li>
<li class="listitem"><p>"string" for G_TYPE_STRING</p></li>
<li class="listitem"><p>"date" for G_TYPE_DATE</p></li>
<li class="listitem"><p>"time" for GDA_TYPE_TIME</p></li>
<li class="listitem"><p>"timestamp" for GDA_TYPE_TIMESTAMP</p></li>
<li class="listitem"><p>"boolean" for G_TYPE_BOOLEAN</p></li>
<li class="listitem"><p>"blob" for GDA_TYPE_BLOB</p></li>
<li class="listitem"><p>"binary" for GDA_TYPE_BINARY</p></li>
<li class="listitem"><p>"null" for GDA_TYPE_NULL</p></li>
</ul></div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
<td>the name of a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>, as returned by <a class="link" href="libgda-4.0-Utility-functions.html#gda-g-type-to-string" title="gda_g_type_to_string ()"><code class="function">gda_g_type_to_string()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> represented by the given <em class="parameter"><code>str</code></em>, or <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-INVALID:CAPS"><span class="type">G_TYPE_INVALID</span></a> if not found</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-default-escape-string"></a><h3>gda_default_escape_string ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gda_default_escape_string (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Escapes <em class="parameter"><code>string</code></em> to make it understandable by a DBMS. The escape method is very common and replaces any
occurrence of "'" with "''" and "\" with "\\"
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>string to escape</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new string</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-default-unescape-string"></a><h3>gda_default_unescape_string ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gda_default_unescape_string (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Do the reverse of <a class="link" href="libgda-4.0-Utility-functions.html#gda-default-escape-string" title="gda_default_escape_string ()"><code class="function">gda_default_escape_string()</code></a>: transforms any "''" into "'", any
"\\" into "\" and any "\'" into "'".
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>string to unescape</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new unescaped string, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in an error was found in <em class="parameter"><code>string</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-identifier-hash"></a><h3>gda_identifier_hash ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gda_identifier_hash (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>);</pre>
<p>
computes a hash string from <em class="parameter"><code>id</code></em>, to be used in hash tables as a <a href="http://library.gnome.org/devel/glib/unstable/glib-Hash-Tables.html#GHashFunc"><span class="type">GHashFunc</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
<td>an identifier string</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new hash</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-identifier-equal"></a><h3>gda_identifier_equal ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_identifier_equal (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id1</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id2</code></em>);</pre>
<p>
Does the same as strcmp(<em class="parameter"><code>id1</code></em>, <em class="parameter"><code>id2</code></em>), but handles the case where id1 and/or id2 are enclosed in double quotes.
can also be used in hash tables as a <a href="http://library.gnome.org/devel/glib/unstable/glib-Hash-Tables.html#GEqualFunc"><span class="type">GEqualFunc</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>id1</code></em> :</span></p></td>
<td>an identifier string</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>id2</code></em> :</span></p></td>
<td>an identifier string</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE if <em class="parameter"><code>id1</code></em> and <em class="parameter"><code>id2</code></em> are equal.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-completion-list-get"></a><h3>gda_completion_list_get ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> ** gda_completion_list_get (<em class="parameter"><code><a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> *cnc</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sql</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> start</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> end</code></em>);</pre>
<p>
Creates an array of strings (terminated by a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) corresponding to possible completions.
If no completion is available, then the returned array contains just one NULL entry, and
if it was not possible to try to compute a completions list, then <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cnc</code></em> :</span></p></td>
<td>a <a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sql</code></em> :</span></p></td>
<td>a partial SQL statement which is the context of the completion proposal</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>start</code></em> :</span></p></td>
<td>starting position within <em class="parameter"><code>sql</code></em> of the "token" to complete (starts at 0)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>end</code></em> :</span></p></td>
<td>ending position within <em class="parameter"><code>sql</code></em> of the "token" to complete</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new array of strings, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (use <a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a> to free the returned array). <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-rfc1738-encode"></a><h3>gda_rfc1738_encode ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gda_rfc1738_encode (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Encodes <em class="parameter"><code>string</code></em> using the RFC 1738 recommendations: the
<code class="constant"><>"#%{}|\^~[]'`;/?:@=&</code> and space characters are replaced by
<code class="constant">"%<code class="literal">ab</code>"</code> where
<code class="constant">ab</code> is the hexadecimal number corresponding to the character.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a string to encode</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new string. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-rfc1738-decode"></a><h3>gda_rfc1738_decode ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_rfc1738_decode (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>
Decodes <em class="parameter"><code>string</code></em> using the RFC 1738 recommendations: the
<code class="constant"><>"#%{}|\^~[]'`;/?:@=&</code> and space characters are replaced by
<code class="constant">"%<code class="literal">ab</code>"</code> where
<code class="constant">ab</code> is the hexadecimal number corresponding to the character.
</p>
<p>
<em class="parameter"><code>string</code></em> should respect the RFC 1738 encoding. If this is not the case (for example if there
is a "<code class="literal">2z</code>" because 2z is not an hexadecimal value), then the part with the problem
is not decoded, and the function returns FALSE.
</p>
<p>
<em class="parameter"><code>string</code></em> is decoded in place, no new string gets created.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a string to decode</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE if no error occurred.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-dsn-split"></a><h3>gda_dsn_split ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gda_dsn_split (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_dsn</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_username</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_password</code></em>);</pre>
<p>
Extract the DSN, username and password from <em class="parameter"><code>string</code></em>. in <em class="parameter"><code>string</code></em>, the various parts are strings
which are expected to be encoded using an RFC 1738 compliant encoding. If they are specified,
the returned username and password strings are correctly decoded.
</p>
<p>
<em class="parameter"><code>out_username</code></em> and <em class="parameter"><code>out_password</code></em> may be set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> depending on <em class="parameter"><code>string</code></em>'s format.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a string in the "[<username>[:<password>]@]<DSN>" form</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_dsn</code></em> :</span></p></td>
<td>a place to store the new string containing the <DSN> part</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_username</code></em> :</span></p></td>
<td>a place to store the new string containing the <username> part</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_password</code></em> :</span></p></td>
<td>a place to store the new string containing the <password> part</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-connection-string-split"></a><h3>gda_connection_string_split ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gda_connection_string_split (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_cnc_params</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_provider</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_username</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_password</code></em>);</pre>
<p>
Extract the provider, connection parameters, username and password from <em class="parameter"><code>string</code></em>.
in <em class="parameter"><code>string</code></em>, the various parts are strings
which are expected to be encoded using an RFC 1738 compliant encoding. If they are specified,
the returned provider, username and password strings are correctly decoded.
</p>
<p>
For example all the following connection strings:
</p>
<pre class="programlisting">
PostgreSQL://meme:pass@DB_NAME=mydb;HOST=server
PostgreSQL://meme@DB_NAME=mydb;HOST=server;PASSWORD=pass
PostgreSQL://meme@DB_NAME=mydb;PASSWORD=pass;HOST=server
PostgreSQL://meme@PASSWORD=pass;DB_NAME=mydb;HOST=server
PostgreSQL://DB_NAME=mydb;HOST=server;USERNAME=meme;PASSWORD=pass
PostgreSQL://DB_NAME=mydb;HOST=server;PASSWORD=pass;USERNAME=meme
PostgreSQL://DB_NAME=mydb;USERNAME=meme;PASSWORD=pass;HOST=server
PostgreSQL://PASSWORD=pass;USERNAME=meme;DB_NAME=mydb;HOST=server
PostgreSQL://:pass@USERNAME=meme;DB_NAME=mydb;HOST=server
PostgreSQL://:pass@DB_NAME=mydb;HOST=server;USERNAME=meme</pre>
<p>
</p>
<p>
will return the following new strings (double quotes added here to delimit strings):
</p>
<pre class="programlisting">
out_cnc_params: "DB_NAME=mydb;HOST=server"
out_provider: "PostgreSQL"
out_username: "meme"
out_password: "pass"</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>a string in the "[<provider>://][<username>[:<password>]@]<connection_params>" form</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_cnc_params</code></em> :</span></p></td>
<td>a place to store the new string containing the <connection_params> part</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_provider</code></em> :</span></p></td>
<td>a place to store the new string containing the <provider> part</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_username</code></em> :</span></p></td>
<td>a place to store the new string containing the <username> part</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_password</code></em> :</span></p></td>
<td>a place to store the new string containing the <password> part</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-parse-iso8601-date"></a><h3>gda_parse_iso8601_date ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_parse_iso8601_date (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> *gdate</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *value</code></em>);</pre>
<p>
Extracts date parts from <em class="parameter"><code>value</code></em>, and sets <em class="parameter"><code>gdate</code></em>'s contents
</p>
<p>
Accepted date format is "YYYY-MM-DD" (more or less than 4 digits for years and
less than 2 digits for month and day are accepted). Years must be in the 1-65535 range,
a limitation imposed by <a href="http://library.gnome.org/devel/glib/unstable/glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gdate</code></em> :</span></p></td>
<td>a pointer to a <a href="http://library.gnome.org/devel/glib/unstable/glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> structure which will be filled</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>a string</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if no error occurred</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-parse-iso8601-time"></a><h3>gda_parse_iso8601_time ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_parse_iso8601_time (<em class="parameter"><code><a class="link" href="libgda-4.0-Gda-Value.html#GdaTime"><span class="type">GdaTime</span></a> *timegda</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *value</code></em>);</pre>
<p>
Extracts time parts from <em class="parameter"><code>value</code></em>, and sets <em class="parameter"><code>timegda</code></em>'s contents
</p>
<p>
Accepted date format is "HH:MM:SS[.ms][TZ]" where TZ is +hour or -hour
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>timegda</code></em> :</span></p></td>
<td>a pointer to a <a class="link" href="libgda-4.0-Gda-Value.html#GdaTime"><span class="type">GdaTime</span></a> structure which will be filled</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>a string</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE if no error occurred</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-parse-iso8601-timestamp"></a><h3>gda_parse_iso8601_timestamp ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_parse_iso8601_timestamp (<em class="parameter"><code><a class="link" href="libgda-4.0-Gda-Value.html#GdaTimestamp"><span class="type">GdaTimestamp</span></a> *timestamp</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *value</code></em>);</pre>
<p>
Extracts date and time parts from <em class="parameter"><code>value</code></em>, and sets <em class="parameter"><code>timestamp</code></em>'s contents
</p>
<p>
Accepted date format is "YYYY-MM-DD HH:MM:SS[.ms][TZ]" where TZ is +hour or -hour
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>timestamp</code></em> :</span></p></td>
<td>a pointer to a <span class="type">GdaTimeStamp</span> structure which will be filled</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>a string</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE if no error occurred</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.17</div>
</body>
</html>
|