Subversion Repositories Games.Carmageddon

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 pmbaty 1
#include "brprintf.h"
2
#include "harness/trace.h"
3
#include "CORE/FW/scratch.h"
4
#include "CORE/STD/brstdlib.h"
5
#include "CORE/STD/logwrite.h"
6
 
7
#include <stdarg.h>
8
#include <stdio.h>
9
 
10
br_int_32 BrSprintf(char* buf, char* fmt, ...) {
11
    int n;
12
    va_list args;
13
 
14
    va_start(args, fmt);
15
    n = vsprintf(buf, fmt, args);
16
    va_end(args);
17
    return n;
18
}
19
 
20
br_int_32 BrSprintfN(char* buf, br_size_t buf_size, char* fmt, ...) {
21
    int n;
22
    va_list args;
23
 
24
    va_start(args, fmt);
25
    n = vsnprintf(buf, buf_size, fmt, args);
26
    va_end(args);
27
    return n;
28
}
29
 
30
int BrLogPrintf(char* fmt, ...) {
31
    int n;
32
    va_list args;
33
 
34
    va_start(args, fmt);
35
    n = BrVSprintf(BrScratchString(), fmt, args);
36
    va_end(args);
37
    BrLogWrite(BrScratchString(), 1, n);
38
 
39
    return n;
40
}
41
 
42
br_int_32 BrSScanf(char* str, char* fmt, ...) {
43
    int n;
44
    va_list args;
45
 
46
    va_start(args, fmt);
47
    n = vsscanf(str, fmt, args);
48
    va_end(args);
49
    return n;
50
}