mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-01 22:58:40 -04:00
scanner: Use indent() function in desc_dump()
This commit is contained in:
parent
3f7048e0e9
commit
e4026ff797
1 changed files with 19 additions and 25 deletions
|
|
@ -138,10 +138,26 @@ uppercase_dup(const char *src)
|
|||
return u;
|
||||
}
|
||||
|
||||
static const char *indent(int n)
|
||||
{
|
||||
const char *whitespace[] = {
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t "
|
||||
};
|
||||
|
||||
return whitespace[n % 8] + 12 - n / 8;
|
||||
}
|
||||
|
||||
static void
|
||||
desc_dump(char *src, int startcol)
|
||||
{
|
||||
int i, j = 0, col = startcol, line = 0;
|
||||
int i, col = startcol, line = 0;
|
||||
|
||||
/* Strip leading space */
|
||||
for (i = 0; isspace(src[i]); i++)
|
||||
|
|
@ -156,14 +172,8 @@ desc_dump(char *src, int startcol)
|
|||
src[i] = ' ';
|
||||
|
||||
if (col > 72 && isspace(src[i])) {
|
||||
if (src[i+1]) {
|
||||
putchar('\n');
|
||||
for (j = 0; j < startcol; j++)
|
||||
putchar(' ');
|
||||
putchar(' ');
|
||||
putchar('*');
|
||||
putchar(' ');
|
||||
}
|
||||
if (src[i+1])
|
||||
printf("\n%s* ", indent(startcol + 1));
|
||||
line++;
|
||||
col = startcol;
|
||||
} else {
|
||||
|
|
@ -619,22 +629,6 @@ emit_event_wrappers(struct wl_list *message_list, struct interface *interface)
|
|||
}
|
||||
}
|
||||
|
||||
static const char *indent(int n)
|
||||
{
|
||||
const char *whitespace[] = {
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t ",
|
||||
"\t\t\t\t\t\t\t\t\t\t\t\t "
|
||||
};
|
||||
|
||||
return whitespace[n % 8] + 12 - n / 8;
|
||||
}
|
||||
|
||||
static void
|
||||
emit_enumerations(struct interface *interface)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue