/*
* Render C declarations as English.
- * Copyright © 2011, 2021 Nick Bowler
+ * Copyright © 2011, 2021, 2023 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "cdecl.h"
#include "cdecl-internal.h"
+static size_t explain_pre_specs(char *buf, size_t n, struct cdecl_declspec *s)
+{
+ return cdecl__explain_specs(buf, n, s, CDECL_SPEC_FUNC|CDECL_SPEC_STOR);
+}
+
+static size_t explain_post_specs(char *buf, size_t n, struct cdecl_declspec *s)
+{
+ return cdecl__explain_specs(buf, n, s, CDECL_SPEC_QUAL|CDECL_SPEC_TYPE);
+}
+
/*
* Renders the start of the thing being declared. If top is true, print
* the "declare" or "type" keywords at the front, as appropriate.
rc = explain_prologue(buf, n, decl->declarators, top);
ret += cdecl__advance(&buf, &n, rc);
- rc = cdecl__explain_pre_specs(buf, n, decl->specifiers);
+ rc = explain_pre_specs(buf, n, decl->specifiers);
ret += cdecl__advance(&buf, &n, rc);
rc = explain_declarators(buf, n, decl->declarators);
ret += cdecl__advance(&buf, &n, rc);
- return ret + cdecl__explain_post_specs(buf, n, decl->specifiers);
+ return ret + explain_post_specs(buf, n, decl->specifiers);
}
static size_t explain_function(char *buf, size_t n, struct cdecl_function *f)