DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T o

⟦1d2b84a4f⟧ TextFile

    Length: 1301 (0x515)
    Types: TextFile
    Names: »or_asc2ps.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/Lib/or/or_asc2ps.c« 

TextFile

/* or_asc2ps.c: convert ascii to printable string  */

# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/or/RCS/or_asc2ps.c,v 5.0 90/09/20 16:07:43 pp Exp Locker: pp $";
# endif

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Lib/or/RCS/or_asc2ps.c,v 5.0 90/09/20 16:07:43 pp Exp Locker: pp $
 *
 * $Log:	or_asc2ps.c,v $
 * Revision 5.0  90/09/20  16:07:43  pp
 * rcsforce : 5.0 public release
 * 
 */



#include "util.h"
#include "or.h"

int or_asc2ps (ascii, ps)
char    *ascii;
char    *ps;
{
    register char       *p, *q;
    int			converted;
    PP_DBG (("Lib/or_asc2ps()"));

    q = ps;
    converted = OK;
    for (p = ascii; *p != '\0'; p++) {
	    
	if (or_isps (*p) && *p != ')' && *p != '(')
		*q++ = *p;
	else {
		converted = NOTOK;
		*q++ = '(';
		switch (*p) {
		    case '@':
			*q++ = 'a';
			break;
		    case '%':
			*q++ = 'p';
			break;
		    case '!':
			*q++ = 'b';
			break;
		    case '"':
			*q++ = 'q';
			break;
		    case '_':
			*q++ = 'u';
			break;
		    case '(':
			*q++ = 'l';
			break;
		    case ')':
			*q++ = 'r';
			break;
		    default:
			(void) sprintf (q, "%03d", *p);
			q = q + 3;
			break;

		}		/* end of switch */

		*q++ = ')';

	}  /* end of if */

    }  /* end of for */

    *q = '\0';
    return converted;
}