[Date Prev][Date Next] [Chronological] [Thread] [Top]

Renaming "language" to "tag"



There is one problem with renaming "language" variables to "tag"
variables, now that the language code is used for arbitrary tagging
options.

slapd/index.c:slap_str2index() has this code:

	} else if ( strcasecmp( str, "nolang" ) == 0 ) {
		*idx = SLAP_INDEX_NOLANG;

I don't know what that is.  Should I just change it to
	strcasecmp( str, "nolang" ) == 0 &&
	strcasecmp( str, "notags" ) == 0
to support both backwards compatibility and correct naming and change
SLAP_INDEX_NOLANG to SLAP_INDEX_NOTAGS?  Or could something break if
two different strings are allowed to have the same meaning?


Here are the other renamings I intend to do:


ad.c:
	ad_find_lang() -> ad_find_tags():
		lang -> tags

	slap_bv2ad():
		MAX_LANG_OPTIONS -> MAX_TAGGING_OPTIONS
		MAX_LANG_LEN     -> MAX_TAGS_LEN
		nlang     -> ntags
		langlen   -> tagslen
		langs[]   -> tags[]
		langbuf[] -> tagbuf
 
	is_ad_sublang() -> is_ad_subtags():
		sublangbv, suplangbv -> subtagsbv, suptagsbv
		suplang, sublang     -> suptags, subtags

modify.c:
		"%s: inappropriate use of language range option",
	->	"%s: inappropriate use of tag range option",

slap.h:
	struct slap_attr_desc.ad_lang -> ad_tags
	SLAP_DESC_LANG_RANGE          -> SLAP_DESC_TAG_RANGE
	slap_ad_is_lang()             -> slap_ad_is_tagged()
	slap_ad_is_lang_range()       -> slap_ad_is_tag_range()

back-bdb/index.c, back-ldbm/index.c:
	index_at_values():
		lang -> tags

-- 
Hallvard