"Fossies" - the Fresh Open Source Software Archive

Member "recode-3.7.12/src/recode.h" (15 Feb 2022, 4106 Bytes) of package /linux/misc/recode-3.7.12.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "recode.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.7.11_vs_3.7.12.

    1 /* Conversion of files between different charsets and surfaces.
    2    Copyright © 1990-2022 Free Software Foundation, Inc.
    3    Contributed by François Pinard <pinard@iro.umontreal.ca>, 1988.
    4 
    5    This library is free software; you can redistribute it and/or
    6    modify it under the terms of the GNU Lesser General Public License
    7    as published by the Free Software Foundation; either version 3 of the
    8    License, or (at your option) any later version.
    9 
   10    This library is distributed in the hope that it will be
   11    useful, but WITHOUT ANY WARRANTY; without even the implied warranty
   12    of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   13    Lesser General Public License for more details.
   14 
   15    You should have received a copy of the GNU Lesser General Public
   16    License along with the Recode Library; see the file `COPYING.LIB'.
   17    If not, see <https://www.gnu.org/licenses/>.
   18 */
   19 
   20 /* Published (opaque) typedefs.  */
   21 typedef struct recode_outer *           RECODE_OUTER;
   22 typedef struct recode_request *         RECODE_REQUEST;
   23 typedef struct recode_task *            RECODE_TASK;
   24 typedef const struct recode_request *       RECODE_CONST_REQUEST;
   25 typedef const struct recode_symbol *        RECODE_CONST_SYMBOL;
   26 
   27 /* Description of list formats.  */
   28 
   29 enum recode_list_format
   30 {
   31   RECODE_NO_FORMAT,     /* format not decided yet */
   32   RECODE_DECIMAL_FORMAT,    /* concise tabular list using decimal */
   33   RECODE_OCTAL_FORMAT,      /* concise tabular list using octal */
   34   RECODE_HEXADECIMAL_FORMAT,    /* concise tabular list using hexadecimal */
   35   RECODE_FULL_FORMAT        /* full list, one character per line */
   36 };
   37 
   38 /* Description of programming languages.  */
   39 
   40 enum recode_programming_language
   41 {
   42   RECODE_NO_LANGUAGE,       /* language not decided yet */
   43   RECODE_LANGUAGE_C,        /* C (or C++) */
   44   RECODE_LANGUAGE_PERL      /* Perl */
   45 };
   46 
   47 /* Function prototypes.  */
   48 
   49 #ifdef __cplusplus
   50 extern "C" {
   51 #endif
   52 
   53 /*--------------------------------.
   54 | Recode library at OUTER level.  |
   55 `--------------------------------*/
   56 
   57 #define RECODE_AUTO_ABORT_FLAG 1
   58 #define RECODE_NO_ICONV_FLAG 2
   59 #define RECODE_STRICT_MAPPING_FLAG 4
   60 #define RECODE_FORCE_FLAG 8
   61 
   62 RECODE_OUTER recode_new_outer (unsigned);
   63 bool recode_delete_outer (RECODE_OUTER);
   64 
   65 bool list_all_symbols (RECODE_OUTER, RECODE_CONST_SYMBOL);
   66 bool list_concise_charset (RECODE_OUTER, RECODE_CONST_SYMBOL,
   67                            const enum recode_list_format);
   68 bool list_full_charset (RECODE_OUTER, RECODE_CONST_SYMBOL);
   69 
   70 /*----------------------------------.
   71 | Recode library at REQUEST level.  |
   72 `----------------------------------*/
   73 
   74 RECODE_REQUEST recode_new_request (RECODE_OUTER);
   75 bool recode_delete_request (RECODE_REQUEST);
   76 bool recode_scan_request (RECODE_REQUEST, const char *);
   77 
   78 bool recode_format_table (RECODE_REQUEST,
   79                           enum recode_programming_language,
   80                           const char *);
   81 
   82 char *recode_string (RECODE_CONST_REQUEST, const char *);
   83 
   84 bool recode_string_to_buffer (RECODE_CONST_REQUEST,
   85                               const char *,
   86                               char **, size_t *, size_t *);
   87 bool recode_string_to_file (RECODE_CONST_REQUEST,
   88                             const char *,
   89                             FILE *);
   90 bool recode_buffer_to_buffer (RECODE_CONST_REQUEST,
   91                               const char *, size_t,
   92                               char **, size_t *, size_t *);
   93 bool recode_buffer_to_file (RECODE_CONST_REQUEST,
   94                             const char *, size_t,
   95                             FILE *);
   96 bool recode_file_to_buffer (RECODE_CONST_REQUEST,
   97                             FILE *,
   98                             char **, size_t *, size_t *);
   99 bool recode_file_to_file (RECODE_CONST_REQUEST,
  100                           FILE *,
  101                           FILE *);
  102 
  103 /*-------------------------------.
  104 | Recode library at TASK level.  |
  105 `-------------------------------*/
  106 
  107 RECODE_TASK recode_new_task (RECODE_CONST_REQUEST);
  108 bool recode_delete_task (RECODE_TASK);
  109 bool recode_perform_task (RECODE_TASK);
  110 /* FILE *recode_filter_open (RECODE_TASK, FILE *); */
  111 /* bool recode_filter_close (RECODE_TASK); */
  112 
  113 #ifdef __cplusplus
  114 }
  115 #endif