History

20080116-1359

Charles.Forsyth committed 18 years ago

Commit d0bd08a1 parent ff72aa73 files · +27 −0Browse files

Unified · Split

3 files
  1. CHANGES +1 −0
  2. emu/port/fns.h +3 −0
  3. emu/port/qio.c +23 −0
CHANGES+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3 set but not used changes from Acme-sac3 set but not used changes from Acme-sac
4 mdb(1) changes from Acme-sac4 mdb(1) changes from Acme-sac
5 ftpfs uses new dial(2)5 ftpfs uses new dial(2)
6 add qbypass to emu/port/qio.c
620080115720080115
7 add blowfish to keyring (not yet documented)8 add blowfish to keyring (not yet documented)
8 add explicit public and private key types to keyring (in development: not yet documented)9 add explicit public and private key types to keyring (in development: not yet documented)
emu/port/fns.h+3−0
@@ -22,6 +22,7 @@ char* clipread(void); · 21 unmodified lines
22int clipwrite(char*);22int clipwrite(char*);
23void copen(Chan*);23void copen(Chan*);
24void cmderror(Cmdbuf*, char*);24void cmderror(Cmdbuf*, char*);
25Block* concatblock(Block*);
25int cread(Chan*, uchar*, int, vlong);26int cread(Chan*, uchar*, int, vlong);
26void cwrite(Chan*, uchar*, int, vlong);27void cwrite(Chan*, uchar*, int, vlong);
27Chan* cunique(Chan*);28Chan* cunique(Chan*);
@@ -145,6 +146,7 @@ Block* pullupqueue(Queue*, int); · 117 unmodified lines
145void qaddlist(Queue*, Block*);146void qaddlist(Queue*, Block*);
146Block* qbread(Queue*, int);147Block* qbread(Queue*, int);
147long qbwrite(Queue*, Block*);148long qbwrite(Queue*, Block*);
149Queue* qbypass(void (*)(void*, Block*), void*);
148int qcanread(Queue*);150int qcanread(Queue*);
149void qclose(Queue*);151void qclose(Queue*);
150int qisclosed(Queue*);152int qisclosed(Queue*);
@@ -185,6 +187,7 @@ void setpointer(int, int); · 34 unmodified lines
185char* skipslash(char*);187char* skipslash(char*);
186void srvrtinit(void);188void srvrtinit(void);
187void swiproc(Proc*, int);189void swiproc(Proc*, int);
190Block* trimblock(Block*, int, int);
188long unionread(Chan*, void*, long);191long unionread(Chan*, void*, long);
189void unlock(Lock*);192void unlock(Lock*);
190Uqid* uqidalloc(Uqidtab*, Chan*);193Uqid* uqidalloc(Uqidtab*, Chan*);
emu/port/qio.c+23−0
@@ -24,6 +24,7 @@ struct Queue · 23 unmodified lines
24 int eof; /* number of eofs read by user */24 int eof; /* number of eofs read by user */
25 25
26 void (*kick)(void*); /* restart output */26 void (*kick)(void*); /* restart output */
27 void (*bypass)(void*, Block*); /* bypass queue altogether */
27 void* arg; /* argument to kick */28 void* arg; /* argument to kick */
28 29
29 QLock rlock; /* mutex for reading processes */30 QLock rlock; /* mutex for reading processes */
@@ -846,6 +847,24 @@ qopen(int limit, int msg, void (*kick)(void*), void *arg) · 816 unmodified lines
846 return q;847 return q;
847}848}
848 849
850/* open a queue to be bypassed */
851Queue*
852qbypass(void (*bypass)(void*, Block*), void *arg)
853{
854 Queue *q;
855
856 q = malloc(sizeof(Queue));
857 if(q == 0)
858 return 0;
859
860 q->limit = 0;
861 q->arg = arg;
862 q->bypass = bypass;
863 q->state = 0;
864
865 return q;
866}
867
849static int868static int
850notempty(void *a)869notempty(void *a)
851{870{
@@ -1179,6 +1198,10 @@ qbwrite(Queue *q, Block *b) · 327 unmodified lines
1179 1198
1180 dowakeup = 0;1199 dowakeup = 0;
1181 n = BLEN(b);1200 n = BLEN(b);
1201 if(q->bypass){
1202 (*q->bypass)(q->arg, b);
1203 return n;
1204 }
1182 cb.b = b;1205 cb.b = b;
1183 1206
1184 qlock(&q->wlock);1207 qlock(&q->wlock);