#include "spice.h"
#include "mfb.h"
#include <ctype.h>
#include <string.h>
Go to the source code of this file.
|
#define | MAXHOP 5 /* max number of MCE=indirections */ |
|
#define | BADNUM 0 /* illegal number for numeric capability */ |
|
#define BADNUM 0 /* illegal number for numeric capability */ |
#define MAXHOP 5 /* max number of MCE=indirections */ |
static char* MFBCapDecod |
( |
| ) |
|
|
static |
static char* MFBCapDecod |
( |
char * |
str, |
|
|
char ** |
area |
|
) |
| |
|
static |
Definition at line 303 of file mfbcaps.c.
313 while((c = *str++) && c !=
','){
320 dp =
"E\033^^\\\\,,n\nr\rt\tb\bf\f";
333 c <<= 3, c |= *str++ -
'0';
334 while(--i && isdigit(*str));
int MFBCheckForMCE |
( |
char * |
mfbcapFile | ) |
|
Definition at line 141 of file mfbcaps.c.
144 register char *
p, *q;
158 while(*p ==
',' || *p ==
' ' || *p ==
'\t')
162 if(p[0] !=
'M' || p[1] !=
'C' || p[2] !=
'E')
return(
MFBOK);
163 (void)
strcpy(mfbname,p+4);
165 while(q && *q !=
',')
171 if((l =
MFBGetEnt(mfbbuf,mfbname,mfbcapFile)) != 1){
174 for(q=mfbbuf; *q !=
','; q++) ;
175 l = p - holdgbuf + strlen(q);
int MFBGetEnt |
( |
char * |
bp, |
|
|
char * |
name, |
|
|
char * |
mfbcapFile |
|
) |
| |
Definition at line 59 of file mfbcaps.c.
66 register int i = 0, cnt = 0;
74 if((CapFile = fopen(mfbcapFile,
"r")) ==
NULL)
76 mfbcapDesc = fileno(CapFile);
86 cnt = read(mfbcapDesc, inputBuffer,
BUFSIZE);
87 if(cnt <= 0 && !NewLine){
88 if(close(mfbcapDesc) < 0)
98 if(NewLine && c !=
' ' && c !=
'\t'){
125 if(close(mfbcapDesc) < 0)
Definition at line 235 of file mfbcaps.c.
247 while(*cp != 0 && *bp != 0){
254 if(!*bp || *bp ==
',')
Definition at line 358 of file mfbcaps.c.
363 register char negative = 0 ;
368 if(*bp == 0)
return(
BADNUM);
371 while(*cp != 0 && *bp != 0){
377 if(*bp == 0)
return(
BADNUM);
378 if(i || *bp !=
'#')
continue;
380 if((negative=(*bp ==
'-'))) bp++ ;
382 while( (j = ((
int)(*bp) - 060)) >= 0 && (j < 10) ) {
383 bp++; i *= 10; i += j;
char* MFBGetStr |
( |
char * |
id, |
|
|
char ** |
area |
|
) |
| |
Definition at line 273 of file mfbcaps.c.
282 if(!*bp)
return(
NULL);
285 while(*cp != 0 && *bp != 0){
291 if(i || *bp !=
'=')
continue;
static char * MFBCapDecod()
Definition at line 192 of file mfbcaps.c.
195 register char *Np, *Bp;
198 if(*Bp ==
'#')
return(
FALSE);
200 for(Np = np; *Np && *Bp == *Np; Bp++, Np++)
continue;
201 if(*Np == 0 && (*Bp ==
'|' || *Bp ==
',' || *Bp == 0))
203 while(*Bp && *Bp !=
',' && *Bp !=
'|') Bp++;
204 if(*Bp == 0 || *Bp ==
',')
return(
FALSE);
static char* MFBSkip |
( |
char * |
bp | ) |
|
|
static |
Definition at line 215 of file mfbcaps.c.
218 while(*bp && !(*bp ==
',' && *(bp - 1) !=
'\\'))
222 while(*bp ==
',' || *bp ==
' ' || *bp ==
'\t')