|
|
BSD 4.3reno
/* int2strb.c - integer to string of bits */
#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/psap/int2strb.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif
/*
* $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/psap/int2strb.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
*
*
* $Log: int2strb.c,v $
* Revision 1.1.1.1 2018/04/24 16:12:56 root
* BSD 4.3reno
*
* Revision 7.0 89/11/23 22:12:39 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 <stdio.h>
#include "psap.h"
/* */
char *int2strb (n, len)
register int n;
int len;
{
register int i;
static char buffer[sizeof (int) + 1];
bzero (buffer, sizeof (buffer));
for (i = 0; i < len; i++)
if (n & (1 << i))
buffer[i / 8] |= (1 << (7 - (i % 8)));
return buffer;
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.