]>
diplodocus.org Git - nmh/blob - docs/historical/SRI-NOSC/subs.dir/m_gmsg.c
36 if((i
= open(".", 0)) < 0)
38 for(j
= 0; j
< 1000; j
++)
44 msgbuf
.xlowmsg
= 5000;
46 msgbuf
.xflags
= (access(".",2) == -1)? READONLY
:0; /*RAND sys call*/
51 if(read(i
, &dir
, sizeof dir
.ent
) != sizeof dir
.ent
)
55 if(j
> msgbuf
.xhghmsg
)
58 if(j
< msgbuf
.xlowmsg
)
60 msgbuf
.xmsgs
[j
] = EXISTS
;
61 if(*cp
== ',') msgbuf
.xmsgs
[j
] =| DELETED
;
62 else msgbuf
.xmsgs
[j
] =| UNDELETED
;
63 } else if(!equal(cp
, ".") &&
66 if(equal(cp
, current
))
68 else if(equal(cp
, listname
))
77 if(msgbuf
.xflags
&READONLY
) {
78 copy(name
, copy("cur-", buf
));
79 if((cp
= m_find(buf
)) != -1)
82 } else if(curfil
&& (i
= open(current
, 0)) >= 0) {
83 if((j
= read(i
, dir
.ent
.d_name
, sizeof dir
.ent
.d_name
)) >= 2){
84 dir
.ent
.d_name
[j
-1] = 0; /* Zap <lf> */
85 if(j
= mu_atoi(dir
.ent
.d_name
))
90 if((i
= alloc(sizeof *mp
+ msgbuf
.xhghmsg
+ 2)) == -1)
92 i
->hghmsg
= msgbuf
.xhghmsg
;
93 i
->nummsg
= msgbuf
.xnummsg
;
94 i
->lowmsg
= msgbuf
.xlowmsg
;
95 i
->curmsg
= msgbuf
.xcurmsg
;
96 i
->selist
= msgbuf
.xselist
;
97 i
->msgflags
= msgbuf
.xflags
;
98 i
->others
= msgbuf
.xothers
;
103 for(j
= 0; j
<= msgbuf
.xhghmsg
; j
++)
104 i
->msgstats
[j
] = msgbuf
.xmsgs
[j
];
119 if(*cp
< '0' || *cp
> '9' || i
> 99)