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.
36 /*----- Required headers --------------------------------------------------*/
40 /*----- External tables ---------------------------------------------------*/
42 extern const char **qq_table[];
43 extern const char *qq_qqlib[];
45 /*----- Functions provided ------------------------------------------------*/
47 /* --- @qq_xlate@ --- *
49 * Arguments: @FILE *fp@ = output file handle
50 * @const char *p@ = pointer to encoded text
54 * Use: Writes the decoded string to the given file handle.
57 extern void qq_xlate(FILE */*fp*/, const char */*p*/);
59 /* --- @qq_file@ --- *
61 * Arguments: @FILE *fp@ = output file handle
62 * @const char **p@ = pointer to the output array
66 * Use: Writes the contents of a file to the output.
69 extern void qq_file(FILE */*fp*/, const char **/*p*/);
71 /* --- @qq_head@ --- *
73 * Arguments: @FILE *fp@ = output file handle
77 * Use: Writes the head of a `qqout.c' file.
80 extern void qq_head(FILE */*fp*/);
82 /* --- @qq_body@ --- *
84 * Arguments: @FILE *fp@ = output file handle
85 * @const char ***p@ = pointer to main table
89 * Use: Writes the body table of a `qqout.c' file.
92 extern void qq_body(FILE */*fp*/, const char ***/*p*/);
94 /* --- @qq_tail@ --- *
96 * Arguments: @FILE *fp@ = output file handle
97 * @const char **qql@ = pointer to qqlib file array
98 * @size_t fno@ = number of files written
99 * @const char *fn@ = name of `qqout.c' file
103 * Use: Writes the head of a `qqout.c' file.
106 extern void qq_tail(FILE */*fp*/, const char **/*qql*/,
107 size_t /*fno*/, const char */*fn*/);
109 /* --- @qq_mkfile@ --- *
111 * Arguments: @const char *fn@ = pointer to a filename
112 * @int mode@ = mode to create file with
114 * Returns: A handle for the created file.
116 * Use: Creates a file, and leading directories and stuff.
119 #ifdef QUINE_PORTABLE
120 extern FILE *qq_mkfile(const char */*fn*/);
122 extern FILE *qq_mkfile(const char */*fn*/, int /*mode*/);
125 /* --- @qq_dump@ --- *
127 * Arguments: @FILE *fp@ = stream to dump on
131 * Use: Writes the program's source code to the given file.
134 extern void qq_dump(FILE */*fp*/);
136 /* --- @qq_create@ --- *
142 * Use: Writes a source distribution to the current directory.
145 extern int qq_create(void);
147 /*----- That's all, folks -------------------------------------------------*/