/rusxmms/librcc

To get this branch, use:
bzr branch http://suren.me/webbzr/rusxmms/librcc

« back to all changes in this revision

Viewing changes to src/librcc.h

  • Committer: Suren A. Chilingaryan
  • Date: 2005-07-29 03:26:28 UTC
  • Revision ID: Arch-1:ds@dside.dyndns.org--darksoft-2004%librcc--main--0.1--patch-23
Translation
    - Language Translation using libtranslate is implemented
    - Autoengine sets current charset (option)

Show diffs side-by-side

added added

removed removed

Lines of Context:
371
371
    RCC_OPTION_AUTODETECT_FS_TITLES,    /**< Detect titles of #RCC_CLASS_FS classes */
372
372
    RCC_OPTION_AUTODETECT_FS_NAMES,     /**< Try to find encoding of #RCC_CLASS_FS by accessing fs */
373
373
    RCC_OPTION_CONFIGURED_LANGUAGES_ONLY, /**< Use only configured languages or languages with auto-engines */
 
374
    RCC_OPTION_TRANSLATE,               /**< Translate #rcc_string if it's language differs from current one */
 
375
    RCC_OPTION_AUTOENGINE_SET_CURRENT,  /**< If enabled autodetection engine will set current charset */
374
376
    RCC_MAX_OPTIONS
375
377
} rcc_option;
376
378
 
908
910
  * @result 
909
911
  *     - NULL if no recoding is required
910
912
  *     - Pointer on initialized context if successful
911
 
  *     - Pointer on errnous context in the case of error
912
913
  */
913
914
rcc_iconv rccIConvOpen(const char *from, const char *to);
914
915
/**
920
921
  * Recodes chunk of data.
921
922
  *
922
923
  * @param icnv is recoding context
923
 
  * @param outbuf is preallocated output buffer
924
 
  * @param outsize is size of output buffer (striped string will be returned if buffer to small) 
925
924
  * @param buf is data for recoding
926
 
  * @param size is size of the data
927
 
  * @return number of recoded bytes in output buffer or -1 in the case of error
928
 
  */
929
 
size_t rccIConvRecode(rcc_iconv icnv, char *outbuf, size_t outsize, const char *buf, size_t size);
 
925
  * @param len is size of the data
 
926
  * @param rlen is size of recoded data
 
927
  * @return recoded string or NULL in the case of error
 
928
  */
 
929
char *rccIConv(rcc_iconv icnv, const char *buf, size_t len, size_t *rlen);
 
930
 
 
931
/**
 
932
  * translating context
 
933
  */
 
934
typedef struct rcc_translate_t *rcc_translate;
 
935
 
 
936
/* rcctranslate.c */
 
937
/**
 
938
  * Open translating context.
 
939
  *
 
940
  * @param from is source language
 
941
  * @param to is destination language
 
942
  * @return
 
943
  *     - NULL if translation is not required or possible
 
944
  *     - Pointer on initialized context if successful
 
945
  */
 
946
rcc_translate rccTranslateOpen(const char *from, const char *to);
 
947
/**
 
948
  * Close translating context.
 
949
  *
 
950
  * @param translate is translating context
 
951
  */
 
952
void rccTranslateClose(rcc_translate translate);
 
953
 
 
954
/*
 
955
 * Set translation timeout
 
956
 *
 
957
 * @param translate is translating context 
 
958
 * @param us is timeout in microseconds (0 - no timeout)
 
959
 * @return non-zero value is returned in the case of errror
 
960
 */
 
961
int rccTranslateSetTimeout(rcc_translate translate, unsigned long us);
 
962
 
 
963
/** 
 
964
  * Translate string.
 
965
  *
 
966
  * @param translate is translating context
 
967
  * @param buf is UTF-8 encoded string for translating
 
968
  * @return recoded string or NULL in the case of error
 
969
  */
 
970
char *rccTranslate(rcc_translate translate, const char *buf);
930
971
 
931
972
/* recode.c */
932
973
/**
1119
1160
  */
1120
1161
#define RCC_CC_FLAG_HAVE_RCD                            0x08
1121
1162
/**
 
1163
  * Libtranslate translation engine compiled in
 
1164
  */
 
1165
#define RCC_CC_FLAG_HAVE_LIBTRANSLATE                   0x10
 
1166
 
 
1167
/**
1122
1168
  * The library build environment is represented by this structure
1123
1169
  */ 
1124
1170
struct rcc_compiled_configuration_t {