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 s

⟦213f50998⟧ TextFile

    Length: 2089 (0x829)
    Types: TextFile
    Names: »showname.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/quipu/dish/showname.c« 

TextFile

/* showname.c - */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/quipu/dish/RCS/showname.c,v 7.0 89/11/23 22:20:24 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/quipu/dish/RCS/showname.c,v 7.0 89/11/23 22:20:24 mrose Rel $
 *
 *
 * $Log:	showname.c,v $
 * Revision 7.0  89/11/23  22:20:24  mrose
 * Release 6.0
 * 
 */

/*
 *				  NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


#include "quipu/util.h"
#include "quipu/name.h"

extern DN       current_dn;
extern DN       dn;

#define	OPT	(!frompipe || rps -> ps_byteno == 0 ? opt : rps)
#define	RPS	(!frompipe || opt -> ps_byteno == 0 ? rps : opt)
extern	char	frompipe;
extern	PS	opt, rps;

extern char 	print_format;


call_showname (argc, argv)
int             argc;
char          **argv;
{
	DN              dnptr;
	int             compact = FALSE;
	int             x;
	extern DN	rel_dn;

	if ((argc = read_cache (argc, argv)) < 0)
		return;

	for (x = 1; x < argc; x++) {
		if (test_arg (argv[x], "-compact",2))  {	/* compact */
			compact = TRUE;
			argc--;
		} else if (test_arg (argv[x], "-nocompact",3))  {
			compact = FALSE;
			argc--;
		} else {
			ps_printf (OPT,"Unknown option %s\n",argv[x]);
			Usage (argv[0]);
			return;
		}
	}

	if (compact) {
		if (rel_dn != NULLDN) {
			DN a,b;

			a = rel_dn;
			b = current_dn;
			for (; a != NULLDN && b != NULLDN ; a = a->dn_parent, b = b->dn_parent)
				if ( dn_comp_cmp (a,b) == NOTOK) 
					break;
			if (a == NULLDN)
				dn_print (RPS,b,RDNOUT);
			else {
				ps_print (RPS, "@");
				dn_print (RPS,current_dn,RDNOUT);
			}
			ps_print (RPS, "\n");
		} else {
			dn_print (RPS, current_dn, RDNOUT);
			ps_print (RPS, "\n");
		}
	} else {
		if (current_dn == NULLDN) {
			ps_print (RPS, "NULL Name\n");
			return;
		}
		for (dnptr = current_dn; dnptr != NULLDN; dnptr = dnptr->dn_parent) {
			rdn_print (RPS,dnptr->dn_rdn,print_format);
			ps_print (RPS, "\n");
		}
	}
}