Sha256: 65a14ca13be7f09cf2a2a9f46060b53fd478cc3ab61081a7d1a69b92eb13b5b6

Contents?: true

Size: 829 Bytes

Versions: 37

Compression:

Stored size: 829 Bytes

Contents

#include "tst.h"
#include <stdio.h>
#include <stdlib.h>

struct tst *tst_init(int width)
{
   struct tst *tst;
   struct node *current_node;
   int i;


if((tst = (struct tst *) calloc(1, sizeof(struct tst))) == NULL)
   return NULL;

if ((tst->node_lines = (struct node_lines *) calloc(1, sizeof(struct node_lines))) == NULL)
{
   free(tst);
   return NULL;
}

tst->node_line_width = width;
tst->node_lines->next = NULL;
if ((tst->node_lines->node_line = (struct node *) calloc(width, sizeof(struct node))) == NULL)
{
   free(tst->node_lines);
   free(tst);
   return NULL;
}

current_node = tst->node_lines->node_line;
tst->free_list = current_node;
for (i = 1; i < width; i++)
{
   current_node->middle = &(tst->node_lines->node_line[i]);
   current_node = current_node->middle;
}
current_node->middle = NULL;
return tst;
}

Version data entries

37 entries across 37 versions & 3 rubygems

Version Path
IOWA-1.0.3 ext/Classifier/tst_init.c
IOWA-1.0.2 ext/Classifier/tst_init.c
IOWA-1.0.0 ext/Classifier/tst_init.c
mongrel-0.2.1 ext/http11/tst_init.c
mongrel-0.3.1 ext/http11/tst_init.c
mongrel-0.2.0 ext/http11/tst_init.c
mongrel-0.3.10.1 ext/http11/tst_init.c
mongrel-0.2.2 ext/http11/tst_init.c
mongrel-0.3.12.1 ext/http11/tst_init.c
mongrel-0.3.12.2 ext/http11/tst_init.c
mongrel-0.3.12.3 ext/http11/tst_init.c
mongrel-0.3.11 ext/http11/tst_init.c
mongrel-0.3.10 ext/http11/tst_init.c
mongrel-0.3.13.2 ext/http11/tst_init.c
mongrel-0.3.12 ext/http11/tst_init.c
mongrel-0.3.13.1 ext/http11/tst_init.c
mongrel-0.3.12.4 ext/http11/tst_init.c
mongrel-0.3.13.4 ext/http11/tst_init.c
mongrel-0.3.13.3 ext/http11/tst_init.c
mongrel-0.3.13 ext/http11/tst_init.c