|
|
@ -5,14 +5,19 @@
|
|
|
|
#include <ulib.h>
|
|
|
|
#include <ulib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
|
|
|
fputch(char c, int *cnt, int fd) {
|
|
|
|
|
|
|
|
write(fd, &c, sizeof(char));
|
|
|
|
|
|
|
|
(*cnt) ++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* *
|
|
|
|
/* *
|
|
|
|
* cputch - writes a single character @c to stdout, and it will
|
|
|
|
* cputch - writes a single character @c to stdout, and it will
|
|
|
|
* increace the value of counter pointed by @cnt.
|
|
|
|
* increace the value of counter pointed by @cnt.
|
|
|
|
* */
|
|
|
|
* */
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
cputch(int c, int *cnt) {
|
|
|
|
cputch(int c, int *cnt) {
|
|
|
|
sys_putc(c);
|
|
|
|
fputch(c, cnt, 1);
|
|
|
|
(*cnt) ++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* *
|
|
|
|
/* *
|
|
|
@ -63,13 +68,6 @@ cputs(const char *str) {
|
|
|
|
return cnt;
|
|
|
|
return cnt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
|
|
|
fputch(char c, int *cnt, int fd) {
|
|
|
|
|
|
|
|
write(fd, &c, sizeof(char));
|
|
|
|
|
|
|
|
(*cnt) ++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
int
|
|
|
|
vfprintf(int fd, const char *fmt, va_list ap) {
|
|
|
|
vfprintf(int fd, const char *fmt, va_list ap) {
|
|
|
|
int cnt = 0;
|
|
|
|
int cnt = 0;
|
|
|
|