Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/localedef/collate.c
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <wchar.h> | #include <wchar.h> | ||||
#include <limits.h> | #include <limits.h> | ||||
#include "localedef.h" | #include "localedef.h" | ||||
#include "parser.h" | #include "parser.h" | ||||
#include "collate.h" | #include "collate.h" | ||||
_Static_assert(COLL_WEIGHTS_MAX == 10, "This code assumes a value of 10"); | |||||
/* | /* | ||||
* Design notes. | * Design notes. | ||||
* | * | ||||
* It will be extremely helpful to the reader if they have access to | * It will be extremely helpful to the reader if they have access to | ||||
* the localedef and locale file format specifications available. | * the localedef and locale file format specifications available. | ||||
* Latest versions of these are available from www.opengroup.org. | * Latest versions of these are available from www.opengroup.org. | ||||
* | * | ||||
* The design for the collation code is a bit complex. The goal is a | * The design for the collation code is a bit complex. The goal is a | ||||
▲ Show 20 Lines • Show All 785 Lines • ▼ Show 20 Lines | add_order_bit(int kw) | ||||
} | } | ||||
collinfo.directive[collinfo.directive_count] |= bit; | collinfo.directive[collinfo.directive_count] |= bit; | ||||
} | } | ||||
void | void | ||||
add_order_directive(void) | add_order_directive(void) | ||||
{ | { | ||||
if (collinfo.directive_count >= COLL_WEIGHTS_MAX) { | if (collinfo.directive_count >= COLL_WEIGHTS_MAX) { | ||||
fprintf(stderr,"too many directives (max %d)", COLL_WEIGHTS_MAX); | fprintf(stderr,"too many directives (max %d)\n", COLL_WEIGHTS_MAX); | ||||
emaste: could add the space after , here and below while you're changing it | |||||
return; | |||||
} | } | ||||
collinfo.directive_count++; | collinfo.directive_count++; | ||||
} | } | ||||
static void | static void | ||||
add_order_pri(int32_t ref) | add_order_pri(int32_t ref) | ||||
{ | { | ||||
if (curr_weight >= NUM_WT) { | if (curr_weight >= NUM_WT) { | ||||
fprintf(stderr,"too many weights (max %d)", NUM_WT); | fprintf(stderr,"too many weights (max %d)\n", NUM_WT); | ||||
return; | return; | ||||
} | } | ||||
order_weights[curr_weight] = ref; | order_weights[curr_weight] = ref; | ||||
curr_weight++; | curr_weight++; | ||||
} | } | ||||
void | void | ||||
add_order_collsym(collsym_t *s) | add_order_collsym(collsym_t *s) | ||||
▲ Show 20 Lines • Show All 453 Lines • Show Last 20 Lines |
could add the space after , here and below while you're changing it