[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting a string stream
From: |
Pascal Bourguignon |
Subject: |
Re: Getting a string stream |
Date: |
Sun, 23 Sep 2001 21:23:58 +0200 (CEST) |
Aurelien <aurelien@fractals.be> wrote:
>
> Hi again,
>
> Sorry, this is more a C question, but it could turn out that objective-c
> has more adequate an answer to my problem...
>
> I have an NSString that I'd like to pass to a function as a stream. This
> is how I'm trying to implement this:
>
> #include <stdio.h>
>
> [...]
> FILE *_stream;
> NSString *streamStr = [[NSString alloc] initWithString: @"..."];
> const char *buffer = [streamStr UTF8String];
> _stream = fmemopen ( buffer, strlen (buffer), "r" );
> [...]
>
> the compiler complains about an "undefined reference to 'fmemopen'"
>
> Seems that my glibc version doesn't support fmemopen. Is something like
> this possible ? fmemopen is such a basic facility...
You can check if you have a function in a library with:
% nm /usr/lib/libc.a | grep fmemopen
fmemopen.o:
00000220 T fmemopen
000001f0 T fmemopen_close
00000000 T fmemopen_read
00000180 T fmemopen_seek
00000090 T fmemopen_write
> How can I know the version of my glibc ?
If you have rpm and you've installed glibc with rpm, you can get its
version with:
% rpm -q --queryformat='%{VERSION}-%{RELEASE}\n' glibc
2.2-9
> Is there another well-known
> function with the same functionality ?
>
> Finally, are there objc objects to handle streams ?
>
> Aurélien
--
__Pascal_Bourguignon__ (o_ Software patents are endangering
() ASCII ribbon against html email //\ the computer industry all around
/\ and Microsoft attachments. V_/ the world http://lpf.ai.mit.edu/
1962:DO20I=1.100 2001:my($f)=`fortune`; http://petition.eurolinux.org/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d? s++:++(+++)>++ a C+++ UB+++L++++$S+X++++>$ P- L+++ E++ W++
N++ o-- K- w------ O- M++$ V PS+E++ Y++ PGP++ t+ 5? X+ R !tv b++(+)
DI+++ D++ G++ e+++ h+(++) r? y---? UF++++
------END GEEK CODE BLOCK------