|
|
1.1 root 1: /* sprintref.c - manage encoded session addresses */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/psap/RCS/sprintref.c,v 7.0 89/11/23 22:13:43 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/psap/RCS/sprintref.c,v 7.0 89/11/23 22:13:43 mrose Rel $
9: *
10: *
11: * $Log: sprintref.c,v $
12: * Revision 7.0 89/11/23 22:13:43 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: /* LINTLIBRARY */
29:
30: #include <stdio.h>
31: #include "psap.h"
32: #include "ssap.h"
33:
34: /* */
35:
36: char *sprintref (sr)
37: struct SSAPref *sr;
38: {
39: register char *cp;
40: static char buffer[BUFSIZ];
41:
42: cp = buffer;
43: *cp++ = '<';
44:
45: if (sr -> sr_ulen) {
46: if (sr -> sr_ulen > 1 && *(sr -> sr_udata + 1) + 2 == sr -> sr_ulen)
47: (void) sprintf (cp, "%*.*s", sr -> sr_ulen - 2, sr -> sr_ulen - 2,
48: sr -> sr_udata + 2);
49: else
50: (void) sprintf (cp, "%*.*s", sr -> sr_ulen, sr -> sr_ulen,
51: sr -> sr_udata);
52: cp += strlen (cp);
53: }
54: *cp++ = ',';
55:
56: if (sr -> sr_clen) {
57: if (sr -> sr_clen > 1 && *(sr -> sr_cdata + 1) + 2 == sr -> sr_clen)
58: (void) sprintf (cp, "%*.*s", sr -> sr_clen - 2, sr -> sr_clen - 2,
59: sr -> sr_cdata + 2);
60: else
61: (void) sprintf (cp, "%*.*s", sr -> sr_clen, sr -> sr_clen,
62: sr -> sr_cdata);
63: cp += strlen (cp);
64: }
65: *cp++ = ',';
66:
67: if (sr -> sr_alen) {
68: if (sr -> sr_alen > 1 && *(sr -> sr_adata + 1) + 2 == sr -> sr_alen)
69: (void) sprintf (cp, "%*.*s", sr -> sr_alen - 2, sr -> sr_alen - 2,
70: sr -> sr_adata + 2);
71: else
72: (void) sprintf (cp, "%*.*s", sr -> sr_alen, sr -> sr_alen,
73: sr -> sr_adata);
74: cp += strlen (cp);
75: }
76: *cp++ = ',';
77:
78: if (sr -> sr_vlen) {
79: if (sr -> sr_vlen > 1 && *(sr -> sr_vdata + 1) + 2 == sr -> sr_vlen)
80: (void) sprintf (cp, "%*.*s", sr -> sr_vlen - 2, sr -> sr_vlen - 2,
81: sr -> sr_vdata + 2);
82: else
83: (void) sprintf (cp, "%*.*s", sr -> sr_vlen, sr -> sr_vlen,
84: sr -> sr_vdata);
85: cp += strlen (cp);
86: }
87: *cp++ = '>';
88:
89: *cp = NULL;
90:
91: return buffer;
92: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.