|
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: 3151 (0xc4f) Types: TextFile Names: »showattr.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« └─⟦de7628f85⟧ └─⟦this⟧ »isode-6.0/quipu/dish/showattr.c«
/* showattr.c - */ #ifndef lint static char *rcsid = "$Header: /f/osi/quipu/dish/RCS/showattr.c,v 7.0 89/11/23 22:20:21 mrose Rel $"; #endif /* * $Header: /f/osi/quipu/dish/RCS/showattr.c,v 7.0 89/11/23 22:20:21 mrose Rel $ * * * $Log: showattr.c,v $ * Revision 7.0 89/11/23 22:20:21 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/attrvalue.h" #include "quipu/entry.h" extern Entry current_entry; 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 rps, opt; 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 = FALSE; 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 = TRUE; } check_want_attr (at) AttributeType at; { Attr_Sequence as; if (at->at_table == NULLTABLE_ATTR) return (ignore_unknown); if (at->at_table->oa_syntax == 0) 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; Attr_Sequence as2; extern Attr_Sequence tmp_ignore; extern Attr_Sequence as_flag; if (at->at_table == NULLTABLE_ATTR) return (ignore_unknown || show_all_flag); if (at->at_table->oa_syntax == 0) return (ignore_unknown || show_all_flag); for (as=tmp_ignore; as != NULLATTR; as=as->attr_link) if (AttrT_cmp (at,&as->attr_type) == 0) { /* may be explicitly wanted... */ for (as2=as_flag; as2 != NULLATTR; as2=as2->attr_link) if (AttrT_cmp (&as2->attr_type,&as->attr_type) == 0) return (TRUE); 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); }