franz/lam8.c
/*
 *	formatted printer for lisp data
 *    use: (cprintf formatstring datum [port])
 */
formatted printer for lisp data
use: (cprintf formatstring datum [port])
formatted printer for lisp data use : ( cprintf formatstring datum [ port ] )
lispval
Lcprintf()
{
    FILE *p;
    char *fstrng;
    lispval v;
    if(np-lbot == 2) protect(nil);	
    chkarg(3,"cprintf");
    fstrng = (char *)verify(lbot->val,"cprintf: first arg not string or symbol");
    p = okport(lbot[2].val,okport(Vpoport->a.clb,poport));
    switch(TYPE(v=lbot[1].val)) {
	case INT:  fprintf(p,fstrng,v->i);
		   break;
	case DOUB: fprintf(p,fstrng,v->r);
		   break;
	case ATOM: fprintf(p,fstrng,v->a.pname);
		   break;
	case STRNG:fprintf(p,fstrng,v);
		   break;
	default:   error("cprintf: Illegal second argument",FALSE);
   };
   return(lbot[1].val);
}
lispval Lcprintf ( ) { FILE * p ; char * fstrng ; lispval v ; if ( np - lbot == 2 ) protect ( nil ) ; chkarg ( 3 , " " ) ; fstrng = ( char * ) verify ( lbot -> val , " " ) ; p = okport ( lbot [ 2 ] . val , okport ( Vpoport -> a . clb , poport ) ) ; switch ( TYPE ( v = lbot [ 1 ] . val ) ) { case INT : fprintf ( p , fstrng , v -> i ) ; break ; case DOUB : fprintf ( p , fstrng , v -> r ) ; break ; case ATOM : fprintf ( p , fstrng , v -> a . pname ) ; break ; case STRNG : fprintf ( p , fstrng , v ) ; break ; default : error ( " " , FALSE ) ; } ; return ( lbot [ 1 ] . val ) ; }
formatted printer for lisp data
    use: (cprintf formatstring datum [port])
formatted printer for lisp data use : ( cprintf formatstring datum [ port ] )
/* write to standard output port */