This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by colf(1); DO NOT EDIT. | |
// The compiler used schema file demo.colf for package demo. | |
// Package demo offers a demonstration. | |
// These comment lines will end up in the generated code. | |
var demo = new function() { | |
const EOF = 'colfer: EOF'; | |
// The upper limit for serial byte sizes. | |
var colferSizeMax = 16 * 1024 * 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package demo offers a demonstration. | |
// These comment lines will end up in the generated code. | |
package demo | |
// Code generated by colf(1); DO NOT EDIT. | |
// The compiler used schema file demo.colf. | |
import ( | |
"encoding/binary" | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by colf(1); DO NOT EDIT. | |
// The compiler used schema file demo.colf for package demo. | |
#include "Colfer.h" | |
#include <errno.h> | |
#include <stdlib.h> | |
#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \ | |
defined(__BIG_ENDIAN__) || \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func writeAll(w io.Writer, records []*batch.Record) error { | |
var buf []byte | |
for _, r := range records { | |
n, err := r.MarshalLen() | |
if err != nil { | |
return err | |
} | |
if n > len(buf) { | |
buf = make([]byte, n*2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is free and unencumbered software released into the public domain. | |
// Marshals a string to an Uint8Array. | |
function encodeUTF8(s) { | |
var i = 0, bytes = new Uint8Array(s.length * 4); | |
for (var ci = 0; ci != s.length; ci++) { | |
var c = s.charCodeAt(ci); | |
if (c < 128) { | |
bytes[i++] = c; | |
continue; |
NewerOlder