[inferno-npe] 7 new revisions pushed by extrudedaluminiu on 2010-03-19 20:49 GMT

0 views
Skip to first unread message

infer...@googlecode.com

unread,
Mar 19, 2010, 4:49:48 PM3/19/10
to inferno-n...@googlegroups.com
7 new revisions:

Revision: acba20bd26
Author: for...@vitanuova.com
Date: Fri Feb 26 03:31:21 2010
Log: 20100226-1131
http://code.google.com/p/inferno-npe/source/detail?r=acba20bd26

Revision: 82fdb96c8b
Author: for...@vitanuova.com
Date: Fri Mar 5 03:39:25 2010
Log: 20100305-1137
http://code.google.com/p/inferno-npe/source/detail?r=82fdb96c8b

Revision: af9b54f953
Author: for...@vitanuova.com
Date: Sun Mar 7 02:25:19 2010
Log: 20100307-1025
http://code.google.com/p/inferno-npe/source/detail?r=af9b54f953

Revision: ea14765153
Author: for...@vitanuova.com
Date: Sun Mar 7 02:33:50 2010
Log: 20100307-1033
http://code.google.com/p/inferno-npe/source/detail?r=ea14765153

Revision: 6820997c7c
Author: for...@vitanuova.com
Date: Wed Mar 10 08:12:19 2010
Log: 20100310-1612
http://code.google.com/p/inferno-npe/source/detail?r=6820997c7c

Revision: d07fcec557
Author: for...@vitanuova.com
Date: Sat Mar 13 07:04:35 2010
Log: 20100313-1504
http://code.google.com/p/inferno-npe/source/detail?r=d07fcec557

Revision: a78c6fd88f
Author: Venkatesh Srinivas <m...@acm.jhu.edu>
Date: Wed Mar 17 18:01:58 2010
Log: Merge with inferno-os 20100310.
http://code.google.com/p/inferno-npe/source/detail?r=a78c6fd88f

==============================================================================
Revision: acba20bd26
Author: for...@vitanuova.com
Date: Fri Feb 26 03:31:21 2010
Log: 20100226-1131
http://code.google.com/p/inferno-npe/source/detail?r=acba20bd26

Added:
/doc/fonts.bem
Modified:
/CHANGES
/include/version.h
/man/4/keyfs

=======================================
--- /dev/null
+++ /doc/fonts.bem Fri Feb 26 03:31:21 2010
@@ -0,0 +1,7 @@
+# FONTS=''
+FONTS='.fp 1 R BemboBookMTStd-Regular
+.fp 2 I BemboBookMTStd-Italic
+.fp 3 B BemboBookMTStd-Bold
+.fp 4 BI BemboBookMTStd-BoldIt
+....fp 5 L LucidaCW
+'
=======================================
--- /CHANGES Sun Feb 21 04:11:43 2010
+++ /CHANGES Fri Feb 26 03:31:21 2010
@@ -1,3 +1,5 @@
+20100226
+ mention -n nvram option in keyfs(4)
20100220
appl/cmd/keyfs.b wasn't clunking fids on error in remove [issue 225]
20100213
=======================================
--- /include/version.h Sun Feb 21 04:11:43 2010
+++ /include/version.h Fri Feb 26 03:31:21 2010
@@ -1,1 +1,1 @@
-#define VERSION "Fourth Edition (20100221)"
+#define VERSION "Fourth Edition (20100226)"
=======================================
--- /man/4/keyfs Sun Jun 3 12:18:23 2007
+++ /man/4/keyfs Fri Feb 26 03:31:21 2010
@@ -7,7 +7,9 @@
.B -D
]
[
-.B -m mountpoint
+.BI -m " mountpoint"
+] [
+.BI -n " nvram"
] [
.I keyfile
]
@@ -105,6 +107,14 @@
.IR keyfile .
.PD
.PP
+If the
+.B -n
+option is given, instead of prompting for the master key,
+.I keyfs
+will read it from the file
+.IR nvram .
+Obviously that file should be well-protected from ordinary observers.
+.PP
The
.B -D
option enables tracing of the file service protocol, for debugging.

==============================================================================
Revision: 82fdb96c8b
Author: for...@vitanuova.com
Date: Fri Mar 5 03:39:25 2010
Log: 20100305-1137
http://code.google.com/p/inferno-npe/source/detail?r=82fdb96c8b

Added:
/emu/Linux/audio-oss.c
Modified:
/CHANGES
/emu/Linux/emu
/include/version.h
/man/1/sh-csv

=======================================
--- /dev/null
+++ /emu/Linux/audio-oss.c Fri Mar 5 03:39:25 2010
@@ -0,0 +1,441 @@
+#include "dat.h"
+#include "fns.h"
+#include "error.h"
+#include "audio.h"
+#include <sys/ioctl.h>
+#include <sys/soundcard.h>
+
+#define Audio_Mic_Val SOUND_MIXER_MIC
+#define Audio_Linein_Val SOUND_MIXER_LINE
+
+#define Audio_Speaker_Val SOUND_MIXER_PCM // SOUND_MIXER_VOLUME
+#define Audio_Headphone_Val SOUND_MIXER_ALTPCM
+#define Audio_Lineout_Val SOUND_MIXER_CD
+
+#define Audio_Pcm_Val AFMT_S16_LE
+#define Audio_Ulaw_Val AFMT_MU_LAW
+#define Audio_Alaw_Val AFMT_A_LAW
+
+#include "audio-tbls.c"
+#define min(a,b) ((a) < (b) ? (a) : (b))
+
+#define DEVAUDIO "/dev/dsp"
+#define DEVMIXER "/dev/mixer"
+
+#define DPRINT if(1)print
+
+enum {
+ A_Pause,
+ A_UnPause,
+ A_In,
+ A_Out,
+};
+
+static struct {
+ int data; /* dsp data fd */
+ int ctl; /* mixer fd */
+ int pause;
+ QLock lk;
+} afd = {.data = -1, .ctl = -1, .pause =A_UnPause };
+
+static Audio_t av;
+static QLock inlock;
+static QLock outlock;
+
+static int audio_open(int);
+static int audio_pause(int, int);
+static int audio_set_info(int, Audio_d*, int);
+
+Audio_t*
+getaudiodev(void)
+{
+ return &av;
+}
+
+void
+audio_file_init(void)
+{
+ audio_info_init(&av);
+}
+
+void
+audio_file_open(Chan *c, int omode)
+{
+ USED(c);
+ DPRINT("audio_file_open %d %d %x\n", afd.data, afd.ctl, omode);
+ qlock(&afd.lk);
+ if(waserror()){
+ qunlock(&afd.lk);
+ nexterror();
+ }
+ if(afd.data >= 0)
+ error(Einuse);
+ if(afd.ctl < 0){
+ afd.ctl = open(DEVMIXER, ORDWR);
+ if(afd.ctl < 0)
+ oserror();
+ }
+ afd.data = audio_open(omode);
+ if(afd.data < 0)
+ oserror();
+ poperror();
+ qunlock(&afd.lk);
+}
+
+void
+audio_file_close(Chan *c)
+{
+ USED(c);
+ DPRINT("audio_file_close %d %d\n", afd.data, afd.ctl);
+ qlock(&afd.lk);
+ if(waserror()){
+ qunlock(&afd.lk);
+ nexterror();
+ }
+ close(afd.data);
+ afd.data = -1;
+ qunlock(&afd.lk);
+ poperror();
+}
+
+long
+audio_file_read(Chan *c, void *va, long count, vlong offset)
+{
+ long ba, status, chunk, total;
+
+ USED(c);
+ USED(offset);
+ DPRINT("audio_file_read %d %d\n", afd.data, afd.ctl);
+ qlock(&inlock);
+ if(waserror()){
+ qunlock(&inlock);
+ nexterror();
+ }
+
+ if(afd.data < 0)
+ error(Eperm);
+
+ /* check block alignment */
+ ba = av.in.bits * av.in.chan / Bits_Per_Byte;
+
+ if(count % ba)
+ error(Ebadarg);
+
+ if(!audio_pause(afd.data, A_UnPause))
+ error(Eio);
+
+ total = 0;
+ while(total < count){
+ chunk = count - total;
+ status = read (afd.data, va + total, chunk);
+ if(status < 0)
+ error(Eio);
+ total += status;
+ }
+
+ if(total != count)
+ error(Eio);
+
+ poperror();
+ qunlock(&inlock);
+
+ return count;
+}
+
+long
+audio_file_write(Chan *c, void *va, long count, vlong offset)
+{
+ long status = -1;
+ long ba, total, chunk, bufsz;
+
+ USED(c);
+ USED(offset);
+ DPRINT("audio_file_write %d %d\n", afd.data, afd.ctl);
+ qlock(&outlock);
+ if(waserror()){
+ qunlock(&outlock);
+ nexterror();
+ }
+
+ if(afd.data < 0)
+ error(Eperm);
+
+ /* check block alignment */
+ ba = av.out.bits * av.out.chan / Bits_Per_Byte;
+
+ if(count % ba)
+ error(Ebadarg);
+
+ total = 0;
+ bufsz = av.out.buf * Audio_Max_Buf / Audio_Max_Val;
+
+ if(bufsz == 0)
+ error(Ebadarg);
+
+ while(total < count){
+ chunk = min(bufsz, count - total);
+ status = write(afd.data, va, chunk);
+ if(status <= 0)
+ error(Eio);
+ total += status;
+ }
+
+ poperror();
+ qunlock(&outlock);
+
+ return count;
+}
+
+long
+audio_ctl_write(Chan *c, void *va, long count, vlong offset)
+{
+ Audio_t tmpav = av;
+ int tfd;
+
+ USED(c);
+ USED(offset);
+ tmpav.in.flags = 0;
+ tmpav.out.flags = 0;
+
+ DPRINT ("audio_ctl_write %X %X\n", afd.data, afd.ctl);
+ if(!audioparse(va, count, &tmpav))
+ error(Ebadarg);
+
+ if(!canqlock(&inlock))
+ error("device busy");
+ if(waserror()){
+ qunlock(&inlock);
+ nexterror();
+ }
+ if(!canqlock(&outlock))
+ error("device busy");
+ if(waserror()){
+ qunlock(&outlock);
+ nexterror();
+ }
+
+ /* DEVAUDIO needs to be open to issue an ioctl */
+ tfd = afd.data;
+ if(tfd < 0){
+ tfd = open(DEVAUDIO, O_RDONLY|O_NONBLOCK);
+ if(tfd < 0)
+ oserror();
+ }
+ if(waserror()){
+ if(tfd != afd.data)
+ close(tfd);
+ nexterror();
+ }
+
+ if(tmpav.in.flags & AUDIO_MOD_FLAG){
+ if(!audio_pause(tfd, A_Pause))
+ error(Ebadarg);
+ if(!audio_set_info(tfd, &tmpav.in, A_In))
+ error(Ebadarg);
+ }
+
+ poperror();
+ if(tfd != afd.data)
+ close(tfd);
+
+ tmpav.in.flags = 0;
+ av = tmpav;
+
+ poperror();
+ qunlock(&outlock);
+ poperror();
+ qunlock(&inlock);
+ return count;
+}
+
+/* Linux/OSS specific stuff */
+
+static int
+choosefmt(Audio_d *i)
+{
+ switch(i->bits){
+ case 8:
+ switch(i->enc){
+ case Audio_Alaw_Val:
+ return AFMT_A_LAW;
+ case Audio_Ulaw_Val:
+ return AFMT_MU_LAW;
+ case Audio_Pcm_Val:
+ return AFMT_U8;
+ }
+ break;
+ case 16:
+ if(i->enc == Audio_Pcm_Val)
+ return AFMT_S16_LE;
+ break;
+ }
+ return -1;
+}
+
+static int
+setvolume(int fd, int what, int left, int right)
+{
+ int can, v;
+
+ if(ioctl(fd, SOUND_MIXER_READ_DEVMASK, &can) < 0)
+ can = ~0;
+
+ DPRINT("setvolume fd%d %X can mix 0x%X (mask %X)\n", fd, what, (can &
(1<<what)), can);
+ if(!(can & (1<<what)))
+ return 0;
+ v = left | (right<<8);
+ if(ioctl(afd.ctl, MIXER_WRITE(what), &v) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+audio_set_info(int fd, Audio_d *i, int d)
+{
+ int status, arg;
+ int oldfmt, newfmt;
+
+ USED(d);
+ DPRINT("audio_set_info (%d) %d %d\n", fd, afd.data, afd.ctl);
+ if(fd < 0)
+ return 0;
+
+ /* sample rate */
+ if(i->flags & AUDIO_RATE_FLAG){
+ arg = i->rate;
+ if(ioctl(fd, SNDCTL_DSP_SPEED, &arg) < 0)
+ return 0;
+ }
+
+ /* channels */
+ if(i->flags & AUDIO_CHAN_FLAG){
+ arg = i->chan;
+ if(ioctl(fd, SNDCTL_DSP_CHANNELS, &arg) < 0)
+ return 0;
+ }
+
+ /* precision */
+ if(i->flags & AUDIO_BITS_FLAG){
+ arg = i->bits;
+ if(ioctl(fd, SNDCTL_DSP_SAMPLESIZE, &arg) < 0)
+ return 0;
+ }
+
+ /* encoding */
+ if(i->flags & AUDIO_ENC_FLAG){
+ ioctl(fd, SNDCTL_DSP_GETFMTS, &oldfmt);
+
+ newfmt = choosefmt(i);
+ if(newfmt < 0)
+ return 0;
+ if(newfmt != oldfmt){
+ status = ioctl(fd, SNDCTL_DSP_SETFMT, &arg);
+ DPRINT ("enc oldfmt newfmt %x status %d\n", oldfmt, newfmt, status);
+ }
+ }
+
+ /* dev volume */
+ if(i->flags & (AUDIO_LEFT_FLAG|AUDIO_VOL_FLAG))
+ return setvolume(afd.ctl, i->dev, i->left, i->right);
+
+ return 1;
+}
+
+static int
+audio_set_blocking(int fd)
+{
+ int val;
+
+ if((val = fcntl(fd, F_GETFL, 0)) == -1)
+ return 0;
+
+ val &= ~O_NONBLOCK;
+
+ if(fcntl(fd, F_SETFL, val) < 0)
+ return 0;
+
+ return 1;
+}
+
+static int
+audio_open(int omode)
+{
+ int fd;
+
+ /* open non-blocking in case someone already has it open */
+ /* otherwise we would block until they close! */
+ switch (omode){
+ case OREAD:
+ fd = open(DEVAUDIO, O_RDONLY|O_NONBLOCK);
+ break;
+ case OWRITE:
+ fd = open(DEVAUDIO, O_WRONLY|O_NONBLOCK);
+ break;
+ case ORDWR:
+ fd = open(DEVAUDIO, O_RDWR|O_NONBLOCK);
+ break;
+ }
+
+ DPRINT("audio_open %d\n", fd);
+ if(fd < 0)
+ oserror();
+
+ /* change device to be blocking */
+ if(!audio_set_blocking(fd)){
+ close(fd);
+ error("cannot set blocking mode");
+ }
+
+ if(!audio_pause(fd, A_Pause)){
+ close(fd);
+ error(Eio);
+ }
+
+ /* set audio info */
+ av.in.flags = ~0;
+ av.out.flags = ~0;
+
+ if(!audio_set_info(fd, &av.in, A_In)){
+ close(fd);
+ error(Ebadarg);
+ }
+
+ av.in.flags = 0;
+
+ /* tada, we're open, blocking, paused and flushed */
+ return fd;
+}
+
+static int
+dspsync(int fd)
+{
+ return ioctl(fd, SNDCTL_DSP_RESET, NULL) >= 0 &&
+ ioctl(fd, SNDCTL_DSP_SYNC, NULL) >= 0;
+}
+
+static int
+audio_pause(int fd, int f)
+{
+ int status;
+
+// DPRINT ("audio_pause (%d) %d %d\n", fd, afd.data, afd.ctl);
+ if(fd < 0)
+ return 0;
+ if(fd != afd.data)
+ return dspsync(fd);
+ qlock(&afd.lk);
+ if(afd.pause == f){
+ qunlock(&afd.lk);
+ return 1;
+ }
+ if(waserror()){
+ qunlock(&afd.lk);
+ nexterror();
+ }
+ status = dspsync(afd.data);
+ if(status)
+ afd.pause = f;
+ poperror();
+ qunlock(&afd.lk);
+ return status;
+}
=======================================
--- /CHANGES Fri Feb 26 03:31:21 2010
+++ /CHANGES Fri Mar 5 03:39:25 2010
@@ -1,3 +1,5 @@
+20100305
+ add emu/Linux/audio-oss.c from saoret.one [issue 226]
20100226
mention -n nvram option in keyfs(4)
20100220
=======================================
--- /emu/Linux/emu Tue Jul 28 03:28:49 2009
+++ /emu/Linux/emu Fri Mar 5 03:39:25 2010
@@ -20,7 +20,7 @@

ip ipif-posix ipaux
eia
-# audio audio
+# audio audio-oss
mem

lib
@@ -93,14 +93,8 @@
/chan /
/nvfs /
/env /
-# /chan
-# /dev
# /dis
-# /env
# /n
-# /net
-# /nvfs /
-# /prog
# /icons
# /osinit.dis
# /dis/emuinit.dis
=======================================
--- /include/version.h Fri Feb 26 03:31:21 2010
+++ /include/version.h Fri Mar 5 03:39:25 2010
@@ -1,1 +1,1 @@
-#define VERSION "Fourth Edition (20100226)"
+#define VERSION "Fourth Edition (20100305)"
=======================================
--- /man/1/sh-csv Fri Dec 22 12:52:35 2006
+++ /man/1/sh-csv Fri Mar 5 03:39:25 2010
@@ -63,4 +63,4 @@
.B csv
treats an empty line as containing a single,
empty element; there is thus no way of
-representing an line containing no elements at all.
+representing a line containing no elements at all.

==============================================================================
Revision: af9b54f953
Author: for...@vitanuova.com
Date: Sun Mar 7 02:25:19 2010
Log: 20100307-1025
http://code.google.com/p/inferno-npe/source/detail?r=af9b54f953

Modified:
/include/version.h
/libsec/port/probably_prime.c

=======================================
--- /include/version.h Fri Mar 5 03:39:25 2010
+++ /include/version.h Sun Mar 7 02:25:19 2010
@@ -1,1 +1,1 @@
-#define VERSION "Fourth Edition (20100305)"
+#define VERSION "Fourth Edition (20100307)"
=======================================
--- /libsec/port/probably_prime.c Fri Dec 22 09:07:39 2006
+++ /libsec/port/probably_prime.c Sun Mar 7 02:25:19 2010
@@ -9,7 +9,7 @@
int
probably_prime(mpint *n, int nrep)
{
- int j, k, rep, nbits, isprime = 1;
+ int j, k, rep, nbits, isprime;
mpint *nm1, *q, *x, *y, *r;

if(n->sign < 0)
@@ -19,18 +19,18 @@
nrep = 18;

k = mptoi(n);
- if(k == 2) // 2 is prime
+ if(k == 2) /* 2 is prime */
return 1;
- if(k < 2) // 1 is not prime
+ if(k < 2) /* 1 is not prime */
return 0;
- if((n->p[0] & 1) == 0) // even is not prime
+ if((n->p[0] & 1) == 0) /* even is not prime */
return 0;

- // test against small prime numbers
+ /* test against small prime numbers */
if(smallprimetest(n) < 0)
return 0;

- // fermat test, 2^n mod n == 2 if p is prime
+ /* fermat test, 2^n mod n == 2 if p is prime */
x = uitomp(2, nil);
y = mpnew(0);
mpexp(x, n, n, y);
@@ -43,38 +43,43 @@

nbits = mpsignif(n);
nm1 = mpnew(nbits);
- mpsub(n, mpone, nm1); // nm1 = n - 1 */
+ mpsub(n, mpone, nm1); /* nm1 = n - 1 */
k = mplowbits0(nm1);
q = mpnew(0);
- mpright(nm1, k, q); // q = (n-1)/2**k
+ mpright(nm1, k, q); /* q = (n-1)/2**k */

for(rep = 0; rep < nrep; rep++){
-
- // x = random in [2, n-2]
- r = mprand(nbits, prng, nil);
- mpmod(r, nm1, x);
- mpfree(r);
- if(mpcmp(x, mpone) <= 0)
- continue;
-
- // y = x**q mod n
+ for(;;){
+ /* find x = random in [2, n-2] */
+ r = mprand(nbits, prng, nil);
+ mpmod(r, nm1, x);
+ mpfree(r);
+ if(mpcmp(x, mpone) > 0)
+ break;
+ }
+
+ /* y = x**q mod n */
mpexp(x, q, n, y);

if(mpcmp(y, mpone) == 0 || mpcmp(y, nm1) == 0)
- goto done;
-
- for(j = 1; j < k; j++){
- mpmul(y, y, x);
- mpmod(x, n, y); // y = y*y mod n
- if(mpcmp(y, nm1) == 0)
- goto done;
- if(mpcmp(y, mpone) == 0){
- isprime = 0;
- goto done;
- }
- }
- isprime = 0;
- }
+ continue;
+
+ for(j = 1;; j++){
+ if(j >= k) {
+ isprime = 0;
+ goto done;
+ }
+ mpmul(y, y, x);
+ mpmod(x, n, y); /* y = y*y mod n */
+ if(mpcmp(y, nm1) == 0)
+ break;
+ if(mpcmp(y, mpone) == 0){
+ isprime = 0;
+ goto done;
+ }
+ }
+ }
+ isprime = 1;
done:
mpfree(y);
mpfree(x);

==============================================================================
Revision: ea14765153
Author: for...@vitanuova.com
Date: Sun Mar 7 02:33:50 2010
Log: 20100307-1033
http://code.google.com/p/inferno-npe/source/detail?r=ea14765153

Modified:
/libsec/port/probably_prime.c

=======================================
--- /libsec/port/probably_prime.c Sun Mar 7 02:25:19 2010
+++ /libsec/port/probably_prime.c Sun Mar 7 02:33:50 2010
@@ -2,10 +2,10 @@
#include <mp.h>
#include <libsec.h>

-// Miller-Rabin probabilistic primality testing
-// Knuth (1981) Seminumerical Algorithms, p.379
-// Menezes et al () Handbook, p.39
-// 0 if composite; 1 if almost surely prime, Pr(err)<1/4**nrep
+/* Miller-Rabin probabilistic primality testing */
+/* Knuth (1981) Seminumerical Algorithms, p.379 */
+/* Menezes et al () Handbook, p.39 */
+/* 0 if composite; 1 if almost surely prime, Pr(err)<1/4**nrep */
int
probably_prime(mpint *n, int nrep)
{
@@ -19,11 +19,11 @@
nrep = 18;

k = mptoi(n);
- if(k == 2) /* 2 is prime */
+ if(k == 2) /* 2 is prime */
return 1;
- if(k < 2) /* 1 is not prime */
+ if(k < 2) /* 1 is not prime */
return 0;
- if((n->p[0] & 1) == 0) /* even is not prime */
+ if((n->p[0] & 1) == 0) /* even is not prime */
return 0;

/* test against small prime numbers */
@@ -43,10 +43,10 @@

nbits = mpsignif(n);
nm1 = mpnew(nbits);
- mpsub(n, mpone, nm1); /* nm1 = n - 1 */
+ mpsub(n, mpone, nm1); /* nm1 = n - 1 */
k = mplowbits0(nm1);
q = mpnew(0);
- mpright(nm1, k, q); /* q = (n-1)/2**k */
+ mpright(nm1, k, q); /* q = (n-1)/2**k */

for(rep = 0; rep < nrep; rep++){
for(;;){
@@ -62,21 +62,21 @@
mpexp(x, q, n, y);

if(mpcmp(y, mpone) == 0 || mpcmp(y, nm1) == 0)
- continue;
+ continue;

for(j = 1;; j++){
- if(j >= k) {
- isprime = 0;
- goto done;
- }
- mpmul(y, y, x);
- mpmod(x, n, y); /* y = y*y mod n */
- if(mpcmp(y, nm1) == 0)
- break;
- if(mpcmp(y, mpone) == 0){
- isprime = 0;
- goto done;
- }
+ if(j >= k) {
+ isprime = 0;
+ goto done;
+ }
+ mpmul(y, y, x);
+ mpmod(x, n, y); /* y = y*y mod n */
+ if(mpcmp(y, nm1) == 0)
+ break;
+ if(mpcmp(y, mpone) == 0){
+ isprime = 0;
+ goto done;
+ }
}
}
isprime = 1;

==============================================================================
Revision: 6820997c7c
Author: for...@vitanuova.com
Date: Wed Mar 10 08:12:19 2010
Log: 20100310-1612
http://code.google.com/p/inferno-npe/source/detail?r=6820997c7c

Modified:
/CHANGES
/appl/lib/tabs.b
/dis/lib/tabs.dis
/include/tk.h
/include/version.h
/man/9/bind
/man/9/variable

=======================================
--- /CHANGES Fri Mar 5 03:39:25 2010
+++ /CHANGES Wed Mar 10 08:12:19 2010
@@ -1,3 +1,5 @@
+20100310
+ stop tabs(2) from issuing pointless tk cmd that produces diagnostics
20100305
add emu/Linux/audio-oss.c from saoret.one [issue 226]
20100226
=======================================
--- /appl/lib/tabs.b Tue Jan 22 13:54:45 2008
+++ /appl/lib/tabs.b Wed Mar 10 08:12:19 2010
@@ -138,23 +138,23 @@
(lab, widg) = tabs[id];
tag := "tag" + string id;
cmd(t, dot+" lower sel" + string id);
- pos := cmd(t, dot+" coords " + tag);
- if(len pos >= 1 && pos[0] != '!'){
- (p, nil) := parsept(pos);
- cmd(t, dot+" coords "+tag+" "+string(p.x+1)+
- " "+string(p.y+1));
- }
+# pos := cmd(t, dot+" coords " + tag);
+# if(len pos >= 1 && pos[0] != '!'){
+# (p, nil) := parsept(pos);
+# cmd(t, dot+" coords "+tag+" "+string(p.x+1)+
+# " "+string(p.y+1));
+# }
if(id > 0)
cmd(t, dot+" lower "+ tag + " tag"+string (id - 1));
cmd(t, dot+" delete win" + string id);
}
id = nid;
(lab, widg) = tabs[id];
- pos := tk->cmd(t, dot+" coords tag" + string id);
- if(len pos >= 1 && pos[0] != '!'){
- (p, nil) := parsept(pos);
- cmd(t, dot+" coords tag"+string id+" "+string(p.x-1)+" "+string(p.y-1));
- }
+# pos := tk->cmd(t, dot+" coords tag" + string id);
+# if(len pos >= 1 && pos[0] != '!'){
+# (p, nil) := parsept(pos);
+# cmd(t, dot+" coords tag"+string id+" "+string(p.x-1)+" "+string(p.y-1));
+# }
cmd(t, dot+" raise tag"+string id);
cmd(t, dot+" raise sel"+string id);
cmd(t, dot+" create window "+string TABSBord+" "+
=======================================
--- /dis/lib/tabs.dis Tue Jan 22 13:54:45 2008
+++ /dis/lib/tabs.dis Wed Mar 10 08:12:19 2010
Binary file, no diff available.
=======================================
--- /include/tk.h Fri Dec 22 09:07:39 2006
+++ /include/tk.h Wed Mar 10 08:12:19 2010
@@ -216,7 +216,7 @@

struct TkPanelimage
{
- void* image; /* really Draw_Image */
+ void* image; /* Image paired with Draw_Image: see lookupimage in
libinterp/draw.c */
int ref;
TkPanelimage* link;
};
=======================================
--- /include/version.h Sun Mar 7 02:25:19 2010
+++ /include/version.h Wed Mar 10 08:12:19 2010
@@ -1,1 +1,1 @@
-#define VERSION "Fourth Edition (20100307)"
+#define VERSION "Fourth Edition (20100310)"
=======================================
--- /man/9/bind Fri Dec 22 12:52:35 2006
+++ /man/9/bind Wed Mar 10 08:12:19 2010
@@ -5,7 +5,7 @@
\f5bind\fI tag sequence script\fR
.sp
\f5bind\fI tag sequence \f5+\fIscript\fR
-.SH INTRODUCTION
+.SH DESCRIPTION
The \f5bind\fR command associates Tk scripts with window events.
If all three arguments are specified, \f5bind\fR will
arrange for \fIscript\fR (a Tk script) to be evaluated whenever
@@ -22,7 +22,7 @@
\fIsequence\fR, whose script is exactly the same as \fIscript\fR, is
removed.
The \fItag\fR argument gives the pathname of the window
to which \fIsequence\fR is bound.
-.SH "EVENT PATTERNS"
+.SS Event Patterns
The \fIsequence\fR argument specifies a sequence of one or more
event patterns, with optional white space between the patterns. Each
event pattern may
@@ -32,11 +32,11 @@
pattern matches a \f5KeyPress\fR event for the particular
character. The second form of pattern is longer but more general.
It has the following syntax:
-.RS
+.IP
.EX
\f5<\fIevent\f5-\fIevent\f5-\fR...\f5-\fIevent\f5>\fR
.EE
-.RE
+.PP
The following events are accepted:
.TP
.BR Key \ or\ Keypress
@@ -98,7 +98,14 @@
.TP
.B FocusOut
The event of the widget losing the keyboard focus.
+.TP
+.B Destroy
+The event of the widget being destroyed.
+See
+.IR destroy (9)
+for details of widget destruction.
.RE
+.PP
The event sequence can contain any combination of the above
events. They are treated independently, and if any of the
events occur, the sequence matches. You cannot combine
@@ -106,14 +113,7 @@
on delivery, except that
.B Motion
events may be combined with button presses (possibly doubled).
-.TP
-.B Destroy
-The event of the widget being destroyed.
-See
-.IR destroy (9)
-for details of widget destruction.
-
-.SH "BINDING SCRIPTS AND SUBSTITUTIONS"
+.SS Binding Scripts and Substitutions
The \fIscript\fR argument to \f5bind\fR is a Tk script,
which will be executed whenever the given event sequence occurs.
If \fIscript\fR contains
=======================================
--- /man/9/variable Fri Dec 22 12:52:35 2006
+++ /man/9/variable Wed Mar 10 08:12:19 2010
@@ -20,6 +20,6 @@
holds the text of the last Tk error encountered.
It resets when queried.
.SH SEE ALSO
-.IR checkbutton (9)
-.IR choicebutton (9)
-.IR radiobutton (9),
+.IR checkbutton (9),
+.IR choicebutton (9),
+.IR radiobutton (9)

==============================================================================
Revision: d07fcec557
Author: for...@vitanuova.com
Date: Sat Mar 13 07:04:35 2010
Log: 20100313-1504
http://code.google.com/p/inferno-npe/source/detail?r=d07fcec557

Added:
/opt/README
Modified:
/include/version.h
/libmemdraw/draw.c
/libtk/scrol.c
/man/9/canvas
/man/9/scrollbar

=======================================
--- /dev/null
+++ /opt/README Sat Mar 13 07:04:35 2010
@@ -0,0 +1,1 @@
+optional components live in subdirectories of /opt.
=======================================
--- /include/version.h Wed Mar 10 08:12:19 2010
+++ /include/version.h Sat Mar 13 07:04:35 2010
@@ -1,1 +1,1 @@
-#define VERSION "Fourth Edition (20100310)"
+#define VERSION "Fourth Edition (20100311)"
=======================================
--- /libmemdraw/draw.c Mon Jun 9 02:36:43 2008
+++ /libmemdraw/draw.c Sat Mar 13 07:04:35 2010
@@ -305,9 +305,6 @@
* Conversion tables.
*/
static uchar replbit[1+8][256]; /* replbit[x][y] is the replication of
the x-bit quantity y to 8-bit depth */
-static uchar conv18[256][8]; /* conv18[x][y] is the yth pixel in the
depth-1 pixel x */
-static uchar conv28[256][4]; /* ... */
-static uchar conv48[256][2];

/*
* bitmap of how to replicate n bits to fill 8, for 1 ≤ n ≤ 8.
@@ -341,7 +338,7 @@
static void
mktables(void)
{
- int i, j, mask, sh, small;
+ int i, j, small;

if(tablesbuilt)
return;
@@ -357,18 +354,6 @@
replbit[j][i] = (small*replmul[j])>>8;
}
}
-
- /* bit unpacking up to 8 bits, only powers of 2 */
- for(i=0; i<256; i++){
- for(j=0, sh=7, mask=1; j<8; j++, sh--)
- conv18[i][j] = replbit[1][(i>>sh)&mask];
-
- for(j=0, sh=6, mask=3; j<4; j++, sh-=2)
- conv28[i][j] = replbit[2][(i>>sh)&mask];
-
- for(j=0, sh=4, mask=15; j<2; j++, sh-=4)
- conv48[i][j] = replbit[4][(i>>sh)&mask];
- }
}

static uchar ones = 0xff;
=======================================
--- /libtk/scrol.c Fri Dec 22 09:07:39 2006
+++ /libtk/scrol.c Sat Mar 13 07:04:35 2010
@@ -44,7 +44,6 @@
{
"activerelief", OPTstab, O(TkScroll, activer), tkrelief,
"command", OPTtext, O(TkScroll, cmd), nil,
- "elementborderwidth", OPTignore, 0, nil, /* deprecated */
"jump", OPTstab, O(TkScroll, jump), tkbool,
"orient", OPTstab, O(TkScroll, orient), tkorient,
nil
=======================================
--- /man/9/canvas Fri Dec 22 12:52:35 2006
+++ /man/9/canvas Sat Mar 13 07:04:35 2010
@@ -19,7 +19,7 @@
.B -confine \fIboolean\fP
Specifies a boolean value that indicates whether or not it should be
allowable to set the canvas's view outside the region defined by the
-\f5scrollRegion\fR argument.
+\f5scrollregion\fR option.
Defaults to true, which means that the view will
be constrained within the scroll region.
.TP
@@ -1342,10 +1342,11 @@
\fIPathName\fR may not refer to a top-level window.

.SH BINDINGS
-In the current implementation, new canvases are not given any
-default behaviour: you'll have to execute explicit Tk commands
-to give the canvas its behaviour.
-
+New canvases are not given any
+default behaviour.
+Use
+.IR bind (2)
+commands to give the canvas its behaviour.
.SH CREDITS
Tk's canvas widget is a blatant ripoff of ideas from Joel Bartlett's
\fIezd\fR program. \fIEzd\fR provides structured graphics in a Scheme
=======================================
--- /man/9/scrollbar Fri Dec 22 12:52:35 2006
+++ /man/9/scrollbar Sat Mar 13 07:04:35 2010
@@ -28,15 +28,6 @@
All scrollable widgets have \f5xview\fR and \f5yview\fR commands
that take exactly the additional arguments appended by the scrollbar
as described in SCROLLING COMMANDS below.
-.ig
-DEPRECATED
-.TP
-.B -elementborderwidth \fIdist\fP
-Specifies the width of borders drawn around the internal elements
-of the scrollbar (the two arrows and the slider).
-If this value is less than zero, the value of the \f5borderwidth\fR
-option is used in its place.
-..
.TP
.B -height \fIdist\fP
Specifies a desired height for the scrollbar.

==============================================================================
Revision: a78c6fd88f
Author: Venkatesh Srinivas <m...@acm.jhu.edu>
Date: Wed Mar 17 18:01:58 2010
Log: Merge with inferno-os 20100310.
http://code.google.com/p/inferno-npe/source/detail?r=a78c6fd88f

Modified:
/CHANGES
/emu/Linux/emu
/include/version.h

=======================================
--- /CHANGES Sun Feb 21 06:23:46 2010
+++ /CHANGES Wed Mar 17 18:01:58 2010
@@ -1,3 +1,9 @@
+20100310
+ stop tabs(2) from issuing pointless tk cmd that produces diagnostics
+20100305
+ add emu/Linux/audio-oss.c from saoret.one [issue 226]
+20100226
+ mention -n nvram option in keyfs(4)
20100220
appl/cmd/keyfs.b wasn't clunking fids on error in remove [issue 225]
20100213
=======================================
--- /emu/Linux/emu Fri Feb 12 09:46:25 2010
+++ /emu/Linux/emu Wed Mar 17 18:01:58 2010
@@ -21,7 +21,7 @@

ip ipif6-posix ipaux
eia
-# audio audio
+# audio audio-oss
mem

lib
@@ -96,14 +96,8 @@
/chan /
/nvfs /
/env /
-# /chan
-# /dev
# /dis
-# /env
# /n
-# /net
-# /nvfs /
-# /prog
# /icons
# /osinit.dis
# /dis/emuinit.dis
=======================================
--- /include/version.h Sun Feb 21 06:23:46 2010
+++ /include/version.h Wed Mar 17 18:01:58 2010
@@ -1,1 +1,1 @@
-#define VERSION "Fourth Edition (20100221)"
+#define VERSION "Fourth Edition (20100311)"
Reply all
Reply to author
Forward
0 new messages