Subversion Repositories Kolibri OS

Rev

Rev 1604 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1408 serge 1
 
2
#include 
3
4
 
5
typedef struct
6
{
7
  char sec;
8
  char min;
9
  char hour;
10
  char rsv;
11
}detime_t;
12
13
 
14
{
15
  char  day;
16
  char  month;
17
  short year;
18
}dedate_t;
19
20
 
21
{
22
  unsigned    attr;
23
  unsigned    flags;
24
  union
25
  {
26
     detime_t  ctime;
27
     unsigned  cr_time;
28
  };
29
  union
30
  {
31
     dedate_t  cdate;
32
     unsigned  cr_date;
33
  };
34
  union
35
  {
36
     detime_t  atime;
37
     unsigned  acc_time;
38
  };
39
  union
40
  {
41
     dedate_t  adate;
42
     unsigned  acc_date;
43
  };
44
  union
45
  {
46
     detime_t  mtime;
47
     unsigned  mod_time;
48
  };
49
  union
50
  {
51
     dedate_t  mdate;
52
     unsigned  mod_date;
53
  };
54
  unsigned    size;
55
  unsigned    size_high;
56
} FILEINFO;
57
58
 
59
60
 
61
{
62
  char *path;
63
  int  offset;
64
} dbgfile_t;
65
66
 
67
68
 
69
#define va_end(v)       __builtin_va_end(v)
70
#define va_arg(v,l)     __builtin_va_arg(v,l)
71
#define __va_copy(d,s)	__builtin_va_copy(d,s)
72
73
 
74
typedef __gnuc_va_list    va_list;
75
76
 
77
78
 
79
{
80
    FILEINFO info;
81
82
 
83
84
 
85
    {
86
        if(!create_file(path))
87
        {
88
            dbgfile.path = path;
89
            return true;
90
        }
91
        else return false;
92
    };
93
    set_file_size(path, 0);
94
    dbgfile.path   = path;
95
    dbgfile.offset = 0;
96
    return true;
97
};
98
99
 
100
101
 
102
{
103
    char  txtbuf[256];
104
    int   len = 0;
105
106
 
107
108
 
109
    if (format)
110
        len = vsnprintf(txtbuf, 256, format, ap);
111
    va_end(ap);
112
113
 
114
        SysMsgBoardStr(txtbuf);
115
116
 
117
}
118
119
 
120
 
121
{
122
    char      txtbuf[256];
123
    unsigned  writes;
124
    int       len = 0;
125
126
 
127
128
 
129
    if (format)
130
      len = vsnprintf(txtbuf, 256, format, ap);
131
    va_end(ap);
132
133
 
134
    {
135
        SysMsgBoardStr(txtbuf);
136
137
 
138
        {
139
            write_file(dbgfile.path,txtbuf,dbgfile.offset,len,&writes);
140
            dbgfile.offset+=writes;
141
        };
142
    };
143
    return len;
144
}
145
146
 
147
{
148
    char      txtbuf[256];
149
    unsigned  writes;
150
    va_list   ap;
151
152
 
153
154
 
155
    if (format)
156
        len = vsnprintf(txtbuf, 256, format, ap);
157
    va_end(ap);
158
159
 
160
    {
161
        SysMsgBoardStr(txtbuf);
162
163
 
164
        {
165
            write_file(dbgfile.path,txtbuf,dbgfile.offset,len,&writes);
166
            dbgfile.offset+=writes;
167
        };
168
    };
169
    return len;
170
}
171
172
 
173
{
174
	va_list ap;
175
	int retval;
176
177
 
178
	retval = vsnprintf(s, n, format, ap);
179
	va_end(ap);
180
181
 
182
}
183