Searched refs:rs (Results 1 - 25 of 33) sorted by relevance

12

/ast/src/lib/librecsort/
H A Drsclear.c29 int rsclear(Rs_t* rs) argument
31 int rsclear(rs)
32 Rs_t* rs;
37 for(m = (uchar*)rs->methdata, endm = m+rs->meth->size; m < endm; ++m)
40 if(rs->vm)
41 vmclear(rs->vm);
42 rs->c_size = 0;
43 rs->type &= RS_TYPES;
44 rs
[all...]
H A Drsclose.c29 int rsclose(Rs_t* rs) argument
31 int rsclose(rs)
32 Rs_t* rs;
37 while (rsdisc(rs, NIL(Rsdisc_t*), RS_POP));
38 if ((rv = RSNOTIFY(rs,RS_CLOSE,0,0,rs->disc)) < 0)
41 if(rs->vm)
42 vmclose(rs->vm);
43 if(rs->methdata)
44 vmfree(Vmheap,rs
[all...]
H A Drsopen.c37 reg Rs_t* rs; local
39 if(rs = (Rs_t*)vmresize(Vmheap,NIL(Void_t*),sizeof(Rs_t),VM_RSZERO))
40 rsdisc(rs,disc,RS_DISC);
41 return rs;
45 int rsinit(reg Rs_t* rs, Rsmethod_t* meth, ssize_t c_max, int type, Rskey_t* key) argument
47 int rsinit(rs, meth, c_max, type, key)
48 Rs_t* rs; /* handle from rsnew() */
60 rs->vmdisc.memoryf = Vmdcheap->memoryf;
61 rs->vmdisc.exceptf = Vmdcheap->exceptf;
62 if(!(rs
104 reg Rs_t* rs; local
[all...]
H A Drsfile.c28 int rsfilewrite(Rs_t* rs, Sfio_t* sp, const char* path) argument
30 int rsfilewrite(rs, sp, path)
31 Rs_t* rs;
36 if ((rs->events & RS_FILE_WRITE) && rsnotify(rs, RS_FILE_WRITE, sp, (Void_t*)path, rs->disc) < 0)
46 int rsfileread(Rs_t* rs, Sfio_t* sp, const char* path) argument
48 int rsfileread(rs, sp, path)
49 Rs_t* rs;
54 if ((rs
64 rsfileclose(Rs_t* rs, Sfio_t* sp) argument
[all...]
H A Drstemp.c28 Sfio_t* rstempwrite(Rs_t* rs, Sfio_t* sp) argument
30 Sfio_t* rstempwrite(rs, sp)
31 Rs_t* rs;
55 if ((rs->events & RS_TEMP_WRITE) && rsnotify(rs, RS_TEMP_WRITE, sp, (Void_t*)0, rs->disc) < 0)
69 int rstempread(Rs_t* rs, Sfio_t* sp) argument
71 int rstempread(rs, sp)
72 Rs_t* rs;
80 if (rs
95 rstempclose(Rs_t* rs, Sfio_t* sp) argument
[all...]
H A Drsdisc.c29 Rsdisc_t* rsdisc(Rs_t* rs, Rsdisc_t* disc, int op) argument
31 Rsdisc_t* rsdisc(rs, disc, op)
32 Rs_t* rs;
45 old = rs->disc;
48 (*old->eventf)(rs,RS_DISC,(Void_t*)disc,(Void_t*)0,old) < 0)
51 rs->type &= ~(RS_DSAMELEN|RS_KSAMELEN);
52 rs->type |= disc->type&(RS_DSAMELEN|RS_KSAMELEN);
55 rs->type |= RS_KSAMELEN;
57 rs->disc = disc;
58 rs
[all...]
H A Drsmethod.c29 Rsmethod_t* rsmethod(Rs_t* rs, Rsmethod_t* meth) argument
31 Rsmethod_t* rsmethod(rs, meth)
32 Rs_t* rs;
36 reg Rsmethod_t* old = rs->meth;
42 if (RSNOTIFY(rs,RS_METHOD,meth,0,rs->disc) < 0)
50 if(rs->methdata)
51 vmfree(Vmheap,rs->methdata);
53 rs->meth = meth;
54 rs
[all...]
H A Drsprocess.c29 #define RSALLOC(rs,r) ((r = rs->free) ? ((rs->free = r->right),r) : (r = rsalloc(rs)) )
30 #define RSFREE(rs,r) (r->right = rs->free, rs->free = r)
33 static Rsobj_t* rsalloc(Rs_t* rs) argument
35 static Rsobj_t* rsalloc(rs)
36 Rs_t* rs;
53 rsprocess(Rs_t* rs, Void_t* argdata, ssize_t s_data) argument
[all...]
H A Drs-copy.c36 static int copyinsert(Rs_t* rs, reg Rsobj_t* obj) argument
38 static int copyinsert(rs, obj)
39 Rs_t* rs;
43 reg Copy_t* copy = (Copy_t*)rs->methdata;
54 static Rsobj_t* copylist(Rs_t* rs) argument
56 static Rsobj_t* copylist(rs)
57 Rs_t* rs;
60 reg Copy_t* copy = (Copy_t*)rs->methdata;
H A Drsnotify.c27 int rsnotify(Rs_t* rs, int op, Void_t* data, Void_t* arg, reg Rsdisc_t* disc) argument
29 int rsnotify(rs, op, data, arg, disc)
30 Rs_t* rs;
40 if (rs->events & op)
43 (r = (*disc->eventf)(rs, op, data, arg, disc)))
H A Drswrite.c28 #define NOTIFY(rs,r,rsrv,endrsrv,cur,out,n) \
36 if ((c = rsnotify(rs, RS_WRITE, r, &out, rs->disc)) < 0) \
44 RESERVE(rs,f,rsrv,endrsrv,cur,out.datalen); \
54 #define RESERVE(rs,f,rsrv,endrsrv,cur,w) \
67 #define WRITE(rs,to,fr,len,t) { \
73 int rswrite(Rs_t* rs, Sfio_t* f, int type) argument
75 int rswrite(rs, f, type)
76 Rs_t* rs; /* sorting context */
90 if(type == RS_OTEXT && (rs
[all...]
H A Drsmerge.c51 #define APPEND(rs,obj,t) \
52 { if((t = rs->sorted)) \
54 else { rs->sorted = t = (obj); } \
75 #define RSRESERVE(rs,rsrv,endrsrv,cur,w,action) \
79 { if(rsrv && sfwrite(rs->f,rsrv,cur-rsrv) != cur-rsrv) { action;} \
82 if(!(rsrv = (uchar*)sfreserve(rs->f,rw,SF_LOCKR)) ) \
83 { if((rw = sfvalue(rs->f)) < w) rw = w; \
84 if(!(rsrv = (uchar*)sfreserve(rs->f,rw,SF_LOCKR)) ) { action;} \
90 #define RSSYNC(rs) \
91 { if(rs
99 mgflush(reg Rs_t* rs) argument
127 mgrefresh(Rs_t* rs, Merge_t* mg) argument
365 mgclose(Rs_t* rs, Merge_t* mg) argument
390 mgopen(Rs_t* rs, Sfio_t* f, int pos) argument
465 mgcompare(Rs_t* rs, Rsobj_t* one, Rsobj_t* two, int reverse) argument
501 mginsert(Rs_t* rs, Merge_t** list, int n, Merge_t* mg) argument
559 mgmove(reg Rs_t* rs, reg Merge_t* mg, ssize_t n) argument
837 mgwrite(reg Rs_t* rs, reg Merge_t* mg, reg int n) argument
895 mgerror(Rs_t* rs, Merge_t** list, int n) argument
921 rsmerge(Rs_t* rs, Sfio_t* f, Sfio_t** files, int n, int type) argument
[all...]
H A DMakefile12 rs-radix.c rs-rasp.c rs-splay.c rs-verify.c rs-copy.c \
H A Drs-verify.c35 static int verifyinsert(Rs_t* rs, reg Rsobj_t* obj) argument
37 static int verifyinsert(rs, obj)
38 Rs_t* rs;
46 reg Rsverify_t* verify = (Rsverify_t*)rs->methdata;
54 if(cmp == 0 && (rs->type&RS_DATA) ) /* compare by obj->data */
70 if(rs->type&RS_REVERSE)
74 if((cmp == 0 && (rs->type&RS_UNIQ)) || cmp < 0 )
75 { if(!(rs->disc->events & RS_VERIFY))
81 else if(rs->type&RS_REVERSE)
88 n = RSNOTIFY(rs,RS_VERIF
130 verifylist(Rs_t* rs) argument
[all...]
H A Drslist.c206 Rsobj_t* rslist(Rs_t* rs) argument
208 Rsobj_t* rslist(rs)
209 Rs_t* rs;
216 if((type = rs->type)&RS_SORTED)
217 return rs->sorted;
219 if((list = (*rs->meth->listf)(rs)) && rs->n_list > 0)
220 { rs->list = (Rsobj_t**)vmresize(rs
[all...]
H A Drslib.c32 rslib(Rs_t* rs, Rskey_t* kp, const char* lib, int flags) argument
34 rslib(rs, kp, lib, flags)
35 Rs_t* rs;
76 rs->events |= disc->events;
H A Drs-splay.c33 static int splayinsert(Rs_t* rs, reg Rsobj_t* obj) argument
35 static int splayinsert(rs, obj)
36 Rs_t* rs;
43 reg Rssplay_t* splay = (Rssplay_t*)rs->methdata;
181 static Rsobj_t* splaylist(Rs_t* rs) argument
183 static Rsobj_t* splaylist(rs)
184 Rs_t* rs;
188 reg Rssplay_t* splay = (Rssplay_t*)rs->methdata;
H A Drs-radix.c37 static int radixinsert(Rs_t* rs, reg Rsobj_t* obj) argument
39 static int radixinsert(rs, obj)
40 Rs_t* rs;
45 reg Rsradix_t* radix = (Rsradix_t*)rs->methdata;
56 static Rsobj_t* radixlist(Rs_t* rs) argument
58 static Rsobj_t* radixlist(rs)
59 Rs_t* rs;
67 reg Rsradix_t* radix = (Rsradix_t*)rs->methdata;
78 if(rs->type&RS_KSAMELEN)
H A Drshdr.h101 #define SETLOCAL(rs) (rs->type |= RS_LOCAL)
102 #define GETLOCAL(rs,l) ((l = (rs->type&RS_LOCAL)), (rs->type &= ~RS_LOCAL), l)
103 #define RSWRITE(rs,f,t) (SETLOCAL(rs), rswrite(rs,f,t))
H A Drs-rasp.c56 static int raspinsert(Rs_t* rs, reg Rsobj_t* obj) argument
58 static int raspinsert(rs, obj)
59 Rs_t* rs;
69 reg Rsrasp_t* rasp = (Rsrasp_t*)rs->methdata;
396 static Rsobj_t* rasplist(Rs_t* rs) argument
398 static Rsobj_t* rasplist(rs)
399 Rs_t* rs;
404 reg Rsrasp_t* rasp = (Rsrasp_t*)rs->methdata;
H A Drecsort.h201 #define rscount(rs) ((rs)->count) /* count # of rsprocess() objs */
/ast/src/cmd/tests/aso/
H A Dtaso.c25 unsigned short vs, rs; local
51 if ((rs = asocasshort(&vs, 1, 2)) != 1)
52 terror("asocasshort return value failed -- expected %d, got %d", 1, rs);
55 else if ((rs = asocasshort(&vs, 1, 3)) != 2)
56 terror("asocasshort return value failed -- expected %d, got %d", 2, rs);
59 if ((rs = asoincshort(&vs)) != 2)
60 terror("asoincshort return failed -- expected %d, got %d", 2, rs);
63 if ((rs = asodecshort(&vs)) != 3)
64 terror("asodecshort return failed -- expected %d, got %d", 3, rs);
/ast/src/lib/libpz/
H A Dpzread.c125 if (!pz->rs.hi)
127 if (pz->rs.lo)
153 pz->rs.lo = 1;
204 pz->rs.hi = k;
205 PZGETZ(pz, pz->io, pz->rs.lo, i);
209 while (pz->rs.lo > 0)
211 pz->rs.lo--;
213 for (i = 0; i < pz->rs.hi; i++)
236 PZGETZ(pz, pz->io, pz->rs.lo, i);
238 pz->rs
[all...]
/ast/src/cmd/dsslib/sort/
H A Dsort.c73 key(Rs_t* rs, unsigned char* data, size_t datasize, unsigned char* key, size_t keysize, Rsdisc_t* disc) argument
93 rev(Rs_t* rs, unsigned char* data, size_t datasize, unsigned char* key, size_t keysize, Rsdisc_t* disc) argument
101 count(Rs_t* rs, int op, void* data, void* arg, Rsdisc_t* disc) argument
/ast/src/lib/libast/sfio/
H A Dsfmode.c176 Sfrsrv_t *rsrv, *rs; local
181 { if(!(rs = (Sfrsrv_t*)malloc(size+sizeof(Sfrsrv_t))))
186 memcpy(rs,rsrv,sizeof(Sfrsrv_t)+rsrv->slen);
189 f->rsrv = rsrv = rs;

Completed in 41 milliseconds

12