Ignore:
Timestamp:
Sep 23, 2008, 7:11:04 PM (13 years ago)
Author:
charles
Message:

run libT, cli, daemon, gtk through the source-code formatter "uncrustify" as promised/threatened

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/ConvertUTF.h

    r5810 r6795  
    44/*
    55 * Copyright 2001-2004 Unicode, Inc.
    6  * 
     6 *
    77 * Disclaimer
    8  * 
     8 *
    99 * This source code is provided as is by Unicode, Inc. No claims are
    1010 * made as to fitness for any particular purpose. No warranties of any
     
    1414 * sole remedy for any claim will be exchange of defective media
    1515 * within 90 days of receipt.
    16  * 
     16 *
    1717 * Limitations on Rights to Redistribute This Code
    18  * 
     18 *
    1919 * Unicode, Inc. hereby grants the right to freely use the information
    2020 * supplied in this file in the creation of products supporting the
     
    3737    Each routine converts the text between *sourceStart and sourceEnd,
    3838    putting the result into the buffer between *targetStart and
    39     targetEnd. Note: the end pointers are *after* the last item: e.g. 
    40     *(sourceEnd - 1) is the last item.
     39    targetEnd. Note: the end pointers are *after* the last item: e.g.
     40 *(sourceEnd - 1) is the last item.
    4141
    4242    The return result indicates whether the conversion was successful,
     
    4949
    5050    Input parameters:
    51         sourceStart - pointer to a pointer to the source buffer.
    52                 The contents of this are modified on return so that
    53                 it points at the next thing to be converted.
    54         targetStart - similarly, pointer to pointer to the target buffer.
    55         sourceEnd, targetEnd - respectively pointers to the ends of the
    56                 two buffers, for overflow checking only.
     51    sourceStart - pointer to a pointer to the source buffer.
     52        The contents of this are modified on return so that
     53        it points at the next thing to be converted.
     54    targetStart - similarly, pointer to pointer to the target buffer.
     55    sourceEnd, targetEnd - respectively pointers to the ends of the
     56        two buffers, for overflow checking only.
    5757
    5858    These conversion functions take a ConversionFlags argument. When this
     
    7171
    7272    Output parameters:
    73         The value "sourceIllegal" is returned from some routines if the input
    74         sequence is malformed.  When "sourceIllegal" is returned, the source
    75         value will point to the illegal value that caused the problem. E.g.,
    76         in UTF-8 when a sequence is malformed, it points to the start of the
    77         malformed sequence. 
     73    The value "sourceIllegal" is returned from some routines if the input
     74    sequence is malformed.  When "sourceIllegal" is returned, the source
     75    value will point to the illegal value that caused the problem. E.g.,
     76    in UTF-8 when a sequence is malformed, it points to the start of the
     77    malformed sequence.
    7878
    7979    Author: Mark E. Davis, 1994.
    8080    Rev History: Rick McGowan, fixes & updates May 2001.
    81                 Fixes & updates, Sept 2001.
     81        Fixes & updates, Sept 2001.
    8282
    83 ------------------------------------------------------------------------ */
     83   ------------------------------------------------------------------------ */
    8484
    8585/* ---------------------------------------------------------------------
     
    8989    All should be unsigned values to avoid sign extension during
    9090    bit mask & shift operations.
    91 ------------------------------------------------------------------------ */
     91   ------------------------------------------------------------------------ */
    9292
    9393
    94 typedef unsigned int    UTF32;  /* at least 32 bits */
    95 typedef unsigned short  UTF16;  /* at least 16 bits */
    96 typedef unsigned char   UTF8;   /* typically 8 bits */
    97 typedef unsigned char   Boolean; /* 0 or 1 */
     94typedef unsigned int    UTF32;  /* at least 32 bits */
     95typedef unsigned short  UTF16;  /* at least 16 bits */
     96typedef unsigned char   UTF8;   /* typically 8 bits */
     97typedef unsigned char   Boolean; /* 0 or 1 */
    9898
    9999/* Some fundamental constants */
     
    104104#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
    105105
    106 typedef enum {
    107         conversionOK,           /* conversion successful */
    108         sourceExhausted,        /* partial character in source, but hit end */
    109         targetExhausted,        /* insuff. room in target for conversion */
    110         sourceIllegal           /* source sequence is illegal/malformed */
     106typedef enum
     107{
     108    conversionOK,       /* conversion successful */
     109    sourceExhausted,    /* partial character in source, but hit end */
     110    targetExhausted,    /* insuff. room in target for conversion */
     111    sourceIllegal       /* source sequence is illegal/malformed */
    111112} ConversionResult;
    112113
    113 typedef enum {
    114         strictConversion = 0,
    115         lenientConversion
     114typedef enum
     115{
     116    strictConversion = 0,
     117    lenientConversion
    116118} ConversionFlags;
    117119
     
    121123#endif
    122124
    123 ConversionResult ConvertUTF8toUTF16 (
    124                 const UTF8** sourceStart, const UTF8* sourceEnd,
    125                 UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
     125ConversionResult ConvertUTF8toUTF16( const UTF8**    sourceStart,
     126                                     const UTF8*     sourceEnd,
     127                                     UTF16**         targetStart,
     128                                     UTF16*          targetEnd,
     129                                     ConversionFlags flags );
    126130
    127 ConversionResult ConvertUTF16toUTF8 (
    128                 const UTF16** sourceStart, const UTF16* sourceEnd,
    129                 UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
    130                
    131 ConversionResult ConvertUTF8toUTF32 (
    132                 const UTF8** sourceStart, const UTF8* sourceEnd,
    133                 UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
     131ConversionResult ConvertUTF16toUTF8( const UTF16**   sourceStart,
     132                                     const UTF16*    sourceEnd,
     133                                     UTF8**          targetStart,
     134                                     UTF8*           targetEnd,
     135                                     ConversionFlags flags );
    134136
    135 ConversionResult ConvertUTF32toUTF8 (
    136                 const UTF32** sourceStart, const UTF32* sourceEnd,
    137                 UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
    138                
    139 ConversionResult ConvertUTF16toUTF32 (
    140                 const UTF16** sourceStart, const UTF16* sourceEnd,
    141                 UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
     137ConversionResult ConvertUTF8toUTF32( const UTF8**    sourceStart,
     138                                     const UTF8*     sourceEnd,
     139                                     UTF32**         targetStart,
     140                                     UTF32*          targetEnd,
     141                                     ConversionFlags flags );
    142142
    143 ConversionResult ConvertUTF32toUTF16 (
    144                 const UTF32** sourceStart, const UTF32* sourceEnd,
    145                 UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
     143ConversionResult ConvertUTF32toUTF8( const UTF32**   sourceStart,
     144                                     const UTF32*    sourceEnd,
     145                                     UTF8**          targetStart,
     146                                     UTF8*           targetEnd,
     147                                     ConversionFlags flags );
    146148
    147 Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
     149ConversionResult ConvertUTF16toUTF32( const UTF16**   sourceStart,
     150                                      const UTF16*    sourceEnd,
     151                                      UTF32**         targetStart,
     152                                      UTF32*          targetEnd,
     153                                      ConversionFlags flags );
     154
     155ConversionResult ConvertUTF32toUTF16( const UTF32**   sourceStart,
     156                                      const UTF32*    sourceEnd,
     157                                      UTF16**         targetStart,
     158                                      UTF16*          targetEnd,
     159                                      ConversionFlags flags );
     160
     161Boolean          isLegalUTF8Sequence( const UTF8 *source,
     162                                      const UTF8 *sourceEnd );
    148163
    149164#ifdef __cplusplus
     
    153168/* --------------------------------------------------------------------- */
    154169
    155 #endif // CONVERT_UNICODE_H
     170#endif /* CONVERT_UNICODE_H */
Note: See TracChangeset for help on using the changeset viewer.