You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
594 B
31 lines
594 B
//
|
|
// intercept.c
|
|
// Unity-iPhone
|
|
//
|
|
// Created by MaxBotvinev on 02.10.17.
|
|
//
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "intercept.h"
|
|
|
|
#include "ffmpeg_wrapper.h"
|
|
|
|
int printf_redirect(const char *format, ...) {
|
|
|
|
va_list arg;
|
|
int done;
|
|
|
|
va_start (arg, format);
|
|
//vfprintf(stdout, "\nREDIRECT to Unity: \n", NULL);
|
|
done = vfprintf(stdout, format, arg);
|
|
|
|
int LOG_BUFFER_LENGTH = 1024;
|
|
char buf[LOG_BUFFER_LENGTH];
|
|
vsnprintf(buf, LOG_BUFFER_LENGTH, format, arg);
|
|
on_progress(buf);
|
|
va_end (arg);
|
|
|
|
return done;
|
|
}
|