5 * Definitions for building quines
7 * (c) 1999 Mark Wooding
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of Quine
14 * Quine is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * Quine is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with Quine; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /*----- Revision history --------------------------------------------------*
32 * Revision 1.1 1999/04/28 19:58:07 mdw
44 /*----- Required headers --------------------------------------------------*/
48 /*----- External tables ---------------------------------------------------*/
50 extern const char **qq_table[];
51 extern const char *qq_qqlib[];
53 /*----- Functions provided ------------------------------------------------*/
55 /* --- @qq_xlate@ --- *
57 * Arguments: @FILE *fp@ = output file handle
58 * @const char *p@ = pointer to encoded text
62 * Use: Writes the decoded string to the given file handle.
65 extern void qq_xlate(FILE */*fp*/, const char */*p*/);
67 /* --- @qq_file@ --- *
69 * Arguments: @FILE *fp@ = output file handle
70 * @const char **p@ = pointer to the output array
74 * Use: Writes the contents of a file to the output.
77 extern void qq_file(FILE */*fp*/, const char **/*p*/);
79 /* --- @qq_head@ --- *
81 * Arguments: @FILE *fp@ = output file handle
85 * Use: Writes the head of a `qqout.c' file.
88 extern void qq_head(FILE */*fp*/);
90 /* --- @qq_body@ --- *
92 * Arguments: @FILE *fp@ = output file handle
93 * @const char ***p@ = pointer to main table
97 * Use: Writes the body table of a `qqout.c' file.
100 extern void qq_body(FILE */*fp*/, const char ***/*p*/);
102 /* --- @qq_tail@ --- *
104 * Arguments: @FILE *fp@ = output file handle
105 * @const char **qql@ = pointer to qqlib file array
106 * @size_t fno@ = number of files written
107 * @const char *fn@ = name of `qqout.c' file
111 * Use: Writes the head of a `qqout.c' file.
114 extern void qq_tail(FILE */*fp*/, const char **/*qql*/,
115 size_t /*fno*/, const char */*fn*/);
117 /* --- @qq_mkfile@ --- *
119 * Arguments: @const char *fn@ = pointer to a filename
120 * @int mode@ = mode to create file with
122 * Returns: A handle for the created file.
124 * Use: Creates a file, and leading directories and stuff.
127 #ifdef QUINE_PORTABLE
128 extern FILE *qq_mkfile(const char */*fn*/);
130 extern FILE *qq_mkfile(const char */*fn*/, int /*mode*/);
133 /* --- @qq_dump@ --- *
135 * Arguments: @FILE *fp@ = stream to dump on
139 * Use: Writes the program's source code to the given file.
142 extern void qq_dump(FILE */*fp*/);
144 /* --- @qq_create@ --- *
150 * Use: Writes a source distribution to the current directory.
153 extern int qq_create(void);
155 /*----- That's all, folks -------------------------------------------------*/