Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/hp2graph/comment.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include "hp2graph.h"

int commentsize = 0;
Comment *commentdata = 0;

static int commentmax = 32;

void addComment(double t, Token s)
{
  if(!commentdata || commentsize == commentmax) {
    commentmax *= 2;
    if(!(commentdata = (Comment *)extend(commentdata, commentmax*sizeof(Comment)))) {
      fprintf(stderr,"Out of memory when allocating memory for COMMENT at %d\n",lexline);
      abort();
    }
  }
  commentdata[commentsize  ].time=t;
  commentdata[commentsize++].comment=s;
}


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].