Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #include <stdio.h>
  2.  
  3. int format_print(char *dest, size_t maxlen, const char *fmt,va_list argp);
  4.  
  5. int fprintf(FILE* file, const char* format, ...)
  6. {
  7. va_list         arg;
  8. char            *buf;
  9. int             printed;
  10. //int           data[4];
  11.        
  12.   va_start (arg, format);
  13.   buf=malloc(4096*2); //8kb max
  14.   //data[0]=(int)&arg-(int)&format;
  15.  
  16.   printed=format_print(buf,8191, format,arg);
  17.   fwrite(buf,printed,1,file);
  18.   free(buf);
  19.  
  20.   return(printed);
  21. }
  22.