|
|
1.1 root 1: #include "quipu/util.h"
2: #include "quipu/attrvalue.h"
3:
4: static Attr_Sequence eptr;
5: #define foreach(a) for(eptr = a; eptr != NULLATTR; eptr=eptr->attr_link)
6:
7: extern AttributeType last_at;
8:
9: as_comp_print (ps,as,format)
10: PS ps;
11: Attr_Sequence as;
12: int format;
13: {
14: AV_Sequence avs;
15: char buffer [LINESIZE];
16: extern int oidformat;
17: char * attr2name_aux();
18:
19: if (as!=NULLATTR) {
20: last_at = as->attr_type;
21:
22: if (format == READOUT)
23: (void) sprintf (buffer,"%s",attr2name (as->attr_type,oidformat));
24: else
25: (void) sprintf (buffer,"%s",attr2name_aux (as->attr_type));
26:
27: if (split_attr (as))
28: if ((as->attr_value == NULLAV) && (format != READOUT))
29: ps_printf (ps, "%s=\n", buffer);
30: else
31: for (avs = as->attr_value; avs != NULLAV; avs = avs->avseq_next) {
32: if (format == READOUT)
33: ps_printf (ps, "%-21s - ", buffer);
34: else
35: ps_printf (ps, "%s= ", buffer);
36: avs_comp_print (ps, avs, format);
37: ps_print (ps, "\n");
38: }
39: else {
40: if (format == READOUT)
41: ps_printf (ps, "%-21s - ", buffer);
42: else
43: ps_printf (ps, "%s= ", buffer);
44: avs_print (ps,as->attr_value,format);
45: }
46:
47: }
48: }
49:
50: as_print (ps,as,format)
51: Attr_Sequence as;
52: PS ps;
53: int format;
54: {
55:
56: if ( as != NULLATTR )
57: foreach (as)
58: as_comp_print (ps,eptr,format);
59:
60: }
61:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.