/* *This is the root component of the SqueakEasy. *[Header with internal data structures and information] * * Copyright 2003 Joseph Pingenot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * */ /*The size of a string chunk in bytes. Note that there is no terminating zero * except in the last chunk*/ #define SQKEZ_STRINGCHUNKLEN 1024 /*The struct which stores the string components*/ struct stringchunk { int end; /*offset of the last character into this chunk * If this block is full, of course, this is * SQKEZ_STRINGCHUNK - 1*/ char chunk[SQKEZ_STRINGCHUNKLEN]; /*the string chunk storage*/ struct stringchunk *next; /*Next chunk in the list*/ }; /*FUNCTIONS!*/ /*reads a full, arbitrary-length line from the client on fd. *ARGS: * fd file descriptor to read from * len pointer to the length of the buffer. *RETURNS * a pointer to the new null-terminated line (sans newline). * the length of the string in len */ char *readline(int fd, long int *len);