/* getlin.c Replacement for getline. Copyright (C) 1992 Ian Lance Taylor This file is part of Taylor UUCP. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #include "uucp.h" /* Read a line from a file, returning the number of characters read. This should really return ssize_t. Returns -1 on error. */ #define CGETLINE_DEFAULT (63) int getline (pzline, pcline, e) char **pzline; size_t *pcline; FILE *e; { char *zput, *zend; int bchar; if (*pzline == NULL) { *pzline = (char *) malloc (CGETLINE_DEFAULT); if (*pzline == NULL) return -1; *pcline = CGETLINE_DEFAULT; } zput = *pzline; zend = *pzline + *pcline - 1; while ((bchar = getc (e)) != EOF) { if (zput >= zend) { size_t cnew; char *znew; cnew = *pcline * 2 + 1; znew = (char *) realloc ((pointer) *pzline, cnew); if (znew == NULL) return -1; zput = znew + *pcline - 1; zend = znew + cnew - 1; *pzline = znew; *pcline = cnew; } *zput++ = bchar; if (bchar == '\n') break; } if (zput == *pzline) return -1; *zput = '\0'; return zput - *pzline; } ption>
path: root/sys/dev/raidframe/rf_diskqueue.h
AgeCommit message (Expand)Author
2009-03-23Rework/simplify the disk queuing code. A bunch of this was stilloster
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
2005-12-11merge ktrace-lwp.christos
2005-02-27nuke trailing whitespaceperry
2005-02-12The 'next' argument to rf_CreateDiskQueueData is always NULL. Sinceoster
2005-02-12Add a 'waitflag' argument to rf_CreateDiskQueueData() and use it tooster
2005-02-05CreateDiskQueueData() doesn't need to use void * for raidPtr.oster
2004-03-04Cleanup one more leftover 'row' variable. Cleanup function prototypesoster
2004-02-24occured -> occurred. From Peter Postma.wiz
2004-01-01Nuke a bunch of unused variables:oster
2003-12-29[Having received a definite lack of strenuous objection, a small amountoster
2003-02-09constify somejdolecek
2002-10-04As part of the effort to get RAIDframe playing nicely with LOCKDEBUG,oster
2002-09-15Nuke unlockingOp -- it was only used for the userland version of theoster
2002-09-15Remove a couple of unneeded structure members.oster
2002-09-15'buf2' is unused. Nuke it.oster
2002-08-02- AuxFunc is no longer used.oster
2001-10-04Step 2 of the disentanglement. We now look to <dev/raidframe/*> foroster
2000-02-13Get recent changes into the tree:oster
2000-01-08Make raidPtr a 'RF_Raid_t *' like it's supposed to be.oster