File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / dsap / common / avs_str.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

#include "quipu/util.h"
#include "quipu/attrvalue.h"

short oc_sntx = -1;
IFP oc_hier = NULLIFP;
short acl_sntx = -1;
IFP merge_acl = NULLIFP;

AV_Sequence str2avs (str,at)
char * str;
AttributeType at;
{
char * ptr;
char * save,val;
AV_Sequence avs = NULLAV;
AV_Sequence newavs;

	if (str == NULLCP)
		return (NULLAV);

	if ((at) && (at->oa_syntax == oc_sntx))
		return ((AV_Sequence)(*oc_hier)(str));

	while ((ptr = index (str,'&')) != 0) {
		save = ptr++;
		save--;
		if (! isspace (*save))
			save++;
		val = *save;
		*save = 0;

		if ((avs) && (at->oa_syntax == acl_sntx)) {
			(*merge_acl)(avs,SkipSpace(str));
			*save = val;
			str = ptr;
			continue;
		}

		newavs = avs_comp_alloc();
		newavs->avseq_next = NULLAV;

		if (str_at2AttrV_aux (str,at,&newavs->avseq_av) == NOTOK)
			return (NULLAV);

		*save = val;
		str = ptr;
		avs = avs_merge (avs,newavs);
	}

	if ((avs) && (at->oa_syntax == acl_sntx)) {
		(*merge_acl)(avs,SkipSpace(str));
		return (avs);
	}

	newavs = avs_comp_alloc();
	newavs->avseq_next = NULLAV;

	if (str_at2AttrV_aux (str,at,&newavs->avseq_av) == NOTOK)
		return (NULLAV);

	return (avs_merge (avs,newavs));

}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.