|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 2661 (0xa65)
Types: TextFile
Names: »showattr.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
└─⟦eba4602b1⟧ »./isode-5.0.tar.Z«
└─⟦d3ac74d73⟧
└─⟦this⟧ »isode-5.0/quipu/dish/showattr.c«
/* showattr.c - */
#ifndef lint
static char *rcsid = "$Header: /f/osi/quipu/dish/RCS/showattr.c,v 6.0 89/03/18 23:40:54 mrose Rel $";
#endif
/*
* $Header: /f/osi/quipu/dish/RCS/showattr.c,v 6.0 89/03/18 23:40:54 mrose Rel $
*
*
* $Log: showattr.c,v $
* Revision 6.0 89/03/18 23:40:54 mrose
* Release 5.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/attrvalue.h"
#include "quipu/entry.h"
extern Entry current_entry;
extern DN current_dn;
extern DN dn;
extern PS rps;
extern PS opt;
extern LLog *log_dua;
extern char value_flag;
extern char key_flag;
extern char print_format;
extern char show_all_flag;
static Attr_Sequence ignore_attr = NULLATTR;
static char ignore_unknown = TRUE;
showattribute (at)
AttributeType at;
{
Attr_Sequence eptr;
if (! show_all_flag) {
if ( ! check_want_attr (at))
return;
} else if ( ! check_want_tmp_attr (at))
return;
for (eptr = current_entry->e_attributes; eptr != NULLATTR; eptr = eptr->attr_link) {
/* Tiptoe through the list of types until one matches, and then print value. */
if (AttrT_cmp (eptr->attr_type,at) == 0) {
if (value_flag)
if (key_flag)
as_comp_print (rps,eptr,print_format);
else
avs_print (rps,eptr->attr_value,print_format);
else {
AttrT_print (rps,at,print_format);
ps_print (rps, "\n");
}
break;
}
if (eptr == NULLATTR)
if (key_flag)
ps_printf (opt, "%-21s - (No such attribute in this entry)\n", at->at_table->oa_ot.ot_name);
else
ps_printf (opt, "No value\n");
}
}
show_unknown ()
{
ignore_unknown = FALSE;
}
check_want_attr (at)
AttributeType at;
{
Attr_Sequence as;
if (at->at_table == NULLTABLE_ATTR)
return (ignore_unknown);
for (as=ignore_attr; as != NULLATTR; as=as->attr_link)
if (AttrT_cmp (at,as->attr_type) == 0)
return (FALSE);
return (check_want_tmp_attr(at));
}
check_want_tmp_attr (at)
AttributeType at;
{
Attr_Sequence as;
extern Attr_Sequence tmp_ignore;
if (at->at_table == NULLTABLE_ATTR)
return (ignore_unknown);
for (as=tmp_ignore; as != NULLATTR; as=as->attr_link)
if (AttrT_cmp (at,as->attr_type) == 0)
return (FALSE);
return (TRUE);
}
new_ignore (ptr)
char * ptr;
{
AttributeType at;
Attr_Sequence newas;
if ((at = str2AttrT (ptr)) == NULLAttrT)
return;
newas = as_comp_new (at,NULLAV,NULLACL_INFO);
ignore_attr = as_merge(ignore_attr,newas);
}