X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=doc%2Fusage.html;h=409ebbf308878bf17f0b2726ade6faf57a8eedb3;hb=b109f95d373fa6baae6c1a43e5b3805fb7fd22fb;hp=00003be0d0b4484dd762b1c4b4e7c0b174d1065f;hpb=5609cf009e11653fec8314695d9897f9b94204d3;p=gedcom-parse.git diff --git a/doc/usage.html b/doc/usage.html index 00003be..409ebbf 100644 --- a/doc/usage.html +++ b/doc/usage.html @@ -25,9 +25,10 @@
locale
mechanism (i.e. via the LANG
, LC_ALL
or LC_CTYPE
environment variables), which also controls the gettext
- mechanism in the application. For this, the following steps need to
+ mechanism in the application. gedcom-parse
contains an example implementation (utf8-locale.c
and utf8-locale.h
+ in the top directory). Feel free to use it in
+your source code (it is not part of the library, and it isn't installed anywhere,
+so you need to take over the source and header file in your application).
+ + +Both functions return a pointer to a static buffer that is overwritten on +each call. To function properly, the application must first set the +locale using thechar *convert_utf8_to_locale (char *input, int *conv_failures);
char *convert_locale_to_utf8 (char *input);
setlocale
function (the second step detailed below).
+ All other steps given below, including setting up and closing down the conversion
+handles, are transparantly handled by the two functions. NULL
if you are not interested (note that usually, the interesting information is just whether there were
+ conversion failures or not, which is then given by the integer being bigger
+than zero or not). The second function doesn't need this, because any
+locale can be converted to UTF-8.+void convert_set_unknown (const char *unknown);
ic
iconv_close(iconv_handle);
+ The example implementation
+mentioned above grows the output buffer dynamically and outputs "?" for characters
+that can't be converted.
+
+
+ Support for configure.in
+Programs using the GEDCOM parser library and using autoconf to configure
+their sources can use the following statements in configure.in (the example
+is checking for gedcom-parse, version 1.34):
+ AC_CHECK_LIB(gedcom, gedcom_parse_file,,
+ AC_MSG_ERROR(Cannot find libgedcom: Please install gedcom-parse))
+AC_MSG_CHECKING(for libgedcom version)
+AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <gedcom.h>
+int
+main()
+{
+if (GEDCOM_PARSE_VERSION >= 1034) exit(0);
+exit(1);
+}],
+ac_gedcom_version_ok='yes',
+ac_gedcom_version_ok='no',
+ac_gedcom_version_ok='no')
+if test "$ac_gedcom_version_ok" = 'yes' ; then
+ AC_MSG_RESULT(ok)
+else
+ AC_MSG_RESULT(not ok)
+ AC_MSG_ERROR(You need at least version 1.34 of gedcom-parse)
+fi
+
-
-
- The source distribution of gedcom-parse
contains an example implementation (utf8-locale.c
and utf8-locale.h
- in the top directory) that grows the output buffer dynamically and outputs
-"?" for characters that can't be converted. Feel free to use it in
-your source code (it is not part of the library, and it isn't installed anywhere,
-so you need to take over the source and header file in your application).
-
-
-Its interface is:
-
- char *convert_utf8_to_locale (char *input);
char *convert_locale_to_utf8 (char *input);
-
-Both functions return a pointer to a static buffer that is overwritten on
-each call. To function properly, the application must first set the
-locale using the setlocale
function (the second step above).
- All other steps, including setting up and closing down the conversion
-handles, are transparantly handled by the two functions.
-
-You can change the "?" that is output for characters that can't be converted
-to any string you want, using the following function before the conversion
-calls:
-
- void convert_set_unknown (const char *unknown);
-
-
+There are three preprocessor symbols defined for version checks in the header:
+
+ GEDCOM_PARSE_VERSION_MAJOR
+ GEDCOM_PARSE_VERSION_MINOR
+ GEDCOM_PARSE_VERSION
+
+
+The last one is equal to (GEDCOM_PARSE_VERSION_MAJOR * 1000) + GEDCOM_PARSE_VERSION_MINOR.
+
$Id$
$Name$