( The Canterbury Corpus )
home | purpose | summary | details | corpora | methods | related | credits | faq


Description of the Csrc file

file name:fields.c
abbreviation:Csrc
description:C source
file size:11150 bytes

Sample of contents of fields.c
(Lines 81 to 100)
 intlinesize; /* Current line buffer size */

 linebuf = (char *) malloc (field_line_inc);
 if (linebuf == NULL)
 return NULL;
 linemax = field_line_inc;
 linesize = 0;
 /*
 * Read in the line.
 */
 while (fgets (&linebuf[linesize], linemax -¬
linesize, file)
 != NULL)
 {
 linesize += strlen (&linebuf[linesize]);
 if (linebuf[linesize - 1] == '\n')
 break;
 else
 {
 linemax += field_line_inc;
 linebuf = (char *) realloc (linebuf, linemax);
Note: Lines displaying the ¬ symbol have been wrapped for clarity



This page last updated Monday, January 08, 2001 by Matt Powell Department of Computer Science University of Canterbury