+int my_fopen(const char *path, const char *mode, ostream *os)
+{
+ FILE *fd = fopen(path, mode);
+ if(fd)
+ {
+ os->OutFd = fd;
+ return 1; /*success*/
+ }
+ else
+ os->OutFd = NULL;
+ return 0;
+}
+
+int my_fseek(ostream *stream, long offset, int whence)
+{
+ return fseek(stream->OutFd, offset, whence);
+}
+int my_fseekr(istream *stream, long offset, int whence)
+{
+ return fseek(stream->InFd, offset, whence);
+}
+
+size_t my_fread(void *ptr, size_t size, size_t nmemb, istream *stream)
+{
+ return fread(ptr, size, nmemb, stream->InFd);
+}
+
+size_t my_fwrite(const void *ptr, size_t size, size_t nmemb, ostream *stream)
+{
+ return fwrite(ptr, size, nmemb, stream->OutFd);
+}
+
+int my_fcloser(istream *fp)
+{
+ return fclose(fp->InFd);
+}
+int my_fclose(ostream *fp)
+{
+ return fclose(fp->OutFd);
+}
+#include <stdarg.h>
+
+int my_printf(const char *format, ...)
+{
+ va_list argptr;
+ int ret;
+
+ va_start(argptr, format);
+ ret = vprintf(format, argptr);
+ va_end(argptr);
+
+ return ret;
+}
+
+int my_sprintf(char *str, const char *format, ...)
+{
+ va_list argptr;
+ int ret;
+
+ va_start(argptr, format);
+ ret = vsprintf(str,format, argptr);
+ va_end(argptr);
+
+ return ret;
+}
+
+int my_fprintf(const char *format, ...)
+{
+ va_list argptr;
+ int ret;
+
+ va_start(argptr, format);
+ ret = vfprintf(stderr,format, argptr);
+ va_end(argptr);
+
+ return ret;
+}
+void my_exit(int status)
+{
+ exit(status);
+}
+
+
+#define GDCM_BUILD_MPEG2DEC