/* sel2str.c - selector to string */
static char *rcsid
= "$Header: /f/osi/compat/RCS/sel2str.c,v 7.2 91/02/22 09:15:44 mrose Interim $";
* $Header: /f/osi/compat/RCS/sel2str.c,v 7.2 91/02/22 09:15:44 mrose Interim $
* Revision 7.2 91/02/22 09:15:44 mrose
* Revision 7.1 90/11/21 11:29:55 mrose
* Revision 7.0 89/11/23 21:23:23 mrose
* 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
char *sel2str (sel
, len
, quoted
)
static char buf1
[NASIZE
* 2 + 1],
static char *bufs
[] = { buf1
, buf2
, buf3
, buf4
};
(void) sprintf (cp
, "#%d",
(sel
[0] & 0xff) << 8 | (sel
[1] & 0xff));
for (ep
= (dp
= sel
) + len
; dp
< ep
; dp
++)
if (!isprint ((u_char
) *dp
))
(void) sprintf (cp
, len
? "\"%*.*s\"" : "\"\"", len
, len
, sel
);
if (len
> NASIZE
) /* XXX */
cp
[explode (cp
, (u_char
*) sel
, len
)] = NULL
;