|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 1634 (0x662) Types: TextFile Names: »sel2str.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« └─⟦de7628f85⟧ └─⟦this⟧ »isode-6.0/compat/sel2str.c«
/* sel2str.c - selector to string */ #ifndef lint static char *rcsid = "$Header: /f/osi/compat/RCS/sel2str.c,v 7.0 89/11/23 21:23:23 mrose Rel $"; #endif /* * $Header: /f/osi/compat/RCS/sel2str.c,v 7.0 89/11/23 21:23:23 mrose Rel $ * * * $Log: sel2str.c,v $ * Revision 7.0 89/11/23 21:23:23 mrose * Release 6.0 * */ /* * NOTICE * * 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 * this agreement. * */ /* LINTLIBRARY */ #include <ctype.h> #include <stdio.h> #include "general.h" #include "manifest.h" #include "isoaddrs.h" /* \f */ char *sel2str (sel, len, quoted) char *sel; int len, quoted; { register char *cp, *dp, *ep; static int i = 0; static char buf1[NASIZE * 2 + 1], buf2[NASIZE * 2 + 1], buf3[NASIZE * 2 + 1], buf4[NASIZE * 2 + 1]; static char *bufs[] = { buf1, buf2, buf3, buf4 }; cp = bufs[i++]; i = i % 4; if (quoted) { #ifndef NOGOSIP if (len == 2) { if (quoted < 0) goto ugly; (void) sprintf (cp, "#%d", (sel[0] & 0xff) << 8 | (sel[1] & 0xff)); goto out; } #endif for (ep = (dp = sel) + len; dp < ep; dp++) if (!isprint (*dp)) goto ugly; if (len > NASIZE * 2) len = NASIZE * 2; (void) sprintf (cp, len ? "\"%*.*s\"" : "\"\"", len, len, sel); } else { ugly: ; if (len > NASIZE) /* XXX */ len = NASIZE; cp[explode (cp, (u_char *) sel, len)] = NULL; } #ifndef NOGOSIP out: ; #endif return cp; }