Category : C Source Code
Archive   : BITSTRG.ZIP
Filename : CREBITAR.C

 
Output of file : CREBITAR.C contained in archive : BITSTRG.ZIP
/*
librairie : bitstrg

crebitarray -- allocation memoire pour champ de bits
*/

#include
#include "bitstrg.h"

/*
Creation of an array of bit

The array is initialized to all 0s
return a pointer on the array parameters structure or NULL if problem
*/

struct SPARRAY* crebitarray(nbbit)
unsigned nbbit; /* number of the last bit in the array */
{
unsigned value; /* number of element in array */

struct SPARRAY* pnt;

value = (((long)nbbit+1) / SIZE )
+ ((((long)nbbit+1) & (SIZE - 1)) ? 1 : 0);

if((pnt = (struct SPARRAY *) calloc (1,sizeof(struct SPARRAY))) != NULL) {
if((pnt->pntarray = (ELEBAR*) calloc(value,sizeof(ELEBAR))) == NULL) {
free(pnt);
return(NULL);
}
pnt->numlbit = nbbit;
}
return(pnt);
}


  3 Responses to “Category : C Source Code
Archive   : BITSTRG.ZIP
Filename : CREBITAR.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/