main() { char t,*st; int a,*sa; float r,*sr; clrscr(); t='B'; a=3; r=7; printr("t: ara=1x%s, angka=%t\n",t,t); printr("a: ara=1x%s, angka=%a\n",a,a); printr("r: ara=1x%s, angka=%2r\n",r,r); st=t; sa=a; sr=r; printr("st: ara=1x%s, angka = %t\n", st,*st); printr("sa: ara=1x%s, angka = %a\n", sa,*sa); printr("sr: ara=1x%s, angka = %2r\n", sr,*sr); *st='ARA'; *sa=200; *sr=500; printr("t: angka=%t\n",t); printr("a: angka=%a\n",a); printr("r: angka=%2r\n",r); getch(); return 0; }
/* fold: fold the line into two or more * lines at the last whitespace before the * FOLD. If no whitespace, fold at FOLD. */ void fold(char l[], int len) { int i, j, k, w, last; for (i = j = k = w = last = 0; l[i] != '\0'; ++i, ++k) { if (j == 0 && len-k <= FOLD) { printr(i, l); return; } else if (j == FOLD-1) { putchar(l[i]); putchar('\n'); j = 0; } else if ((w = iswhite(l[i])) > 0) { if ((last = lastwhite(i+1, j+1, l)) == 1) { putchar(l[i]); putchar('\n'); j = 0; k = k + w - 1; } else { putchar(l[i]); j = j + w; k = k + w - 1; } } else { putchar(l[i]); ++j; } } }
lispval Nbreak() { register lispval hold; register FILE *port; port = okport(Vpoport->a.clb,stdout); fprintf(port,"Breaking:"); if ((hold = lbot->val) != nil && ((hold = hold->d.car) != nil)) { printr(hold,port); } putc('\n',port); dmpport(port); return(errorh(Verbrk,"",nil,TRUE,0)); }
int main(int argc, char **argv) { int x; int i; i = 1; x = 0; if (argc == 1) error(argv[0]); ard = lst_new(); ard = makelst(ard, argc, argv, 1); ft_select(ard); i = 0; while (i < (int)ard->len) { if (ard->start->bol == 2 || ard->start->bol == 3) printr(ard->start->str, x++, ft_celement(ard)); ard->start = ard->start->next; i++; } return (0); }
/* * * (oblist) * * oblist returns a list of all symbols in the oblist * * written by jkf. */ lispval Loblist() { int indx; lispval headp, tailp ; struct atom *symb ; extern int hashtop; Savestack(0); headp = tailp = newdot(); /* allocate first DTPR */ protect(headp); /*protect the list from garbage collection*/ /*line added by kls */ for( indx=0 ; indx <= hashtop-1 ; indx++ ) /* though oblist */ { for( symb = hasht[indx] ; symb != (struct atom *) CNIL ; symb = symb-> hshlnk) { if(TYPE(symb) != ATOM) { printf(" non symbol in hasht[%d] = %x: ",indx,symb); printr((lispval) symb,stdout); printf(" \n"); fflush(stdout); } tailp->d.car = (lispval) symb ; /* remember this atom */ tailp = tailp->d.cdr = newdot() ; /* link to next DTPR */ } } tailp->d.cdr = nil ; /* close the list unfortunately throwing away the last DTPR */ Restorestack(); return(headp); }