Changeset 471

Show
Ignore:
Timestamp:
01/16/07 19:23:06 (5 years ago)
Author:
radekk
Message:

Indenting source code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sweep/branches/display-cache/include/sweep/sweep.h

    r124 r471  
    3333#include <sweep/sweep_filter.h> 
    3434 
    35 #endif  /* __SWEEP_H__ */ 
    36  
    37  
    38  
    39  
    40  
    41  
     35#endif /* __SWEEP_H__ */ 
  • sweep/branches/display-cache/include/sweep/sweep_filter.h

    r124 r471  
    2626                                   sw_framecount_t nr_frames, 
    2727                                   sw_param_set pset, gpointer custom_data); 
    28 sw_op_instance * 
    29 perform_filter_region_op (sw_sample * sample, char * desc, 
    30                           SweepFilterRegion func, sw_param_set pset, 
    31                           gpointer custom_data); 
     28sw_op_instance *perform_filter_region_op (sw_sample * sample, char *desc, 
     29                                         SweepFilterRegion func, 
     30                                        sw_param_set pset, 
     31                                         gpointer custom_data); 
    3232 
    33 sw_op_instance * 
    34 perform_filter_op (sw_sample * sample, char * desc, SweepFilter func
    35                    sw_param_set pset, gpointer custom_data); 
     33sw_op_instance *perform_filter_op (sw_sample * sample, char *desc, 
     34                                  SweepFilter func, sw_param_set pset
     35                                  gpointer custom_data); 
    3636 
    3737 
  • sweep/branches/display-cache/include/sweep/sweep_sample.h

    r124 r471  
    2424#include <sweep/sweep_types.h> 
    2525 
    26 sw_sample * 
    27 sample_new_empty(char * pathname, gint nr_channels, gint sample_rate, 
    28                  gint sample_length); 
     26sw_sample *sample_new_empty (char *pathname, gint nr_channels, 
     27                             gint sample_rate, gint sample_length); 
    2928 
    30 sw_sample * 
    31 sample_new_copy(sw_sample * s); 
     29sw_sample *sample_new_copy (sw_sample * s); 
    3230 
    33 void 
    34 sample_destroy (sw_sample * s); 
     31void sample_destroy (sw_sample * s); 
    3532 
    36 sw_sounddata * 
    37 sample_get_sounddata (sw_sample * s); 
     33sw_sounddata *sample_get_sounddata (sw_sample * s); 
    3834 
    39 void 
    40 sample_set_file_format (sw_sample * s, sw_file_format_t file_format); 
     35void sample_set_file_format (sw_sample * s, sw_file_format_t file_format); 
    4136 
    42 void 
    43 sample_set_pathname (sw_sample * s, char * pathname); 
     37void sample_set_pathname (sw_sample * s, char *pathname); 
    4438 
    45 GList * 
    46 sample_bank_list_names (void); 
     39GList *sample_bank_list_names (void); 
    4740 
    48 sw_sample * 
    49 sample_bank_find_byname (const gchar * name); 
     41sw_sample *sample_bank_find_byname (const gchar * name); 
    5042 
    51 gboolean 
    52 sample_bank_contains (sw_sample *s); 
     43gboolean sample_bank_contains (sw_sample * s); 
    5344 
    54 void 
    55 sample_bank_add (sw_sample * s); 
     45void sample_bank_add (sw_sample * s); 
    5646 
    57 void 
    58 sample_bank_remove (sw_sample * s); 
     47void sample_bank_remove (sw_sample * s); 
    5948 
    60 void 
    61 sample_refresh_views (sw_sample * s); 
     49void sample_refresh_views (sw_sample * s); 
    6250 
    63 void 
    64 sample_start_marching_ants (sw_sample * s); 
     51void sample_start_marching_ants (sw_sample * s); 
    6552 
    66 void 
    67 sample_stop_marching_ants (sw_sample * s); 
     53void sample_stop_marching_ants (sw_sample * s); 
    6854 
    69 void 
    70 sample_set_edit_state (sw_sample * s, sw_edit_state edit_state); 
     55void sample_set_edit_state (sw_sample * s, sw_edit_state edit_state); 
    7156 
    72 void 
    73 sample_set_edit_mode (sw_sample * s, sw_edit_mode edit_mode); 
     57void sample_set_edit_mode (sw_sample * s, sw_edit_mode edit_mode); 
    7458 
    75 void 
    76 sample_refresh_playmode (sw_sample * s); 
     59void sample_refresh_playmode (sw_sample * s); 
    7760 
    78 void 
    79 sample_set_previewing (sw_sample * s, gboolean previewing); 
     61void sample_set_previewing (sw_sample * s, gboolean previewing); 
    8062 
    81 void 
    82 sample_set_stop_offset (sw_sample * s); 
     63void sample_set_stop_offset (sw_sample * s); 
    8364 
    8465void 
     
    8667                       gboolean by_user); 
    8768 
    88 void 
    89 sample_set_rec_marker (sw_sample * s, sw_framecount_t offset); 
     69void sample_set_rec_marker (sw_sample * s, sw_framecount_t offset); 
    9070 
    91 void 
    92 sample_set_scrubbing (sw_sample * s, gboolean scrubbing); 
     71void sample_set_scrubbing (sw_sample * s, gboolean scrubbing); 
    9372 
    94 void 
    95 sample_set_looping (sw_sample * s, gboolean looping); 
     73void sample_set_looping (sw_sample * s, gboolean looping); 
    9674 
    97 void 
    98 sample_set_playrev (sw_sample * s, gboolean reverse); 
     75void sample_set_playrev (sw_sample * s, gboolean reverse); 
    9976 
    100 void 
    101 sample_set_mute (sw_sample * s, gboolean mute); 
     77void sample_set_mute (sw_sample * s, gboolean mute); 
    10278 
    103 void 
    104 sample_set_color (sw_sample * s, gint color); 
     79void sample_set_color (sw_sample * s, gint color); 
    10580 
    106 void 
    107 sample_set_progress_text (sw_sample * s, gchar * text); 
     81void sample_set_progress_text (sw_sample * s, gchar * text); 
    10882 
    109 void 
    110 sample_set_progress_percent (sw_sample * s, gint percent); 
     83void sample_set_progress_percent (sw_sample * s, gint percent); 
    11184 
    112 void 
    113 sample_refresh_progress_percent (sw_sample * s); 
     85void sample_refresh_progress_percent (sw_sample * s); 
    11486 
    115 int 
    116 sample_set_progress_ready (sw_sample * s); 
     87int sample_set_progress_ready (sw_sample * s); 
    11788 
    118 void 
    119 sample_set_tmp_message (sw_sample * s, const char * fmt, ...); 
     89void sample_set_tmp_message (sw_sample * s, const char *fmt, ...); 
    12090 
    12191/* 
     
    12999 * 
    130100 */ 
    131 void 
    132 sample_replace_throughout (sw_sample * os, sw_sample * s); 
     101void sample_replace_throughout (sw_sample * os, sw_sample * s); 
    133102 
    134103 
    135104/* Selection handling */ 
    136105 
    137 gboolean 
    138 sample_offset_in_sel (sw_sample * s, sw_framecount_t offset); 
     106gboolean sample_offset_in_sel (sw_sample * s, sw_framecount_t offset); 
    139107 
    140 guint 
    141 sample_sel_nr_regions (sw_sample * s); 
     108guint sample_sel_nr_regions (sw_sample * s); 
    142109 
    143 void 
    144 sample_clear_selection (sw_sample * s); 
     110void sample_clear_selection (sw_sample * s); 
    145111 
    146 void 
    147 sample_add_selection (sw_sample * s, sw_sel * sel); 
     112void sample_add_selection (sw_sample * s, sw_sel * sel); 
    148113 
    149 sw_sel * 
    150 sample_add_selection_1 (sw_sample * s, 
    151                         sw_framecount_t start, sw_framecount_t end); 
     114sw_sel *sample_add_selection_1 (sw_sample * s, 
     115                                sw_framecount_t start, sw_framecount_t end); 
    152116 
    153 void 
    154 sample_set_selection (sw_sample * s, GList * gl); 
     117void sample_set_selection (sw_sample * s, GList * gl); 
    155118 
    156 sw_sel * 
    157 sample_set_selection_1 (sw_sample * s, 
    158                         sw_framecount_t start, sw_framecount_t end); 
     119sw_sel *sample_set_selection_1 (sw_sample * s, 
     120                                sw_framecount_t start, sw_framecount_t end); 
    159121 
    160122 
     
    164126                         sw_framecount_t new_start, sw_framecount_t new_end); 
    165127 
    166 void 
    167 sample_selection_invert (sw_sample * s); 
     128void sample_selection_invert (sw_sample * s); 
    168129 
    169 void 
    170 sample_selection_select_all (sw_sample * s); 
     130void sample_selection_select_all (sw_sample * s); 
    171131 
    172 void 
    173 sample_selection_select_none (sw_sample * s); 
     132void sample_selection_select_none (sw_sample * s); 
    174133 
    175 void 
    176 sample_selection_halve (sw_sample * s); 
     134void sample_selection_halve (sw_sample * s); 
    177135 
    178 void 
    179 sample_selection_double (sw_sample * s); 
     136void sample_selection_double (sw_sample * s); 
    180137 
    181 void 
    182 sample_selection_shift_left (sw_sample * s); 
     138void sample_selection_shift_left (sw_sample * s); 
    183139 
    184 void 
    185 sample_selection_shift_right (sw_sample * s); 
     140void sample_selection_shift_right (sw_sample * s); 
    186141 
    187142/* info dialog */ 
    188 void 
    189 sample_show_info_dialog (sw_sample * sample); 
     143void sample_show_info_dialog (sw_sample * sample); 
    190144 
    191145 
  • sweep/branches/display-cache/include/sweep/sweep_selection.h

    r124 r471  
    2222#define __SWEEP_SELECTION_H__ 
    2323 
    24 sw_sel * 
    25 sel_new (sw_framecount_t start, sw_framecount_t end); 
     24sw_sel *sel_new (sw_framecount_t start, sw_framecount_t end); 
    2625 
    27 sw_sel * 
    28 sel_copy (sw_sel * sel); 
     26sw_sel *sel_copy (sw_sel * sel); 
    2927 
    30 GList * 
    31 sels_add_selection (GList * sels, sw_sel * sel); 
     28GList *sels_add_selection (GList * sels, sw_sel * sel); 
    3229 
    33 GList * 
    34 sels_add_selection_1 (GList * sels, sw_framecount_t start, sw_framecount_t end); 
     30GList *sels_add_selection_1 (GList * sels, sw_framecount_t start, 
     31                            sw_framecount_t end); 
    3532 
    3633/* 
     
    4037 * return > 0 if s1 comes after s2 in the sort order. 
    4138 */ 
    42 gint 
    43 sel_cmp (sw_sel * s1, sw_sel * s2); 
     39gint sel_cmp (sw_sel * s1, sw_sel * s2); 
    4440 
    4541/* 
     
    4844 * returns a copy of sels 
    4945 */ 
    50 GList * 
    51 sels_copy (GList * sels); 
     46GList *sels_copy (GList * sels); 
    5247 
    5348/* 
     
    5651 * inverts sels in place 
    5752 */ 
    58 GList * 
    59 sels_invert (GList * sels, sw_framecount_t nr_frames); 
     53GList *sels_invert (GList * sels, sw_framecount_t nr_frames); 
    6054 
    61 sw_op_instance * 
    62 perform_selection_op (sw_sample * s, char * desc, SweepFilter func
    63                       sw_param_set pset, gpointer custom_data); 
     55sw_op_instance *perform_selection_op (sw_sample * s, char *desc, 
     56                                     SweepFilter func, sw_param_set pset
     57                                    gpointer custom_data); 
    6458 
    6559#endif /* __SWEEP_SELECTION_H__ */ 
  • sweep/branches/display-cache/include/sweep/sweep_sounddata.h

    r124 r471  
    2222#define __SWEEP_SOUNDDATA_H__ 
    2323 
    24 sw_sounddata * 
    25 sounddata_new_empty(gint nr_channels, gint sample_rate, gint sample_length); 
     24sw_sounddata *sounddata_new_empty (gint nr_channels, gint sample_rate, 
     25                                  gint sample_length); 
    2626 
    27 void 
    28 sounddata_destroy (sw_sounddata * sounddata); 
     27void sounddata_destroy (sw_sounddata * sounddata); 
    2928 
    30 void 
    31 sounddata_lock_selection (sw_sounddata * sounddata); 
     29void sounddata_lock_selection (sw_sounddata * sounddata); 
    3230 
    33 void 
    34 sounddata_unlock_selection (sw_sounddata * sounddata); 
     31void sounddata_unlock_selection (sw_sounddata * sounddata); 
    3532 
    36 void 
    37 sounddata_clear_selection (sw_sounddata * sounddata); 
     33void sounddata_clear_selection (sw_sounddata * sounddata); 
    3834 
    3935/* 
     
    4440 */ 
    4541 
    46 void 
    47 sounddata_normalise_selection (sw_sounddata * sounddata); 
     42void sounddata_normalise_selection (sw_sounddata * sounddata); 
    4843 
    49 void 
    50 sounddata_add_selection (sw_sounddata * sounddata, sw_sel * sel); 
     44void sounddata_add_selection (sw_sounddata * sounddata, sw_sel * sel); 
    5145 
    52 sw_sel * 
    53 sounddata_add_selection_1 (sw_sounddata * sounddata
    54                            sw_framecount_t start, sw_framecount_t end); 
     46sw_sel *sounddata_add_selection_1 (sw_sounddata * sounddata, 
     47                                  sw_framecount_t start
     48                                  sw_framecount_t end); 
    5549 
    56 sw_sel * 
    57 sounddata_set_selection_1 (sw_sounddata * sounddata
    58                            sw_framecount_t start, sw_framecount_t end); 
     50sw_sel *sounddata_set_selection_1 (sw_sounddata * sounddata, 
     51                                  sw_framecount_t start
     52                                  sw_framecount_t end); 
    5953 
    60 guint 
    61 sounddata_selection_nr_regions (sw_sounddata * sounddata); 
     54guint sounddata_selection_nr_regions (sw_sounddata * sounddata); 
    6255 
    63 gint 
    64 sounddata_selection_nr_frames (sw_sounddata * sounddata); 
     56gint sounddata_selection_nr_frames (sw_sounddata * sounddata); 
    6557 
    66 gint 
    67 sounddata_selection_width (sw_sounddata * sounddata); 
     58gint sounddata_selection_width (sw_sounddata * sounddata); 
    6859 
    69 void 
    70 sounddata_selection_translate (sw_sounddata * sounddata, gint delta); 
     60void sounddata_selection_translate (sw_sounddata * sounddata, gint delta); 
    7161 
    72 void 
    73 sounddata_selection_scale (sw_sounddata * sounddata, gfloat scale); 
     62void sounddata_selection_scale (sw_sounddata * sounddata, gfloat scale); 
    7463 
    7564/* 
  • sweep/branches/display-cache/include/sweep/sweep_typeconvert.h

    r57 r471  
    2626 * in a given format. 
    2727 */ 
    28 glong 
    29 frames_to_samples (sw_format * format, sw_framecount_t nr_frames); 
     28glong frames_to_samples (sw_format * format, sw_framecount_t nr_frames); 
    3029 
    3130/* 
    3231 * Determine the size in bytes of a number of frames of a given format. 
    3332 */ 
    34 glong 
    35 frames_to_bytes (sw_format * format, sw_framecount_t nr_frames); 
     33glong frames_to_bytes (sw_format * format, sw_framecount_t nr_frames); 
    3634 
    3735/* 
    3836 * Convert a number of frames to seconds 
    3937 */ 
    40 sw_time_t 
    41 frames_to_time (sw_format * format, sw_framecount_t nr_frames); 
     38sw_time_t frames_to_time (sw_format * format, sw_framecount_t nr_frames); 
    4239 
    4340/* 
    4441 * Convert seconds to frames 
    4542 */ 
    46 sw_framecount_t 
    47 time_to_frames (sw_format * format, sw_time_t time); 
     43sw_framecount_t time_to_frames (sw_format * format, sw_time_t time); 
    4844 
    4945#endif /* __SWEEP_TYPE_CONVERT_H__ */ 
  • sweep/branches/display-cache/include/sweep/sweep_types.h

    r304 r471  
    2323 
    2424#include <glib.h> 
    25 #include <gdk/gdktypes.h>  /* XXX: for GdkModifierType */ 
    26 #include <gtk/gtk.h> /* XXX: for info_clist widget */ 
     25#include <gdk/gdktypes.h>      /* XXX: for GdkModifierType */ 
     26#include <gtk/gtk.h>           /* XXX: for info_clist widget */ 
    2727 
    2828#include <sys/types.h> 
     
    5454#if 0 
    5555 
    56 #if (SIZEOF_OFF_T == 8)  
     56#if (SIZEOF_OFF_T == 8) 
    5757/* For libsndfile version 1 */ 
    5858typedef off_t sw_framecount_t; 
     
    9090 * 
    9191 */ 
    92 struct _sw_sel { 
     92struct _sw_sel 
     93
    9394  sw_framecount_t sel_start; 
    9495  sw_framecount_t sel_end; 
     
    100101 * Multichannel data is interleaved: Stereo is stored LR. 
    101102 */ 
    102 struct _sw_format { 
    103   gint channels;  /* nr channels per frame */ 
    104   gint rate;      /* sampling rate (Hz) */ 
    105 }; 
    106  
    107 struct _sw_sounddata { 
     103struct _sw_format 
     104
     105  gint channels;                /* nr channels per frame */ 
     106  gint rate;                    /* sampling rate (Hz) */ 
     107}; 
     108 
     109struct _sw_sounddata 
     110
    108111  int refcount; 
    109112 
    110   sw_format * format; 
    111   sw_framecount_t nr_frames;    /* nr frames */ 
     113  sw_format *format; 
     114  sw_framecount_t nr_frames;   /* nr frames */ 
    112115 
    113116  gpointer data; 
    114   GMutex * data_mutex; /* Mutex for access to sample data */ 
    115          
    116   GList * sels;     /* selection: list of sw_sels */ 
    117   GMutex * sels_mutex; /* Mutex for access to sels */ 
     117  GMutex *data_mutex;          /* Mutex for access to sample data */ 
     118 
     119  GList *sels;                 /* selection: list of sw_sels */ 
     120  GMutex *sels_mutex;          /* Mutex for access to sels */ 
    118121}; 
    119122 
     
    121124 
    122125 
    123 typedef enum { 
     126typedef enum 
     127
    124128  SWEEP_EDIT_MODE_READY, 
    125   SWEEP_EDIT_MODE_META, /* modifying metadata: sels etc. */ 
     129  SWEEP_EDIT_MODE_META,                /* modifying metadata: sels etc. */ 
    126130  SWEEP_EDIT_MODE_FILTER, 
    127131  SWEEP_EDIT_MODE_ALLOC, 
    128132} sw_edit_mode; 
    129133 
    130 typedef enum { 
     134typedef enum 
     135
    131136  SWEEP_EDIT_STATE_IDLE, 
    132137  SWEEP_EDIT_STATE_PENDING, 
     
    136141} sw_edit_state; 
    137142 
    138 typedef enum { 
     143typedef enum 
     144
    139145  SWEEP_TRANSPORT_STOP, 
    140146  SWEEP_TRANSPORT_PLAY, 
     
    143149 
    144150/* File formats */ 
    145 typedef enum { 
    146   SWEEP_FILE_FORMAT_NONE=0, 
    147   SWEEP_FILE_FORMAT_BY_EXTENSION=0, 
     151typedef enum 
     152
     153  SWEEP_FILE_FORMAT_NONE = 0, 
     154  SWEEP_FILE_FORMAT_BY_EXTENSION = 0, 
    148155  SWEEP_FILE_FORMAT_RAW, 
    149156  SWEEP_FILE_FORMAT_WAV, 
     
    165172 * The length of data available *data is (end - start) 
    166173 */ 
    167 struct _sw_edit_region { 
     174struct _sw_edit_region 
     175
    168176  sw_framecount_t start; 
    169177  sw_framecount_t end; 
     
    172180}; 
    173181 
    174 struct _sw_edit_buffer { 
    175   sw_format * format; 
    176   GList * regions; 
     182struct _sw_edit_buffer 
     183
     184  sw_format *format; 
     185  GList *regions; 
    177186  gint refcount; 
    178187}; 
     
    186195typedef struct _sw_op_instance sw_op_instance; 
    187196 
    188 struct _sw_operation { 
     197struct _sw_operation 
     198
    189199  sw_edit_mode edit_mode; 
    190200  SweepCallback _do_; 
     
    196206}; 
    197207 
    198 struct _sw_op_instance { 
    199   sw_sample * sample; 
    200   char * description; 
    201   sw_operation * op; 
     208struct _sw_op_instance 
     209
     210  sw_sample *sample; 
     211  char *description; 
     212  sw_operation *op; 
    202213  gpointer do_data; 
    203214  gpointer undo_data; 
     
    208219 * Basic types for parameters 
    209220 */ 
    210 typedef enum { 
     221typedef enum 
     222
    211223  SWEEP_TYPE_BOOL = 0, 
    212224  SWEEP_TYPE_INT, 
     
    218230typedef gint sw_int; 
    219231typedef gdouble sw_float; 
    220 typedef gchar * sw_string; 
     232typedef gchar *sw_string; 
    221233 
    222234 
     
    225237 */ 
    226238typedef union _sw_param sw_param; 
    227 typedef sw_param * sw_param_set; 
    228  
    229 union _sw_param { 
     239typedef sw_param *sw_param_set; 
     240 
     241union _sw_param 
     242
    230243  sw_bool b; 
    231   sw_int i; 
     244  sw_int i; 
    232245  sw_float f; 
    233246  sw_string s; 
     
    243256 * the usage of the sw_constraint. 
    244257 */ 
    245 typedef enum { 
     258typedef enum 
     259
    246260/* 
    247261 * SW_PARAM_CONSTRAINED_NOT indicates that the parameter is completely 
     
    253267 *     How free is its life, how wretched its lot! 
    254268 */ 
    255   SW_PARAM_CONSTRAINED_NOT=0, 
     269  SW_PARAM_CONSTRAINED_NOT = 0, 
    256270 
    257271/* 
     
    303317#define SW_RANGE_STEP_VALID (1<<2) 
    304318 
    305 #define SW_RANGE_ALL_VALID (SW_RANGE_LOWER_BOUND_VALID|SW_RANGE_UPPER_BOUND_VALID|SW_RANGE_STEP_VALID)  
     319#define SW_RANGE_ALL_VALID (SW_RANGE_LOWER_BOUND_VALID|SW_RANGE_UPPER_BOUND_VALID|SW_RANGE_STEP_VALID) 
    306320 
    307321/* 
     
    335349 */ 
    336350#define SW_PARAM_HINT_FILENAME     (1<<3) 
    337   
     351 
    338352 
    339353typedef struct _sw_param_spec sw_param_spec; 
     
    355369 * string parameters. 
    356370 */ 
    357 struct _sw_param_range { 
     371struct _sw_param_range 
     372
    358373  int valid_mask; 
    359374  sw_param lower; 
     
    369384 * All constraints are disregarded for boolean parameters. 
    370385 */ 
    371 union _sw_constraint { 
     386union _sw_constraint 
     387
    372388  /* 
    373389   * param_list: Values are constrained to those within a list of 
     
    376392   * ie. this length = constraint->param_list[0].i 
    377393   */ 
    378   sw_param * list; 
     394  sw_param *list; 
    379395 
    380396  /* 
    381397   * param_range, as described above. 
    382398   */ 
    383   sw_param_range * range;  /* param range */ 
     399  sw_param_range *range;       /* param range */ 
    384400}; 
    385401 
     
    388404 * sw_param_spec: specification for a parameter. 
    389405 */ 
    390 struct _sw_param_spec { 
     406struct _sw_param_spec 
     407
    391408  /* A short name for this parameter */ 
    392   gchar * name; 
     409  gchar *name; 
    393410 
    394411  /* A longer description of the parameter's purpose and usage */ 
    395   gchar * desc; 
     412  gchar *desc; 
    396413 
    397414  /* The type of the parameter */ 
     
    414431typedef struct _sw_plugin sw_plugin; 
    415432 
    416 struct _sw_procedure { 
    417   gchar * name; 
    418   gchar * description; 
    419   gchar * author; 
    420   gchar * copyright; 
    421   gchar * url; 
    422  
    423   gchar * identifier; 
     433struct _sw_procedure 
     434
     435  gchar *name; 
     436  gchar *description; 
     437  gchar *author; 
     438  gchar *copyright; 
     439  gchar *url; 
     440 
     441  gchar *identifier; 
    424442 
    425443  /* Key bindings */ 
     
    428446 
    429447  gint nr_params; 
    430   sw_param_spec * param_specs; 
     448  sw_param_spec *param_specs; 
    431449 
    432450  /* suggest sets suggested values for the members of pset, 
     
    446464   * If nr_params is 0 then this function will be passed a NULL pset. 
    447465   */ 
    448   sw_op_instance * (*apply) (sw_sample * sample, 
    449                             sw_param_set pset, gpointer custom_data); 
     466  sw_op_instance *(*apply) (sw_sample * sample, 
     467                            sw_param_set pset, gpointer custom_data); 
    450468 
    451469  /* custom data to pass to the suggest and apply functions */ 
     
    453471}; 
    454472 
    455 struct _sw_plugin { 
     473struct _sw_plugin 
     474
    456475  /* plugin_init () returns a list of procedures */ 
    457   GList * (*plugin_init) (void); 
     476  GList *(*plugin_init) (void); 
    458477 
    459478  /* plugin_cleanup() frees the plugin's private data structures */ 
     
    461480}; 
    462481 
    463 typedef sw_sample * (*SweepFilter) (sw_sample * sample, 
    464                                     sw_param_set pset, 
    465                                     gpointer custom_data); 
    466  
    467  
    468 #endif  /* __SWEEP_TYPES_H__ */ 
    469  
    470  
    471  
    472  
    473  
    474  
     482typedef sw_sample *(*SweepFilter) (sw_sample * sample, 
     483                                   sw_param_set pset, gpointer custom_data); 
     484 
     485 
     486#endif /* __SWEEP_TYPES_H__ */ 
  • sweep/branches/display-cache/include/sweep/sweep_undo.h

    r124 r471  
    2424#include "sweep_types.h" 
    2525 
    26 gint 
    27 update_edit_progress (gpointer data); 
     26gint update_edit_progress (gpointer data); 
    2827 
    29 sw_op_instance * 
    30 sw_op_instance_new (sw_sample * sample, char * description, 
    31                     sw_operation * operation); 
     28sw_op_instance *sw_op_instance_new (sw_sample * sample, char *description, 
     29                                    sw_operation * operation); 
    3230 
    3331void 
    34 schedule_operation (sw_sample * sample, char * description, 
    35                     sw_operation * operation, void * do_data); 
     32schedule_operation (sw_sample * sample, char *description, 
     33                    sw_operation * operation, void *do_data); 
    3634 
    37 void 
    38 register_operation (sw_sample * s, sw_op_instance * inst); 
     35void register_operation (sw_sample * s, sw_op_instance * inst); 
    3936 
    40 void 
    41 trim_registered_ops (sw_sample * s, int length); 
     37void trim_registered_ops (sw_sample * s, int length); 
    4238 
    43 void 
    44 undo_current (sw_sample * s); 
     39void undo_current (sw_sample * s); 
    4540 
    46 void 
    47 redo_current (sw_sample * s); 
     41void redo_current (sw_sample * s); 
    4842 
    49 void 
    50 revert_op (sw_sample * sample, GList * op_gl); 
     43void revert_op (sw_sample * sample, GList * op_gl); 
    5144 
    52 void 
    53 set_active_op (sw_sample * s, sw_op_instance * inst); 
     45void set_active_op (sw_sample * s, sw_op_instance * inst); 
    5446 
    55 void 
    56 cancel_active_op (sw_sample * s); 
     47void cancel_active_op (sw_sample * s); 
    5748 
    5849/* Stock undo functions */ 
     
    6152typedef struct _replace_data replace_data; 
    6253 
    63 struct _replace_data { 
    64   sw_sample * old_sample; 
    65   sw_sample * new_sample; 
     54struct _replace_data 
     55
     56  sw_sample *old_sample; 
     57  sw_sample *new_sample; 
    6658}; 
    6759 
    68 replace_data * 
    69 replace_data_new (sw_sample * old_sample, sw_sample * new_sample); 
     60replace_data *replace_data_new (sw_sample * old_sample, 
     61                               sw_sample * new_sample); 
    7062 
    71 void 
    72 undo_by_replace (replace_data * r); 
     63void undo_by_replace (replace_data * r); 
    7364 
    74 void 
    75 redo_by_replace (replace_data * r); 
     65void redo_by_replace (replace_data * r); 
    7666#endif 
    7767 
    7868typedef struct _sounddata_replace_data sounddata_replace_data; 
    7969 
    80 struct _sounddata_replace_data { 
    81   sw_sample * sample; 
    82   sw_sounddata * old_sounddata; 
    83   sw_sounddata * new_sounddata; 
     70struct _sounddata_replace_data 
     71
     72  sw_sample *sample; 
     73  sw_sounddata *old_sounddata; 
     74  sw_sounddata *new_sounddata; 
    8475}; 
    8576 
    86 sounddata_replace_data * 
    87 sounddata_replace_data_new (sw_sample * sample, 
    88                             sw_sounddata * old_sounddata, 
    89                             sw_sounddata * new_sounddata); 
     77sounddata_replace_data *sounddata_replace_data_new (sw_sample * sample, 
     78                                                    sw_sounddata * 
     79                                                    old_sounddata, 
     80                                                    sw_sounddata * 
     81                                                    new_sounddata); 
    9082 
    91 void 
    92 sounddata_replace_data_destroy (sounddata_replace_data * sr); 
     83void sounddata_replace_data_destroy (sounddata_replace_data * sr); 
    9384 
    94 void 
    95 undo_by_sounddata_replace (sw_sample * s, sounddata_replace_data * sr); 
     85void undo_by_sounddata_replace (sw_sample * s, sounddata_replace_data * sr); 
    9686 
    97 void 
    98 redo_by_sounddata_replace (sw_sample * s, sounddata_replace_data * sr); 
     87void redo_by_sounddata_replace (sw_sample * s, sounddata_replace_data * sr); 
    9988 
    10089 
    10190typedef struct _paste_over_data paste_over_data; 
    10291 
    103 struct _paste_over_data { 
    104   sw_sample * sample; 
    105   sw_edit_buffer * old_eb; 
    106   sw_edit_buffer * new_eb; 
     92struct _paste_over_data 
     93
     94  sw_sample *sample; 
     95  sw_edit_buffer *old_eb; 
     96  sw_edit_buffer *new_eb; 
    10797}; 
    10898 
    109 paste_over_data * 
    110 paste_over_data_new (sw_edit_buffer * old_eb, sw_edit_buffer * new_eb); 
     99paste_over_data *paste_over_data_new (sw_edit_buffer * old_eb, 
     100                                    sw_edit_buffer * new_eb); 
    111101 
    112 void 
    113 paste_over_data_destroy (paste_over_data * p); 
     102void paste_over_data_destroy (paste_over_data * p); 
    114103 
    115 void 
    116 undo_by_paste_over (sw_sample * s, paste_over_data * p); 
     104void undo_by_paste_over (sw_sample * s, paste_over_data * p); 
    117105 
    118 void 
    119 redo_by_paste_over (sw_sample * s, paste_over_data * p); 
     106void redo_by_paste_over (sw_sample * s, paste_over_data * p); 
    120107 
    121108 
    122109typedef struct _splice_data splice_data; 
    123110 
    124 struct _splice_data { 
    125   sw_sample * sample; 
    126   sw_edit_buffer * eb; 
    127   GList * sels; /* Previous sels of sounddata */ 
     111struct _splice_data 
     112
     113  sw_sample *sample; 
     114  sw_edit_buffer *eb; 
     115  GList *sels;                  /* Previous sels of sounddata */ 
    128116}; 
    129117 
    130 splice_data * 
    131 splice_data_new (sw_edit_buffer * eb, GList * sels); 
     118splice_data *splice_data_new (sw_edit_buffer * eb, GList * sels); 
    132119 
    133 void 
    134 splice_data_destroy (splice_data * s); 
     120void splice_data_destroy (splice_data * s); 
    135121 
    136 void 
    137 undo_by_splice_in (sw_sample * s, splice_data * sp); 
     122void undo_by_splice_in (sw_sample * s, splice_data * sp); 
    138123 
    139 void 
    140 redo_by_splice_out (sw_sample * s, splice_data * sp); 
     124void redo_by_splice_out (sw_sample * s, splice_data * sp); 
    141125 
    142 void 
    143 undo_by_splice_out (sw_sample * s, splice_data * sp); 
     126void undo_by_splice_out (sw_sample * s, splice_data * sp); 
    144127 
    145 void 
    146 redo_by_splice_in (sw_sample * s, splice_data * sp); 
     128void redo_by_splice_in (sw_sample * s, splice_data * sp); 
    147129 
    148 void 
    149 undo_by_splice_over (sw_sample * s, splice_data * sp); 
     130void undo_by_splice_over (sw_sample * s, splice_data * sp); 
    150131 
    151 void 
    152 redo_by_splice_over (sw_sample * s, splice_data * sp); 
     132void redo_by_splice_over (sw_sample * s, splice_data * sp); 
    153133 
    154 void 
    155 undo_by_crop_in (sw_sample * s, splice_data * sp); 
     134void undo_by_crop_in (sw_sample * s, splice_data * sp); 
    156135 
    157 void 
    158 redo_by_crop_out (sw_sample * s, splice_data * sp); 
     136void redo_by_crop_out (sw_sample * s, splice_data * sp); 
    159137 
    160138#endif /* __SWEEP_UNDO_H__ */ 
  • sweep/branches/display-cache/intl/bindtextdom.c

    r183 r471  
    7070/* Lock variable to protect the global data in the gettext implementation.  */ 
    7171__libc_rwlock_define (extern, _nl_state_lock attribute_hidden) 
    72  
    73  
    7472/* Names for the libintl functions are a problem.  They must not clash 
    7573   with existing names and they should follow ANSI C.  But this source 
     
    8684# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset 
    8785#endif 
    88  
    8986/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP 
    9087   to be used for the DOMAINNAME message catalog. 
     
    9390   If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither 
    9491   modified nor returned.  */ 
    95 static void 
    96 set_binding_values (const char *domainname, 
    97                    const char **dirnamep, const char **codesetp) 
     92     static void 
     93       set_binding_values (const char *domainname, 
     94                          const char **dirnamep, const char **codesetp) 
    9895{ 
    9996  struct binding *binding; 
     
    114111  modified = 0; 
    115112 
    116   for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) 
     113  for (binding = _nl_domain_bindings; binding != NULL; 
     114       binding = binding->next) 
    117115    { 
    118116      int compare = strcmp (domainname, binding->domainname); 
     
    140138            { 
    141139              /* The domain is already bound.  If the new value and the old 
    142                 one are equal we simply do nothing.  Otherwise replace the 
    143                 old binding.  */ 
     140                one are equal we simply do nothing.  Otherwise replace the 
     141                old binding.  */ 
    144142              char *result = binding->dirname; 
    145143              if (strcmp (dirname, result) != 0) 
    146144                { 
    147                   if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) 
    148                     result = (char *) INTUSE(_nl_default_dirname); 
     145                  if (strcmp (dirname, INTUSE (_nl_default_dirname)) == 0) 
     146                    result = (char *) INTUSE (_nl_default_dirname); 
    149147                  else 
    150148                    { 
     
    161159                  if (__builtin_expect (result != NULL, 1)) 
    162160                    { 
    163                       if (binding->dirname != INTUSE(_nl_default_dirname)) 
     161                      if (binding->dirname != INTUSE (_nl_default_dirname)) 
    164162                        free (binding->dirname); 
    165163 
     
    182180            { 
    183181              /* The domain is already bound.  If the new value and the old 
    184                 one are equal we simply do nothing.  Otherwise replace the 
    185                 old binding.  */ 
     182                one are equal we simply do nothing.  Otherwise replace the 
     183                old binding.  */ 
    186184              char *result = binding->codeset; 
    187185              if (result == NULL || strcmp (codeset, result) != 0) 
     
    215213      /* Simply return the default values.  */ 
    216214      if (dirnamep) 
    217         *dirnamep = INTUSE(_nl_default_dirname); 
     215        *dirnamep = INTUSE (_nl_default_dirname); 
    218216      if (codesetp) 
    219217        *codesetp = NULL; 
     
    224222      size_t len = strlen (domainname) + 1; 
    225223      struct binding *new_binding = 
    226         (struct binding *) malloc (offsetof (struct binding, domainname) + len); 
     224        (struct binding *) malloc (offsetof (struct binding, domainname) + 
     225                                   len); 
    227226 
    228227      if (__builtin_expect (new_binding == NULL, 0)) 
     
    237236          if (dirname == NULL) 
    238237            /* The default value.  */ 
    239             dirname = INTUSE(_nl_default_dirname); 
     238            dirname = INTUSE (_nl_default_dirname); 
    240239          else 
    241240            { 
    242               if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) 
    243                 dirname = INTUSE(_nl_default_dirname); 
     241              if (strcmp (dirname, INTUSE (_nl_default_dirname)) == 0) 
     242                dirname = INTUSE (_nl_default_dirname); 
    244243              else 
    245244                { 
     
    264263      else 
    265264        /* The default value.  */ 
    266         new_binding->dirname = (char *) INTUSE(_nl_default_dirname); 
     265        new_binding->dirname = (char *) INTUSE (_nl_default_dirname); 
    267266 
    268267      new_binding->codeset_cntr = 0; 
     
    320319        { 
    321320        failed_codeset: 
    322           if (new_binding->dirname != INTUSE(_nl_default_dirname)) 
     321          if (new_binding->dirname != INTUSE (_nl_default_dirname)) 
    323322            free (new_binding->dirname); 
    324323        failed_dirname: 
  • sweep/branches/display-cache/intl/dcgettext.c

    r183 r471  
    5252#ifdef _LIBC 
    5353/* Alias for function name in GNU C Library.  */ 
    54 INTDEF(__dcgettext) 
    55 weak_alias (__dcgettext, dcgettext); 
     54INTDEF (__dcgettext) weak_alias (__dcgettext, dcgettext); 
    5655#endif 
  • sweep/branches/display-cache/intl/dcigettext.c

    r183 r471  
    4242#  else 
    4343#   ifdef _AIX 
    44  #pragma alloca 
     44#pragma alloca 
    4545#   else 
    4646#    ifndef alloca 
     
    291291/* Value used as the default domain for gettext(3).  */ 
    292292const char *_nl_current_default_domain attribute_hidden 
    293      = _nl_default_default_domain; 
     293  = _nl_default_default_domain; 
    294294 
    295295/* Contains the default location of the message catalogs.  */ 
     
    300300INTVARDEF (_nl_default_dirname) 
    301301#endif 
    302  
    303302/* List with bindings of specific domains created by bindtextdomain() 
    304303   calls.  */ 
    305 struct binding *_nl_domain_bindings; 
     304     struct binding *_nl_domain_bindings; 
    306305 
    307306/* Prototypes for local functions.  */ 
    308 static char *plural_lookup (struct loaded_l10nfile *domain, 
    309                             unsigned long int n, 
    310                             const char *translation, size_t translation_len) 
    311     internal_function; 
    312 static const char *guess_category_value (int category, 
    313                                          const char *categoryname) 
    314      internal_function; 
     307     static char *plural_lookup (struct loaded_l10nfile *domain, 
     308                                unsigned long int n, 
     309                                const char *translation, 
     310                                size_t translation_len) internal_function; 
     311     static const char *guess_category_value (int category, 
     312                                              const char *categoryname) 
     313  internal_function; 
    315314#ifdef _LIBC 
    316315# include "../locale/localeinfo.h" 
    317316# define category_to_name(category)     _nl_category_names[category] 
    318317#else 
    319 static const char *category_to_name (int category) internal_function; 
     318     static const char *category_to_name (int category) internal_function; 
    320319#endif 
    321320 
     
    325324#ifdef HAVE_ALLOCA 
    326325/* Nothing has to be done.  */ 
    327 # define freea(p) /* nothing */ 
    328 # define ADD_BLOCK(list, address) /* nothing */ 
    329 # define FREE_BLOCKS(list) /* nothing */ 
    330 #else 
    331 struct block_list 
    332 
    333   void *address; 
    334   struct block_list *next; 
    335 }; 
     326# define freea(p)              /* nothing */ 
     327# define ADD_BLOCK(list, address)      /* nothing */ 
     328# define FREE_BLOCKS(list)     /* nothing */ 
     329#else 
     330     struct block_list 
     331     
     332       void *address; 
     333       struct block_list *next; 
     334     }; 
    336335# define ADD_BLOCK(list, addr)                                                \ 
    337336  do {                                                                        \ 
     
    357356# define alloca(size) (malloc (size)) 
    358357# define freea(p) free (p) 
    359 #endif /* have alloca */ 
     358#endif /* have alloca */ 
    360359 
    361360 
    362361#ifdef _LIBC 
    363362/* List of blocks allocated for translations.  */ 
    364 typedef struct transmem_list 
    365 
    366   struct transmem_list *next; 
    367   char data[ZERO]; 
    368 } transmem_block_t; 
    369 static struct transmem_list *transmem_list; 
    370 #else 
    371 typedef unsigned char transmem_block_t; 
     363     typedef struct transmem_list 
     364     
     365       struct transmem_list *next; 
     366       char data[ZERO]; 
     367     } transmem_block_t; 
     368     static struct transmem_list *transmem_list; 
     369#else 
     370     typedef unsigned char transmem_block_t; 
    372371#endif 
    373372 
     
    387386__libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden) 
    388387#endif 
    389  
    390388/* Checking whether the binaries runs SUID must be done and glibc provides 
    391389   easier methods therefore we make a difference here.  */ 
     
    406404#  define getegid() getgid() 
    407405# endif 
    408 static int enable_secure; 
     406     static int enable_secure; 
    409407# define ENABLE_SECURE (enable_secure == 1) 
    410408# define DETERMINE_SECURE \ 
     
    424422   CATEGORY locale and, if PLURAL is nonzero, search over string 
    425423   depending on the plural form determined by N.  */ 
    426 char * 
    427 DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2
    428             int plural, unsigned long int n, int category) 
     424     char *DCIGETTEXT (const char *domainname, const char *msgid1, 
     425                      const char *msgid2, int plural, unsigned long int n
     426                      int category) 
    429427{ 
    430428#ifndef HAVE_ALLOCA 
     
    454452  if (category < 0 || category >= __LC_LAST || category == LC_ALL) 
    455453    /* Bogus.  */ 
    456     return (plural == 0 
    457             ? (char *) msgid1 
     454    return (plural == 0 ? (char *) msgid1 
    458455            /* Use the Germanic plural rule.  */ 
    459456            : n == 1 ? (char *) msgid1 : (char *) msgid2); 
     
    480477     some time.  */ 
    481478  search = (struct known_translation_t *) 
    482           alloca (offsetof (struct known_translation_t, msgid) + msgid_len); 
     479    alloca (offsetof (struct known_translation_t, msgid) + msgid_len); 
    483480  memcpy (search->msgid, msgid1, msgid_len); 
    484481  search->domainname = (char *) domainname; 
     
    508505 
    509506  /* First find matching binding.  */ 
    510   for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) 
     507  for (binding = _nl_domain_bindings; binding != NULL; 
     508       binding = binding->next) 
    511509    { 
    512510      int compare = strcmp (domainname, binding->domainname); 
     
    523521 
    524522  if (binding == NULL) 
    525     dirname = (char *) INTUSE(_nl_default_dirname); 
     523    dirname = (char *) INTUSE (_nl_default_dirname); 
    526524  else if (IS_ABSOLUTE_PATH (binding->dirname)) 
    527525    dirname = binding->dirname; 
     
    563561 
    564562  domainname_len = strlen (domainname); 
    565   xdomainname = (char *) alloca (strlen (categoryname) 
    566                                  + domainname_len + 5); 
     563  xdomainname = (char *) alloca (strlen (categoryname) + domainname_len + 5); 
    567564  ADD_BLOCK (block_list, xdomainname); 
    568565 
    569566  stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), 
    570                   domainname, domainname_len), 
    571           ".mo"); 
     567                   domainname, domainname_len), ".mo"); 
    572568 
    573569  /* Creating working area.  */ 
     
    607603 
    608604      /* If the current locale value is C (or POSIX) we don't load a 
    609         domain.  Return the MSGID.  */ 
     605        domain.  Return the MSGID.  */ 
    610606      if (strcmp (single_locale, "C") == 0 
    611607          || strcmp (single_locale, "POSIX") == 0) 
     
    613609 
    614610      /* Find structure describing the message catalog matching the 
    615         DOMAINNAME and CATEGORY.  */ 
     611        DOMAINNAME and CATEGORY.  */ 
    616612      domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); 
    617613 
     
    640636            { 
    641637              /* Found the translation of MSGID1 in domain DOMAIN: 
    642                 starting at RETVAL, RETLEN bytes.  */ 
     638                starting at RETVAL, RETLEN bytes.  */ 
    643639              FREE_BLOCKS (block_list); 
    644640#if defined HAVE_TSEARCH || defined _LIBC 
     
    655651                      newp->domainname = 
    656652                        mempcpy (newp->msgid, msgid1, msgid_len); 
    657                       memcpy (newp->domainname, domainname, domainname_len + 1); 
     653                      memcpy (newp->domainname, domainname, 
     654                              domainname_len + 1); 
    658655                      newp->category = category; 
    659656                      newp->counter = _nl_msg_cat_cntr; 
     
    692689    } 
    693690 
    694  return_untranslated: 
     691return_untranslated: 
    695692  /* Return the untranslated MSGID.  */ 
    696693  FREE_BLOCKS (block_list); 
     
    701698      extern void _nl_log_untranslated (const char *logfilename, 
    702699                                        const char *domainname, 
    703                                         const char *msgid1, const char *msgid2, 
    704                                         int plural); 
     700                                        const char *msgid1, 
     701                                        const char *msgid2, int plural); 
    705702      const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED"); 
    706703 
    707704      if (logfilename != NULL && logfilename[0] != '\0') 
    708         _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural); 
     705        _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, 
     706                              plural); 
    709707    } 
    710708#endif 
    711709  __set_errno (saved_errno); 
    712   return (plural == 0 
    713           ? (char *) msgid1 
     710  return (plural == 0 ? (char *) msgid1 
    714711          /* Use the Germanic plural rule.  */ 
    715712          : n == 1 ? (char *) msgid1 : (char *) msgid2); 
     
    717714 
    718715 
    719 char * 
    720 internal_function 
     716char *internal_function 
    721717_nl_find_msg (struct loaded_l10nfile *domain_file, 
    722718              struct binding *domainbinding, const char *msgid, 
    723               size_t *lengthp) 
     719              size_t * lengthp) 
    724720{ 
    725721  struct loaded_domain *domain; 
     
    764760          if (nstr < nstrings 
    765761              ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len 
    766                && (strcmp (msgid, 
    767                             domain->data + W (domain->must_swap, 
    768                                               domain->orig_tab[nstr].offset)) 
    769                     == 0) 
     762              && (strcmp (msgid, 
     763                          domain->data + W (domain->must_swap, 
     764                                            domain->orig_tab[nstr].offset)) 
     765                  == 0) 
    770766              : domain->orig_sysdep_tab[nstr - nstrings].length > len 
    771                && (strcmp (msgid, 
    772                             domain->orig_sysdep_tab[nstr - nstrings].pointer) 
    773                     == 0)) 
     767              && (strcmp (msgid, 
     768                          domain->orig_sysdep_tab[nstr - nstrings].pointer) 
     769                  == 0)) 
    774770            { 
    775771              act = nstr; 
     
    787783    { 
    788784      /* Try the default method:  binary search in the sorted array of 
    789         messages.  */ 
     785        messages.  */ 
    790786      size_t top, bottom; 
    791787 
     
    811807    } 
    812808 
    813  found: 
     809found: 
    814810  /* The translation was found at index ACT.  If we have to convert the 
    815811     string to use a different character set, this is the time.  */ 
     
    831827    { 
    832828      /* The domain's codeset has changed through bind_textdomain_codeset() 
    833         since the message catalog was initialized or last accessed.  We 
    834         have to reinitialize the converter.  */ 
     829        since the message catalog was initialized or last accessed.  We 
     830        have to reinitialize the converter.  */ 
    835831      _nl_free_domain_conv (domain); 
    836832      _nl_init_domain_conv (domain_file, domain, domainbinding); 
     
    839835  if ( 
    840836# ifdef _LIBC 
    841       domain->conv != (__gconv_t) -
     837      domain->conv != (__gconv_t) -
    842838# else 
    843839#  if HAVE_ICONV 
    844       domain->conv != (iconv_t) -
     840      domain->conv != (iconv_t) -
    845841#  endif 
    846842# endif 
    847      
     843   
    848844    { 
    849845      /* We are supposed to do a conversion.  First allocate an 
    850         appropriate table with the same structure as the table 
    851         of translations in the file, where we can put the pointers 
    852         to the converted strings in. 
    853         There is a slight complication with plural entries.  They 
    854         are represented by consecutive NUL terminated strings.  We 
    855         handle this case by converting RESULTLEN bytes, including 
    856         NULs.  */ 
     846        appropriate table with the same structure as the table 
     847        of translations in the file, where we can put the pointers 
     848        to the converted strings in. 
     849        There is a slight complication with plural entries.  They 
     850        are represented by consecutive NUL terminated strings.  We 
     851        handle this case by converting RESULTLEN bytes, including 
     852        NULs.  */ 
    857853 
    858854      if (domain->conv_tab == NULL 
    859855          && ((domain->conv_tab = 
    860                  (char **) calloc (nstrings + domain->n_sysdep_strings, 
    861                                    sizeof (char *))) 
    862               == NULL)) 
     856               (char **) calloc (nstrings + domain->n_sysdep_strings, 
     857                                 sizeof (char *))) == NULL)) 
    863858        /* Mark that we didn't succeed allocating a table.  */ 
    864859        domain->conv_tab = (char **) -1; 
     
    932927              if (iconv (domain->conv, 
    933928                         (ICONV_CONST char **) &inptr, &inleft, 
    934                          &outptr, &outleft) 
    935                   != (size_t) (-1)) 
     929                         &outptr, &outleft) != (size_t) (-1)) 
    936930                { 
    937931                  outbuf = (unsigned char *) outptr; 
     
    982976# ifdef _LIBC 
    983977              /* Add the block to the list of blocks we have to free 
    984                  at some point.  */ 
     978                at some point.  */ 
    985979              newmem->next = transmem_list; 
    986980              transmem_list = newmem; 
     
    1004998          freemem = outbuf; 
    1005999          freemem += freemem_size & (alignof (size_t) - 1); 
    1006           freemem_size = freemem_size & ~ (alignof (size_t) - 1); 
     1000          freemem_size = freemem_size & ~(alignof (size_t) - 1); 
    10071001 
    10081002          __libc_lock_unlock (lock); 
     
    10101004 
    10111005      /* Now domain->conv_tab[act] contains the translation of all 
    1012         the plural variants.  */ 
     1006        the plural variants.  */ 
    10131007      result = domain->conv_tab[act] + sizeof (size_t); 
    10141008      resultlen = *(size_t *) domain->conv_tab[act]; 
    10151009    } 
    10161010 
    1017  converted: 
     1011converted: 
    10181012  /* The result string is converted.  */ 
    10191013 
     
    10261020 
    10271021/* Look up a plural variant.  */ 
    1028 static char * 
    1029 internal_function 
     1022static char *internal_function 
    10301023plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, 
    10311024               const char *translation, size_t translation_len) 
     
    10641057#ifndef _LIBC 
    10651058/* Return string representation of locale CATEGORY.  */ 
    1066 static const char * 
    1067 internal_function 
     1059static const char *internal_function 
    10681060category_to_name (int category) 
    10691061{ 
     
    10711063 
    10721064  switch (category) 
    1073  
     1065   
    10741066#ifdef LC_COLLATE 
    1075   case LC_COLLATE: 
    1076     retval = "LC_COLLATE"; 
    1077     break; 
     1067    case LC_COLLATE: 
     1068      retval = "LC_COLLATE"; 
     1069      break; 
    10781070#endif 
    10791071#ifdef LC_CTYPE 
    1080   case LC_CTYPE: 
    1081     retval = "LC_CTYPE"; 
    1082     break; 
     1072    case LC_CTYPE: 
     1073      retval = "LC_CTYPE"; 
     1074      break; 
    10831075#endif 
    10841076#ifdef LC_MONETARY 
    1085   case LC_MONETARY: 
    1086     retval = "LC_MONETARY"; 
    1087     break; 
     1077    case LC_MONETARY: 
     1078      retval = "LC_MONETARY"; 
     1079      break; 
    10881080#endif 
    10891081#ifdef LC_NUMERIC 
    1090   case LC_NUMERIC: 
    1091     retval = "LC_NUMERIC"; 
    1092     break; 
     1082    case LC_NUMERIC: 
     1083      retval = "LC_NUMERIC"; 
     1084      break; 
    10931085#endif 
    10941086#ifdef LC_TIME 
    1095   case LC_TIME: 
    1096     retval = "LC_TIME"; 
    1097     break; 
     1087    case LC_TIME: 
     1088      retval = "LC_TIME"; 
     1089      break; 
    10981090#endif 
    10991091#ifdef LC_MESSAGES 
    1100   case LC_MESSAGES: 
    1101     retval = "LC_MESSAGES"; 
    1102     break; 
     1092    case LC_MESSAGES: 
     1093      retval = "LC_MESSAGES"; 
     1094      break; 
    11031095#endif 
    11041096#ifdef LC_RESPONSE 
    1105   case LC_RESPONSE: 
    1106     retval = "LC_RESPONSE"; 
    1107     break; 
     1097    case LC_RESPONSE: 
     1098      retval = "LC_RESPONSE"; 
     1099      break; 
    11081100#endif 
    11091101#ifdef LC_ALL 
    1110   case LC_ALL: 
    1111     /* This might not make sense but is perhaps better than any other 
    1112        value.  */ 
    1113     retval = "LC_ALL"; 
    1114     break; 
    1115 #endif 
    1116   default: 
    1117     /* If you have a better idea for a default value let me know.  */ 
    1118     retval = "LC_XXX"; 
    1119  
     1102    case LC_ALL: 
     1103      /* This might not make sense but is perhaps better than any other 
     1104         value.  */ 
     1105      retval = "LC_ALL"; 
     1106      break; 
     1107#endif 
     1108    default: 
     1109      /* If you have a better idea for a default value let me know.  */ 
     1110      retval = "LC_XXX"; 
     1111   
    11201112 
    11211113  return retval; 
     
    11251117/* Guess value of current locale from value of the environment variables 
    11261118   or system-dependent defaults.  */ 
    1127 static const char * 
    1128 internal_function 
     1119static const char *internal_function 
    11291120guess_category_value (int category, const char *categoryname) 
    11301121{ 
     
    11381129  /* We use the settings in the following order: 
    11391130     1. The value of the environment variable 'LANGUAGE'.  This is a GNU 
    1140         extension.  Its value can be a colon-separated list of locale names. 
     1131     extension.  Its value can be a colon-separated list of locale names. 
    11411132     2. The value of the environment variable 'LC_ALL', 'LC_xxx', or 'LANG'. 
    1142         More precisely, the first among these that is set to a non-empty value. 
    1143         This is how POSIX specifies it.  The value is a single locale name. 
     1133     More precisely, the first among these that is set to a non-empty value. 
     1134     This is how POSIX specifies it.  The value is a single locale name. 
    11441135     3. A system-dependent preference list of languages.  Its value can be a 
    1145         colon-separated list of locale names. 
     1136     colon-separated list of locale names. 
    11461137     4. A system-dependent default locale name. 
    11471138     This way: 
    1148        - System-dependent settings can be overridden by environment variables. 
    1149        - If the system provides both a list of languages and a default locale, 
    1150          the former is used.  */ 
     1139     - System-dependent settings can be overridden by environment variables. 
     1140     - If the system provides both a list of languages and a default locale, 
     1141     the former is used.  */ 
    11511142 
    11521143  /* Fetch the locale name, through the POSIX method of looking to `LC_ALL', 
     
    11681159     to "C" because 
    11691160     1. "C" locale usually uses the ASCII encoding, and most international 
    1170        messages use non-ASCII characters. These characters get displayed 
    1171        as question marks (if using glibc's iconv()) or as invalid 8-bit 
    1172        characters (because other iconv()s refuse to convert most non-ASCII 
    1173        characters to ASCII). In any case, the output is ugly. 
     1161     messages use non-ASCII characters. These characters get displayed 
     1162     as question marks (if using glibc's iconv()) or as invalid 8-bit 
     1163     characters (because other iconv()s refuse to convert most non-ASCII 
     1164     characters to ASCII). In any case, the output is ugly. 
    11741165     2. The precise output of some programs in the "C" locale is specified 
    1175        by POSIX and should not depend on environment variables like 
    1176        "LANGUAGE" or system-dependent information.  We allow such programs 
    1177         to use gettext().  */ 
     1166     by POSIX and should not depend on environment variables like 
     1167     "LANGUAGE" or system-dependent information.  We allow such programs 
     1168     to use gettext().  */ 
    11781169  if (strcmp (locale, "C") == 0) 
    11791170    return locale; 
     
    11911182      language_default = _nl_language_preferences_default (); 
    11921183      if (language_default != NULL) 
    1193         return language_default; 
     1184       return language_default; 
    11941185    } 
    11951186  /* The least priority value is the locale name, if defaulted.  */ 
     
    12341225      struct binding *oldp = _nl_domain_bindings; 
    12351226      _nl_domain_bindings = _nl_domain_bindings->next; 
    1236       if (oldp->dirname != INTUSE(_nl_default_dirname)) 
     1227      if (oldp->dirname != INTUSE (_nl_default_dirname)) 
    12371228        /* Yes, this is a pointer comparison.  */ 
    12381229        free (oldp->dirname); 
  • sweep/branches/display-cache/intl/eval-plural.h

    r183 r471  
    2222 
    2323/* Evaluate the plural expression and return an index value.  */ 
    24 STATIC 
    25 unsigned long int 
    26 internal_function 
     24STATIC unsigned long int internal_function 
    2725plural_eval (struct expression *pexp, unsigned long int n) 
    2826{ 
     
    4543        /* pexp->operation must be lnot.  */ 
    4644        unsigned long int arg = plural_eval (pexp->val.args[0], n); 
    47         return ! arg; 
     45        return !arg; 
    4846      } 
    4947    case 2: 
  • sweep/branches/display-cache/intl/explodename.c

    r183 r471  
    5656                  const char **sponsor, const char **revision) 
    5757{ 
    58   enum { undecided, xpg, cen } syntax; 
     58  enum 
     59  { undecided, xpg, cen } syntax; 
    5960  char *cp; 
    6061  int mask; 
     
    136137      if (cp[0] == '+') 
    137138        { 
    138         /* Next is special application (CEN syntax).  */ 
     139        /* Next is special application (CEN syntax).  */ 
    139140          cp[0] = '\0'; 
    140141          *special = ++cp; 
     
    148149      if (cp[0] == ',') 
    149150        { 
    150         /* Next is sponsor (CEN syntax).  */ 
     151        /* Next is sponsor (CEN syntax).  */ 
    151152          cp[0] = '\0'; 
    152153          *sponsor = ++cp; 
     
    160161      if (cp[0] == '_') 
    161162        { 
    162         /* Next is revision (CEN syntax).  */ 
     163        /* Next is revision (CEN syntax).  */ 
    163164          cp[0] = '\0'; 
    164165          *revision = ++cp; 
  • sweep/branches/display-cache/intl/finddomain.c

    r183 r471  
    4646   the DOMAINNAME and CATEGORY parameters with respect to the currently 
    4747   established bindings.  */ 
    48 struct loaded_l10nfile * 
    49 internal_function 
     48struct loaded_l10nfile *internal_function 
    5049_nl_find_domain (const char *dirname, char *locale, 
    5150                 const char *domainname, struct binding *domainbinding) 
     
    6564  /* LOCALE can consist of up to four recognized parts for the XPG syntax: 
    6665 
    67                language[_territory[.codeset]][@modifier] 
     66     language[_territory[.codeset]][@modifier] 
    6867 
    6968     and six parts for the CEN syntax: 
    7069 
    71        language[_territory][+audience][+special][,[sponsor][_revision]] 
     70     language[_territory][+audience][+special][,[sponsor][_revision]] 
    7271 
    7372     Beside the first part all of them are allowed to be missing.  If 
     
    7574     looked for.  The various parts will be stripped off according to 
    7675     the following order: 
    77                (1) revision 
    78                (2) sponsor 
    79                (3) special 
    80                (4) codeset 
    81                (5) normalized codeset 
    82                (6) territory 
    83                (7) audience/modifier 
     76     (1) revision 
     77     (2) sponsor 
     78     (3) special 
     79     (4) codeset 
     80     (5) normalized codeset 
     81     (6) territory 
     82     (7) audience/modifier 
    8483   */ 
    8584 
     
    113112 
    114113  /* See whether the locale value is an alias.  If yes its value 
    115      *overwrites* the alias name.  No test for the original value is 
    116      done.  */ 
     114   *overwrites* the alias name.  No test for the original value is 
     115   done.  */ 
    117116  alias_value = _nl_expand_alias (locale); 
    118117  if (alias_value != NULL) 
     
    142141     generalization.  */ 
    143142  retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, 
    144                                strlen (dirname) + 1, mask, language, territory, 
    145                                codeset, normalized_codeset, modifier, special, 
    146                                sponsor, revision, domainname, 1); 
     143                               strlen (dirname) + 1, mask, language, 
     144                               territory, codeset, normalized_codeset, 
     145                               modifier, special, sponsor, revision, 
     146                               domainname, 1); 
    147147  if (retval == NULL) 
    148148    /* This means we are out of core.  */ 
  • sweep/branches/display-cache/intl/gettextP.h

    r183 r471  
    141141  struct binding *next; 
    142142  char *dirname; 
    143   int codeset_cntr;     /* Incremented each time codeset changes.  */ 
     143  int codeset_cntr;            /* Incremented each time codeset changes.  */ 
    144144  char *codeset; 
    145145  char domainname[ZERO]; 
     
    158158#endif 
    159159 
    160 struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale, 
    161                                          const char *__domainname, 
    162                                          struct binding *__domainbinding) 
    163      internal_function; 
    164 void _nl_load_domain (struct loaded_l10nfile *__domain, 
    165                       struct binding *__domainbinding) 
    166      internal_function; 
    167 void _nl_unload_domain (struct loaded_domain *__domain) 
    168      internal_function; 
    169 const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file, 
    170                                   struct loaded_domain *__domain, 
    171                                   struct binding *__domainbinding) 
    172      internal_function; 
    173 void _nl_free_domain_conv (struct loaded_domain *__domain) 
    174      internal_function; 
    175  
    176 char *_nl_find_msg (struct loaded_l10nfile *domain_file, 
    177                     struct binding *domainbinding, const char *msgid, 
    178                     size_t *lengthp) 
    179      internal_function; 
    180  
    181 #ifdef _LIBC 
    182 extern char *__gettext (const char *__msgid); 
    183 extern char *__dgettext (const char *__domainname, const char *__msgid); 
    184 extern char *__dcgettext (const char *__domainname, const char *__msgid, 
    185                           int __category); 
    186 extern char *__ngettext (const char *__msgid1, const char *__msgid2, 
    187                          unsigned long int __n); 
    188 extern char *__dngettext (const char *__domainname, 
    189                           const char *__msgid1, const char *__msgid2, 
    190                           unsigned long int n); 
    191 extern char *__dcngettext (const char *__domainname, 
    192                            const char *__msgid1, const char *__msgid2, 
    193                            unsigned long int __n, int __category); 
    194 extern char *__dcigettext (const char *__domainname, 
    195                            const char *__msgid1, const char *__msgid2, 
    196                            int __plural, unsigned long int __n, 
    197                            int __category); 
    198 extern char *__textdomain (const char *__domainname); 
    199 extern char *__bindtextdomain (const char *__domainname, 
    200                                const char *__dirname); 
    201 extern char *__bind_textdomain_codeset (const char *__domainname, 
    202                                         const char *__codeset); 
     160struct loaded_l10nfile * 
     161_nl_find_domain (const char *__dirname, char *__locale, 
     162                 const char *__domainname, struct binding *__domainbinding) 
     163  internal_function; 
     164     void _nl_load_domain (struct loaded_l10nfile *__domain, 
     165                           struct binding *__domainbinding) internal_function; 
     166     void _nl_unload_domain (struct loaded_domain *__domain) 
     167  internal_function; 
     168     const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file, 
     169                                       struct loaded_domain *__domain, 
     170                                       struct binding *__domainbinding) 
     171  internal_function; 
     172     void _nl_free_domain_conv (struct loaded_domain *__domain) 
     173  internal_function; 
     174 
     175     char *_nl_find_msg (struct loaded_l10nfile *domain_file, 
     176                         struct binding *domainbinding, const char *msgid, 
     177                         size_t * lengthp) internal_function; 
     178 
     179#ifdef _LIBC 
     180     extern char *__gettext (const char *__msgid); 
     181     extern char *__dgettext (const char *__domainname, const char *__msgid); 
     182     extern char *__dcgettext (const char *__domainname, const char *__msgid, 
     183                               int __category); 
     184     extern char *__ngettext (const char *__msgid1, const char *__msgid2, 
     185                              unsigned long int __n); 
     186     extern char *__dngettext (const char *__domainname, 
     187                               const char *__msgid1, const char *__msgid2, 
     188                               unsigned long int n); 
     189     extern char *__dcngettext (const char *__domainname, 
     190                                const char *__msgid1, const char *__msgid2, 
     191                                unsigned long int __n, int __category); 
     192     extern char *__dcigettext (const char *__domainname, 
     193                                const char *__msgid1, const char *__msgid2, 
     194                                int __plural, unsigned long int __n, 
     195                                int __category); 
     196     extern char *__textdomain (const char *__domainname); 
     197     extern char *__bindtextdomain (const char *__domainname, 
     198                                    const char *__dirname); 
     199     extern char *__bind_textdomain_codeset (const char *__domainname, 
     200                                             const char *__codeset); 
    203201#else 
    204202/* Declare the exported libintl_* functions, in a way that allows us to 
     
    208206# define _INTL_REDIRECT_MACROS 
    209207# include "libgnuintl.h" 
    210 extern char *libintl_dcigettext (const char *__domainname, 
    211                                  const char *__msgid1, const char *__msgid2
    212                                  int __plural, unsigned long int __n
    213                                  int __category); 
     208     extern char *libintl_dcigettext (const char *__domainname, 
     209                                      const char *__msgid1
     210                                      const char *__msgid2, int __plural
     211                                      unsigned long int __n, int __category); 
    214212#endif 
    215213 
  • sweep/branches/display-cache/intl/gmo.h

    r183 r471  
    6464  /* The following line is intended to throw an error.  Using #error is 
    6565     not portable enough.  */ 
    66   "Cannot determine unsigned 32-bit data type." 
     66"Cannot determine unsigned 32-bit data type." 
    6767#  endif 
    6868# endif 
    6969#endif 
    70  
    71  
    7270/* Header for binary .mo file format.  */ 
    73 struct mo_file_header 
     71  struct mo_file_header 
    7472{ 
    7573  /* The magic number.  */ 
     
    147145/* @@ begin of epilog @@ */ 
    148146 
    149 #endif /* gettext.h  */ 
     147#endif /* gettext.h  */ 
  • sweep/branches/display-cache/intl/intl-compat.c

    r183 r471  
    5757 
    5858 
    59 DLL_EXPORTED 
    60 char * 
     59DLL_EXPORTED char * 
    6160gettext (const char *msgid) 
    6261{ 
     
    6564 
    6665 
    67 DLL_EXPORTED 
    68 char * 
     66DLL_EXPORTED char * 
    6967dgettext (const char *domainname, const char *msgid) 
    7068{ 
     
    7371 
    7472 
    75 DLL_EXPORTED 
    76 char * 
     73DLL_EXPORTED char * 
    7774dcgettext (const char *domainname, const char *msgid, int category) 
    7875{ 
     
    8178 
    8279 
    83 DLL_EXPORTED 
    84 char * 
     80DLL_EXPORTED char * 
    8581ngettext (const char *msgid1, const char *msgid2, unsigned long int n) 
    8682{ 
     
    8985 
    9086 
    91 DLL_EXPORTED 
    92 char * 
     87DLL_EXPORTED char * 
    9388dngettext (const char *domainname, 
    9489           const char *msgid1, const char *msgid2, unsigned long int n) 
     
    9893 
    9994 
    100 DLL_EXPORTED 
    101 char * 
     95DLL_EXPORTED char * 
    10296dcngettext (const char *domainname, 
    10397            const char *msgid1, const char *msgid2, unsigned long int n, 
     
    108102 
    109103 
    110 DLL_EXPORTED 
    111 char * 
     104DLL_EXPORTED char * 
    112105textdomain (const char *domainname) 
    113106{ 
     
    116109 
    117110 
    118 DLL_EXPORTED 
    119 char * 
     111DLL_EXPORTED char * 
    120112bindtextdomain (const char *domainname, const char *dirname) 
    121113{ 
     
    124116 
    125117 
    126 DLL_EXPORTED 
    127 char * 
     118DLL_EXPORTED char * 
    128119bind_textdomain_codeset (const char *domainname, const char *codeset) 
    129120{ 
  • sweep/branches/display-cache/intl/l10nflist.c

    r183 r471  
    9898  return count; 
    9999} 
     100 
    100101# undef __argz_count 
    101102# define __argz_count(argz, len) argz_count__ (argz, len) 
     
    104105#  define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) 
    105106# endif 
    106 #endif /* !_LIBC && !HAVE___ARGZ_COUNT */ 
     107#endif /* !_LIBC && !HAVE___ARGZ_COUNT */ 
    107108 
    108109#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY 
     
    121122    } 
    122123} 
     124 
    123125# undef __argz_stringify 
    124126# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) 
     
    128130  INTUSE(__argz_stringify) (argz, len, sep) 
    129131# endif 
    130 #endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ 
     132#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ 
    131133 
    132134#if !defined _LIBC && !defined HAVE___ARGZ_NEXT 
     
    137139    { 
    138140      if (entry < argz + argz_len) 
    139         entry = strchr (entry, '\0') + 1; 
     141       entry = strchr (entry, '\0') + 1; 
    140142 
    141143      return entry >= argz + argz_len ? NULL : (char *) entry; 
    142144    } 
     145  else if (argz_len > 0) 
     146    return argz; 
    143147  else 
    144     if (argz_len > 0) 
    145       return argz; 
    146     else 
    147       return 0; 
    148 
     148    return 0; 
     149
     150 
    149151# undef __argz_next 
    150152# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) 
    151 #endif /* !_LIBC && !HAVE___ARGZ_NEXT */ 
     153#endif /* !_LIBC && !HAVE___ARGZ_NEXT */ 
    152154 
    153155 
     
    164166  return x; 
    165167} 
    166  
    167168  
     169 
    168170struct loaded_l10nfile * 
    169171_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, 
     
    243245    { 
    244246      /* This component can be part of both syntaces but has different 
    245         leading characters.  For CEN we use `+', else `@'.  */ 
     247        leading characters.  For CEN we use `+', else `@'.  */ 
    246248      *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; 
    247249      cp = stpcpy (cp, modifier); 
  • sweep/branches/display-cache/intl/langprefs.c

    r183 r471  
    4444_nl_language_preferences_default (void) 
    4545{ 
    46 #if HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ 
     46#if HAVE_CFPREFERENCESCOPYAPPVALUE     /* MacOS X 10.2 or newer */ 
    4747  { 
    4848    /* Cache the preferences list, since CoreFoundation calls are expensive.  */ 
     
    5858            && CFGetTypeID (preferences) == CFArrayGetTypeID ()) 
    5959          { 
    60             CFArrayRef prefArray = (CFArrayRef)preferences; 
     60            CFArrayRef prefArray = (CFArrayRef) preferences; 
    6161            int n = CFArrayGetCount (prefArray); 
    6262            char buf[256]; 
     
    6969                if (element != NULL 
    7070                    && CFGetTypeID (element) == CFStringGetTypeID () 
    71                     && CFStringGetCString ((CFStringRef)element, 
     71                    && CFStringGetCString ((CFStringRef) element, 
    7272                                           buf, sizeof (buf), 
    7373                                           kCFStringEncodingASCII)) 
     
    9999                          CFArrayGetValueAtIndex (prefArray, i); 
    100100                        if (element != NULL 
    101                             && CFGetTypeID (element) == CFStringGetTypeID () 
    102                             && CFStringGetCString ((CFStringRef)element, 
     101                           && CFGetTypeID (element) == CFStringGetTypeID () 
     102                            && CFStringGetCString ((CFStringRef) element, 
    103103                                                   buf, sizeof (buf), 
    104104                                                   kCFStringEncodingASCII)) 
  • sweep/branches/display-cache/intl/loadinfo.h

    r183 r471  
    9999   furthermore its ->successor[] field contains a list of other lookup 
    100100   results from which this lookup result inherits.  */ 
    101 extern struct loaded_l10nfile * 
    102 _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, 
    103                     const char *dirlist, size_t dirlist_len, int mask, 
    104                     const char *language, const char *territory, 
    105                     const char *codeset, const char *normalized_codeset, 
    106                     const char *modifier, const char *special, 
    107                     const char *sponsor, const char *revision, 
    108                     const char *filename, int do_allocate); 
     101extern struct loaded_l10nfile *_nl_make_l10nflist (struct loaded_l10nfile 
     102                                                   **l10nfile_list, 
     103                                                   const char *dirlist, 
     104                                                   size_t dirlist_len, 
     105                                                   int mask, 
     106                                                   const char *language, 
     107                                                   const char *territory, 
     108                                                   const char *codeset, 
     109                                                   const char 
     110                                                   *normalized_codeset, 
     111                                                   const char *modifier, 
     112                                                   const char *special, 
     113                                                   const char *sponsor, 
     114                                                   const char *revision, 
     115                                                   const char *filename, 
     116                                                   int do_allocate); 
    109117 
    110118/* Lookup the real locale name for a locale alias NAME, or NULL if 
     
    143151extern char *_nl_find_language (const char *name); 
    144152 
    145 #endif /* loadinfo.h */ 
     153#endif /* loadinfo.h */ 
  • sweep/branches/display-cache/intl/loadmsgcat.c

    r183 r471  
    4747#  else 
    4848#   ifdef _AIX 
    49  #pragma alloca 
     49#pragma alloca 
    5050#   else 
    5151#    ifndef alloca 
     
    468468   some additional code emulating it.  */ 
    469469#ifdef HAVE_ALLOCA 
    470 # define freea(p) /* nothing */ 
     470# define freea(p)              /* nothing */ 
    471471#else 
    472472# define alloca(n) malloc (n) 
     
    754754#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) 
    755755      /* The 'I' flag, in numeric format directives, replaces ASCII digits 
    756         with the 'outdigits' defined in the LC_CTYPE locale facet.  This is 
    757         used for Farsi (Persian) and maybe Arabic.  */ 
     756        with the 'outdigits' defined in the LC_CTYPE locale facet.  This is 
     757        used for Farsi (Persian) and maybe Arabic.  */ 
    758758      return "I"; 
    759759#else 
     
    767767/* Initialize the codeset dependent parts of an opened message catalog. 
    768768   Return the header entry.  */ 
    769 const char * 
    770 internal_function 
     769const char *internal_function 
    771770_nl_init_domain_conv (struct loaded_l10nfile *domain_file, 
    772771                      struct loaded_domain *domain, 
     
    785784    (domainbinding != NULL ? domainbinding->codeset_cntr : 0); 
    786785#ifdef _LIBC 
    787   domain->conv = (__gconv_t) -1; 
     786  domain->conv = (__gconv_t) - 1; 
    788787#else 
    789788# if HAVE_ICONV 
    790   domain->conv = (iconv_t) -1; 
     789  domain->conv = (iconv_t) - 1; 
    791790# endif 
    792791#endif 
     
    847846          charset = norm_add_slashes (charset, NULL); 
    848847          if (__gconv_open (outcharset, charset, &domain->conv, 
    849                             GCONV_AVOID_NOCONV) 
    850               != __GCONV_OK) 
    851             domain->conv = (__gconv_t) -1; 
     848                            GCONV_AVOID_NOCONV) != __GCONV_OK) 
     849            domain->conv = (__gconv_t) - 1; 
    852850# else 
    853851#  if HAVE_ICONV 
     
    885883 
    886884/* Frees the codeset dependent parts of an opened message catalog.  */ 
    887 void 
    888 internal_function 
     885void internal_function 
    889886_nl_free_domain_conv (struct loaded_domain *domain) 
    890887{ 
     
    893890 
    894891#ifdef _LIBC 
    895   if (domain->conv != (__gconv_t) -1) 
     892  if (domain->conv != (__gconv_t) - 1) 
    896893    __gconv_close (domain->conv); 
    897894#else 
    898895# if HAVE_ICONV 
    899   if (domain->conv != (iconv_t) -1) 
     896  if (domain->conv != (iconv_t) - 1) 
    900897    iconv_close (domain->conv); 
    901898# endif 
     
    905902/* Load the message catalogs specified by FILENAME.  If it is no valid 
    906903   message catalog do nothing.  */ 
    907 void 
    908 internal_function 
     904void internal_function 
    909905_nl_load_domain (struct loaded_l10nfile *domain_file, 
    910906                 struct binding *domainbinding) 
     
    945941  if ( 
    946942#ifdef _LIBC 
    947       __builtin_expect (fstat64 (fd, &st) != 0, 0) 
     943      __builtin_expect (fstat64 (fd, &st) != 0, 0) 
    948944#else 
    949       __builtin_expect (fstat (fd, &st) != 0, 0) 
    950 #endif 
    951       || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) 
    952       || __builtin_expect (size < sizeof (struct mo_file_header), 0)) 
     945      __builtin_expect (fstat (fd, &st) != 0, 0) 
     946#endif 
     947      || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) 
     948      || __builtin_expect (size < sizeof (struct mo_file_header), 0)) 
    953949    { 
    954950      /* Something went wrong.  */ 
     
    10061002  /* Using the magic number we can test whether it really is a message 
    10071003     catalog file.  */ 
    1008   if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, 
    1009                        0)) 
     1004  if (__builtin_expect 
     1005      (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, 0)) 
    10101006    { 
    10111007      /* The magic number is wrong: not a message catalog file.  */ 
     
    10461042        (domain->hash_size > 2 
    10471043         ? (const nls_uint32 *) 
    1048            ((char *) data + W (domain->must_swap, data->hash_tab_offset)) 
     1044         ((char *) data + W (domain->must_swap, data->hash_tab_offset)) 
    10491045         : NULL); 
    10501046      domain->must_swap_hash_tab = domain->must_swap; 
     
    10671063              goto invalid; 
    10681064 
    1069             n_sysdep_strings = 
    1070               W (domain->must_swap, data->n_sysdep_strings); 
     1065            n_sysdep_strings = W (domain->must_swap, data->n_sysdep_strings); 
    10711066            if (n_sysdep_strings > 0) 
    10721067              { 
     
    11061101                      } 
    11071102 
    1108                     sysdep_segment_values[i] = get_sysdep_segment_value (name); 
     1103                    sysdep_segment_values[i] = 
     1104                      get_sysdep_segment_value (name); 
    11091105                  } 
    11101106 
     
    11311127                        const struct sysdep_string *sysdep_string = 
    11321128                          (const struct sysdep_string *) 
    1133                           ((char *) data 
    1134                            + W (domain->must_swap, 
    1135                                 j == 0 
    1136                                 ? orig_sysdep_tab[i] 
    1137                                 : trans_sysdep_tab[i])); 
     1129                          ((char *) data + W (domain->must_swap, 
     1130                                              j == 0 
     1131                                              ? orig_sysdep_tab[i] 
     1132                                              : trans_sysdep_tab[i])); 
    11381133                        size_t need = 0; 
    1139                         const struct segment_pair *p = sysdep_string->segments; 
    1140  
    1141                         if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) 
     1134                        const struct segment_pair *p = 
     1135                          sysdep_string->segments; 
     1136 
     1137                        if (W (domain->must_swap, p->sysdepref) != 
     1138                            SEGMENTS_END) 
    11421139                          for (p = sysdep_string->segments;; p++) 
    11431140                            { 
     
    11641161                                } 
    11651162 
    1166                               need += strlen (sysdep_segment_values[sysdepref]); 
     1163                              need += 
     1164                                strlen (sysdep_segment_values[sysdepref]); 
    11671165                            } 
    11681166 
     
    11791177                  } 
    11801178                memneed += 2 * n_inmem_sysdep_strings 
    1181                           * sizeof (struct sysdep_string_desc); 
     1179                  * sizeof (struct sysdep_string_desc); 
    11821180 
    11831181                if (n_inmem_sysdep_strings > 0) 
     
    11931191                    inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem; 
    11941192                    mem += n_inmem_sysdep_strings 
    1195                            * sizeof (struct sysdep_string_desc); 
    1196                     inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem; 
    1197                     mem += n_inmem_sysdep_strings 
    1198                            * sizeof (struct sysdep_string_desc); 
     1193                      * sizeof (struct sysdep_string_desc); 
     1194                    inmem_trans_sysdep_tab = 
     1195                      (struct sysdep_string_desc *) mem; 
     1196                    mem += 
     1197                      n_inmem_sysdep_strings * 
     1198                      sizeof (struct sysdep_string_desc); 
    11991199                    inmem_hash_tab = (nls_uint32 *) mem; 
    12001200                    mem += domain->hash_size * sizeof (nls_uint32); 
     
    12101210                            const struct sysdep_string *sysdep_string = 
    12111211                              (const struct sysdep_string *) 
    1212                               ((char *) data 
    1213                                + W (domain->must_swap, 
    1214                                     j == 0 
    1215                                     ? orig_sysdep_tab[i] 
    1216                                     : trans_sysdep_tab[i])); 
     1212                              ((char *) data + W (domain->must_swap, 
     1213                                                  j == 0 
     1214                                                  ? orig_sysdep_tab[i] 
     1215                                                  : trans_sysdep_tab[i])); 
    12171216                            const struct segment_pair *p = 
    12181217                              sysdep_string->segments; 
     
    12291228                                    break; 
    12301229 
    1231                                   if (sysdep_segment_values[sysdepref] == NULL) 
     1230                                  if (sysdep_segment_values[sysdepref] == 
     1231                                      NULL) 
    12321232                                    { 
    12331233                                      /* This particular string pair is 
    1234                                         invalid.  */ 
     1234                                        invalid.  */ 
    12351235                                      valid = 0; 
    12361236                                      break; 
     
    12481248                                const struct sysdep_string *sysdep_string = 
    12491249                                  (const struct sysdep_string *) 
    1250                                   ((char *) data 
    1251                                    + W (domain->must_swap, 
    1252                                         j == 0 
    1253                                         ? orig_sysdep_tab[i] 
    1254                                         : trans_sysdep_tab[i])); 
     1250                                  ((char *) data + W (domain->must_swap, 
     1251                                                      j == 0 
     1252                                                      ? orig_sysdep_tab[i] 
     1253                                                      : trans_sysdep_tab[i])); 
    12551254                                const char *static_segments = 
    12561255                                  (char *) data 
    1257                                   + W (domain->must_swap, sysdep_string->offset); 
     1256                                  + W (domain->must_swap, 
     1257                                       sysdep_string->offset); 
    12581258                                const struct segment_pair *p = 
    12591259                                  sysdep_string->segments; 
     
    12661266                                  (j == 0 
    12671267                                   ? inmem_orig_sysdep_tab 
    1268                                    : inmem_trans_sysdep_tab) 
    1269                                   + k; 
     1268                                   : inmem_trans_sysdep_tab) + k; 
    12701269 
    12711270                                if (W (domain->must_swap, p->sysdepref) 
     
    12751274                                    inmem_tab_entry->length = 
    12761275                                      W (domain->must_swap, p->segsize); 
    1277                                     inmem_tab_entry->pointer = static_segments; 
     1276                                    inmem_tab_entry->pointer = 
     1277                                      static_segments; 
    12781278                                  } 
    12791279                                else 
     
    12911291                                        if (segsize > 0) 
    12921292                                          { 
    1293                                             memcpy (mem, static_segments, segsize); 
     1293                                            memcpy (mem, static_segments, 
     1294                                                    segsize); 
    12941295                                            mem += segsize; 
    12951296                                            static_segments += segsize; 
     
    12991300                                          break; 
    13001301 
    1301                                         n = strlen (sysdep_segment_values[sysdepref]); 
    1302                                         memcpy (mem, sysdep_segment_values[sysdepref], n); 
     1302                                        n = 
     1303                                          strlen (sysdep_segment_values 
     1304                                                  [sysdepref]); 
     1305                                        memcpy (mem, 
     1306                                                sysdep_segment_values 
     1307                                                [sysdepref], n); 
    13031308                                        mem += n; 
    13041309                                      } 
     
    13321337                              { 
    13331338                                /* Hash table entry is empty.  Use it.  */ 
    1334                                 inmem_hash_tab[idx] = 1 + domain->nstrings + i; 
     1339                                inmem_hash_tab[idx] = 
     1340                                  1 + domain->nstrings + i; 
    13351341                                break; 
    13361342                              } 
     
    13971403 
    13981404#ifdef _LIBC 
    1399 void 
    1400 internal_function 
     1405void internal_function 
    14011406_nl_unload_domain (struct loaded_domain *domain) 
    14021407{ 
  • sweep/branches/display-cache/intl/localcharset.c

    r409 r471  
    4242 
    4343#if defined _WIN32 || defined __WIN32__ 
    44 # undef WIN32   /* avoid warning on mingw32 */ 
     44# undef WIN32                  /* avoid warning on mingw32 */ 
    4545# define WIN32 
    4646#endif 
     
    9999   are atomic. But I don't know what will happen if the two assignments mix.  */ 
    100100#if __STDC__ != 1 
    101 # define volatile /* empty */ 
     101# define volatile              /* empty */ 
    102102#endif 
    103103/* Pointer to the contents of the charset.alias file, if it has already been 
    104104   read, else NULL.  Its format is: 
    105105   ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0'  */ 
    106 static const char * volatile charset_aliases; 
     106static const char *volatile charset_aliases; 
    107107 
    108108/* Return a pointer to the contents of the charset.alias file.  */ 
     
    122122 
    123123      /* Make it possible to override the charset.alias location.  This is 
    124         necessary for running the testsuite before "make install".  */ 
     124        necessary for running the testsuite before "make install".  */ 
    125125      dir = getenv ("CHARSETALIASDIR"); 
    126126      if (dir == NULL || dir[0] == '\0') 
     
    154154            { 
    155155              int c; 
    156               char buf1[50+1]; 
    157               char buf2[50+1]; 
     156              char buf1[50 + 1]; 
     157              char buf2[50 + 1]; 
    158158              size_t l1, l2; 
    159159              char *old_res_ptr; 
     
    218218# if defined VMS 
    219219      /* To avoid the troubles of an extra file charset.alias_vms in the 
    220         sources of many GNU packages, simply inline the aliases here.  */ 
     220        sources of many GNU packages, simply inline the aliases here.  */ 
    221221      /* The list of encodings is taken from the OpenVMS 7.3-1 documentation 
    222         "Compaq C Run-Time Library Reference Manual for OpenVMS systems" 
    223         section 10.7 "Handling Different Character Sets".  */ 
     222        "Compaq C Run-Time Library Reference Manual for OpenVMS systems" 
     223        section 10.7 "Handling Different Character Sets".  */ 
    224224      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" 
    225            "ISO8859-2" "\0" "ISO-8859-2" "\0" 
    226            "ISO8859-5" "\0" "ISO-8859-5" "\0" 
    227            "ISO8859-7" "\0" "ISO-8859-7" "\0" 
    228            "ISO8859-8" "\0" "ISO-8859-8" "\0" 
    229            "ISO8859-9" "\0" "ISO-8859-9" "\0" 
    230            /* Japanese */ 
    231            "eucJP" "\0" "EUC-JP" "\0" 
    232            "SJIS" "\0" "SHIFT_JIS" "\0" 
    233            "DECKANJI" "\0" "DEC-KANJI" "\0" 
    234            "SDECKANJI" "\0" "EUC-JP" "\0" 
    235            /* Chinese */ 
    236            "eucTW" "\0" "EUC-TW" "\0" 
    237            "DECHANYU" "\0" "DEC-HANYU" "\0" 
    238            "DECHANZI" "\0" "GB2312" "\0" 
    239            /* Korean */ 
    240            "DECKOREAN" "\0" "EUC-KR" "\0"; 
     225        "ISO8859-2" "\0" "ISO-8859-2" "\0" 
     226        "ISO8859-5" "\0" "ISO-8859-5" "\0" 
     227        "ISO8859-7" "\0" "ISO-8859-7" "\0" 
     228        "ISO8859-8" "\0" "ISO-8859-8" "\0" "ISO8859-9" "\0" "ISO-8859-9" "\0" 
     229        /* Japanese */ 
     230        "eucJP" "\0" "EUC-JP" "\0" 
     231        "SJIS" "\0" "SHIFT_JIS" "\0" 
     232        "DECKANJI" "\0" "DEC-KANJI" "\0" "SDECKANJI" "\0" "EUC-JP" "\0" 
     233        /* Chinese */ 
     234        "eucTW" "\0" "EUC-TW" "\0" 
     235        "DECHANYU" "\0" "DEC-HANYU" "\0" "DECHANZI" "\0" "GB2312" "\0" 
     236        /* Korean */ 
     237        "DECKOREAN" "\0" "EUC-KR" "\0"; 
    241238# endif 
    242239 
    243240# if defined WIN32 
    244241      /* To avoid the troubles of installing a separate file in the same 
    245         directory as the DLL and of retrieving the DLL's directory at 
    246         runtime, simply inline the aliases here.  */ 
     242        directory as the DLL and of retrieving the DLL's directory at 
     243        runtime, simply inline the aliases here.  */ 
    247244 
    248245      cp = "CP936" "\0" "GBK" "\0" 
    249            "CP1361" "\0" "JOHAB" "\0" 
    250            "CP20127" "\0" "ASCII" "\0" 
    251            "CP20866" "\0" "KOI8-R" "\0" 
    252            "CP21866" "\0" "KOI8-RU" "\0" 
    253            "CP28591" "\0" "ISO-8859-1" "\0" 
    254            "CP28592" "\0" "ISO-8859-2" "\0" 
    255            "CP28593" "\0" "ISO-8859-3" "\0" 
    256            "CP28594" "\0" "ISO-8859-4" "\0" 
    257            "CP28595" "\0" "ISO-8859-5" "\0" 
    258            "CP28596" "\0" "ISO-8859-6" "\0" 
    259            "CP28597" "\0" "ISO-8859-7" "\0" 
    260            "CP28598" "\0" "ISO-8859-8" "\0" 
    261            "CP28599" "\0" "ISO-8859-9" "\0" 
    262            "CP28605" "\0" "ISO-8859-15" "\0"; 
     246        "CP1361" "\0" "JOHAB" "\0" 
     247        "CP20127" "\0" "ASCII" "\0" 
     248        "CP20866" "\0" "KOI8-R" "\0" 
     249        "CP21866" "\0" "KOI8-RU" "\0" 
     250        "CP28591" "\0" "ISO-8859-1" "\0" 
     251        "CP28592" "\0" "ISO-8859-2" "\0" 
     252        "CP28593" "\0" "ISO-8859-3" "\0" 
     253        "CP28594" "\0" "ISO-8859-4" "\0" 
     254        "CP28595" "\0" "ISO-8859-5" "\0" 
     255        "CP28596" "\0" "ISO-8859-6" "\0" 
     256        "CP28597" "\0" "ISO-8859-7" "\0" 
     257        "CP28598" "\0" "ISO-8859-8" "\0" 
     258        "CP28599" "\0" "ISO-8859-9" "\0" "CP28605" "\0" "ISO-8859-15" "\0"; 
    263259# endif 
    264260#endif 
     
    363359            { 
    364360              memcpy (buf, dot, modifier - dot); 
    365               buf [modifier - dot] = '\0'; 
     361              buf[modifier - dot] = '\0'; 
    366362              return buf; 
    367363            } 
  • sweep/branches/display-cache/intl/localcharset.h

    r183 r471  
    2323 
    2424#ifdef __cplusplus 
    25 extern "C" { 
     25extern "C" 
     26
    2627#endif 
    2728 
     
    3233   If the canonical name cannot be determined, the result is a non-canonical 
    3334   name.  */ 
    34 extern const char * locale_charset (void); 
     35  extern const char *locale_charset (void); 
    3536 
    3637 
     
    4041 
    4142 
    42 #endif /* _LOCALCHARSET_H */ 
     43#endif                         /* _LOCALCHARSET_H */ 
  • sweep/branches/display-cache/intl/localealias.c

    r183 r471  
    4848#  else 
    4949#   ifdef _AIX 
    50  #pragma alloca 
     50#pragma alloca 
    5151#   else 
    5252#    ifndef alloca 
     
    105105   some additional code emulating it.  */ 
    106106#ifdef HAVE_ALLOCA 
    107 # define freea(p) /* nothing */ 
     107# define freea(p)              /* nothing */ 
    108108#else 
    109109# define alloca(n) malloc (n) 
     
    141141 
    142142/* Prototypes for local functions.  */ 
    143 static size_t read_alias_file (const char *fname, int fname_len) 
    144      internal_function; 
    145 static int extend_alias_table (void)
    146 static int alias_compare (const struct alias_map *map1, 
    147                           const struct alias_map *map2); 
    148  
    149  
    150 const char * 
    151 _nl_expand_alias (const char *name) 
     143static size_t 
     144read_alias_file (const char *fname, int fname_len) 
     145  internal_function
     146     static int extend_alias_table (void); 
     147     static int alias_compare (const struct alias_map *map1, 
     148                               const struct alias_map *map2); 
     149 
     150 
     151     const char *_nl_expand_alias (const char *name) 
    152152{ 
    153153  static const char *locale_alias_path; 
     
    172172        retval = (struct alias_map *) bsearch (&item, map, nmap, 
    173173                                               sizeof (struct alias_map), 
    174                                                (int (*) (const void *, 
    175                                                         const void *
    176                                                ) alias_compare); 
     174                                               (int (*)(const void *, 
     175                                                        const void *)
     176                                              alias_compare); 
    177177      else 
    178178        retval = NULL; 
     
    213213 
    214214 
    215 static size_t 
    216 internal_function 
     215static size_t internal_function 
    217216read_alias_file (const char *fname, int fname_len) 
    218217{ 
     
    245244    { 
    246245      /* It is a reasonable approach to use a fix buffer here because 
    247         a) we are only interested in the first two fields 
    248         b) these fields must be usable as file names and so must not 
    249            be that long 
    250         We avoid a multi-kilobyte buffer here since this would use up 
    251         stack space which we might not have if the program ran out of 
    252         memory.  */ 
     246        a) we are only interested in the first two fields 
     247        b) these fields must be usable as file names and so must not 
     248         be that long 
     249        We avoid a multi-kilobyte buffer here since this would use up 
     250        stack space which we might not have if the program ran out of 
     251        memory.  */ 
    253252      char buf[400]; 
    254253      char *alias; 
     
    345344 
    346345      /* Possibly not the whole line fits into the buffer.  Ignore 
    347         the rest of the line.  */ 
     346        the rest of the line.  */ 
    348347      while (strchr (buf, '\n') == NULL) 
    349348        if (FGETS (buf, sizeof buf, fp) == NULL) 
     
    359358  if (added > 0) 
    360359    qsort (map, nmap, sizeof (struct alias_map), 
    361            (int (*) (const void *, const void *)) alias_compare); 
     360           (int (*)(const void *, const void *)) alias_compare); 
    362361 
    363362  return added; 
     
    400399    { 
    401400      /* I know this seems to be odd but the tolower() function in 
    402         some systems libc cannot handle nonalpha characters.  */ 
     401        some systems libc cannot handle nonalpha characters.  */ 
    403402      c1 = isupper (*p1) ? tolower (*p1) : *p1; 
    404403      c2 = isupper (*p2) ? tolower (*p2) : *p2; 
  • sweep/branches/display-cache/intl/localename.c

    r183 r471  
    3939 
    4040#if defined _WIN32 || defined __WIN32__ 
    41 # undef WIN32   /* avoid warning on mingw32 */ 
     41# undef WIN32                  /* avoid warning on mingw32 */ 
    4242# define WIN32 
    4343#endif 
     
    714714     MacOS X 10.3.8 function 
    715715     CFLocaleCreateCanonicalLocaleIdentifierFromString().  */ 
    716   typedef struct { const char legacy[21+1]; const char unixy[5+1]; } 
    717           legacy_entry; 
     716  typedef struct 
     717  { 
     718    const char legacy[21 + 1]; 
     719    const char unixy[5 + 1]; 
     720  } 
     721  legacy_entry; 
    718722  static const legacy_entry legacy_table[] = { 
    719     { "Afrikaans",             "af" }, 
    720     { "Albanian",              "sq" }, 
    721     { "Amharic",               "am" }, 
    722     { "Arabic",                "ar" }, 
    723     { "Armenian",              "hy" }, 
    724     { "Assamese",              "as" }, 
    725     { "Aymara",                "ay" }, 
    726     { "Azerbaijani",           "az" }, 
    727     { "Basque",                "eu" }, 
    728     { "Belarusian",            "be" }, 
    729     { "Belorussian",           "be" }, 
    730     { "Bengali",               "bn" }, 
    731     { "Brazilian Portugese",   "pt_BR" }, 
    732     { "Brazilian Portuguese",  "pt_BR" }, 
    733     { "Breton",                "br" }, 
    734     { "Bulgarian",             "bg" }, 
    735     { "Burmese",               "my" }, 
    736     { "Byelorussian",          "be" }, 
    737     { "Catalan",               "ca" }, 
    738     { "Chewa",                 "ny" }, 
    739     { "Chichewa",              "ny" }, 
    740     { "Chinese",               "zh" }, 
    741     { "Chinese, Simplified",   "zh_CN" }, 
    742     { "Chinese, Traditional",  "zh_TW" }, 
    743     { "Chinese, Tradtional",   "zh_TW" }, 
    744     { "Croatian",              "hr" }, 
    745     { "Czech",                 "cs" }, 
    746     { "Danish",                "da" }, 
    747     { "Dutch",                 "nl" }, 
    748     { "Dzongkha",              "dz" }, 
    749     { "English",               "en" }, 
    750     { "Esperanto",             "eo" }, 
    751     { "Estonian",              "et" }, 
    752     { "Faroese",               "fo" }, 
    753     { "Farsi",                 "fa" }, 
    754     { "Finnish",               "fi" }, 
    755     { "Flemish",               "nl_BE" }, 
    756     { "French",                "fr" }, 
    757     { "Galician",              "gl" }, 
    758     { "Gallegan",              "gl" }, 
    759     { "Georgian",              "ka" }, 
    760     { "German",                "de" }, 
    761     { "Greek",                 "el" }, 
    762     { "Greenlandic",           "kl" }, 
    763     { "Guarani",               "gn" }, 
    764     { "Gujarati",              "gu" }, 
    765     { "Hawaiian",              "haw" }, /* Yes, "haw", not "cpe".  */ 
    766     { "Hebrew",                "he" }, 
    767     { "Hindi",                 "hi" }, 
    768     { "Hungarian",             "hu" }, 
    769     { "Icelandic",             "is" }, 
    770     { "Indonesian",            "id" }, 
    771     { "Inuktitut",             "iu" }, 
    772     { "Irish",                 "ga" }, 
    773     { "Italian",               "it" }, 
    774     { "Japanese",              "ja" }, 
    775     { "Javanese",              "jv" }, 
    776     { "Kalaallisut",           "kl" }, 
    777     { "Kannada",               "kn" }, 
    778     { "Kashmiri",              "ks" }, 
    779     { "Kazakh",                "kk" }, 
    780     { "Khmer",                 "km" }, 
    781     { "Kinyarwanda",           "rw" }, 
    782     { "Kirghiz",               "ky" }, 
    783     { "Korean",                "ko" }, 
    784     { "Kurdish",               "ku" }, 
    785     { "Latin",                 "la" }, 
    786     { "Latvian",               "lv" }, 
    787     { "Lithuanian",            "lt" }, 
    788     { "Macedonian",            "mk" }, 
    789     { "Malagasy",              "mg" }, 
    790     { "Malay",                 "ms" }, 
    791     { "Malayalam",             "ml" }, 
    792     { "Maltese",               "mt" }, 
    793     { "Manx",                  "gv" }, 
    794     { "Marathi",               "mr" }, 
    795     { "Moldavian",             "mo" }, 
    796     { "Mongolian",             "mn" }, 
    797     { "Nepali",                "ne" }, 
    798     { "Norwegian",             "nb" }, /* Yes, "nb", not the obsolete "no".  */ 
    799     { "Nyanja",                "ny" }, 
    800     { "Nynorsk",               "nn" }, 
    801     { "Oriya",                 "or" }, 
    802     { "Oromo",                 "om" }, 
    803     { "Panjabi",               "pa" }, 
    804     { "Pashto",                "ps" }, 
    805     { "Persian",               "fa" }, 
    806     { "Polish",                "pl" }, 
    807     { "Portuguese",            "pt" }, 
    808     { "Portuguese, Brazilian", "pt_BR" }, 
    809     { "Punjabi",               "pa" }, 
    810     { "Pushto",                "ps" }, 
    811     { "Quechua",               "qu" }, 
    812     { "Romanian",              "ro" }, 
    813     { "Ruanda",                "rw" }, 
    814     { "Rundi",                 "rn" }, 
    815     { "Russian",               "ru" }, 
    816     { "Sami",                  "se_NO" }, /* Not just "se".  */ 
    817     { "Sanskrit",              "sa" }, 
    818     { "Scottish",              "gd" }, 
    819     { "Serbian",               "sr" }, 
    820     { "Simplified Chinese",    "zh_CN" }, 
    821     { "Sindhi",                "sd" }, 
    822     { "Sinhalese",             "si" }, 
    823     { "Slovak",                "sk" }, 
    824     { "Slovenian",             "sl" }, 
    825     { "Somali",                "so" }, 
    826     { "Spanish",               "es" }, 
    827     { "Sundanese",             "su" }, 
    828     { "Swahili",               "sw" }, 
    829     { "Swedish",               "sv" }, 
    830     { "Tagalog",               "tl" }, 
    831     { "Tajik",                 "tg" }, 
    832     { "Tajiki",                "tg" }, 
    833     { "Tamil",                 "ta" }, 
    834     { "Tatar",                 "tt" }, 
    835     { "Telugu",                "te" }, 
    836     { "Thai",                  "th" }, 
    837     { "Tibetan",               "bo" }, 
    838     { "Tigrinya",              "ti" }, 
    839     { "Tongan",                "to" }, 
    840     { "Traditional Chinese",   "zh_TW" }, 
    841     { "Turkish",               "tr" }, 
    842     { "Turkmen",               "tk" }, 
    843     { "Uighur",                "ug" }, 
    844     { "Ukrainian",             "uk" }, 
    845     { "Urdu",                  "ur" }, 
    846     { "Uzbek",                 "uz" }, 
    847     { "Vietnamese",            "vi" }, 
    848     { "Welsh",                 "cy" }, 
    849     { "Yiddish",               "yi"
     723    {"Afrikaans", "af"}, 
     724    {"Albanian", "sq"}, 
     725    {"Amharic", "am"}, 
     726    {"Arabic", "ar"}, 
     727    {"Armenian", "hy"}, 
     728    {"Assamese", "as"}, 
     729    {"Aymara", "ay"}, 
     730    {"Azerbaijani", "az"}, 
     731    {"Basque", "eu"}, 
     732    {"Belarusian", "be"}, 
     733    {"Belorussian", "be"}, 
     734    {"Bengali", "bn"}, 
     735    {"Brazilian Portugese", "pt_BR"}, 
     736    {"Brazilian Portuguese", "pt_BR"}, 
     737    {"Breton", "br"}, 
     738    {"Bulgarian", "bg"}, 
     739    {"Burmese", "my"}, 
     740    {"Byelorussian", "be"}, 
     741    {"Catalan", "ca"}, 
     742    {"Chewa", "ny"}, 
     743    {"Chichewa", "ny"}, 
     744    {"Chinese", "zh"}, 
     745    {"Chinese, Simplified", "zh_CN"}, 
     746    {"Chinese, Traditional", "zh_TW"}, 
     747    {"Chinese, Tradtional", "zh_TW"}, 
     748    {"Croatian", "hr"}, 
     749    {"Czech", "cs"}, 
     750    {"Danish", "da"}, 
     751    {"Dutch", "nl"}, 
     752    {"Dzongkha", "dz"}, 
     753    {"English", "en"}, 
     754    {"Esperanto", "eo"}, 
     755    {"Estonian", "et"}, 
     756    {"Faroese", "fo"}, 
     757    {"Farsi", "fa"}, 
     758    {"Finnish", "fi"}, 
     759    {"Flemish", "nl_BE"}, 
     760    {"French", "fr"}, 
     761    {"Galician", "gl"}, 
     762    {"Gallegan", "gl"}, 
     763    {"Georgian", "ka"}, 
     764    {"German", "de"}, 
     765    {"Greek", "el"}, 
     766    {"Greenlandic", "kl"}, 
     767    {"Guarani", "gn"}, 
     768    {"Gujarati", "gu"}, 
     769    {"Hawaiian", "haw"},       /* Yes, "haw", not "cpe".  */ 
     770    {"Hebrew", "he"}, 
     771    {"Hindi", "hi"}, 
     772    {"Hungarian", "hu"}, 
     773    {"Icelandic", "is"}, 
     774    {"Indonesian", "id"}, 
     775    {"Inuktitut", "iu"}, 
     776    {"Irish", "ga"}, 
     777    {"Italian", "it"}, 
     778    {"Japanese", "ja"}, 
     779    {"Javanese", "jv"}, 
     780    {"Kalaallisut", "kl"}, 
     781    {"Kannada", "kn"}, 
     782    {"Kashmiri", "ks"}, 
     783    {"Kazakh", "kk"}, 
     784    {"Khmer", "km"}, 
     785    {"Kinyarwanda", "rw"}, 
     786    {"Kirghiz", "ky"}, 
     787    {"Korean", "ko"}, 
     788    {"Kurdish", "ku"}, 
     789    {"Latin", "la"}, 
     790    {"Latvian", "lv"}, 
     791    {"Lithuanian", "lt"}, 
     792    {"Macedonian", "mk"}, 
     793    {"Malagasy", "mg"}, 
     794    {"Malay", "ms"}, 
     795    {"Malayalam", "ml"}, 
     796    {"Maltese", "mt"}, 
     797    {"Manx", "gv"}, 
     798    {"Marathi", "mr"}, 
     799    {"Moldavian", "mo"}, 
     800    {"Mongolian", "mn"}, 
     801    {"Nepali", "ne"}, 
     802    {"Norwegian", "nb"},       /* Yes, "nb", not the obsolete "no".  */ 
     803    {"Nyanja", "ny"}, 
     804    {"Nynorsk", "nn"}, 
     805    {"Oriya", "or"}, 
     806    {"Oromo", "om"}, 
     807    {"Panjabi", "pa"}, 
     808    {"Pashto", "ps"}, 
     809    {"Persian", "fa"}, 
     810    {"Polish", "pl"}, 
     811    {"Portuguese", "pt"}, 
     812    {"Portuguese, Brazilian", "pt_BR"}, 
     813    {"Punjabi", "pa"}, 
     814    {"Pushto", "ps"}, 
     815    {"Quechua", "qu"}, 
     816    {"Romanian", "ro"}, 
     817    {"Ruanda", "rw"}, 
     818    {"Rundi", "rn"}, 
     819    {"Russian", "ru"}, 
     820    {"Sami", "se_NO"},         /* Not just "se".  */ 
     821    {"Sanskrit", "sa"}, 
     822    {"Scottish", "gd"}, 
     823    {"Serbian", "sr"}, 
     824    {"Simplified Chinese", "zh_CN"}, 
     825    {"Sindhi", "sd"}, 
     826    {"Sinhalese", "si"}, 
     827    {"Slovak", "sk"}, 
     828    {"Slovenian", "sl"}, 
     829    {"Somali", "so"}, 
     830    {"Spanish", "es"}, 
     831    {"Sundanese", "su"}, 
     832    {"Swahili", "sw"}, 
     833    {"Swedish", "sv"}, 
     834    {"Tagalog", "tl"}, 
     835    {"Tajik", "tg"}, 
     836    {"Tajiki", "tg"}, 
     837    {"Tamil", "ta"}, 
     838    {"Tatar", "tt"}, 
     839    {"Telugu", "te"}, 
     840    {"Thai", "th"}, 
     841    {"Tibetan", "bo"}, 
     842    {"Tigrinya", "ti"}, 
     843    {"Tongan", "to"}, 
     844    {"Traditional Chinese", "zh_TW"}, 
     845    {"Turkish", "tr"}, 
     846    {"Turkmen", "tk"}, 
     847    {"Uighur", "ug"}, 
     848    {"Ukrainian", "uk"}, 
     849    {"Urdu", "ur"}, 
     850    {"Uzbek", "uz"}, 
     851    {"Vietnamese", "vi"}, 
     852    {"Welsh", "cy"}, 
     853    {"Yiddish", "yi"
    850854  }; 
    851855 
    852856  /* Convert new-style locale names with language tags (ISO 639 and ISO 15924) 
    853857     to Unix (ISO 639 and ISO 3166) names.  */ 
    854   typedef struct { const char langtag[7+1]; const char unixy[12+1]; } 
    855           langtag_entry; 
     858  typedef struct 
     859  { 
     860    const char langtag[7 + 1]; 
     861    const char unixy[12 + 1]; 
     862  } 
     863  langtag_entry; 
    856864  static const langtag_entry langtag_table[] = { 
    857865    /* MacOS X has "az-Arab", "az-Cyrl", "az-Latn". 
    858866       The default script for az on Unix is Latin.  */ 
    859     { "az-Latn", "az" }, 
     867    {"az-Latn", "az"}, 
    860868    /* MacOS X has "ga-dots".  Does not yet exist on Unix.  */ 
    861     { "ga-dots", "ga" }, 
     869    {"ga-dots", "ga"}, 
    862870    /* MacOS X has "kk-Cyrl".  Does not yet exist on Unix.  */ 
    863871    /* MacOS X has "mn-Cyrl", "mn-Mong". 
    864872       The default script for mn on Unix is Cyrillic.  */ 
    865     { "mn-Cyrl", "mn" }, 
     873    {"mn-Cyrl", "mn"}, 
    866874    /* MacOS X has "ms-Arab", "ms-Latn". 
    867875       The default script for ms on Unix is Latin.  */ 
    868     { "ms-Latn", "ms" }, 
     876    {"ms-Latn", "ms"}, 
    869877    /* MacOS X has "tg-Cyrl". 
    870878       The default script for tg on Unix is Cyrillic.  */ 
    871     { "tg-Cyrl", "tg" }, 
     879    {"tg-Cyrl", "tg"}, 
    872880    /* MacOS X has "tk-Cyrl".  Does not yet exist on Unix.  */ 
    873881    /* MacOS X has "tt-Cyrl". 
    874882       The default script for tt on Unix is Cyrillic.  */ 
    875     { "tt-Cyrl", "tt" }, 
     883    {"tt-Cyrl", "tt"}, 
    876884    /* MacOS X has "zh-Hans", "zh-Hant". 
    877885       Country codes are used to distinguish these on Unix.  */ 
    878     { "zh-Hans", "zh_CN" }, 
    879     { "zh-Hant", "zh_TW"
     886    {"zh-Hans", "zh_CN"}, 
     887    {"zh-Hant", "zh_TW"
    880888  }; 
    881889 
    882890  /* Convert script names (ISO 15924) to Unix conventions. 
    883891     See http://www.unicode.org/iso15924/iso15924-codes.html  */ 
    884   typedef struct { const char script[4+1]; const char unixy[9+1]; } 
    885           script_entry; 
     892  typedef struct 
     893  { 
     894    const char script[4 + 1]; 
     895    const char unixy[9 + 1]; 
     896  } 
     897  script_entry; 
    886898  static const script_entry script_table[] = { 
    887     { "Arab", "arabic" }, 
    888     { "Cyrl", "cyrillic" }, 
    889     { "Mong", "mongolian"
     899    {"Arab", "arabic"}, 
     900    {"Cyrl", "cyrillic"}, 
     901    {"Mong", "mongolian"
    890902  }; 
    891903 
     
    10171029  /* POSIX:2001 says: 
    10181030     "All implementations shall define a locale as the default locale, to be 
    1019       invoked when no environment variables are set, or set to the empty 
    1020       string.  This default locale can be the POSIX locale or any other 
    1021       implementation-defined locale.  Some implementations may provide 
    1022       facilities for local installation administrators to set the default 
    1023       locale, customizing it for each location.  POSIX:2001 does not require 
    1024       such a facility.  */ 
     1031     invoked when no environment variables are set, or set to the empty 
     1032     string.  This default locale can be the POSIX locale or any other 
     1033     implementation-defined locale.  Some implementations may provide 
     1034     facilities for local installation administrators to set the default 
     1035     locale, customizing it for each location.  POSIX:2001 does not require 
     1036     such a facility.  */ 
    10251037 
    10261038#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined(WIN32)) 
     
    10461058      { 
    10471059        char namebuf[256]; 
    1048 #  if HAVE_CFLOCALECOPYCURRENT /* MacOS X 10.3 or newer */ 
     1060#  if HAVE_CFLOCALECOPYCURRENT /* MacOS X 10.3 or newer */ 
    10491061        CFLocaleRef locale = CFLocaleCopyCurrent (); 
    10501062        CFStringRef name = CFLocaleGetIdentifier (locale); 
    10511063 
    1052         if (CFStringGetCString (name, namebuf, sizeof(namebuf), 
     1064        if (CFStringGetCString (name, namebuf, sizeof (namebuf), 
    10531065                                kCFStringEncodingASCII)) 
    10541066          { 
     
    10571069          } 
    10581070        CFRelease (locale); 
    1059 #  elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ 
    1060         CFTypeRef value = 
    1061           CFPreferencesCopyAppValue (CFSTR ("AppleLocale"), 
    1062                                      kCFPreferencesCurrentApplication); 
     1071#  elif HAVE_CFPREFERENCESCOPYAPPVALUE  /* MacOS X 10.2 or newer */ 
     1072        CFTypeRef value = CFPreferencesCopyAppValue (CFSTR ("AppleLocale"), 
     1073                                                     kCFPreferencesCurrentApplication); 
    10631074        if (value != NULL 
    10641075            && CFGetTypeID (value) == CFStringGetTypeID () 
    1065             && CFStringGetCString ((CFStringRef)value, namebuf, sizeof(namebuf)
    1066                                    kCFStringEncodingASCII)) 
     1076            && CFStringGetCString ((CFStringRef) value, namebuf
     1077                                   sizeof (namebuf), kCFStringEncodingASCII)) 
    10671078          { 
    10681079            _nl_locale_name_canonicalize (namebuf); 
     
    10781089# endif 
    10791090 
    1080 # if defined(WIN32) /* WIN32 */ 
     1091# if defined(WIN32)            /* WIN32 */ 
    10811092  { 
    10821093    LCID lcid; 
     
    10991110    switch (primary) 
    11001111      { 
    1101       case LANG_AFRIKAANS: return "af_ZA"; 
    1102       case LANG_ALBANIAN: return "sq_AL"; 
    1103       case LANG_AMHARIC: return "am_ET"; 
     1112      case LANG_AFRIKAANS: 
     1113        return "af_ZA"; 
     1114      case LANG_ALBANIAN: 
     1115        return "sq_AL"; 
     1116      case LANG_AMHARIC: 
     1117        return "am_ET"; 
    11041118      case LANG_ARABIC: 
    11051119        switch (sub) 
    11061120          { 
    1107           case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; 
    1108           case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; 
    1109           case SUBLANG_ARABIC_EGYPT: return "ar_EG"; 
    1110           case SUBLANG_ARABIC_LIBYA: return "ar_LY"; 
    1111           case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; 
    1112           case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; 
    1113           case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; 
    1114           case SUBLANG_ARABIC_OMAN: return "ar_OM"; 
    1115           case SUBLANG_ARABIC_YEMEN: return "ar_YE"; 
    1116           case SUBLANG_ARABIC_SYRIA: return "ar_SY"; 
    1117           case SUBLANG_ARABIC_JORDAN: return "ar_JO"; 
    1118           case SUBLANG_ARABIC_LEBANON: return "ar_LB"; 
    1119           case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; 
    1120           case SUBLANG_ARABIC_UAE: return "ar_AE"; 
    1121           case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; 
    1122           case SUBLANG_ARABIC_QATAR: return "ar_QA"; 
     1121          case SUBLANG_ARABIC_SAUDI_ARABIA: 
     1122            return "ar_SA"; 
     1123          case SUBLANG_ARABIC_IRAQ: 
     1124            return "ar_IQ"; 
     1125          case SUBLANG_ARABIC_EGYPT: 
     1126            return "ar_EG"; 
     1127          case SUBLANG_ARABIC_LIBYA: 
     1128            return "ar_LY"; 
     1129          case SUBLANG_ARABIC_ALGERIA: 
     1130            return "ar_DZ"; 
     1131          case SUBLANG_ARABIC_MOROCCO: 
     1132            return "ar_MA"; 
     1133          case SUBLANG_ARABIC_TUNISIA: 
     1134            return "ar_TN"; 
     1135          case SUBLANG_ARABIC_OMAN: 
     1136            return "ar_OM"; 
     1137          case SUBLANG_ARABIC_YEMEN: 
     1138            return "ar_YE"; 
     1139          case SUBLANG_ARABIC_SYRIA: 
     1140            return "ar_SY"; 
     1141          case SUBLANG_ARABIC_JORDAN: 
     1142            return "ar_JO"; 
     1143          case SUBLANG_ARABIC_LEBANON: 
     1144            return "ar_LB"; 
     1145          case SUBLANG_ARABIC_KUWAIT: 
     1146            return "ar_KW"; 
     1147          case SUBLANG_ARABIC_UAE: 
     1148            return "ar_AE"; 
     1149          case SUBLANG_ARABIC_BAHRAIN: 
     1150            return "ar_BH"; 
     1151          case SUBLANG_ARABIC_QATAR: 
     1152            return "ar_QA"; 
    11231153          } 
    11241154        return "ar"; 
    1125       case LANG_ARMENIAN: return "hy_AM"; 
    1126       case LANG_ASSAMESE: return "as_IN"; 
     1155      case LANG_ARMENIAN: 
     1156        return "hy_AM"; 
     1157      case LANG_ASSAMESE: 
     1158        return "as_IN"; 
    11271159      case LANG_AZERI: 
    11281160        switch (sub) 
    11291161          { 
    1130           /* FIXME: Adjust this when Azerbaijani locales appear on Unix.  */ 
    1131           case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; 
    1132           case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; 
     1162            /* FIXME: Adjust this when Azerbaijani locales appear on Unix.  */ 
     1163          case SUBLANG_AZERI_LATIN: 
     1164            return "az_AZ@latin"; 
     1165          case SUBLANG_AZERI_CYRILLIC: 
     1166            return "az_AZ@cyrillic"; 
    11331167          } 
    11341168        return "az"; 
     
    11361170        switch (sub) 
    11371171          { 
    1138           case SUBLANG_DEFAULT: return "eu_ES"; 
    1139           } 
    1140         return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR".  */ 
    1141       case LANG_BELARUSIAN: return "be_BY"; 
     1172          case SUBLANG_DEFAULT: 
     1173            return "eu_ES"; 
     1174          } 
     1175        return "eu";            /* Ambiguous: could be "eu_ES" or "eu_FR".  */ 
     1176      case LANG_BELARUSIAN: 
     1177        return "be_BY"; 
    11421178      case LANG_BENGALI: 
    11431179        switch (sub) 
    11441180          { 
    1145           case SUBLANG_BENGALI_INDIA: return "bn_IN"; 
    1146           case SUBLANG_BENGALI_BANGLADESH: return "bn_BD"; 
     1181          case SUBLANG_BENGALI_INDIA: 
     1182            return "bn_IN"; 
     1183          case SUBLANG_BENGALI_BANGLADESH: 
     1184            return "bn_BD"; 
    11471185          } 
    11481186        return "bn"; 
    1149       case LANG_BULGARIAN: return "bg_BG"; 
    1150       case LANG_BURMESE: return "my_MM"; 
    1151       case LANG_CAMBODIAN: return "km_KH"; 
    1152       case LANG_CATALAN: return "ca_ES"; 
    1153       case LANG_CHEROKEE: return "chr_US"; 
     1187      case LANG_BULGARIAN: 
     1188        return "bg_BG"; 
     1189      case LANG_BURMESE: 
     1190        return "my_MM"; 
     1191      case LANG_CAMBODIAN: 
     1192        return "km_KH"; 
     1193      case LANG_CATALAN: 
     1194        return "ca_ES"; 
     1195      case LANG_CHEROKEE: 
     1196        return "chr_US"; 
    11541197      case LANG_CHINESE: 
    11551198        switch (sub) 
    11561199          { 
    1157           case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW"; 
    1158           case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN"; 
    1159           case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; 
    1160           case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; 
    1161           case SUBLANG_CHINESE_MACAU: return "zh_MO"; 
     1200          case SUBLANG_CHINESE_TRADITIONAL: 
     1201            return "zh_TW"; 
     1202          case SUBLANG_CHINESE_SIMPLIFIED: 
     1203            return "zh_CN"; 
     1204          case SUBLANG_CHINESE_HONGKONG: 
     1205            return "zh_HK"; 
     1206          case SUBLANG_CHINESE_SINGAPORE: 
     1207            return "zh_SG"; 
     1208          case SUBLANG_CHINESE_MACAU: 
     1209            return "zh_MO"; 
    11621210          } 
    11631211        return "zh"; 
    1164       case LANG_CROATIAN:       /* LANG_CROATIAN == LANG_SERBIAN 
     1212      case LANG_CROATIAN:      /* LANG_CROATIAN == LANG_SERBIAN 
    11651213                                 * What used to be called Serbo-Croatian 
    11661214                                 * should really now be two separate 
     
    11721220        switch (sub) 
    11731221          { 
    1174           case SUBLANG_DEFAULT: return "hr_HR"; 
    1175           case SUBLANG_SERBIAN_LATIN: return "sr_CS"; 
    1176           case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic"; 
     1222          case SUBLANG_DEFAULT: 
     1223            return "hr_HR"; 
     1224          case SUBLANG_SERBIAN_LATIN: 
     1225            return "sr_CS"; 
     1226          case SUBLANG_SERBIAN_CYRILLIC: 
     1227            return "sr_CS@cyrillic"; 
    11771228          } 
    11781229        return "hr"; 
    1179       case LANG_CZECH: return "cs_CZ"; 
    1180       case LANG_DANISH: return "da_DK"; 
    1181       case LANG_DIVEHI: return "dv_MV"; 
     1230      case LANG_CZECH: 
     1231        return "cs_CZ"; 
     1232      case LANG_DANISH: 
     1233        return "da_DK"; 
     1234      case LANG_DIVEHI: 
     1235        return "dv_MV"; 
    11821236      case LANG_DUTCH: 
    11831237        switch (sub) 
    11841238          { 
    1185           case SUBLANG_DUTCH: return "nl_NL"; 
    1186           case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE"; 
     1239          case SUBLANG_DUTCH: 
     1240            return "nl_NL"; 
     1241          case SUBLANG_DUTCH_BELGIAN:   /* FLEMISH, VLAAMS */ 
     1242            return "nl_BE"; 
    11871243          } 
    11881244        return "nl"; 
    1189       case LANG_EDO: return "bin_NG"; 
     1245      case LANG_EDO: 
     1246        return "bin_NG"; 
    11901247      case LANG_ENGLISH: 
    11911248        switch (sub) 
    11921249          { 
    1193           /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought 
    1194            * English was the language spoken in England. 
    1195            * Oh well. 
    1196            */ 
    1197           case SUBLANG_ENGLISH_US: return "en_US"; 
    1198           case SUBLANG_ENGLISH_UK: return "en_GB"; 
    1199           case SUBLANG_ENGLISH_AUS: return "en_AU"; 
    1200           case SUBLANG_ENGLISH_CAN: return "en_CA"; 
    1201           case SUBLANG_ENGLISH_NZ: return "en_NZ"; 
    1202           case SUBLANG_ENGLISH_EIRE: return "en_IE"; 
    1203           case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; 
    1204           case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; 
    1205           case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ 
    1206           case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; 
    1207           case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; 
    1208           case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; 
    1209           case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; 
    1210           case SUBLANG_ENGLISH_INDONESIA: return "en_ID"; 
    1211           case SUBLANG_ENGLISH_HONGKONG: return "en_HK"; 
    1212           case SUBLANG_ENGLISH_INDIA: return "en_IN"; 
    1213           case SUBLANG_ENGLISH_MALAYSIA: return "en_MY"; 
    1214           case SUBLANG_ENGLISH_SINGAPORE: return "en_SG"; 
     1250            /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought 
     1251             * English was the language spoken in England. 
     1252             * Oh well. 
     1253             */ 
     1254          case SUBLANG_ENGLISH_US: 
     1255            return "en_US"; 
     1256          case SUBLANG_ENGLISH_UK: 
     1257            return "en_GB"; 
     1258          case SUBLANG_ENGLISH_AUS: 
     1259            return "en_AU"; 
     1260          case SUBLANG_ENGLISH_CAN: 
     1261            return "en_CA"; 
     1262          case SUBLANG_ENGLISH_NZ: 
     1263            return "en_NZ"; 
     1264          case SUBLANG_ENGLISH_EIRE: 
     1265            return "en_IE"; 
     1266          case SUBLANG_ENGLISH_SOUTH_AFRICA: 
     1267            return "en_ZA"; 
     1268          case SUBLANG_ENGLISH_JAMAICA: 
     1269            return "en_JM"; 
     1270          case SUBLANG_ENGLISH_CARIBBEAN: 
     1271            return "en_GD";     /* Grenada? */ 
     1272          case SUBLANG_ENGLISH_BELIZE: 
     1273            return "en_BZ"; 
     1274          case SUBLANG_ENGLISH_TRINIDAD: 
     1275            return "en_TT"; 
     1276          case SUBLANG_ENGLISH_ZIMBABWE: 
     1277            return "en_ZW"; 
     1278          case SUBLANG_ENGLISH_PHILIPPINES: 
     1279            return "en_PH"; 
     1280          case SUBLANG_ENGLISH_INDONESIA: 
     1281            return "en_ID"; 
     1282          case SUBLANG_ENGLISH_HONGKONG: 
     1283            return "en_HK"; 
     1284          case SUBLANG_ENGLISH_INDIA: 
     1285            return "en_IN"; 
     1286          case SUBLANG_ENGLISH_MALAYSIA: 
     1287            return "en_MY"; 
     1288          case SUBLANG_ENGLISH_SINGAPORE: 
     1289            return "en_SG"; 
    12151290          } 
    12161291        return "en"; 
    1217       case LANG_ESTONIAN: return "et_EE"; 
    1218       case LANG_FAEROESE: return "fo_FO"; 
    1219       case LANG_FARSI: return "fa_IR"; 
    1220       case LANG_FINNISH: return "fi_FI"; 
     1292      case LANG_ESTONIAN: 
     1293        return "et_EE"; 
     1294      case LANG_FAEROESE: 
     1295        return "fo_FO"; 
     1296      case LANG_FARSI: 
     1297        return "fa_IR"; 
     1298      case LANG_FINNISH: 
     1299        return "fi_FI"; 
    12211300      case LANG_FRENCH: 
    12221301        switch (sub) 
    12231302          { 
    1224           case SUBLANG_FRENCH: return "fr_FR"; 
    1225           case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE"; 
    1226           case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; 
    1227           case SUBLANG_FRENCH_SWISS: return "fr_CH"; 
    1228           case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; 
    1229           case SUBLANG_FRENCH_MONACO: return "fr_MC"; 
    1230           case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */ 
    1231           case SUBLANG_FRENCH_REUNION: return "fr_RE"; 
    1232           case SUBLANG_FRENCH_CONGO: return "fr_CG"; 
    1233           case SUBLANG_FRENCH_SENEGAL: return "fr_SN"; 
    1234           case SUBLANG_FRENCH_CAMEROON: return "fr_CM"; 
    1235           case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI"; 
    1236           case SUBLANG_FRENCH_MALI: return "fr_ML"; 
    1237           case SUBLANG_FRENCH_MOROCCO: return "fr_MA"; 
    1238           case SUBLANG_FRENCH_HAITI: return "fr_HT"; 
     1303          case SUBLANG_FRENCH: 
     1304            return "fr_FR"; 
     1305          case SUBLANG_FRENCH_BELGIAN:  /* WALLOON */ 
     1306            return "fr_BE"; 
     1307          case SUBLANG_FRENCH_CANADIAN: 
     1308            return "fr_CA"; 
     1309          case SUBLANG_FRENCH_SWISS: 
     1310            return "fr_CH"; 
     1311          case SUBLANG_FRENCH_LUXEMBOURG: 
     1312            return "fr_LU"; 
     1313          case SUBLANG_FRENCH_MONACO: 
     1314            return "fr_MC"; 
     1315          case SUBLANG_FRENCH_WESTINDIES: 
     1316            return "fr";        /* Caribbean? */ 
     1317          case SUBLANG_FRENCH_REUNION: 
     1318            return "fr_RE"; 
     1319          case SUBLANG_FRENCH_CONGO: 
     1320            return "fr_CG"; 
     1321          case SUBLANG_FRENCH_SENEGAL: 
     1322            return "fr_SN"; 
     1323          case SUBLANG_FRENCH_CAMEROON: 
     1324            return "fr_CM"; 
     1325          case SUBLANG_FRENCH_COTEDIVOIRE: 
     1326            return "fr_CI"; 
     1327          case SUBLANG_FRENCH_MALI: 
     1328            return "fr_ML"; 
     1329          case SUBLANG_FRENCH_MOROCCO: 
     1330            return "fr_MA"; 
     1331          case SUBLANG_FRENCH_HAITI: 
     1332            return "fr_HT"; 
    12391333          } 
    12401334        return "fr"; 
    1241       case LANG_FRISIAN: return "fy_NL"; 
     1335      case LANG_FRISIAN: 
     1336        return "fy_NL"; 
    12421337      case LANG_FULFULDE: 
    12431338        /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin.  */ 
     
    12461341        switch (sub) 
    12471342          { 
    1248           case 0x01: /* SCOTTISH */ return "gd_GB"; 
    1249           case 0x02: /* IRISH */ return "ga_IE"; 
     1343          case 0x01:            /* SCOTTISH */ 
     1344            return "gd_GB"; 
     1345          case 0x02:            /* IRISH */ 
     1346            return "ga_IE"; 
    12501347          } 
    12511348        return "C"; 
    1252       case LANG_GALICIAN: return "gl_ES"; 
    1253       case LANG_GEORGIAN: return "ka_GE"; 
     1349      case LANG_GALICIAN: 
     1350        return "gl_ES"; 
     1351      case LANG_GEORGIAN: 
     1352        return "ka_GE"; 
    12541353      case LANG_GERMAN: 
    12551354        switch (sub) 
    12561355          { 
    1257           case SUBLANG_GERMAN: return "de_DE"; 
    1258           case SUBLANG_GERMAN_SWISS: return "de_CH"; 
    1259           case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; 
    1260           case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; 
    1261           case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; 
     1356          case SUBLANG_GERMAN: 
     1357            return "de_DE"; 
     1358          case SUBLANG_GERMAN_SWISS: 
     1359            return "de_CH"; 
     1360          case SUBLANG_GERMAN_AUSTRIAN: 
     1361            return "de_AT"; 
     1362          case SUBLANG_GERMAN_LUXEMBOURG: 
     1363            return "de_LU"; 
     1364          case SUBLANG_GERMAN_LIECHTENSTEIN: 
     1365            return "de_LI"; 
    12621366          } 
    12631367        return "de"; 
    1264       case LANG_GREEK: return "el_GR"; 
    1265       case LANG_GUARANI: return "gn_PY"; 
    1266       case LANG_GUJARATI: return "gu_IN"; 
    1267       case LANG_HAUSA: return "ha_NG"; 
     1368      case LANG_GREEK: 
     1369        return "el_GR"; 
     1370      case LANG_GUARANI: 
     1371        return "gn_PY"; 
     1372      case LANG_GUJARATI: 
     1373        return "gu_IN"; 
     1374      case LANG_HAUSA: 
     1375        return "ha_NG"; 
    12681376      case LANG_HAWAIIAN: 
    12691377        /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers) 
    12701378           or Hawaii Creole English ("cpe_US", 600000 speakers)?  */ 
    12711379        return "cpe_US"; 
    1272       case LANG_HEBREW: return "he_IL"; 
    1273       case LANG_HINDI: return "hi_IN"; 
    1274       case LANG_HUNGARIAN: return "hu_HU"; 
    1275       case LANG_IBIBIO: return "nic_NG"; 
    1276       case LANG_ICELANDIC: return "is_IS"; 
    1277       case LANG_IGBO: return "ig_NG"; 
    1278       case LANG_INDONESIAN: return "id_ID"; 
    1279       case LANG_INUKTITUT: return "iu_CA"; 
     1380      case LANG_HEBREW: 
     1381        return "he_IL"; 
     1382      case LANG_HINDI: 
     1383        return "hi_IN"; 
     1384      case LANG_HUNGARIAN: 
     1385        return "hu_HU"; 
     1386      case LANG_IBIBIO: 
     1387        return "nic_NG"; 
     1388      case LANG_ICELANDIC: 
     1389        return "is_IS"; 
     1390      case LANG_IGBO: 
     1391        return "ig_NG"; 
     1392      case LANG_INDONESIAN: 
     1393        return "id_ID"; 
     1394      case LANG_INUKTITUT: 
     1395        return "iu_CA"; 
    12801396      case LANG_ITALIAN: 
    12811397        switch (sub) 
    12821398          { 
    1283           case SUBLANG_ITALIAN: return "it_IT"; 
    1284           case SUBLANG_ITALIAN_SWISS: return "it_CH"; 
     1399          case SUBLANG_ITALIAN: 
     1400            return "it_IT"; 
     1401          case SUBLANG_ITALIAN_SWISS: 
     1402            return "it_CH"; 
    12851403          } 
    12861404        return "it"; 
    1287       case LANG_JAPANESE: return "ja_JP"; 
    1288       case LANG_KANNADA: return "kn_IN"; 
    1289       case LANG_KANURI: return "kr_NG"; 
     1405      case LANG_JAPANESE: 
     1406        return "ja_JP"; 
     1407      case LANG_KANNADA: 
     1408        return "kn_IN"; 
     1409      case LANG_KANURI: 
     1410        return "kr_NG"; 
    12901411      case LANG_KASHMIRI: 
    12911412        switch (sub) 
    12921413          { 
    1293           case SUBLANG_DEFAULT: return "ks_PK"; 
    1294           case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; 
     1414          case SUBLANG_DEFAULT: 
     1415            return "ks_PK"; 
     1416          case SUBLANG_KASHMIRI_INDIA: 
     1417            return "ks_IN"; 
    12951418          } 
    12961419        return "ks"; 
    1297       case LANG_KAZAK: return "kk_KZ"; 
     1420      case LANG_KAZAK: 
     1421        return "kk_KZ"; 
    12981422      case LANG_KONKANI: 
    12991423        /* FIXME: Adjust this when such locales appear on Unix.  */ 
    13001424        return "kok_IN"; 
    1301       case LANG_KOREAN: return "ko_KR"; 
    1302       case LANG_KYRGYZ: return "ky_KG"; 
    1303       case LANG_LAO: return "lo_LA"; 
    1304       case LANG_LATIN: return "la_VA"; 
    1305       case LANG_LATVIAN: return "lv_LV"; 
    1306       case LANG_LITHUANIAN: return "lt_LT"; 
    1307       case LANG_MACEDONIAN: return "mk_MK"; 
     1425      case LANG_KOREAN: 
     1426        return "ko_KR"; 
     1427      case LANG_KYRGYZ: 
     1428        return "ky_KG"; 
     1429      case LANG_LAO: 
     1430        return "lo_LA"; 
     1431      case LANG_LATIN: 
     1432        return "la_VA"; 
     1433      case LANG_LATVIAN: 
     1434        return "lv_LV"; 
     1435      case LANG_LITHUANIAN: 
     1436        return "lt_LT"; 
     1437      case LANG_MACEDONIAN: 
     1438        return "mk_MK"; 
    13081439      case LANG_MALAY: 
    13091440        switch (sub) 
    13101441          { 
    1311           case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; 
    1312           case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; 
     1442          case SUBLANG_MALAY_MALAYSIA: 
     1443            return "ms_MY"; 
     1444          case SUBLANG_MALAY_BRUNEI_DARUSSALAM: 
     1445            return "ms_BN"; 
    13131446          } 
    13141447        return "ms"; 
    1315       case LANG_MALAYALAM: return "ml_IN"; 
    1316       case LANG_MALTESE: return "mt_MT"; 
     1448      case LANG_MALAYALAM: 
     1449        return "ml_IN"; 
     1450      case LANG_MALTESE: 
     1451        return "mt_MT"; 
    13171452      case LANG_MANIPURI: 
    13181453        /* FIXME: Adjust this when such locales appear on Unix.  */ 
    13191454        return "mni_IN"; 
    1320       case LANG_MARATHI: return "mr_IN"; 
     1455      case LANG_MARATHI: 
     1456        return "mr_IN"; 
    13211457      case LANG_MONGOLIAN: 
    13221458        switch (sub) 
    13231459          { 
    1324           case SUBLANG_DEFAULT: return "mn_MN"; 
    1325           } 
    1326         return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN".  */ 
     1460          case SUBLANG_DEFAULT: 
     1461            return "mn_MN"; 
     1462          } 
     1463        return "mn";            /* Ambiguous: could be "mn_CN" or "mn_MN".  */ 
    13271464      case LANG_NEPALI: 
    13281465        switch (sub) 
    13291466          { 
    1330           case SUBLANG_DEFAULT: return "ne_NP"; 
    1331           case SUBLANG_NEPALI_INDIA: return "ne_IN"; 
     1467          case SUBLANG_DEFAULT: 
     1468            return "ne_NP"; 
     1469          case SUBLANG_NEPALI_INDIA: 
     1470            return "ne_IN"; 
    13321471          } 
    13331472        return "ne"; 
     
    13351474        switch (sub) 
    13361475          { 
    1337           case SUBLANG_NORWEGIAN_BOKMAL: return "nb_NO"; 
    1338           case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; 
     1476          case SUBLANG_NORWEGIAN_BOKMAL: 
     1477            return "nb_NO"; 
     1478          case SUBLANG_NORWEGIAN_NYNORSK: 
     1479            return "nn_NO"; 
    13391480          } 
    13401481        return "no"; 
    1341       case LANG_ORIYA: return "or_IN"; 
    1342       case LANG_OROMO: return "om_ET"; 
    1343       case LANG_PAPIAMENTU: return "pap_AN"; 
     1482      case LANG_ORIYA: 
     1483        return "or_IN"; 
     1484      case LANG_OROMO: 
     1485        return "om_ET"; 
     1486      case LANG_PAPIAMENTU: 
     1487        return "pap_AN"; 
    13441488      case LANG_PASHTO: 
    1345         return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF".  */ 
    1346       case LANG_POLISH: return "pl_PL"; 
     1489        return "ps";            /* Ambiguous: could be "ps_PK" or "ps_AF".  */ 
     1490      case LANG_POLISH: 
     1491        return "pl_PL"; 
    13471492      case LANG_PORTUGUESE: 
    13481493        switch (sub) 
    13491494          { 
    1350           case SUBLANG_PORTUGUESE: return "pt_PT"; 
    1351           /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. 
    1352              Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ 
    1353           case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; 
     1495          case SUBLANG_PORTUGUESE: 
     1496            return "pt_PT"; 
     1497            /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. 
     1498               Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ 
     1499          case SUBLANG_PORTUGUESE_BRAZILIAN: 
     1500            return "pt_BR"; 
    13541501          } 
    13551502        return "pt"; 
     
    13571504        switch (sub) 
    13581505          { 
    1359           case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */ 
    1360           case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */ 
     1506          case SUBLANG_PUNJABI_INDIA: 
     1507            return "pa_IN";     /* Gurmukhi script */ 
     1508          case SUBLANG_PUNJABI_PAKISTAN: 
     1509            return "pa_PK";     /* Arabic script */ 
    13611510          } 
    13621511        return "pa"; 
    1363       case LANG_RHAETO_ROMANCE: return "rm_CH"; 
     1512      case LANG_RHAETO_ROMANCE: 
     1513        return "rm_CH"; 
    13641514      case LANG_ROMANIAN: 
    13651515        switch (sub) 
    13661516          { 
    1367           case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO"; 
    1368           case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD"; 
     1517          case SUBLANG_ROMANIAN_ROMANIA: 
     1518            return "ro_RO"; 
     1519          case SUBLANG_ROMANIAN_MOLDOVA: 
     1520            return "ro_MD"; 
    13691521          } 
    13701522        return "ro"; 
     
    13721524        switch (sub) 
    13731525          { 
    1374           case SUBLANG_DEFAULT: return "ru_RU"; 
    1375           } 
    1376         return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD".  */ 
    1377       case LANG_SAAMI: /* actually Northern Sami */ return "se_NO"; 
    1378       case LANG_SANSKRIT: return "sa_IN"; 
     1526          case SUBLANG_DEFAULT: 
     1527            return "ru_RU"; 
     1528          } 
     1529        return "ru";            /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD".  */ 
     1530      case LANG_SAAMI:          /* actually Northern Sami */ 
     1531        return "se_NO"; 
     1532      case LANG_SANSKRIT: 
     1533        return "sa_IN"; 
    13791534      case LANG_SINDHI: 
    13801535        switch (sub) 
    13811536          { 
    1382           case SUBLANG_SINDHI_INDIA: return "sd_IN"; 
    1383           case SUBLANG_SINDHI_PAKISTAN: return "sd_PK"; 
     1537          case SUBLANG_SINDHI_INDIA: 
     1538            return "sd_IN"; 
     1539          case SUBLANG_SINDHI_PAKISTAN: 
     1540            return "sd_PK"; 
    13841541          } 
    13851542        return "sd"; 
    1386       case LANG_SINHALESE: return "si_LK"; 
    1387       case LANG_SLOVAK: return "sk_SK"; 
    1388       case LANG_SLOVENIAN: return "sl_SI"; 
    1389       case LANG_SOMALI: return "so_SO"; 
     1543      case LANG_SINHALESE: 
     1544        return "si_LK"; 
     1545      case LANG_SLOVAK: 
     1546        return "sk_SK"; 
     1547      case LANG_SLOVENIAN: 
     1548        return "sl_SI"; 
     1549      case LANG_SOMALI: 
     1550        return "so_SO"; 
    13901551      case LANG_SORBIAN: 
    13911552        /* FIXME: Adjust this when such locales appear on Unix.  */ 
     
    13941555        switch (sub) 
    13951556          { 
    1396           case SUBLANG_SPANISH: return "es_ES"; 
    1397           case SUBLANG_SPANISH_MEXICAN: return "es_MX"; 
     1557          case SUBLANG_SPANISH: 
     1558            return "es_ES"; 
     1559          case SUBLANG_SPANISH_MEXICAN: 
     1560            return "es_MX"; 
    13981561          case SUBLANG_SPANISH_MODERN: 
    13991562            return "es_ES@modern";      /* not seen on Unix */ 
    1400           case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; 
    1401           case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; 
    1402           case SUBLANG_SPANISH_PANAMA: return "es_PA"; 
    1403           case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; 
    1404           case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; 
    1405           case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; 
    1406           case SUBLANG_SPANISH_PERU: return "es_PE"; 
    1407           case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; 
    1408           case SUBLANG_SPANISH_ECUADOR: return "es_EC"; 
    1409           case SUBLANG_SPANISH_CHILE: return "es_CL"; 
    1410           case SUBLANG_SPANISH_URUGUAY: return "es_UY"; 
    1411           case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; 
    1412           case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; 
    1413           case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; 
    1414           case SUBLANG_SPANISH_HONDURAS: return "es_HN"; 
    1415           case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; 
    1416           case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; 
     1563          case SUBLANG_SPANISH_GUATEMALA: 
     1564            return "es_GT"; 
     1565          case SUBLANG_SPANISH_COSTA_RICA: 
     1566            return "es_CR"; 
     1567          case SUBLANG_SPANISH_PANAMA: 
     1568            return "es_PA"; 
     1569          case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: 
     1570            return "es_DO"; 
     1571          case SUBLANG_SPANISH_VENEZUELA: 
     1572            return "es_VE"; 
     1573          case SUBLANG_SPANISH_COLOMBIA: 
     1574            return "es_CO"; 
     1575          case SUBLANG_SPANISH_PERU: 
     1576            return "es_PE"; 
     1577          case SUBLANG_SPANISH_ARGENTINA: 
     1578            return "es_AR"; 
     1579          case SUBLANG_SPANISH_ECUADOR: 
     1580            return "es_EC"; 
     1581          case SUBLANG_SPANISH_CHILE: 
     1582            return "es_CL"; 
     1583          case SUBLANG_SPANISH_URUGUAY: 
     1584            return "es_UY"; 
     1585          case SUBLANG_SPANISH_PARAGUAY: 
     1586            return "es_PY"; 
     1587          case SUBLANG_SPANISH_BOLIVIA: 
     1588            return "es_BO"; 
     1589          case SUBLANG_SPANISH_EL_SALVADOR: 
     1590            return "es_SV"; 
     1591          case SUBLANG_SPANISH_HONDURAS: 
     1592            return "es_HN"; 
     1593          case SUBLANG_SPANISH_NICARAGUA: 
     1594            return "es_NI"; 
     1595          case SUBLANG_SPANISH_PUERTO_RICO: 
     1596            return "es_PR"; 
    14171597          } 
    14181598        return "es"; 
    1419       case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */ 
    1420       case LANG_SWAHILI: return "sw_KE"; 
     1599      case LANG_SUTU: 
     1600        return "bnt_TZ";        /* or "st_LS" or "nso_ZA"? */ 
     1601      case LANG_SWAHILI: 
     1602        return "sw_KE"; 
    14211603      case LANG_SWEDISH: 
    14221604        switch (sub) 
    14231605          { 
    1424           case SUBLANG_DEFAULT: return "sv_SE"; 
    1425           case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; 
     1606          case SUBLANG_DEFAULT: 
     1607            return "sv_SE"; 
     1608          case SUBLANG_SWEDISH_FINLAND: 
     1609            return "sv_FI"; 
    14261610          } 
    14271611        return "sv"; 
    1428       case LANG_SYRIAC: return "syr_TR"; /* An extinct language.  */ 
    1429       case LANG_TAGALOG: return "tl_PH"; 
    1430       case LANG_TAJIK: return "tg_TJ"; 
     1612      case LANG_SYRIAC: 
     1613        return "syr_TR";        /* An extinct language.  */ 
     1614      case LANG_TAGALOG: 
     1615        return "tl_PH"; 
     1616      case LANG_TAJIK: 
     1617        return "tg_TJ"; 
    14311618<