3 * Definitions for building quines
5 * (c) 1999 Mark Wooding
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of Quine
12 * Quine is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * Quine is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with Quine; if not, write to the Free Software Foundation,
24 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 /*----- Required headers --------------------------------------------------*/
38 /*----- External tables ---------------------------------------------------*/
40 extern const char **qq_table[];
41 extern const char *qq_qqlib[];
43 /*----- Functions provided ------------------------------------------------*/
45 /* --- @qq_xlate@ --- *
47 * Arguments: @FILE *fp@ = output file handle
48 * @const char *p@ = pointer to encoded text
52 * Use: Writes the decoded string to the given file handle.
55 extern void qq_xlate(FILE */*fp*/, const char */*p*/);
57 /* --- @qq_file@ --- *
59 * Arguments: @FILE *fp@ = output file handle
60 * @const char **p@ = pointer to the output array
64 * Use: Writes the contents of a file to the output.
67 extern void qq_file(FILE */*fp*/, const char **/*p*/);
69 /* --- @qq_head@ --- *
71 * Arguments: @FILE *fp@ = output file handle
75 * Use: Writes the head of a `qqout.c' file.
78 extern void qq_head(FILE */*fp*/);
80 /* --- @qq_body@ --- *
82 * Arguments: @FILE *fp@ = output file handle
83 * @const char ***p@ = pointer to main table
87 * Use: Writes the body table of a `qqout.c' file.
90 extern void qq_body(FILE */*fp*/, const char ***/*p*/);
92 /* --- @qq_tail@ --- *
94 * Arguments: @FILE *fp@ = output file handle
95 * @const char **qql@ = pointer to qqlib file array
96 * @size_t fno@ = number of files written
97 * @const char *fn@ = name of `qqout.c' file
101 * Use: Writes the head of a `qqout.c' file.
104 extern void qq_tail(FILE */*fp*/, const char **/*qql*/,
105 size_t /*fno*/, const char */*fn*/);
107 /* --- @qq_mkfile@ --- *
109 * Arguments: @const char *fn@ = pointer to a filename
110 * @int mode@ = mode to create file with
112 * Returns: A handle for the created file.
114 * Use: Creates a file, and leading directories and stuff.
117 #ifdef QUINE_PORTABLE
118 extern FILE *qq_mkfile(const char */*fn*/);
120 extern FILE *qq_mkfile(const char */*fn*/, int /*mode*/);
123 /* --- @qq_dump@ --- *
125 * Arguments: @FILE *fp@ = stream to dump on
129 * Use: Writes the program's source code to the given file.
132 extern void qq_dump(FILE */*fp*/);
134 /* --- @qq_create@ --- *
140 * Use: Writes a source distribution to the current directory.
143 extern int qq_create(void);
145 /*----- That's all, folks -------------------------------------------------*/