Subversion Repositories Kolibri OS

Rev

Rev 1408 | Rev 1616 | Go to most recent revision | Details | Compare with Previous | 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
 
1604 serge 102
 
1408 serge 103
{
104
    char  txtbuf[256];
105
    int   len = 0;
106
107
 
108
109
 
110
    if (format)
111
        len = vsnprintf(txtbuf, 256, format, ap);
112
    va_end(ap);
113
114
 
115
        SysMsgBoardStr(txtbuf);
116
117
 
118
}
119
120
 
121
 
122
{
123
    char      txtbuf[256];
124
    unsigned  writes;
125
    int       len = 0;
126
127
 
128
129
 
130
    if (format)
131
      len = vsnprintf(txtbuf, 256, format, ap);
132
    va_end(ap);
133
134
 
135
    {
136
        SysMsgBoardStr(txtbuf);
137
138
 
1604 serge 139
140
 
141
        {
1408 serge 142
            write_file(dbgfile.path,txtbuf,dbgfile.offset,len,&writes);
143
            dbgfile.offset+=writes;
144
        };
145
    };
146
    return len;
147
}
148
149
 
150
{
151
    char      txtbuf[256];
152
    unsigned  writes;
153
    va_list   ap;
154
155
 
156
157
 
158
    if (format)
159
        len = vsnprintf(txtbuf, 256, format, ap);
160
    va_end(ap);
161
162
 
163
    {
164
        SysMsgBoardStr(txtbuf);
165
166
 
167
        {
168
            write_file(dbgfile.path,txtbuf,dbgfile.offset,len,&writes);
169
            dbgfile.offset+=writes;
170
        };
171
    };
172
    return len;
173
}
174
175
 
176
{
177
	va_list ap;
178
	int retval;
179
180
 
181
	retval = vsnprintf(s, n, format, ap);
182
	va_end(ap);
183
184
 
185
}
186