diff --git a/codes/codes-mapping-context.h b/codes/codes-mapping-context.h index 358f3e7d4eab36294fca5ca031e7e2f98b94f2c6..812b9446dcabefa9d6892a6653af2316fc6e2532 100644 --- a/codes/codes-mapping-context.h +++ b/codes/codes-mapping-context.h @@ -16,6 +16,10 @@ #include #include +/* for convenience - an annotation-ignoring "group_modulo" context, + * matching previous mapping behavior in most interfaces (modelnet and such) */ +extern struct codes_mctx const CODES_MCTX_DEFAULT; + /* types of map contexts */ enum codes_mctx_type { // instructs those using the context to map directly to an LP diff --git a/src/util/codes-mapping-context.c b/src/util/codes-mapping-context.c index 4236d333401a3ec3e84865874b2e87f3d77aca6d..61f2069c00fbfa8af171341c422f6dbaa14b83d0 100644 --- a/src/util/codes-mapping-context.c +++ b/src/util/codes-mapping-context.c @@ -7,6 +7,18 @@ #include #include +struct codes_mctx const CODES_MCTX_DEFAULT = { + .type = CODES_MCTX_GROUP_MODULO, + .u = { + .group_modulo = { + .anno = { + .annotation = NULL, + .ignore_annotations = true + } + } + } +}; + struct codes_mctx codes_mctx_set_global_direct(tw_lpid lpid) { struct codes_mctx rtn;