Been trying to tackle this problem for a while now...
I'm trying to work with some zlib values but getting really confused...
First here are all the header-ish info needed to understand:
typedef struct z_stream_s {
Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */
Bytef *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */
free_func zfree; /* used to free the internal state */
voidpf opaque; /* private data object passed to zalloc and zfree */
int data_type; /* best guess about the data type: binary or text */
uLong adler; /* adler32 value of the uncompressed data */
uLong reserved; /* reserved for future use */
} z_stream;
typedef z_stream FAR *z_streamp;
typedef Byte FAR Bytef;
typedef unsigned char Byte;
I have a z_streamp, and want to get a string version of *next_in that can be displayed in a messagebox. I usually use C# so all these pointers and incompatible string types have been confusing me :|
From what I understand, the z_streamp object I have is actually a pointer to a z_stream_s, which contains the *next_in value , which is a pointer to a Bytef which is actually a Byte which is actually an unsigned char... so how do I go from a z_streamp to a lpcstr of *next_in's value?
Question
fhpuqrgrpgvirzhpujbj
Been trying to tackle this problem for a while now...
I'm trying to work with some zlib values but getting really confused...
First here are all the header-ish info needed to understand:
typedef struct z_stream_s { Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total nb of input bytes read so far */ Bytef *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total nb of bytes output so far */ char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: binary or text */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; typedef Byte FAR Bytef; typedef unsigned char Byte;I have a z_streamp, and want to get a string version of *next_in that can be displayed in a messagebox. I usually use C# so all these pointers and incompatible string types have been confusing me :|
From what I understand, the z_streamp object I have is actually a pointer to a z_stream_s, which contains the *next_in value , which is a pointer to a Bytef which is actually a Byte which is actually an unsigned char... so how do I go from a z_streamp to a lpcstr of *next_in's value?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts