I have a problem with libpng library, I am trying to use my own memory allocation routines. So, as stays in doc, I define PNG_USER_MEM_SUPPORTED and want to use png_create_read_struct_2() instead of png_create_read_struct(). png_create_read_struct_2 takes following parameters:
png_structp png_ptr = png_create_read_struct_2 (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, user_error_fn, user_warning_fn, (png_voidp) user_mem_ptr, user_malloc_fn, user_free_fn);
I'm interested in last three params.
I've wrote my_malloc and my_free, but my question is, what is the user_mem_ptr, and if anyone worked with it and used it, please give me a clue, or link me to some example (I haven't found a well explained example on web :-| ).
Thank you in advance.