|
|
@@ -71,8 +71,8 @@ void log_in (int type, int flag, char * data) { |
|
|
|
string_concatenate (log_notify, "\n"); |
|
|
|
} |
|
|
|
|
|
|
|
void log_out (void) { |
|
|
|
echo (log_notify); |
|
|
|
void log_out (char * name) { |
|
|
|
dump (name, log_notify); |
|
|
|
|
|
|
|
log_notify = deallocate (log_notify); |
|
|
|
} |
|
|
@@ -85,6 +85,24 @@ void echo (char * data) { |
|
|
|
out (data, string_length (data)); |
|
|
|
} |
|
|
|
|
|
|
|
void dump (char * name, char * data) { |
|
|
|
int file = -1; |
|
|
|
|
|
|
|
if (name == NULL) { |
|
|
|
echo (data); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (data == NULL) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
file = file_open (name, O_RDWR | O_CREAT | O_APPEND); |
|
|
|
|
|
|
|
file_write (file, data, string_length (data)); |
|
|
|
|
|
|
|
file = file_close (file); |
|
|
|
} |
|
|
|
|
|
|
|
void echo_byte (int byte) { |
|
|
|
out ("0123456789ABCDEF" + (byte % 256) / 16, 1); |
|
|
|