File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / dsap / common / avs_cpy.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"

extern LLog * log_dsap;

static AV_Sequence eptr;
#define foreach(a)      for(eptr = a; eptr != NULLAV; eptr = eptr->avseq_next)

AV_Sequence  avs_comp_cpy (avs)
AV_Sequence  avs;
{
AV_Sequence ptr;

	if (avs==NULLAV) {
		DLOG (log_dsap,LLOG_DEBUG,("copy of null avs"));
		return (NULLAV);
	}
	ptr = (AV_Sequence) smalloc (sizeof(avseqcomp));
	AttrV_cpy_aux (&avs->avseq_av,&ptr->avseq_av);
	ptr->avseq_next = NULLAV;
	return (ptr);
}

AV_Sequence  avs_cpy (avs)
AV_Sequence  avs;
{
AV_Sequence start;
AV_Sequence ptr,ptr2;

	if (avs == NULLAV ) {
		DLOG (log_dsap,LLOG_DEBUG,("avs_cpy of null avs"));
		return (NULLAV);
	}
	start = avs_comp_cpy (avs);
	ptr2 = start;
	foreach (avs->avseq_next) {
		ptr = avs_comp_cpy (eptr);
		ptr2->avseq_next = ptr;
		ptr2 = ptr;
	}
	return (start);
}


unix.superglobalmegacorp.com

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