Missing dependencies added.
[AROS-Contrib.git] / rexx / lstring / lines.c
blob5624bbb02b4cdbf7d8f15c5836c213bf12816bb0
1 /*
2 * $Header$
3 * $Log$
4 * Revision 1.1 2001/04/04 05:43:37 wang
5 * First commit: compiles on Linux, Amiga, Windows, Windows CE, generic gcc
7 * Revision 1.2 1999/11/26 12:52:25 bnv
8 * Changed: To use the new macros.
10 * Revision 1.1 1998/07/02 17:18:00 bnv
11 * Initial Version
15 #include <lstring.h>
17 /* ---------------- Llines ------------------- */
18 long
19 Llines( FILEP f )
21 long pos,l;
22 int ch,prev;
24 pos = FTELL(f); /* read current position */
25 l = 0;
26 prev = ' ';
27 while (1) {
28 ch = FGETC(f);
29 if (ch==-1) {
30 if (prev!='\n') l++;
31 break;
33 if (ch=='\n') l++;
34 prev = ch;
36 FSEEK(f,pos,SEEK_SET);
37 return l;
38 } /* Llines */