// modification d'un entier dans le buffer
void Prodbuffer::setint(int ind,int i)
{
	setchar(ind,i); i>>=8;
	setchar(ind+1,i); i>>=8;
	setchar(ind+2,i); i>>=8;
	setchar(ind+3,i);
}
Ejemplo n.º 2
0
/*FUNCTION*/
LVAL c_newnode(tpLspObject pLSP,
               unsigned char type
  ){
/*noverbatim
CUT*/
   LVAL p;

   if( null((p = getnode())) )
      return NIL;

   settype(p,type);
   switch( type )
   {
   case NTYPE_CON:
      return NULL;
   case NTYPE_FLO:
      setfloat(p,0.0);
      break;
   case NTYPE_INT:
      setint(p,0);
      break;
   case NTYPE_STR:
      setstring(p,NULL);
      break;
   case NTYPE_SYM:
      setsymbol(p,NULL);
      break;
   case NTYPE_CHR:
      setchar(p,(char)0);
      break;
   default:
      return NULL;
   }
   return p;
}
Ejemplo n.º 3
0
static void createcat (lua_State *L, const char *catname, int (catf) (int)) {
  TTree *t = newcharset(L);
  int i;
  for (i = 0; i <= UCHAR_MAX; i++)
    if (catf(i)) setchar(treebuffer(t), i);
  lua_setfield(L, -2, catname);
}
Ejemplo n.º 4
0
int topstack(char sequence[]) {
	
	int counter = 0;
	int character, value;
	
	while ((sequence[0] = character = setchar()) == ' ' || character =='\t') ;
	sequence[1] = '\0';
	
	if(!isdigit(chracter) && character != '.' && character != 13 && character != 8) {
		if(character == 33) {
			
			counter = -1;
			
			while ((sequence[++i] = value =  setchar()) && (value != 13)) ;
			
			unsetchar(value);
			sequence[counter] = '\0';
			return FUNCTION;
		}
		
		return character;
	}
	
	if (character == 13) {
		return ' ';
	}
	
	if (character == 8) {
		return 'b';
	}
	
	if(isdigit(character)) {
		while (isdigit(sequence[++i] = character = setchar())) ;
	}
	
	if (character == '.') {
		while (isdigit(sequence[++i] = character = setchar())) ;
	}
	
	sequence[counter] = '\0';
	
	if (counter > 0) {
		unsetchar(character);
	}
	
	return NUMBER;
}
Ejemplo n.º 5
0
static inline void clear_screen(){
  for(int l=0;l<24;l++){
    for(int c=0;c<80;c++){
      setchar(l,c,' ');
    }
  }
  g_x=g_y=0;
}
Ejemplo n.º 6
0
void	RTC::int_handler(INT_CONTEXT* context)
{
	//printf("RTC::int_handler is called m_clock_ticks=%d\n", m_clock_ticks);
	int x = 79, y = 24;
	int color = 12;
	switch (m_clock_ticks++ % 4)
	{
	case 0: setchar(x, y, '-', color, 0);break;
	case 1: setchar(x, y, '\\', color, 0);break;
	case 2: setchar(x, y, '|', color, 0);break;
	case 3: setchar(x, y, '/', color, 0);break;
	}
	//PIC::dump_pic_irq_context(context);
	//What is important is that if register C is not read after an IRQ 8, 
	//then the interrupt will not happen again.
	outportb(0x70, 0x0c); //¶ÁRTC¼Ä´æÆ÷C£¬¸´Î»Î´¾öµÄÖжÏ״̬
	inportb(0x71);
}
Ejemplo n.º 7
0
static int lp_set (lua_State *L) {
  size_t l;
  const char *s = luaL_checklstring(L, 1, &l);
  TTree *tree = newcharset(L);
  while (l--) {
    setchar(treebuffer(tree), (byte)(*s));
    s++;
  }
  return 1;
}
Ejemplo n.º 8
0
/*FUNCTION*/
LVAL c_code_char(tpLspObject pLSP,
                 LVAL p
  ){
/*noverbatim
CUT*/
  LVAL q;

  if( null(p) || !integerp(p) )return NIL;
  q = newchar();
  setchar(q,(char)getint(p));
  return q;
  }
void cls()
{                                /* simple clear screen function */
  int x, y;

  for(y = 0; y < 20; y++)        /* loop for the num of charaters across (x)*/
    for(x = 0; x < 30; x++)      /* loop for the num of charaters high (y)*/
    {    
      gotoxy(x, y);              /* moves the postion to x,y */
      setchar(' ');              /* puts a space on screen */
    }                            /* does the above until we have cleared the screen */
gotoxy(0,0);                     /* returns the position to the top left */
}
Ejemplo n.º 10
0
/*FUNCTION*/
LVAL c_char_upcase(tpLspObject pLSP,
                   LVAL p
  ){
/*noverbatim
CUT*/
  LVAL q;

  if( null(p) || !characterp(p) )return NIL;
  q = newchar();
  setchar(q, (isalpha(getchr(p)) && islower(getchr(p))) ?
          toupper((int) getchr(p)) : getchr(p));
  return q;
  }
Ejemplo n.º 11
0
static int lp_range (lua_State *L) {
  int arg;
  int top = lua_gettop(L);
  TTree *tree = newcharset(L);
  for (arg = 1; arg <= top; arg++) {
    int c;
    size_t l;
    const char *r = luaL_checklstring(L, arg, &l);
    luaL_argcheck(L, l == 2, arg, "range must have two characters");
    for (c = (byte)r[0]; c <= (byte)r[1]; c++)
      setchar(treebuffer(tree), c);
  }
  return 1;
}
// modification d'un short dans le buffer
void Prodbuffer::setshort(int ind,int i)
{
	setchar(ind,i); i>>=8;
	setchar(ind+1,i);
}
Ejemplo n.º 13
0
int server::delete_mail(char *buf){
	//DELETE flag username from datatime attachment_code
	//from time box attachment topic
	//number text

	char temp[Max_buf],username[30],from[30],datatime[30],atta[30],ff[2];
	int boxNo;
	int flag;//flag ==1  totally delete

	for(int i = 0; i < 30; i++) atta[i] = '\0';
	sscanf(buf,"%s%s%s%d%s%s",temp,ff,username,&boxNo,datatime,atta);
	flag=ff[0]-'0';
	setchar(datatime,'/','-');
	setchar(datatime,':',';');
	//修改信箱
	char file_name[50];
	FILE *fp;
	int i=0;
	strcpy_s(file_name,username);
	strcat_s(file_name,".txt");
	fp=fopen(file_name,"r+");
	while(!feof(fp)) temp[i++]=fgetc(fp);
	i--;
	temp[i]='\0';
	char *p1,*p2;
	p1=strstr(temp,datatime);
	p2=p1+strlen(datatime);
	if(flag) *(p2+1)='3';
	else *(p2+1)='2';

	rewind(fp);
	for (i=0;i<strlen(temp);i++) fputc(temp[i],fp);
	fclose(fp);

	////修改引用次数,彻底删除时才修改
	//if(flag){
	//	strcpy_s(file_name,from);
	//	strcat_s(file_name,"+");
	//	strcat_s(file_name,datatime);
	//	strcat_s(file_name,".ini");
	//	fp=fopen(file_name,"r+");

	//	int num,digit_n;
	//	fscanf(fp,"%d",&num);
	//	digit_n=digit_num(num);
	//	rewind(fp);
	//	num--;
	//	if(!num)	{
	//		fclose(fp);
	//		strcpy_s(temp,file_name);
	//		strcpy_s(file_name,"del ");
	//		strcat_s(file_name,temp);
	//		system(file_name);
	//	}
	//	else {
	//		for(i=0;i<digit_n;i++) fputc(' ',fp);
	//		rewind(fp);
	//		fprintf(fp,"%d",num);
	//		fclose(fp);
	//	}
	//}
	//以下进行删除附件
	if(atta != ""){
		int attid,innum,tmp=0;
		FILE *f;
		for(i=0;i<9;i++) tmp=tmp*10+atta[i]-'0';
		fp=fopen("att_info.ini","r+");
		while (!feof(fp))
		{
			int n=1;
			fscanf(fp,"%d%d",&attid,&innum);
			n+=digit_num(attid);
			n+=digit_num(innum);
			if(attid==tmp){
				innum--;
				if(innum==0){
					fseek(fp,0-n,SEEK_CUR);
					for(i=0;i<n;i++) fputc(' ',fp);
					fclose(fp);
					strcpy_s(file_name,"del ");
					strcat_s(file_name,atta);
					system(file_name);
				}
				else if(flag){//彻底删除改变引用次数
					fseek(fp,0-n,SEEK_CUR);
					for(i=0;i<n;i++) fputc(' ',fp);
					fseek(fp,0-n,SEEK_CUR);
					fprintf(fp,"%d %d",attid,innum);
					fclose(fp);
					break;
				}
			}
		}
	}
	char sendbuf[Max_buf];
	strcpy_s(sendbuf,"DELETE DONE");
	senddata(sendbuf);
	return 0;

}
Ejemplo n.º 14
0
Archivo: macro.c Proyecto: 8l/FUZIX
static int getch(char endch)
{
	register char d;

retry:
	d = readc();
	if (!subchar(d))
		return (d);

	if (d == DOLLAR) {
		register int c;
		if ((c = readc(), dolchar(c))) {
			NAMPTR n = (NAMPTR) NIL;
			int dolg = 0;
			BOOL bra;
			register const char *argp;
			register const char *v;
			CHAR idb[2];
			char *id = idb;

			if (bra = (c == BRACE))
				c = readc();

			if (letter(c)) {
				argp = (STRING) relstak();
				while (alphanum(c)) {
					pushstak(c);
					c = readc();
				}
				zerostak();
				n = lookup(absstak(argp));
				setstak(argp);
				v = n->namval;
				id = (char *)n->namid;
				peekc = c | MARK;;
			} else if (digchar(c)) {
				*id = c;
				idb[1] = 0;
				if (astchar(c)) {
					dolg = 1;
					c = '1';
				}
				c -= '0';
				v = ((c == 0) ? (const char *)cmdadr :
				         (c <= dolc) ? dolv[c]
					 : (dolg = 0, NULL));
			} else if (c == '$') {
				v = pidadr;
			} else if (c == '!') {
				v = pcsadr;
			} else if (c == '#') {
				v = dolladr;
			} else if (c == '?') {
				v = exitadr;
			} else if (c == '-') {
				v = flagadr;
			} else if (bra) {
				error(badsub);
			} else {
				goto retry;
			}
			c = readc();

			if (!defchar(c) && bra)
				error(badsub);

			argp = 0;
			if (bra) {
				if (c != '}') {
					argp = (STRING) relstak();
					if ((v == 0) ^ (setchar(c)))
						copyto('}');
					else
						skipto('}');

					argp = absstak(argp);
				}
			} else {
				peekc = c | MARK;
				c = 0;
			}
			if (v) {
				if (c != '+') {
					for (;;) {
						while (c = *v++)
							pushstak(c | quote);

						if (dolg == 0 || (++dolg > dolc))
							break;
						else {
							v = dolv[dolg];
							pushstak(SP | (*id == '*' ? quote : 0));
						}
					}
				}
			} else if (argp) {
				if (c == '?') {
					failed(id,
					       *argp ? argp : badparam);
				} else if (c == '=') {
					if (n)
						assign(n, argp);
					else
						error(badsub);
				}
                        } else if (flags & setflg) {
				failed(id, badparam);
			}
			goto retry;
		} else {
			peekc = c | MARK;
		}
	} else if (d == endch) {
		return (d);
	} else if (d == SQUOTE) {
		comsubst();
		goto retry;
	} else if (d == DQUOTE) {
		quoted++;
		quote ^= QUOTE;
		goto retry;
	}
	return d;
}
Ejemplo n.º 15
0
void dopage()
{

    while ((opcode = (int) get1()) != EOP) {    /* process page until eop */
        if (opcode <= LASTCHAR)
            dochar((char) opcode);
        else if ((opcode >= FONT_00) && (opcode <= FONT_63)) 
            setfont(opcode - FONT_00);
        else if (opcode > POST_POST)
            errorexit(illop);
        else
            switch (opcode) {
                case SET1     : setchar(get1()); break;
                case SET2     : setchar(get2()); break;
                case SET3     : setchar(get3()); break;
                case SET4     : setchar(get4()); break;
                case SET_RULE : { long height = sget4();
                                  rule(MOVE, sget4(), height); break;
                                }
                case PUT1     : putcharacter(get1()); break;
                case PUT2     : putcharacter(get2()); break;
                case PUT3     : putcharacter(get3()); break;
                case PUT4     : putcharacter(get4()); break;
                case PUT_RULE : { long height = sget4();
                                  rule(STAY, sget4(), height); break;
                                }
                case NOP      : break;  /* no-op */
                case BOP      : errorexit(bdbop); break;
/*              case EOP      : break;  strange place to have EOP */
                case PUSH     : if (sptr >= stackmax)            /* push */
                                     errorexit(stkof);
                                stack[sptr].hh = h;
                                stack[sptr].vv = v;
                                stack[sptr].ww = w;
                                stack[sptr].xx = x;
                                stack[sptr].yy = y;
                                stack[sptr].zz = z;
                                sptr++;
                                break;
                case POP      : if (sptr == 0)                   /* pop */
                                    errorexit(stkuf);
                                sptr--;
                                h = stack[sptr].hh;
                                v = stack[sptr].vv;
                                w = stack[sptr].ww;
                                x = stack[sptr].xx;
                                y = stack[sptr].yy;
                                z = stack[sptr].zz;
                                break;
                case RIGHT1   : (void) horizontalmove(sget1()); break;
                case RIGHT2   : (void) horizontalmove(sget2()); break;
                case RIGHT3   : (void) horizontalmove(sget3()); break;
                case RIGHT4   : (void) horizontalmove(sget4()); break;
                case W0       : h += w; break;
                case W1       : w = horizontalmove(sget1()); break;
                case W2       : w = horizontalmove(sget2()); break;
                case W3       : w = horizontalmove(sget3()); break;
                case W4       : w = horizontalmove(sget4()); break;
                case X0       : h += x; break;
                case X1       : x = horizontalmove(sget1()); break;
                case X2       : x = horizontalmove(sget2()); break;
                case X3       : x = horizontalmove(sget3()); break;
                case X4       : x = horizontalmove(sget4()); break;
                case DOWN1    : v += sget1(); break;
                case DOWN2    : v += sget2(); break;
                case DOWN3    : v += sget3(); break;
                case DOWN4    : v += sget4(); break;
                case Y0       : v += y; break;
                case Y1       : y = sget1(); v += y; break;
                case Y2       : y = sget2(); v += y; break;
                case Y3       : y = sget3(); v += y; break;
                case Y4       : y = sget4(); v += y; break;
                case Z0       : v += z; break;
                case Z1       : z = sget1(); v += z; break;
                case Z2       : z = sget2(); v += z; break;
                case Z3       : z = sget3(); v += z; break;
                case Z4       : z = sget4(); v += z; break;
                case FNT1     :
                case FNT2     :
                case FNT3     :
                case FNT4     : setfont(num(opcode - FNT1 + 1));
                                break;
                case XXX1     : mseek(DVIfile, get1(), relative); break;
                case XXX2     : mseek(DVIfile, get2(), relative); break;
                case XXX3     : mseek(DVIfile, get3(), relative); break;
                case XXX4     : mseek(DVIfile, get4(), relative); break;
                case FNT_DEF1 :
                case FNT_DEF2 :
                case FNT_DEF3 :
                case FNT_DEF4 : fontdef(opcode - FNT_DEF1 + 1);
                                break;
                case PRE      : errorexit(bdpre); break;
                case POST     : errorexit(bdpst); break;
                case POST_POST: errorexit(bdpp); break;
            }
    }

} /* dopage */
Ejemplo n.º 16
0
int server::mail(char *buf){
	//  MAIL receiver sender (datatime) attachment topic text
	//拆分收件人
	char *reciever,*sender,*attachment,*topic,*text;
	char *p1,*p2,*p3,*p4,*p5,*p6;
	char tag[2],time[10],data[10],datatime[20];
	p1=strchr(buf,'\n');*p1=' ';
	p2=strchr(buf,'\n');*p2=' ';
	p3=strchr(buf,'\n');*p3=' ';
	p4=strchr(buf,'\n');*p4=' ';
	p5=strchr(buf,'\n');*p5=' ';
	p6=buf+strlen(buf);
	reciever=getsubstr(p1,p2);
	sender=getsubstr(p2,p3);
	attachment=getsubstr(p3,p4);
	topic=getsubstr(p4,p5);
	text=getsubstr(p5,p6);
	_strtime(time);
	_strdate(data);
	strcpy(datatime,data);
	strcat_s(datatime,"/\0");
	strcat_s(datatime,time);
	setchar(datatime,'/','-');
	setchar(datatime,':',';');
	strcpy_s(tag,"0\0");//得到收件人、发件人、日期、信箱、主题、正文


	FILE *fp;     
	char temp[30],file_name[40],buff[150],sendbuf[Max_buf];
	int i,j=0,NUM=0;

	strcpy(buff,sender);
	strcat_s(buff,"\n\0");
	strcat_s(buff,datatime);
	strcat_s(buff,"\n\0");
	strcat_s(buff,tag);
	strcat_s(buff,"\n\0");
	strcat_s(buff,attachment);
	strcat_s(buff,"\n\0");
	strcat_s(buff,topic);
	strcat_s(buff,"\n\0");//用户信箱中存放的数据,发件人、日期、tag、主题,用回车隔开

	strcpy_s(sendbuf,"SEND_MAIL\n\0");

	for (i=0;i<strlen(reciever);i++)//有多个收件人,分离收件人
	{
		if(reciever[i]==';'){
			temp[i-j]='\0';
			j=i+1;
			NUM++;//记录收件人个数,每得到一个收件人+1
			strcpy_s(file_name,temp);
			strcat_s(file_name,".txt");
			fp=fopen(file_name,"r+");
			if(fp==NULL){//收件人不存在
				strcat_s(sendbuf,"FAIL\0");
				senddata(sendbuf);
				return 0;
			}
			fseek(fp,0,SEEK_END);//文件指针移动到文件末尾
			for (int k=0;k<strlen(buff);k++)  fputc(buff[k],fp);//写入邮件内容文件中
			fclose(fp);
		}
		else temp[i-j]=reciever[i];
	}

	strcat_s(sendbuf,"DONE\0");
	senddata(sendbuf);

	//向正文文件中写数据
	strcpy_s(file_name,sender);
	strcat_s(file_name,"+");
	strcat_s(file_name,datatime);
	strcat_s(file_name,".ini");

	fp=fopen(file_name,"w");
	fprintf(fp,"%d\n",NUM);
	for (i=0;i<strlen(text);i++)  fputc(text[i],fp);//写入邮件内容文件中
	fclose(fp);//邮件列表中修改

	//修改附件引用次数
	if(attachment[0]!='0'){//有附件
		p1=strchr(attachment,';');
		p2=attachment+strlen(attachment);
		p3=getsubstr(p1,p2);//附件编号
		fp=fopen("att_info.ini","r+");
		int a,b,c;
		c=atoi(p3);
		while(!feof(fp)){
			fscanf(fp,"%d %d",&a,&b);
			if(a==c){
				fseek(fp,-2,SEEK_CUR);
				fputs("  ",fp);
				fseek(fp,-2,SEEK_CUR);
				fprintf(fp,"%d",NUM);
				fclose(fp);
				break;
			}
		}
	}
	//修改邮件列表中发件箱内容
	strcpy_s(file_name,sender);
	strcat_s(file_name,".txt\0");
	fp=fopen(file_name,"r+");
	fseek(fp,0,SEEK_END);
	fprintf(fp,"%s",reciever);
	fputc('\n',fp);
	fprintf(fp,"%s",datatime);
	fputc('\n',fp);
	fprintf(fp,"%s","4\0");
	fputc('\n',fp);
	fprintf(fp,"%s",attachment);
	fputc('\n',fp);
	fprintf(fp,"%s",topic);
	fputc('\n',fp);
	fclose(fp);
	return 0;
}
Ejemplo n.º 17
0
tchar 
setfield(int x)
{
	register tchar ii, jj, *fp;
	register int i, j, k;
	int length, ws, npad, temp;
	unsigned int type;
	tchar **pp, *padptr[NPP];
	tchar fbuf[FBUFSZ];
	int savfc, savtc, savlc;
	tchar rchar = 0, nexti = 0;
	int savepos;
	int oev;

	prdblesc = 1;
	if (x == tabch) 
		rchar = tabc | chbits;
	else if (x ==  ldrch) 
		rchar = dotc | chbits;
	if (chartab[trtab[cbits(rchar)]] != 0)
		rchar = setchar(rchar);
	temp = npad = ws = 0;
	savfc = fc;
	savtc = tabch;
	savlc = ldrch;
	tabch = ldrch = fc = IMP;
	savepos = numtab[HP].val;
	gchtab[tabch] &= ~TABBIT;
	gchtab[ldrch] &= ~LDRBIT;
	gchtab[fc] &= ~FCBIT;
	gchtab[IMP] |= TABBIT|LDRBIT|FCBIT;
	for (j = 0; ; j++) {
		if ((tabtab[j] & TABMASK) == 0) {
			if (x == savfc)
				errprint("zero field width.");
			jj = 0;
			goto rtn;
		}
		if ((length = ((tabtab[j] & TABMASK) - numtab[HP].val)) > 0 )
			break;
	}
	type = tabtab[j] & (~TABMASK);
	fp = fbuf;
	pp = padptr;
	if (x == savfc) {
		*fp++ = mkxfunc(FLDMARK, 0);
		nexti = getch();
		while (1) {
			j = cbits(ii = nexti);
			jj = width(ii);
			oev = ev;
			if (j != savfc && j != '\n' &&
					pp < (padptr + NPP - 1) &&
					fp < (fbuf + FBUFSZ - 3))
				nexti = getch();
			else
				nexti = 0;
			if (ev == oev)
				jj += kernadjust(ii, nexti);
			widthp = jj;
			numtab[HP].val += jj;
			if (j == padc) {
				npad++;
				*pp++ = fp;
				if (pp > (padptr + NPP - 1))
					break;
				goto s1;
			} else if (j == savfc) 
				break;
			else if (j == '\n') {
				temp = j;
				nlflg = 0;
				break;
			}
			ws += jj;
s1:
			*fp++ = ii;
			if (fp > (fbuf + FBUFSZ - 3))
				break;
		}
		if (!npad) {
			npad++;
			*pp++ = fp;
			*fp++ = 0;
		}
		*fp++ = temp;
		*fp++ = 0;
		temp = i = (j = length - ws) / npad;
		i = (i / HOR) * HOR;
		if ((j -= i * npad) < 0)
			j = -j;
		ii = makem(i);
		if (temp < 0)
			ii |= NMOT;
		for (; npad > 0; npad--) {
			*(*--pp) = ii;
			if (j) {
				j -= HOR;
				(*(*pp)) += HOR;
			}
		}
		pushback(fbuf);
		jj = 0;
	} else if (type == 0) {
		/*plain tab or leader*/
		if (pbp >= pbsize-4)
			growpbbuf();
		pbbuf[pbp++] = mkxfunc(FLDMARK, 0);
		if ((j = width(rchar)) > 0) {
			int nchar;
			k = kernadjust(rchar, rchar);
			if (length < j)
				nchar = 0;
			else {
				nchar = 1;
				length -= j;
				nchar += length / (k+j);
				length %= k+j;
			}
			pbbuf[pbp++] = FILLER;
			while (nchar-->0) {
				if (pbp >= pbsize-5)
					if (growpbbuf() == NULL)
						break;
				numtab[HP].val += j;
				widthp = j;
				if (nchar > 0) {
					numtab[HP].val += k;
					widthp += k;
				}
				pbbuf[pbp++] = rchar;
			}
			pbbuf[pbp++] = FILLER;
		}
		if (length)
			jj = sabsmot(length) | MOT;
		else 
			jj = 0;
	} else {
		/*center tab*/
		/*right tab*/
		*fp++ = mkxfunc(FLDMARK, 0);
		nexti = getch();
		while (((j = cbits(ii = nexti)) != savtc) &&  (j != '\n') && (j != savlc)) {
			jj = width(ii);
			oev = ev;
			if (fp < (fbuf + FBUFSZ - 3)) {
				nexti = getch();
				if (ev == oev)
					jj += kernadjust(ii, nexti);
			}
			ws += jj;
			numtab[HP].val += jj;
			widthp = jj;
			*fp++ = ii;
			if (fp > (fbuf + FBUFSZ - 3)) 
				break;
		}
		*fp++ = ii;
		*fp++ = 0;
		if (type == RTAB)
			length -= ws;
		else 
			length -= ws / 2; /*CTAB*/
		pushback(fbuf);
		if ((j = width(rchar)) != 0 && length > 0) {
			int nchar;
			k = kernadjust(rchar, rchar);
			if (length < j)
				nchar = 0;
			else {
				nchar = 1;
				length -= j;
				nchar += length / (k+j);
				length %= k+j;
			}
			if (pbp >= pbsize-3)
				growpbbuf();
			pbbuf[pbp++] = FILLER;
			while (nchar-- > 0) {
				if (pbp >= pbsize-3)
					if (growpbbuf() == NULL)
						break;
				pbbuf[pbp++] = rchar;
			}
		}
		length = (length / HOR) * HOR;
		jj = makem(length);
		nlflg = 0;
	}
rtn:
	gchtab[fc] &= ~FCBIT;
	gchtab[tabch] &= ~TABBIT;
	gchtab[ldrch] &= ~LDRBIT;
	fc = savfc;
	tabch = savtc;
	ldrch = savlc;
	gchtab[fc] |= FCBIT;
	gchtab[tabch] = TABBIT;
	gchtab[ldrch] |= LDRBIT;
	numtab[HP].val = savepos;
	if (pbp < pbsize-3 || growpbbuf())
		pbbuf[pbp++] = mkxfunc(FLDMARK, x);
	prdblesc = 0;
	return(jj | ADJBIT);
}
Ejemplo n.º 18
0
static inline void print_character(unsigned char x){  
  if(++g_x == NUM_CHARS)
    next_line();
  setchar(g_y,g_x,x);
}