Category : Files from Magazines
Archive   : CUJ9306.ZIP
Filename : 1106112B

 
Output of file : 1106112B contained in archive : CUJ9306.ZIP
typedef char * Buffer;

void Buffer_initialize(char ** pointer);
int Buffer_allocate(char ** pointer, size_t size,
char * name);
void Buffer_terminate(char ** pointer);

int some_function(void)
{
Buffer buffer1, buffer2;
int ret1, ret2;

Buffer_initialize(&buffer1);
Buffer_initialize(&buffer2);

if (Buffer_allocate(&buffer1, 1024, "buffer1")
== SUCCESS
&& Buffer_allocate(&buffer2, 1024, "buffer2")
== SUCCESS)
{
/* Do whatever processing is required. */
}
Buffer_terminate(&buffer1);
Buffer_terminate(&buffer2);
}

void Buffer_initialize(Buffer * buffer)
{
*buffer = NULL:
return;
}

int Buffer_allocate(Buffer * pointer, size_t size,
char * name)
{
int return_code = SUCCESS;
*pointer = malloc(size);
if (*pointer == NULL)
{

fprintf(stderr, "Allocation failure for %s size %d",
name, size);
return_code = FAILUE;
}
return return_code;
}

void Buffer_terminate(Buffer * pointer)
{
if (*pointer != NULL)
{
free(*pointer);
*pointer = NULL;
}
return;
}




  3 Responses to “Category : Files from Magazines
Archive   : CUJ9306.ZIP
Filename : 1106112B

  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/