Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 874255f3b26b44feb57fbe38a7384518 > files > 284

gmerlin-0.4.1-2mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>gmerlin: /home/mandrake/rpm/BUILD/gmerlin-0.4.1/include/gmerlin/utils.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_9de5cad15617e449f29680677e022ed8.html">include</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_4a3f2046eda2c9424010fb7393a61021.html">gmerlin</a>
  </div>
</div>
<div class="contents">
<h1>utils.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> * gmerlin - a general purpose multimedia framework and applications</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (c) 2001 - 2008 Members of the Gmerlin project</span>
<a name="l00005"></a>00005 <span class="comment"> * gmerlin-general@lists.sourceforge.net</span>
<a name="l00006"></a>00006 <span class="comment"> * http://gmerlin.sourceforge.net</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This program is free software: you can redistribute it and/or modify</span>
<a name="l00009"></a>00009 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00010"></a>00010 <span class="comment"> * the Free Software Foundation, either version 2 of the License, or</span>
<a name="l00011"></a>00011 <span class="comment"> * (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00016"></a>00016 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00019"></a>00019 <span class="comment"> * along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00020"></a>00020 <span class="comment"> * *****************************************************************/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef __BG_UTILS_H_</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define __BG_UTILS_H_</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;<a class="codeRef" doxygen="gavl.tags:http://gmerlin.sourceforge.net/doc/gavl//" href="http://gmerlin.sourceforge.net/doc/gavl//gavl_8h.html">gavl/gavl.h</a>&gt;</span>
<a name="l00026"></a>00026 
<a name="l00048"></a>00048 <span class="comment">/* Append a trailing '/' if it's missing. Argument must be free()able */</span>
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 <span class="keywordtype">char</span> * <a class="code" href="group__files.html#g3f47b08c836218f12113a6b6687ee360" title="Append a trailing slash to a path name.">bg_fix_path</a>(<span class="keywordtype">char</span> * path);
<a name="l00051"></a>00051 
<a name="l00059"></a>00059 <span class="keywordtype">int</span> <a class="code" href="group__files.html#g50749de9533e0e50ef7539905cf7d4ec" title="Ensure that a directory exists.">bg_ensure_directory</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * dir);
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 
<a name="l00073"></a>00073 <span class="keywordtype">char</span> * <a class="code" href="group__files.html#g195a6818345b0567e610abb32a27d9b3" title="Search for a file for reading.">bg_search_file_read</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * directory, <span class="keyword">const</span> <span class="keywordtype">char</span> * file);
<a name="l00074"></a>00074 
<a name="l00087"></a>00087 <span class="keywordtype">char</span> * <a class="code" href="group__files.html#g591565d0087d5fd623b05bca2d973c24" title="Search for a file for writing.">bg_search_file_write</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * directory, <span class="keyword">const</span> <span class="keywordtype">char</span> * file);
<a name="l00088"></a>00088 
<a name="l00098"></a>00098 <span class="keywordtype">int</span> <a class="code" href="group__files.html#g87ee654a2054b10219247db03daffb71" title="Search for an executable.">bg_search_file_exec</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * file, <span class="keywordtype">char</span> ** path);
<a name="l00099"></a>00099 
<a name="l00108"></a>00108 <span class="keywordtype">char</span> * <a class="code" href="group__files.html#gb80249fd80dff27f45109de51be0eefe" title="Find an URL launcher.">bg_find_url_launcher</a>();
<a name="l00109"></a>00109 
<a name="l00117"></a>00117 <span class="keywordtype">void</span> <a class="code" href="group__files.html#gad78656e05a0cc1cc885079960acc7c7" title="Display html help.">bg_display_html_help</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * path);
<a name="l00118"></a>00118 
<a name="l00126"></a>00126 <span class="keywordtype">char</span> * <a class="code" href="group__files.html#g3945d74fa10a7e5319a76bf0162c146e" title="Create a unique filename.">bg_create_unique_filename</a>(<span class="keywordtype">char</span> * format);
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 
<a name="l00147"></a>00147 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g85f65ca22c7e0e43e07a2c66f50b2204" title="Duplicate a string.">bg_strdup</a>(<span class="keywordtype">char</span> * old_string, <span class="keyword">const</span> <span class="keywordtype">char</span> * new_string);
<a name="l00148"></a>00148 
<a name="l00159"></a>00159 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#gb244d3ebad539ce68b6845060a577c79" title="Duplicate a string from a part of a source string.">bg_strndup</a>(<span class="keywordtype">char</span> * old_string,
<a name="l00160"></a>00160                   <span class="keyword">const</span> <span class="keywordtype">char</span> * new_start,
<a name="l00161"></a>00161                   <span class="keyword">const</span> <span class="keywordtype">char</span> * new_end);
<a name="l00162"></a>00162 
<a name="l00169"></a>00169 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g0f1126a9090f15b26b6c887ef47d6062" title="Concatenate two strings.">bg_strcat</a>(<span class="keywordtype">char</span> * old_string, <span class="keyword">const</span> <span class="keywordtype">char</span> * tail);
<a name="l00170"></a>00170 
<a name="l00178"></a>00178 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g9ab27a7531f6d53a6776667da5b6ffd3" title="Append a part of a string to another string.">bg_strncat</a>(<span class="keywordtype">char</span> * old_string, <span class="keyword">const</span> <span class="keywordtype">char</span> * start, <span class="keyword">const</span> <span class="keywordtype">char</span> * end);
<a name="l00179"></a>00179 
<a name="l00185"></a>00185 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g512496339d271800ccad7d909466da43" title="Convert an UTF-8 string to uppercase.">bg_toupper</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * str);
<a name="l00186"></a>00186 
<a name="l00187"></a>00187 
<a name="l00196"></a>00196 <span class="keywordtype">int</span> <a class="code" href="group__strings.html#gc7cb47e44502ede7a9969dd357211986" title="Check if a string looks like an URL.">bg_string_is_url</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * str);
<a name="l00197"></a>00197 
<a name="l00213"></a>00213 <span class="keywordtype">int</span> <a class="code" href="group__strings.html#g786cca69eabd5b43eae0566289813af9" title="Split an URL into their parts.">bg_url_split</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * url,
<a name="l00214"></a>00214                  <span class="keywordtype">char</span> ** protocol,
<a name="l00215"></a>00215                  <span class="keywordtype">char</span> ** user,
<a name="l00216"></a>00216                  <span class="keywordtype">char</span> ** password,
<a name="l00217"></a>00217                  <span class="keywordtype">char</span> ** hostname,
<a name="l00218"></a>00218                  <span class="keywordtype">int</span> * port,
<a name="l00219"></a>00219                  <span class="keywordtype">char</span> ** path);
<a name="l00220"></a>00220 
<a name="l00230"></a>00230 <span class="keywordtype">void</span> <a class="code" href="group__strings.html#gcdc3eadf71268ab17c6e44058402d49a" title="Get MD5 hash of a filename.">bg_get_filename_hash</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * gml, <span class="keywordtype">char</span> ret[33]);
<a name="l00231"></a>00231 
<a name="l00240"></a>00240 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#ge53e17355b5cf85d6050c0b6fcd482a9" title="Print into a string.">bg_sprintf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * format,...) __attribute__ ((format (printf, 1, 2)));
<a name="l00241"></a>00241 
<a name="l00250"></a>00250 <span class="keywordtype">char</span> ** <a class="code" href="group__strings.html#g3e09358b31ca242b0d77da64f37b4799" title="Break a string into substrings.">bg_strbreak</a>(const <span class="keywordtype">char</span> * str, <span class="keywordtype">char</span> delim);
<a name="l00251"></a>00251 
<a name="l00258"></a>00258 <span class="keywordtype">void</span> <a class="code" href="group__strings.html#gf548c01df6e5f7fa89be6bf84a782746" title="Free a substrings array.">bg_strbreak_free</a>(<span class="keywordtype">char</span> ** retval);
<a name="l00259"></a>00259 
<a name="l00270"></a>00270 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#gde07b6cfc705fa3eb87b0e169267ddad" title="Scramble a string.">bg_scramble_string</a>(const <span class="keywordtype">char</span> * str);
<a name="l00271"></a>00271 
<a name="l00282"></a>00282 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g871f478ddc0303b07b1a27d88a7e9a53" title="Descramble a string.">bg_descramble_string</a>(const <span class="keywordtype">char</span> * str);
<a name="l00283"></a>00283 
<a name="l00291"></a>00291 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g2b52f10ce16f30531ed438d8e824110b" title="Convert a binary string (in system charset) to an URI.">bg_string_to_uri</a>(const <span class="keywordtype">char</span> * pos1, <span class="keywordtype">int</span> len);
<a name="l00292"></a>00292 
<a name="l00300"></a>00300 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#gf36af54a0711c076061e3d33630daa57" title="Convert an URI to a a binary string (in system charset).">bg_uri_to_string</a>(const <span class="keywordtype">char</span> * pos1, <span class="keywordtype">int</span> len);
<a name="l00301"></a>00301 
<a name="l00312"></a>00312 <span class="keywordtype">char</span> ** <a class="code" href="group__strings.html#gaa73f7bd8a0c1dd5d82d2fa495a7638d" title="Decode an URI list.">bg_urilist_decode</a>(const <span class="keywordtype">char</span> * str, <span class="keywordtype">int</span> len);
<a name="l00313"></a>00313 
<a name="l00318"></a>00318 <span class="keywordtype">void</span> <a class="code" href="group__strings.html#gcbcb97e546dcb05e3c62cf438d64fd85" title="Free an URI list.">bg_urilist_free</a>(<span class="keywordtype">char</span> ** uri_list);
<a name="l00319"></a>00319 
<a name="l00328"></a>00328 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g3c961ec1b257dcc6bd6b35c9598db808" title="Convert a string from the system character set to UTF-8.">bg_system_to_utf8</a>(const <span class="keywordtype">char</span> * str, <span class="keywordtype">int</span> len);
<a name="l00329"></a>00329 
<a name="l00338"></a>00338 <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g2811bcb3e6da8bed49c079ca13f640ba" title="Convert a string from UTF-8 to the system character set.">bg_utf8_to_system</a>(const <span class="keywordtype">char</span> * str, <span class="keywordtype">int</span> len);
<a name="l00339"></a>00339 
<a name="l00345"></a>00345 const <span class="keywordtype">char</span> * <a class="code" href="group__strings.html#g3f6852a10ccf9bd55b564e1c6d261c4b" title="Get a language name.">bg_get_language_name</a>(const <span class="keywordtype">char</span> * iso);
<a name="l00346"></a>00346 
<a name="l00353"></a>00353 <span class="keywordtype">int</span> <a class="code" href="group__strings.html#ga982eb0cc563236178fd1186d088c374" title="Check if a string occurs in a space-separated list of strings.">bg_string_match</a>(const <span class="keywordtype">char</span> * str, const <span class="keywordtype">char</span> * key_list);
<a name="l00354"></a>00354 
<a name="l00355"></a>00355 <span class="comment">/* @} */</span>
<a name="l00356"></a>00356 
<a name="l00372"></a>00372 <span class="keywordtype">void</span> <a class="code" href="group__misc.html#gd320141c29d41fc7440fe189006ab2c1" title="Do a hexdump of binary data.">bg_hexdump</a>(uint8_t * data, <span class="keywordtype">int</span> len, <span class="keywordtype">int</span> linebreak);
<a name="l00373"></a>00373 
<a name="l00380"></a>00380 <span class="keywordtype">char</span> * <a class="code" href="group__misc.html#gf81531ffd8bd903924e80256944c0e14" title="Convert an audio format to a string.">bg_audio_format_to_string</a>(<a class="codeRef" doxygen="gavl.tags:http://gmerlin.sourceforge.net/doc/gavl//" href="http://gmerlin.sourceforge.net/doc/gavl//structgavl__audio__format__s.html">gavl_audio_format_t</a> * format, <span class="keywordtype">int</span> use_tabs);
<a name="l00381"></a>00381 
<a name="l00382"></a>00382 
<a name="l00389"></a>00389 <span class="keywordtype">char</span> * <a class="code" href="group__misc.html#g5129c3a329034438a94b12f4bb07a108" title="Convert a video format to a string.">bg_video_format_to_string</a>(<a class="codeRef" doxygen="gavl.tags:http://gmerlin.sourceforge.net/doc/gavl//" href="http://gmerlin.sourceforge.net/doc/gavl//structgavl__video__format__s.html">gavl_video_format_t</a> * format, <span class="keywordtype">int</span> use_tabs);
<a name="l00390"></a>00390 
<a name="l00395"></a>00395 <span class="keywordtype">void</span> <a class="code" href="group__misc.html#ga6389bf6e4856f3900d23ba2d39d54ab" title="Dump to stderr.">bg_dprintf</a>(const <span class="keywordtype">char</span> * format, ...) __attribute__ ((format (printf, 1, 2)));
<a name="l00396"></a>00396 
<a name="l00402"></a>00402 <span class="keywordtype">void</span> <a class="code" href="group__misc.html#gf6b3f98898a333b16c35055d1061e34e" title="Dump to stderr with intendation.">bg_diprintf</a>(<span class="keywordtype">int</span> indent, const <span class="keywordtype">char</span> * format, ...) __attribute__ ((format (printf, 2, 3)));
<a name="l00403"></a>00403 
<a name="l00404"></a>00404 <span class="comment">/* @} */</span>
<a name="l00405"></a>00405 
<a name="l00406"></a>00406 extern <span class="keywordtype">char</span> const * const bg_language_codes[];
<a name="l00407"></a>00407 extern <span class="keywordtype">char</span> const * const bg_language_labels[];
<a name="l00408"></a>00408 
<a name="l00409"></a>00409 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00410"></a>00410 <span class="preprocessor"></span><span class="preprocessor">#define bg_debug(f,...) fprintf(stderr, f, __VA_ARGS__)</span>
<a name="l00411"></a>00411 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00412"></a>00412 <span class="preprocessor"></span><span class="preprocessor">#define bg_debug(f,...)</span>
<a name="l00413"></a>00413 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00414"></a>00414 <span class="preprocessor"></span>
<a name="l00415"></a>00415 
<a name="l00416"></a>00416 
<a name="l00417"></a>00417 <span class="preprocessor">#endif // __BG_UTILS_H_</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sat Aug 22 01:28:05 2009 for gmerlin by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>