Skip to content

Commit

Permalink
libast: Update cdt(3): Allow empty strings in (dt)trees
Browse files Browse the repository at this point in the history
This backports most of the Cdt (container data types) mechanism
from the ksh 93v- beta, based on ground work done by OpenSUSE:
https://build.opensuse.org/package/view_file/shells/ksh/ksh93-dttree-crash.dif
plus adaptations to match ksh 93u+m and an updated manual page
(src/lib/libast/man/cdt.3) added directly from the 93v- sources.

| Thu Dec 20 12:48:02 UTC 2012 - werner@suse.de
|
| - Add ksh93-dttree-crash.dif - Allow empty strings in (dt)trees
|   (bnc#795324)
|
| Fri Oct 25 14:07:57 UTC 2013 - werner@suse.de
|
| - Rework patch ksh93-dttree-crash.dif

As usual, precious little information is available because the
OpenSUSE bug report is currently closed to the public:
https://bugzilla.opensuse.org/show_bug.cgi?id=795324

However, a cursory inspection suggests that this code contains
improvements to do with concurrent processing and related
robustness. The new cdt.3 manual page adds a lot about that.

This has been in production use on OpenSUSE for a long time,
so hopefully this will make ksh a little more stable again.
Only one way to find out: let's commit and test this...

BTW, to get a nice manual, use groff and ghostscript's ps2pdf:
$ groff -tman src/lib/libast/man/cdt.3 | ps2pdf - cdt.3.pdf
  • Loading branch information
McDutchie committed Jan 28, 2021
1 parent aa2644a commit cc49275
Show file tree
Hide file tree
Showing 21 changed files with 710 additions and 212 deletions.
3 changes: 3 additions & 0 deletions src/cmd/ksh93/sh/arith.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ static Namval_t *scope(register Namval_t *np,register struct lval *lvalue,int as
{
ap = nv_arrayptr(np);
if(ap && !ap->table)
{
ap->table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->table,shp,1);
}
if(ap && ap->table && (nq=nv_search(nv_getsub(np),ap->table,NV_ADD)))
nq->nvenv = (char*)np;
if(nq && nv_isnull(nq))
Expand Down
30 changes: 19 additions & 11 deletions src/cmd/ksh93/sh/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static Namarr_t *array_scope(Namval_t *np, Namarr_t *ap, int flags)
if(is_associative(aq))
{
aq->scope = (void*)dtopen(&_Nvdisc,Dtoset);
dtuserdata(aq->scope,&sh,1);
dtview((Dt_t*)aq->scope,aq->table);
aq->table = (Dt_t*)aq->scope;
return(aq);
Expand Down Expand Up @@ -373,7 +374,10 @@ static Namval_t *array_find(Namval_t *np,Namarr_t *arp, int flag)
{
char *cp;
if(!ap->header.table)
{
ap->header.table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->header.table,&sh,1);
}
sfprintf(sh.strbuf,"%d",ap->cur);
cp = sfstruse(sh.strbuf);
mp = nv_search(cp, ap->header.table, NV_ADD);
Expand Down Expand Up @@ -410,7 +414,10 @@ int nv_arraysettype(Namval_t *np, Namval_t *tp, const char *sub, int flags)
av[1] = 0;
sh.last_table = 0;
if(!ap->table)
{
ap->table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->table,&sh,1);
}
if(nq = nv_search(sub, ap->table, NV_ADD))
{
if(!nq->nvfun && nq->nvalue.cp && *nq->nvalue.cp==0)
Expand Down Expand Up @@ -452,7 +459,6 @@ static Namfun_t *array_clone(Namval_t *np, Namval_t *mp, int flags, Namfun_t *fp
int nelem, skipped=0;
Dt_t *otable=ap->table;
struct index_array *aq = (struct index_array*)ap, *ar;
Shell_t *shp = sh_getinterp();
if(flags&NV_MOVE)
{
if((flags&NV_COMVAR) && nv_putsub(np,NIL(char*),ARRAY_SCAN))
Expand Down Expand Up @@ -485,6 +491,7 @@ static Namfun_t *array_clone(Namval_t *np, Namval_t *mp, int flags, Namfun_t *fp
if(ap->table)
{
ap->table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->table,&sh,1);
if(ap->scope && !(flags&NV_COMVAR))
{
ap->scope = ap->table;
Expand Down Expand Up @@ -855,6 +862,7 @@ static struct index_array *array_grow(Namval_t *np, register struct index_array
if(nv_hasdisc(np,&array_disc) || (nv_type(np) && nv_isvtree(np)))
{
ap->header.table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->header.table,&sh,1);
mp = nv_search("0", ap->header.table,NV_ADD);
if(mp && nv_isnull(mp))
{
Expand Down Expand Up @@ -1180,15 +1188,14 @@ Namval_t *nv_putsub(Namval_t *np,register char *sp,register long mode)
{
if(sp)
{
Shell_t *shp = sh_getinterp();
if(ap && ap->xp && !strmatch(sp,"+([0-9])"))
{
Namval_t *mp = nv_namptr(ap->xp,0);
nv_putval(mp, sp,0);
size = nv_getnum(mp);
}
else
size = (int)sh_arith(shp,(char*)sp);
size = (int)sh_arith(&sh,(char*)sp);
}
if(size <0 && ap)
size += array_maxindex(np);
Expand Down Expand Up @@ -1242,7 +1249,10 @@ Namval_t *nv_putsub(Namval_t *np,register char *sp,register long mode)
char *cp;
Namval_t *mp;
if(!ap->header.table)
{
ap->header.table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->header.table,&sh,1);
}
sfprintf(sh.strbuf,"%d",ap->cur);
cp = sfstruse(sh.strbuf);
mp = nv_search(cp, ap->header.table, NV_ADD);
Expand Down Expand Up @@ -1379,7 +1389,6 @@ static void array_fixed_setdata(Namval_t *np,Namarr_t* ap,struct fixed_array* fp

static int array_fixed_init(Namval_t *np, char *sub, char *cp)
{
Shell_t *shp=sh_getinterp();
Namarr_t *ap;
struct fixed_array *fp;
int n=1,sz;
Expand All @@ -1403,12 +1412,12 @@ static int array_fixed_init(Namval_t *np, char *sub, char *cp)
fp->max = (int*)(fp+1);
fp->incr = fp->max+n;
fp->cur = fp->incr+n;
fp->max[0] = (int)sh_arith(shp,(char*)sub);
fp->max[0] = (int)sh_arith(&sh,(char*)sub);
for(n=1,ep=cp;*ep=='['; ep=cp)
{
cp = nv_endsubscript(np,ep,0);
cp[-1]=0;
fp->max[n++] = sz = (int)sh_arith(shp,(char*)ep+1);
fp->max[n++] = sz = (int)sh_arith(&sh,(char*)ep+1);
if(sz<0)
{
free((void*)ap);
Expand All @@ -1429,7 +1438,6 @@ static int array_fixed_init(Namval_t *np, char *sub, char *cp)

static char *array_fixed(Namval_t *np, char *sub, char *cp,int mode)
{
Shell_t *shp=sh_getinterp();
Namarr_t *ap = nv_arrayptr(np);
struct fixed_array *fp = (struct fixed_array*)ap->fixed;
char *ep;
Expand All @@ -1447,7 +1455,7 @@ static char *array_fixed(Namval_t *np, char *sub, char *cp,int mode)
}
else
fp->curi = 0;
size = (int)sh_arith(shp,(char*)sub);
size = (int)sh_arith(&sh,(char*)sub);
fp->cur[n] = size;
if(size >= fp->max[n] || (size < 0))
errormsg(SH_DICT,ERROR_exit(1),e_subscript, nv_name(np));
Expand All @@ -1459,7 +1467,7 @@ static char *array_fixed(Namval_t *np, char *sub, char *cp,int mode)
errormsg(SH_DICT,ERROR_exit(1),e_subscript, nv_name(np));
cp = nv_endsubscript(np,ep,0);
cp[-1]=0;
size = (int)sh_arith(shp,(char*)ep+1);
size = (int)sh_arith(&sh,(char*)ep+1);
if(size >= fp->max[n] || (size < 0))
errormsg(SH_DICT,ERROR_exit(1),e_subscript, nv_name(np));
fp->cur[n] = size;
Expand Down Expand Up @@ -1658,6 +1666,7 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
if(ap = (struct assoc_array*)calloc(1,sizeof(struct assoc_array)))
{
ap->header.table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->header.table,&sh,1);
ap->cur = 0;
ap->pos = 0;
ap->header.hdr.disc = &array_disc;
Expand Down Expand Up @@ -1730,8 +1739,7 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
case NV_ANAME:
if(ap->cur)
{
Shell_t *shp = sh_getinterp();
if(!shp->instance && nv_isnull(ap->cur))
if(!sh.instance && nv_isnull(ap->cur))
return(NIL(void*));
return((void*)ap->cur->nvname);
}
Expand Down
5 changes: 5 additions & 0 deletions src/cmd/ksh93/sh/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,9 +1812,13 @@ static Init_t *nv_init(Shell_t *shp)
(OPTINDNOD)->nvalue.lp = (&shp->st.optindex);
/* set up the seconds clock */
shp->alias_tree = dtopen(&_Nvdisc,Dtoset);
dtuserdata(shp->alias_tree,shp,1);
shp->track_tree = dtopen(&_Nvdisc,Dtset);
dtuserdata(shp->track_tree,shp,1);
shp->bltin_tree = sh_inittree(shp,(const struct shtable2*)shtab_builtins);
dtuserdata(shp->bltin_tree,shp,1);
shp->fun_tree = dtopen(&_Nvdisc,Dtoset);
dtuserdata(shp->fun_tree,shp,1);
dtview(shp->fun_tree,shp->bltin_tree);
nv_mount(DOTSHNOD, "type", shp->typedict=dtopen(&_Nvdisc,Dtoset));
nv_adddisc(DOTSHNOD, shdiscnames, (Namval_t**)0);
Expand Down Expand Up @@ -1857,6 +1861,7 @@ Dt_t *sh_inittree(Shell_t *shp,const struct shtable2 *name_vals)
nbltins = n;
}
base_treep = treep = dtopen(&_Nvdisc,Dtoset);
dtuserdata(treep,shp,1);
treep->user = (void*)shp;
for(tp=name_vals;*tp->sh_name;tp++,np++)
{
Expand Down
3 changes: 3 additions & 0 deletions src/cmd/ksh93/sh/macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -2738,7 +2738,10 @@ static char *sh_tilde(Shell_t *shp,register const char *string)
skip:
#endif /* _WINIX */
if(!logins_tree)
{
logins_tree = dtopen(&_Nvdisc,Dtbag);
dtuserdata(logins_tree,shp,1);
}
if(np=nv_search(string,logins_tree,NV_ADD))
{
save = shp->subshell;
Expand Down
1 change: 1 addition & 0 deletions src/cmd/ksh93/sh/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ int sh_main(int ac, char *av[], Shinit_f userinit)
/* preset aliases for interactive non-POSIX ksh */
dtclose(shp->alias_tree);
shp->alias_tree = sh_inittree(shp,shtab_aliases);
dtuserdata(shp->alias_tree,shp,1);
}
}
#if SHOPT_REMOTE
Expand Down
8 changes: 8 additions & 0 deletions src/cmd/ksh93/sh/name.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
{
Dt_t *dp = dtview(shp->var_tree,(Dt_t*)0);
rp->sdict = dtopen(&_Nvdisc,Dtoset);
dtuserdata(rp->sdict,shp,1);
dtview(rp->sdict,dp);
dtview(shp->var_tree,rp->sdict);
}
Expand Down Expand Up @@ -1131,7 +1132,10 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
ap = nv_arrayptr(np);
}
if(n && ap && !ap->table)
{
ap->table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->table,shp,1);
}
if(ap && ap->table && (nq=nv_search(sub,ap->table,n)))
nq->nvenv = (char*)np;
if(nq && nv_isnull(nq))
Expand Down Expand Up @@ -2285,6 +2289,7 @@ void sh_scope(Shell_t *shp, struct argnod *envlist, int fun)
newroot = nv_dict(shp->namespace);
#endif /* SHOPT_NAMESPACE */
newscope = dtopen(&_Nvdisc,Dtoset);
dtuserdata(newscope,shp,1);
if(envlist)
{
dtview(newscope,(Dt_t*)shp->var_tree);
Expand Down Expand Up @@ -3277,7 +3282,10 @@ int nv_rename(register Namval_t *np, int flags)
if(ap=nv_arrayptr(np))
{
if(!ap->table)
{
ap->table = dtopen(&_Nvdisc,Dtoset);
dtuserdata(ap->table,shp,1);
}
if(ap->table)
mp = nv_search(nv_getsub(np),ap->table,NV_ADD);
nv_arraychild(np,mp,0);
Expand Down
1 change: 1 addition & 0 deletions src/cmd/ksh93/sh/nvdisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,7 @@ static Namfun_t *clone_table(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp
Dt_t *oroot=tp->dict,*nroot=dtopen(&_Nvdisc,Dtoset);
if(!nroot)
return(0);
dtuserdata(nroot,dtuserdata(oroot,0,0),1);
memcpy((void*)ntp,(void*)fp,sizeof(struct table));
ntp->dict = nroot;
ntp->parent = nv_lastdict();
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/ksh93/sh/subshell.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ Dt_t *sh_subtracktree(int create)
if(create && sh.subshell && !sh.subshare && sp && !sp->strack)
{
sp->strack = dtopen(&_Nvdisc,Dtset);
dtuserdata(sp->strack,&sh,1);
dtview(sp->strack,sh.track_tree);
sh.track_tree = sp->strack;
}
Expand All @@ -420,6 +421,7 @@ Dt_t *sh_subfuntree(int create)
if(create && sh.subshell && !sh.subshare && sp && !sp->sfun)
{
sp->sfun = dtopen(&_Nvdisc,Dtoset);
dtuserdata(sp->sfun,&sh,1);
dtview(sp->sfun,sh.fun_tree);
sh.fun_tree = sp->sfun;
}
Expand Down
15 changes: 10 additions & 5 deletions src/cmd/ksh93/sh/xec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2429,6 +2429,7 @@ int sh_exec(register const Shnode_t *t, int flags)
else
{
root = dtopen(&_Nvdisc,Dtoset);
dtuserdata(root,shp,1);
nv_mount(np, (char*)0, root);
np->nvalue.cp = Empty;
dtview(root,shp->var_base);
Expand Down Expand Up @@ -2484,11 +2485,6 @@ int sh_exec(register const Shnode_t *t, int flags)
slp = (struct slnod*)np->nvenv;
sh_funstaks(slp->slchild,-1);
stakdelete(slp->slptr);
if(shp->funload)
{
free((void*)np->nvalue.rp);
np->nvalue.rp = 0;
}
if(rp->sdict)
{
Namval_t *mp, *nq;
Expand All @@ -2502,6 +2498,12 @@ int sh_exec(register const Shnode_t *t, int flags)
dtclose(rp->sdict);
rp->sdict = 0;
}
if(shp->funload)
{
if(!shp->fpathdict)
free((void*)np->nvalue.rp);
np->nvalue.rp = 0;
}
}
if(!np->nvalue.rp)
{
Expand Down Expand Up @@ -2540,7 +2542,10 @@ int sh_exec(register const Shnode_t *t, int flags)
if(!shp->fpathdict)
shp->fpathdict = dtopen(&_Rpdisc,Dtobag);
if(shp->fpathdict)
{
dtuserdata(shp->fpathdict,shp,1);
dtinsert(shp->fpathdict,rp);
}
}
}
else
Expand Down
18 changes: 17 additions & 1 deletion src/lib/libast/Mamfile
Original file line number Diff line number Diff line change
Expand Up @@ -3964,6 +3964,14 @@ make install
prev cdt/dtopen.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtopen.c
done dtopen.o generated
make dtstat.o
make cdt/dtstat.c
prev cdt/dthdr.h implicit
done cdt/dtstat.c
meta dtstat.o %.c>%.o cdt/dtstat.c dtstat
prev cdt/dtstat.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtstat.c
done dtstat.o generated
make dtstrhash.o
make cdt/dtstrhash.c
prev cdt/dthdr.h implicit
Expand All @@ -3980,6 +3988,14 @@ make install
prev cdt/dttree.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dttree.c
done dttree.o generated
make dtuser.o
make cdt/dtuser.c
prev cdt/dthdr.h implicit
done cdt/dtuser.c
meta dtuser.o %.c>%.o cdt/dtuser.c dtuser
prev cdt/dtuser.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtuser.c
done dtuser.o generated
make dtview.o
make cdt/dtview.c
prev cdt/dthdr.h implicit
Expand Down Expand Up @@ -6095,7 +6111,7 @@ make install
exec - ${AR} rc libast.a streval.o strexpr.o strmatch.o strcopy.o modei.o modex.o strmode.o strlcat.o strlcpy.o strlook.o strncopy.o strsearch.o strpsearch.o stresc.o stropt.o strtape.o strpcmp.o strnpcmp.o strvcmp.o strnvcmp.o tok.o tokline.o tokscan.o pathaccess.o pathcat.o pathcanon.o pathcheck.o pathpath.o pathexists.o pathfind.o pathkey.o pathprobe.o pathrepl.o pathnative.o pathposix.o pathtemp.o pathtmp.o pathstat.o pathgetlink.o pathsetlink.o pathbin.o pathshell.o pathcd.o pathprog.o ftwalk.o ftwflags.o fts.o astintercept.o conformance.o getenv.o setenviron.o optget.o optjoin.o optesc.o optctx.o strsort.o struniq.o magic.o mime.o mimetype.o signal.o sigflag.o systrace.o error.o errorf.o errormsg.o errorx.o localeconv.o setlocale.o translate.o catopen.o iconv.o lc.o lctab.o mc.o base64.o recfmt.o recstr.o reclen.o fmtrec.o fmtbase.o fmtbuf.o fmtclock.o fmtdev.o fmtelapsed.o fmterror.o fmtesc.o fmtfmt.o fmtfs.o fmtident.o fmtint.o fmtip4.o fmtip6.o fmtls.o fmtmatch.o fmtmode.o fmtnum.o fmtperm.o fmtre.o fmttime.o
exec - ${AR} rc libast.a fmtuid.o fmtgid.o fmtsignal.o fmtscale.o fmttmx.o fmttv.o fmtversion.o strelapsed.o strperm.o struid.o strgid.o strtoip4.o strtoip6.o stack.o stk.o swapget.o swapmem.o swapop.o swapput.o sigdata.o sigcrit.o sigunblock.o procopen.o procclose.o procrun.o procfree.o tmdate.o tmequiv.o tmfix.o tmfmt.o tmform.o tmgoff.o tminit.o tmleap.o tmlex.o tmlocale.o tmmake.o tmpoff.o tmscan.o tmsleep.o tmtime.o tmtype.o tmweek.o tmword.o tmzone.o tmxdate.o tmxduration.o tmxfmt.o tmxgettime.o tmxleap.o tmxmake.o tmxscan.o tmxsettime.o tmxsleep.o tmxtime.o tmxtouch.o tvcmp.o tvgettime.o tvsettime.o tvsleep.o tvtouch.o cmdarg.o vecargs.o vecfile.o vecfree.o vecload.o vecstring.o univdata.o touch.o mnt.o debug.o memccpy.o memchr.o memcmp.o memcpy.o memdup.o memmove.o memset.o mkdir.o mkfifo.o mknod.o rmdir.o remove.o rename.o link.o unlink.o strdup.o strchr.o strrchr.o strstr.o strtod.o strtold.o strtol.o strtoll.o strtoul.o strtoull.o strton.o strtonll.o strntod.o strntold.o strnton.o
exec - ${AR} rc libast.a strntonll.o strntol.o strntoll.o strntoul.o strntoull.o strcasecmp.o strncasecmp.o strerror.o mktemp.o tmpnam.o fsync.o execlp.o execve.o execvp.o execvpe.o spawnveg.o vfork.o killpg.o hsearch.o tsearch.o getlogin.o putenv.o setenv.o unsetenv.o lstat.o statvfs.o eaccess.o gross.o omitted.o readlink.o symlink.o getpgrp.o setpgid.o setsid.o waitpid.o creat64.o fcntl.o open.o atexit.o getdents.o getwd.o dup2.o errno.o getpreroot.o ispreroot.o realopen.o setpreroot.o getgroups.o mount.o system.o iblocks.o modedata.o tmdata.o memfatal.o sfkeyprintf.o sfdcdio.o sfdcdos.o sfdcfilter.o sfdcseekable.o sfdcslow.o sfdcsubstr.o sfdctee.o sfdcunion.o sfdcmore.o sfdcprefix.o wc.o wc2utf8.o basename.o closelog.o dirname.o fmtmsglib.o fnmatch.o ftw.o getdate.o getsubopt.o glob.o nftw.o openlog.o re_comp.o resolvepath.o realpath.o regcmp.o regexp.o setlogmask.o strftime.o strptime.o swab.o syslog.o tempnam.o wordexp.o mktime.o regalloc.o regclass.o regcoll.o regcomp.o regcache.o regdecomp.o regerror.o regexec.o regfatal.o reginit.o
exec - ${AR} rc libast.a regnexec.o regsubcomp.o regsubexec.o regsub.o regrecord.o regrexec.o regstat.o dtclose.o dtdisc.o dthash.o dtlist.o dtmethod.o dtopen.o dtstrhash.o dttree.o dtview.o dtwalk.o dtnew.o dtcomp.o sfclose.o sfclrlock.o sfdisc.o sfdlen.o sfexcept.o sfgetl.o sfgetu.o sfcvt.o sfecvt.o sffcvt.o sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetr.o sfllen.o sfmode.o sfmove.o sfnew.o sfpkrd.o sfnotify.o sfnputc.o sfopen.o sfpeek.o sfpoll.o sfpool.o sfpopen.o sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o sfreserve.o sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o sfstack.o sfstrtod.o sfsync.o sfswap.o sftable.o sftell.o sftmp.o sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfpurge.o sfraise.o sfwalk.o sfgetm.o sfmutex.o sfputm.o sfresize.o _sfclrerr.o _sfeof.o _sferror.o _sffileno.o _sfopen.o _sfstacked.o _sfvalue.o _sfgetc.o _sfgetl.o _sfgetl2.o _sfgetu.o _sfgetu2.o _sfdlen.o _sfllen.o _sfslen.o _sfulen.o _sfputc.o _sfputd.o _sfputl.o _sfputm.o
exec - ${AR} rc libast.a regnexec.o regsubcomp.o regsubexec.o regsub.o regrecord.o regrexec.o regstat.o dtclose.o dtdisc.o dthash.o dtlist.o dtmethod.o dtopen.o dtstat.o dtstrhash.o dttree.o dtuser.o dtview.o dtwalk.o dtnew.o dtcomp.o sfclose.o sfclrlock.o sfdisc.o sfdlen.o sfexcept.o sfgetl.o sfgetu.o sfcvt.o sfecvt.o sffcvt.o sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetr.o sfllen.o sfmode.o sfmove.o sfnew.o sfpkrd.o sfnotify.o sfnputc.o sfopen.o sfpeek.o sfpoll.o sfpool.o sfpopen.o sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o sfreserve.o sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o sfstack.o sfstrtod.o sfsync.o sfswap.o sftable.o sftell.o sftmp.o sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfpurge.o sfraise.o sfwalk.o sfgetm.o sfmutex.o sfputm.o sfresize.o _sfclrerr.o _sfeof.o _sferror.o _sffileno.o _sfopen.o _sfstacked.o _sfvalue.o _sfgetc.o _sfgetl.o _sfgetl2.o _sfgetu.o _sfgetu2.o _sfdlen.o _sfllen.o _sfslen.o _sfulen.o _sfputc.o _sfputd.o _sfputl.o _sfputm.o
exec - ${AR} rc libast.a _sfputu.o clearerr.o fclose.o fdopen.o feof.o ferror.o fflush.o fgetc.o fgetpos.o fgets.o fileno.o fopen.o fprintf.o fpurge.o fputc.o fputs.o fread.o freopen.o fscanf.o fseek.o fseeko.o fsetpos.o ftell.o ftello.o fwrite.o flockfile.o ftrylockfile.o funlockfile.o getc.o getchar.o getw.o pclose.o popen.o printf.o putc.o putchar.o puts.o putw.o rewind.o scanf.o setbuf.o setbuffer.o setlinebuf.o setvbuf.o snprintf.o sprintf.o sscanf.o asprintf.o vasprintf.o tmpfile.o ungetc.o vfprintf.o vfscanf.o vprintf.o vscanf.o vsnprintf.o vsprintf.o vsscanf.o _doprnt.o _doscan.o _filbuf.o _flsbuf.o _stdfun.o _stdopen.o _stdprintf.o _stdscanf.o _stdsprnt.o _stdvbuf.o _stdvsnprnt.o _stdvsprnt.o _stdvsscn.o fgetwc.o fwprintf.o putwchar.o vfwscanf.o wprintf.o fgetws.o fwscanf.o swprintf.o vswprintf.o wscanf.o fputwc.o getwc.o swscanf.o vswscanf.o fputws.o getwchar.o ungetwc.o vwprintf.o fwide.o putwc.o vfwprintf.o vwscanf.o stdio_c99.o fcloseall.o fmemopen.o getdelim.o getline.o frexp.o frexpl.o astcopy.o
exec - ${AR} rc libast.a astconf.o astdynamic.o astlicense.o astquery.o astwinsize.o conftab.o aststatic.o getopt.o getoptl.o aso.o asolock.o asometh.o asorelax.o aso-sem.o aso-fcntl.o vmbest.o vmclear.o vmclose.o vmdcheap.o vmdebug.o vmdisc.o vmexit.o vmlast.o vmopen.o vmpool.o vmprivate.o vmprofile.o vmregion.o vmsegment.o vmset.o vmstat.o vmstrdup.o vmtrace.o vmwalk.o vmmopen.o malloc.o vmgetmem.o a64l.o acosh.o asinh.o atanh.o cbrt.o crypt.o erf.o err.o exp.o exp__E.o expm1.o gamma.o getpass.o lgamma.o log.o log1p.o log__L.o rand48.o random.o rcmd.o rint.o support.o sfstrtmp.o spawn.o
exec - (ranlib libast.a) >/dev/null 2>&1 || true
Expand Down
4 changes: 2 additions & 2 deletions src/lib/libast/cdt/cdtlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
/* This struct holds private method data created on DT_OPEN */
struct _dtdata_s
{ unsigned int lock; /* general dictionary lock */
Dtuser_t user; /* application's data */
unsigned int type; /* method type, control flags */
ssize_t size; /* number of objects */
Dtuser_t user; /* application's data */
Dt_t dict; /* when DT_INDATA is requested */
};

Expand Down Expand Up @@ -123,7 +123,7 @@ typedef struct _dtlib_s
#endif /* _BLD_cdt */

/* these macros lock/unlock dictionaries. DTRETURN substitutes for "return" */
#define DTSETLOCK(dt) (((dt)->data->type&DT_SHARE) ? asolock(&(dt)->data->lock,1,ASO_SPINLOCK) : 0 )
#define DTSETLOCK(dt) (((dt)->data->type&DT_SHARE) ? asolock(&(dt)->data->lock,1,ASO_LOCK) : 0 )
#define DTCLRLOCK(dt) (((dt)->data->type&DT_SHARE) ? asolock(&(dt)->data->lock,1,ASO_UNLOCK) : 0 )
#define DTRETURN(ob,rv) do { (ob) = (rv); goto dt_return; } while(0)
#define DTERROR(dt, mesg) (!((dt)->disc && (dt)->disc->eventf) ? 0 : \
Expand Down
6 changes: 0 additions & 6 deletions src/lib/libast/cdt/dtcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,3 @@ extern ssize_t dtsize(Dt_t* d)
{
return (ssize_t)(*(_DT(d)->searchf))((d),(Void_t*)(0),DT_STAT);
}

#undef dtstat
extern ssize_t dtstat(Dt_t* d)
{
return (ssize_t)(*(_DT(d)->searchf))((d),(Void_t*)(0),DT_STAT);
}
Loading

0 comments on commit cc49275

Please sign in to comment.