77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
* (should) never get called.
*/
void begin_session(void) { }
void write_clip (void *data, int len) { }
void term_deselect(void) { }
/* GUI Adaptation - Sept 2000 */
void send_msg(HWND h, UINT message, WPARAM wParam)
{
while (!PostMessage( h, message, wParam, 0))
SleepEx(1000,TRUE);
}
void tell_char(FILE *stream, char c)
{
if (!gui_mode)
fputc(c, stream);
else
{
unsigned int msg_id = WM_STD_OUT_CHAR;
if (stream == stderr) msg_id = WM_STD_ERR_CHAR;
send_msg( (HWND)atoi(gui_hwnd), msg_id, (WPARAM)c );
}
}
void tell_str(FILE *stream, char *str)
{
unsigned int i;
for( i = 0; i < strlen(str); ++i )
tell_char(stream, str[i]);
}
void tell_user(FILE *stream, char *fmt, ...)
{
char str[0x100]; /* Make the size big enough */
va_list ap;
va_start(ap, fmt);
vsprintf(str, fmt, ap);
va_end(ap);
strcat(str, "\n");
tell_str(stream, str);
}
void gui_update_stats(char *name, unsigned long size, int percentage, time_t elapsed)
{
unsigned int i;
if (strcmp(name,statname) != 0)
{
for( i = 0; i < strlen(name); ++i )
send_msg( (HWND)atoi(gui_hwnd), WM_STATS_CHAR, (WPARAM)name[i]);
|
|
|
|
|
|
|
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
* (should) never get called.
*/
void begin_session(void) { }
void write_clip (void *data, int len) { }
void term_deselect(void) { }
/* GUI Adaptation - Sept 2000 */
static void send_msg(HWND h, UINT message, WPARAM wParam)
{
while (!PostMessage( h, message, wParam, 0))
SleepEx(1000,TRUE);
}
static void tell_char(FILE *stream, char c)
{
if (!gui_mode)
fputc(c, stream);
else
{
unsigned int msg_id = WM_STD_OUT_CHAR;
if (stream == stderr) msg_id = WM_STD_ERR_CHAR;
send_msg( (HWND)atoi(gui_hwnd), msg_id, (WPARAM)c );
}
}
static void tell_str(FILE *stream, char *str)
{
unsigned int i;
for( i = 0; i < strlen(str); ++i )
tell_char(stream, str[i]);
}
static void tell_user(FILE *stream, char *fmt, ...)
{
char str[0x100]; /* Make the size big enough */
va_list ap;
va_start(ap, fmt);
vsprintf(str, fmt, ap);
va_end(ap);
strcat(str, "\n");
tell_str(stream, str);
}
static void gui_update_stats(char *name, unsigned long size, int percentage, time_t elapsed)
{
unsigned int i;
if (strcmp(name,statname) != 0)
{
for( i = 0; i < strlen(name); ++i )
send_msg( (HWND)atoi(gui_hwnd), WM_STATS_CHAR, (WPARAM)name[i]);
|