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

⟦31a77fc17⟧ TextFile

    Length: 1781 (0x6f5)
    Types: TextFile
    Names: »or_or2std.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_or2std.c« 

TextFile

/* or_or2std.c: convert interanl list to standard format or name */

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

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



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

void or_or2std (or, buf, nicepn)
OR_ptr          or;
char            *buf;
int             nicepn;   /* pretty pn required ? */
{
	OR_ptr		ptr;
	char		tbuf[LINESIZE];
	int		gotpn,
			addslash;


	PP_DBG (("or_util.c/or_or2std ()"));

	buf[0] = '\0';

	if (nicepn) {
		gotpn = or_getpn (or, buf);
		if (!gotpn)
			buf[0] = '\0';
	}
	else
		gotpn = FALSE;

	ptr = or_lastpart (or);

	for (addslash = FALSE ; ptr != NULLOR; ptr = ptr -> or_prev ) {

		PP_DBG ((
		"or_util.c/or_or2std: Comp type='%d' ddname='%s' value='%s'",
		ptr -> or_type, ptr-> or_ddname, ptr -> or_value
		));

		if (gotpn && (ptr -> or_type == OR_S ||
				ptr -> or_type == OR_G ||
				ptr -> or_type == OR_I))
					continue;

		addslash = TRUE;

		(void) strcat (buf, "/");

		if (ptr -> or_type == OR_DD) {
	    		if (or_ddvalid_chk (ptr -> or_ddname, &tbuf[0]) == NOTOK)
			{
				(void) strcat (buf, "DD.");
				qstrcat (buf, ptr -> or_ddname );
		    	}
	    		else
				qstrcat (buf, tbuf);

	    		(void) strcat (buf, "=");
	    		qstrcat (buf, ptr -> or_value);
		}
		else {
	    		(void) strcat (buf, or_type2name (ptr -> or_type));
	    		(void) strcat (buf, "=" );
	    		qstrcat (buf, ptr -> or_value);
		}
	}

	if (addslash)
		(void) strcat (buf, "/");

	PP_DBG (("or_util.c/or_or2std returns ('%s')", buf));
}