             background.async(group: queues) {
                 let functions = gir.functions.filter{!blacklist.contains($0.name)}.map(swiftCode).joined(separator: "\n\n")
                 if let dir = outputDirectory {
-                    let output = prefix + functions
+                    let output = preamble + functions
                     let f = "\(dir)/\(node)-functions.swift"
                     write(output, to: f)
                 } else { outq.async(group: queues) { print(functions) } }

            processSpecialCases(gir, forFile: node)
            let blacklist = GIR.blacklist
            let boilerplate = gir.boilerPlate
            let prefix = gir.preamble
            let modulePrefix = modulePrefix + boilerplate
            let queues = DispatchGroup()
            let background = DispatchQueue.global()
            let outq = DispatchQueue(label: "com.github.rhx.gir2swift.outputqueue")
            if outputDirectory == nil { print(modulePrefix + prefix) }

            func write(_ string: String, to fileName: String) {
                do {
                    if fileManager.fileExists(atPath: fileName) {
                        let oldContent = try String(contentsOfFile: fileName, encoding: .utf8)
                        let newContent = oldContent + string
                        try newContent.write(toFile: fileName, atomically: true, encoding: .utf8)
                    } else {
                        try string.write(toFile: fileName, atomically: true, encoding: .utf8)
                    }
                } catch {
                    outq.async(group: queues) { print("\(error)", to: &Streams.stdErr) }
                }
            }
            func writebg(_ string: String, to fileName: String) {
                background.async(group: queues) { write(string, to: fileName) }
            }
            func write<T: GIR.Record>(_ types: [T], using ptrconvert: (String) -> (GIR.Record) -> String) {
                if let dir = outputDirectory {
                    writebg(modulePrefix, to: "\(dir)/\(node).swift")
                    var output = prefix
                    var first: Character? = nil
                    var firstName = ""
                    var name = ""

                let enumerations = gir.enumerations.filter{!blacklist.contains($0.name)}.map(swiftCode).joined(separator: "\n\n")
                if let dir = outputDirectory {
                    let f = "\(dir)/\(node)-enumerations.swift"
                    let output = preamble + enumerations
                    write(output, to: f)
                } else { outq.async(group: queues) { print(enumerations) } }
            }
