summaryrefslogtreecommitdiff
path: root/fluid/code.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/code.cxx')
-rw-r--r--fluid/code.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/fluid/code.cxx b/fluid/code.cxx
index b782ee35f..7b156f57e 100644
--- a/fluid/code.cxx
+++ b/fluid/code.cxx
@@ -283,6 +283,14 @@ void write_c(const char* format,...) {
va_end(args);
}
+// write code (c) of size (n) to C file, with optional comment (com) w/o trailing space
+void write_cc(const char *indent, int n, const char *c, const char *com) {
+ if (*com)
+ write_c("%s%.*s; %s\n", indent, n, c, com);
+ else
+ write_c("%s%.*s;\n", indent, n, c);
+}
+
void write_h(const char* format,...) {
if (varused_test) return;
va_list args;
@@ -291,6 +299,14 @@ void write_h(const char* format,...) {
va_end(args);
}
+// write code (c) of size (n) to H file, with optional comment (com) w/o trailing space
+void write_hc(const char *indent, int n, const char* c, const char *com) {
+ if (*com)
+ write_h("%s%.*s; %s\n", indent, n, c, com);
+ else
+ write_h("%s%.*s;\n", indent, n, c);
+}
+
#include <FL/filename.H>
int write_number;
int write_sourceview;