* getline()
@ 2003-08-24 14:36 Progga
2003-08-24 16:01 ` getline() J.
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Progga @ 2003-08-24 14:36 UTC (permalink / raw)
To: linux-c-programming
Is there any 'C' lib which contains the getline() function ? I have found
a code similar to this:
-------
char *temp ;
int n = 0 ;
FILE *file_handle = NULL ;
// [snipped]
getline(&temp, &n, file_handle);
--------
But there's no prototype declaration and 'greping' through the '*/includes/'
havn't produced anything relevant either.
Khoda Hafez
Progga
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: getline()
2003-08-24 14:36 getline() Progga
@ 2003-08-24 16:01 ` J.
2003-08-24 21:32 ` getline() Glynn Clements
2003-08-25 12:43 ` getline() Michael Taylor
2 siblings, 0 replies; 6+ messages in thread
From: J. @ 2003-08-24 16:01 UTC (permalink / raw)
To: linux-c-programming
On Sun, 24 Aug 2003, Progga wrote:
>
> Is there any 'C' lib which contains the getline() function ? I have found
> a code similar to this:
>
> -------
>
> char *temp ;
> int n = 0 ;
> FILE *file_handle = NULL ;
>
> // [snipped]
>
> getline(&temp, &n, file_handle);
Aren't you searching for fgets() ?
char line[1024];
while((fgets(line, 1024, stdin)) != NULL)
printf("%s", line);
>
> Khoda Hafez
> Progga
JM
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: getline()
2003-08-24 14:36 getline() Progga
2003-08-24 16:01 ` getline() J.
@ 2003-08-24 21:32 ` Glynn Clements
2003-08-24 21:59 ` getline() Nico Schottelius
2003-08-25 12:43 ` getline() Michael Taylor
2 siblings, 1 reply; 6+ messages in thread
From: Glynn Clements @ 2003-08-24 21:32 UTC (permalink / raw)
To: Progga; +Cc: linux-c-programming
Progga wrote:
>
> Is there any 'C' lib which contains the getline() function ?
getline() is in libc. The prototype is in stdio.h, but you may need to
use -D_GNU_SOURCE to enable it.
--
Glynn Clements <glynn.clements@virgin.net>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: getline()
2003-08-24 21:32 ` getline() Glynn Clements
@ 2003-08-24 21:59 ` Nico Schottelius
2003-08-25 6:24 ` getline() Mike Castle
0 siblings, 1 reply; 6+ messages in thread
From: Nico Schottelius @ 2003-08-24 21:59 UTC (permalink / raw)
To: Glynn Clements; +Cc: Progga, linux-c-programming
[-- Attachment #1: Type: text/plain, Size: 204 bytes --]
> getline() is in libc. The prototype is in stdio.h, but you may need to
> use -D_GNU_SOURCE to enable it.
...and then you won't be able to use it with the dietlibc anymore...
no good idea ihmo.
Nico
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: getline()
2003-08-24 21:59 ` getline() Nico Schottelius
@ 2003-08-25 6:24 ` Mike Castle
0 siblings, 0 replies; 6+ messages in thread
From: Mike Castle @ 2003-08-25 6:24 UTC (permalink / raw)
To: linux-c-programming
In article <20030824215956.GF25257@schottelius.org>,
Nico Schottelius <nico-linux-c-programming@schottelius.org> wrote:
>> getline() is in libc. The prototype is in stdio.h, but you may need to
>> use -D_GNU_SOURCE to enable it.
>
>..and then you won't be able to use it with the dietlibc anymore...
Why? If you use getline(), you should be providing your own version for
systems that don't have it. If they have it, great, use the system
version, if they don't, use yours.
mrc
--
Mike Castle dalgoda@ix.netcom.com www.netcom.com/~dalgoda/
We are all of us living in the shadow of Manhattan. -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: getline()
2003-08-24 14:36 getline() Progga
2003-08-24 16:01 ` getline() J.
2003-08-24 21:32 ` getline() Glynn Clements
@ 2003-08-25 12:43 ` Michael Taylor
2 siblings, 0 replies; 6+ messages in thread
From: Michael Taylor @ 2003-08-25 12:43 UTC (permalink / raw)
To: Progga; +Cc: linux-c-programming
Progga wrote:
> Is there any 'C' lib which contains the getline() function ? I have found
> a code similar to this:
Getline is part of the GNU readline package, and is included in GNU libc, the
standard libc used on GNU/Linux systems (as a GNU extension -- #define
_GNU_SOURCE). Readline is include I believe in FreeBSD's libc, and available as
a package for NetBSD. See: <http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html>
readline 4.3: <ftp://ftp.cwru.edu/pub/bash/readline-4.3.tar.gz>
--
Michael Taylor
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-08-25 12:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-24 14:36 getline() Progga
2003-08-24 16:01 ` getline() J.
2003-08-24 21:32 ` getline() Glynn Clements
2003-08-24 21:59 ` getline() Nico Schottelius
2003-08-25 6:24 ` getline() Mike Castle
2003-08-25 12:43 ` getline() Michael Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).