|
|
1.1 root 1: /* get_ava.c - */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/quipu/dish/RCS/get_ava.c,v 7.0 89/11/23 22:20:09 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/quipu/dish/RCS/get_ava.c,v 7.0 89/11/23 22:20:09 mrose Rel $
9: *
10: *
11: * $Log: get_ava.c,v $
12: * Revision 7.0 89/11/23 22:20:09 mrose
13: * Release 6.0
14: *
15: */
16:
17: /*
18: * NOTICE
19: *
20: * Acquisition, use, and distribution of this module and related
21: * materials are subject to the restrictions of a license agreement.
22: * Consult the Preface in the User's Manual for the full terms of
23: * this agreement.
24: *
25: */
26:
27:
28: #include "quipu/util.h"
29: #include "quipu/commonarg.h"
30:
31: #define OPT (!frompipe || rps -> ps_byteno == 0 ? opt : rps)
32: #define RPS (!frompipe || opt -> ps_byteno == 0 ? rps : opt)
33: extern char frompipe;
34: extern PS opt, rps;
35:
36: get_ava (avasert, type, value)
37: AVA *avasert;
38: char *type;
39: char *value;
40: {
41: char *TidyString ();
42:
43: if (type == NULLCP || *type == 0)
44: return (NOTOK);
45:
46: avasert->ava_type = AttrT_new (TidyString (type));
47: if (avasert->ava_type == NULLAttrT) {
48: ps_printf (OPT, "Invalid at %s\n", type);
49: return (NOTOK);
50: }
51:
52: if ((avasert->ava_value = str_at2AttrV (TidyString (value), avasert->ava_type)) == NULLAttrV) {
53: ps_print (OPT, "Invalid attribute value value\n");
54: AttrT_free (avasert->ava_type);
55: return (NOTOK);
56: }
57:
58: return (OK);
59: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.