- int n = buf_create();
- #define CREDITS_TITLE(t) bufstr_add(n, strcat("**", t), 0);
- #define CREDITS_FUNCTION(f) bufstr_add(n, strcat("*", f), 0);
- #define CREDITS_PERSON(p) bufstr_add(n, p, 0);
+ if (type == CREDITS_TYPE_TITLE)
+ line = strcat("**", line);
+ else if (type == CREDITS_TYPE_FUNCTION)
+ line = strcat("*", line);
+
+ if (fh >= 0)
+ fputs(fh, strcat(line, "\n"));
+ if (n >= 0)
+ bufstr_add(n, line, 0);
+}
+
+void credits_build(int fh, int n)
+{
+ #define CREDITS_TITLE(t) credits_add_line(fh, n, CREDITS_TYPE_TITLE, t);
+ #define CREDITS_FUNCTION(f) credits_add_line(fh, n, CREDITS_TYPE_FUNCTION, f);
+ #define CREDITS_PERSON(p) credits_add_line(fh, n, CREDITS_TYPE_PERSON, p);