|
|
1.1 root 1: /* showentry.c - */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/quipu/dish/RCS/showentry.c,v 7.2 90/03/15 11:18:34 mrose Exp $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/quipu/dish/RCS/showentry.c,v 7.2 90/03/15 11:18:34 mrose Exp $
9: *
10: *
11: * $Log: showentry.c,v $
12: * Revision 7.2 90/03/15 11:18:34 mrose
13: * quipu-sync
14: *
15: * Revision 7.1 90/01/11 18:37:46 mrose
16: * real-sync
17: *
18: * Revision 7.0 89/11/23 22:20:22 mrose
19: * Release 6.0
20: *
21: */
22:
23: /*
24: * NOTICE
25: *
26: * Acquisition, use, and distribution of this module and related
27: * materials are subject to the restrictions of a license agreement.
28: * Consult the Preface in the User's Manual for the full terms of
29: * this agreement.
30: *
31: */
32:
33:
34: #include "quipu/util.h"
35: #include "quipu/dua.h"
36: #include "quipu/entry.h"
37: #include "quipu/read.h"
38:
39: extern Entry current_entry;
40: extern DN current_dn;
41:
42: #define OPT (!frompipe || rps -> ps_byteno == 0 ? opt : rps)
43: #define RPS (!frompipe || opt -> ps_byteno == 0 ? rps : opt)
44: extern char frompipe;
45: extern PS opt, rps;
46:
47: extern DN dn;
48: char move_flag;
49:
50: extern char fred_flag;
51: extern char fred_expand;
52: extern char fred_long;
53: extern char fred_phone;
54: extern char fred_sequence;
55: extern char fred_subdisplay;
56:
57: extern LLog *log_dua;
58:
59: call_showentry (argc, argv)
60: int argc;
61: char **argv;
62: {
63: Attr_Sequence eptr;
64: char *vect[2];
65: int x;
66: extern char name_flag;
67: extern char all_flag;
68: extern Attr_Sequence as_flag;
69: extern char flag_show;
70:
71: vect[0] = "showentry";
72:
73: move_flag = FALSE;
74: fred_flag = FALSE;
75: fred_expand = FALSE;
76: fred_long = 2;
77: fred_phone = FALSE;
78: fred_sequence = TRUE;
79: fred_subdisplay = FALSE;
80: name_flag = FALSE;
81:
82: for (x=1; x<argc; x++) {
83: if (test_arg (argv[x], "-move",2))
84: move_flag = TRUE;
85: else if (test_arg (argv[x], "-nomove",3))
86: move_flag = FALSE;
87: else if (test_arg (argv[x], "-fred",4))
88: fred_flag = TRUE;
89: else if (test_arg (argv[x], "-expand",4))
90: fred_expand = TRUE;
91: else if (test_arg (argv[x], "-full",4))
92: fred_long = TRUE;
93: else if (test_arg (argv[x], "-summary",7))
94: fred_long = FALSE;
95: else if (test_arg (argv[x], "-phone",5))
96: fred_phone = TRUE;
97: else if (test_arg (argv[x], "-nofredseq",9))
98: fred_sequence = FALSE;
99: else if (test_arg (argv[x], "-subdisplay",10))
100: fred_subdisplay = TRUE;
101: else
102: continue;
103: shuffle_up (argc--,argv,x--);
104:
105: }
106: if ((argc = read_cache (argc, argv)) < 0)
107: return;
108:
109:
110: if (argc != 1) {
111: ps_printf (OPT,"Unknown option %s\n",argv[1]);
112: Usage (argv[0]);
113: return;
114: }
115:
116: if (current_entry == NULLENTRY) {
117: ps_print (OPT,"Specify an entry \n");
118: /* this CAN happen - when the entry is not cache, but -noread */
119: return;
120: }
121:
122: if (fred_flag) {
123: if (fred_long == 2)
124: if ((fred_subdisplay && fred_expand)
125: || (!fred_subdisplay && !fred_expand))
126: fred_long = TRUE;
127: else
128: fred_long = fred_expand;
129: if (fred_expand)
130: fred_long = fred_subdisplay = TRUE;
131:
132: (void) showfred (current_dn, fred_long, fred_subdisplay);
133: }
134: else {
135: if (name_flag) {
136: dn_print (RPS,dn,EDBOUT);
137: ps_print (RPS,"\n");
138: }
139:
140: if (all_flag)
141: eptr = current_entry->e_attributes;
142: else
143: eptr = as_flag;
144:
145: if (flag_show)
146: for (; eptr != NULLATTR; eptr = eptr->attr_link)
147: showattribute (eptr->attr_type);
148: }
149:
150: consolidate_move();
151: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.