Commit 75ba7b7e authored by Jonathan Jenkins's avatar Jonathan Jenkins
Browse files

add ordering flag to config to define "default" ordering semantics

parent 8dbcd527
...@@ -39,6 +39,10 @@ typedef struct config_anno_map_s ...@@ -39,6 +39,10 @@ typedef struct config_anno_map_s
// only explicit annotations tracked here - use a flag to indicate a // only explicit annotations tracked here - use a flag to indicate a
// non-annotated LP type // non-annotated LP type
int has_unanno_lp; int has_unanno_lp;
// for configuration/mapping functions to be able to provide "default"
// (annotation-ignoring) lookup semantics, provide a flag to determine if
// the unannotated lp type is first
int is_unanno_first;
uint64_t num_annos; uint64_t num_annos;
// maintain the number of lps that have the particular annotation // maintain the number of lps that have the particular annotation
uint64_t num_anno_lps[CONFIGURATION_MAX_ANNOS]; uint64_t num_anno_lps[CONFIGURATION_MAX_ANNOS];
......
...@@ -284,6 +284,8 @@ static void check_add_anno( ...@@ -284,6 +284,8 @@ static void check_add_anno(
config_anno_map_t *map){ config_anno_map_t *map){
if (anno[0] == '\0'){ if (anno[0] == '\0'){
map->has_unanno_lp = 1; map->has_unanno_lp = 1;
if (!map->num_annos)
map->is_unanno_first = 1;
} }
else{ else{
uint64_t a = 0; uint64_t a = 0;
...@@ -322,6 +324,7 @@ static void check_add_lp_type_anno( ...@@ -322,6 +324,7 @@ static void check_add_lp_type_anno(
strcpy(map->lp_name, lp_name); strcpy(map->lp_name, lp_name);
map->num_annos = 0; map->num_annos = 0;
map->has_unanno_lp = 0; map->has_unanno_lp = 0;
map->is_unanno_first = 0;
memset(map->num_anno_lps, 0, memset(map->num_anno_lps, 0,
CONFIGURATION_MAX_ANNOS*sizeof(*map->num_anno_lps)); CONFIGURATION_MAX_ANNOS*sizeof(*map->num_anno_lps));
check_add_anno(anno, map); check_add_anno(anno, map);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment