Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Img library - io_open(IO_MEM, IO_WRITE, ...): (3 Items)
   
Img library - io_open(IO_MEM, IO_WRITE, ...)  
How to use io_open() for write into memory buffer?
Try like
   output = io_open(IO_MEM, IO_WRITE, (unsigned)BUF_SIZE, (void*)buf);
gives errno = ENOTSUP         48  /* Not supported (1003.1b-1993)   */
Is it possible?

Additional remark - documentation for image library is rather brief (e.g. not mentioned how to free memory allocated 
with img_load())
RE: Img library - io_open(IO_MEM, IO_WRITE, ...)  
No, it is a read-only interface.  Only the IO_FD interface supports write functionality.

-----Original Message-----
From: Andrzej Polanski(deleted) [mailto:community-noreply@qnx.com] 
Sent: Friday, December 1, 2017 5:29 AM
To: advanced-graphics <advanced-graphics@community.qnx.com>
Subject: Img library - io_open(IO_MEM, IO_WRITE, ...)

How to use io_open() for write into memory buffer?
Try like
   output = io_open(IO_MEM, IO_WRITE, (unsigned)BUF_SIZE, (void*)buf);
gives errno = ENOTSUP         48  /* Not supported (1003.1b-1993)   */
Is it possible?

Additional remark - documentation for image library is rather brief (e.g. not mentioned how to free memory allocated 
with img_load())



_______________________________________________

Advanced Graphics
http://community.qnx.com/sf/go/post118255
To cancel your subscription to this discussion, please e-mail advanced-graphics-unsubscribe@community.qnx.com
Re: RE: Img library - io_open(IO_MEM, IO_WRITE, ...)  
Thank you for fast response.

I would like to do it myself.
In particular - how to properly initialize 
struct _io_bstream {
	io_stream_t	stream;
	unsigned	flags;
	_uint8		*buf;
	unsigned 	bufsiz, buf_pos, buf_nleft;
	unsigned	pos, nleft;
	io_close_f	*close_f;
}
in my version of "io_open_f()"?
I have tried  but it does not work properly (perhaps flags or sizes not set properly).
Is there doc or example?