Subversion Repositories Kolibri OS

Rev

Rev 1604 | Rev 1869 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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