Displaying 9 results from an estimated 9 matches for "out1c".
Did you mean:
out1
2019 Jan 25
0
[klibc:update-dash] input: Remove HETIO
..., old, sizeof(*new));
- new->c_cc[VMIN] = 1;
- new->c_cc[VTIME] = 0;
- new->c_lflag &= ~ICANON; /* unbuffered input */
- new->c_lflag &= ~ECHO;
- tcsetattr(0, TCSANOW, new);
-}
-
-void input_home(int *cursor) /* Command line input routines */
-{
- while (*cursor > 0) {
- out1c('\b');
- --*cursor;
- }
- flushout(out1);
-}
-
-
-void input_delete(int cursor)
-{
- int j = 0;
-
- memmove(parsenextc + cursor, parsenextc + cursor + 1,
- BUFSIZ - cursor - 1);
- for (j = cursor; j < (BUFSIZ - 1); j++) {
- if (!*(parsenextc + j))
- break;
- else
- out1c(*(parsen...
2020 Mar 28
0
[klibc:update-dash] dash: input: Remove HETIO
..., old, sizeof(*new));
- new->c_cc[VMIN] = 1;
- new->c_cc[VTIME] = 0;
- new->c_lflag &= ~ICANON; /* unbuffered input */
- new->c_lflag &= ~ECHO;
- tcsetattr(0, TCSANOW, new);
-}
-
-void input_home(int *cursor) /* Command line input routines */
-{
- while (*cursor > 0) {
- out1c('\b');
- --*cursor;
- }
- flushout(out1);
-}
-
-
-void input_delete(int cursor)
-{
- int j = 0;
-
- memmove(parsenextc + cursor, parsenextc + cursor + 1,
- BUFSIZ - cursor - 1);
- for (j = cursor; j < (BUFSIZ - 1); j++) {
- if (!*(parsenextc + j))
- break;
- else
- out1c(*(parsen...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Simplify echo command
...*argv);
+ if (likely(*argv))
+ nonl += print_escape_str("%s", NULL, NULL, *argv++);
if (nonl > 0)
break;
- c = ' ';
- if (!*++argv) {
-end:
- if (nonl) {
- break;
- }
- c = '\n';
- }
- outc(c, outs);
+ c = *argv ? ' ' : '\n';
+ out1c(c);
} while (*argv);
return 0;
}
2019 Jan 25
0
[klibc:update-dash] builtin: Move echo space/nl handling into print_escape_str
...- int c;
+ const char *fmt = "%s ";
+ char *s = *argv;
- if (likely(*argv))
- nonl += print_escape_str("%s", NULL, NULL, *argv++);
- if (likely((nonl + !*argv) > 1))
- break;
+ if (!s || !*++argv)
+ fmt = lastfmt;
- c = *argv ? ' ' : '\n';
- out1c(c);
- } while (*argv);
+ nonl = print_escape_str(fmt, NULL, NULL, s ?: nullstr);
+ } while (!nonl && *argv);
return 0;
}
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Simplify echo command
...*argv);
+ if (likely(*argv))
+ nonl += print_escape_str("%s", NULL, NULL, *argv++);
if (nonl > 0)
break;
- c = ' ';
- if (!*++argv) {
-end:
- if (nonl) {
- break;
- }
- c = '\n';
- }
- outc(c, outs);
+ c = *argv ? ' ' : '\n';
+ out1c(c);
} while (*argv);
return 0;
}
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Move echo space/nl handling into print_escape_str
...- int c;
+ const char *fmt = "%s ";
+ char *s = *argv;
- if (likely(*argv))
- nonl += print_escape_str("%s", NULL, NULL, *argv++);
- if (likely((nonl + !*argv) > 1))
- break;
+ if (!s || !*++argv)
+ fmt = lastfmt;
- c = *argv ? ' ' : '\n';
- out1c(c);
- } while (*argv);
+ nonl = print_escape_str(fmt, NULL, NULL, s ?: nullstr);
+ } while (!nonl && *argv);
return 0;
}
2012 Jul 02
0
[klibc:master] [OUTPUT] Make outc an inline function
...)->nextc == (file)->end ? outcslow((c), (file)) : (*(file)->nextc = (c), (file)->nextc++))
+static inline void outc(int ch, struct output *file)
+{
+ if (file->nextc == file->end)
+ outcslow(ch, file);
+ else {
+ *file->nextc = ch;
+ file->nextc++;
+ }
+}
#endif
#define out1c(c) outc((c), out1)
#define out2c(c) outcslow((c), out2)
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle embedded NULs correctly in printf
...size_t, const char *, ...)
__attribute__((__format__(__printf__,3,4)));
+int xasprintf(char **, const char *, ...);
#ifndef USE_GLIBC_STDIO
void doformat(struct output *, const char *, va_list);
#endif
@@ -115,6 +117,7 @@ static inline void outc(int ch, struct output *file)
#endif
#define out1c(c) outc((c), out1)
#define out2c(c) outcslow((c), out2)
+#define out1mem(s, l) outmem((s), (l), out1)
#define out1str(s) outstr((s), out1)
#define out2str(s) outstr((s), out2)
#define outerr(f) (f)->flags
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle embedded NULs correctly in printf
...size_t, const char *, ...)
__attribute__((__format__(__printf__,3,4)));
+int xasprintf(char **, const char *, ...);
#ifndef USE_GLIBC_STDIO
void doformat(struct output *, const char *, va_list);
#endif
@@ -115,6 +117,7 @@ static inline void outc(int ch, struct output *file)
#endif
#define out1c(c) outc((c), out1)
#define out2c(c) outcslow((c), out2)
+#define out1mem(s, l) outmem((s), (l), out1)
#define out1str(s) outstr((s), out1)
#define out2str(s) outstr((s), out2)
#define outerr(f) (f)->flags