lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [07/54] [abbrv] Remove bundled Clownfish.
Date Sat, 26 Apr 2014 23:11:37 GMT
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/clownfish/runtime/common/charmonizer.main b/clownfish/runtime/common/charmonizer.main
deleted file mode 100644
index 5db08b1..0000000
--- a/clownfish/runtime/common/charmonizer.main
+++ /dev/null
@@ -1,429 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* Source fragment for the Clownfish runtime's charmonizer.c.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "Charmonizer/Probe.h"
-#include "Charmonizer/Probe/AtomicOps.h"
-#include "Charmonizer/Probe/BuildEnv.h"
-#include "Charmonizer/Probe/DirManip.h"
-#include "Charmonizer/Probe/Floats.h"
-#include "Charmonizer/Probe/FuncMacro.h"
-#include "Charmonizer/Probe/Headers.h"
-#include "Charmonizer/Probe/Integers.h"
-#include "Charmonizer/Probe/LargeFiles.h"
-#include "Charmonizer/Probe/Memory.h"
-#include "Charmonizer/Probe/SymbolVisibility.h"
-#include "Charmonizer/Probe/UnusedVars.h"
-#include "Charmonizer/Probe/VariadicMacros.h"
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/ConfWriterC.h"
-#include "Charmonizer/Core/ConfWriterPerl.h"
-#include "Charmonizer/Core/ConfWriterRuby.h"
-
-typedef struct SourceFileContext {
-    chaz_MakeVar *var;
-} SourceFileContext;
-
-static const char cfish_version[]       = "0.3.0";
-static const char cfish_major_version[] = "0.3";
-
-static void
-S_add_compiler_flags(struct chaz_CLIArgs *args) {
-    chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-
-    if (chaz_Probe_gcc_version_num()) {
-        if (getenv("LUCY_VALGRIND")) {
-            chaz_CFlags_append(extra_cflags,
-                "-DLUCY_VALGRIND -fno-inline-functions");
-        }
-        else if (getenv("LUCY_DEBUG")) {
-            chaz_CFlags_append(extra_cflags,
-                "-DLUCY_DEBUG -pedantic -Wall -Wextra -Wno-variadic-macros");
-            if (args->charmony_pm) {
-                chaz_CFlags_append(extra_cflags, "-DPERL_GCC_PEDANTIC");
-            }
-        }
-
-        /* Only core source files require this -- not our headers and
-         * autogenerated files. */
-        chaz_CFlags_append(extra_cflags, "-std=gnu99 -D_GNU_SOURCE");
-    }
-    else if (chaz_Probe_msvc_version_num()) {
-        /* Compile as C++ under MSVC. */
-        chaz_CFlags_append(extra_cflags, "/TP");
-
-        /* Thwart stupid warnings. */
-        chaz_CFlags_append(extra_cflags, "/D_CRT_SECURE_NO_WARNINGS");
-        chaz_CFlags_append(extra_cflags, "/D_SCL_SECURE_NO_WARNINGS");
-
-        if (chaz_Probe_msvc_version_num() < 1300) {
-            /* Redefine 'for' to fix broken 'for' scoping under MSVC6. */
-            chaz_CFlags_append(extra_cflags, "/Dfor=\"if(0);else for\"");
-        }
-    }
-
-    /* When compiling for Perl bindings, define HAS_BOOL so that the Perl
-     * headers don't redefine 'bool' in conflict with C++.
-     *
-     * TODO: Compile all files that #include Perl headers separately and
-     * remove this directive.
-     */
-    if (args->charmony_pm) {
-        chaz_CFlags_add_define(extra_cflags, "HAS_BOOL", NULL);
-    }
-
-    chaz_CFlags_add_define(extra_cflags, "CFP_CFISH", NULL);
-    chaz_CFlags_add_define(extra_cflags, "CFP_TESTCFISH", NULL);
-}
-
-static int
-S_ends_with(const char *string, const char *postfix) {
-    size_t len         = strlen(string);
-    size_t postfix_len = strlen(postfix);
-    return len >= postfix_len
-           && memcmp(string + len - postfix_len, postfix, postfix_len) == 0;
-}
-
-static void
-S_c_file_callback(const char *dir, char *file, void *context) {
-    SourceFileContext *sfc = (SourceFileContext*)context;
-    const char *dir_sep = chaz_OS_dir_sep();
-    const char *obj_ext = chaz_CC_obj_ext();
-    size_t file_len = strlen(file);
-    char *obj_file;
-
-    /* Strip extension */
-    if (!S_ends_with(file, ".c")) {
-        chaz_Util_warn("Unexpected C filename: %s", file);
-        return;
-    }
-    file[file_len-2] = '\0';
-
-    obj_file = chaz_Util_join("", dir, dir_sep, file, obj_ext, NULL);
-    chaz_MakeVar_append(sfc->var, obj_file);
-    free(obj_file);
-}
-
-static void
-S_cfh_file_callback(const char *dir, char *file, void *context) {
-    SourceFileContext *sfc = (SourceFileContext*)context;
-    const char *dir_sep = chaz_OS_dir_sep();
-    char *cfh_file;
-
-    if (!S_ends_with(file, ".cfh")) {
-        chaz_Util_warn("Unexpected Clownfish header filename: %s", file);
-        return;
-    }
-
-    cfh_file = chaz_Util_join(dir_sep, dir, file, NULL);
-    chaz_MakeVar_append(sfc->var, cfh_file);
-    free(cfh_file);
-}
-
-static void
-S_write_makefile(struct chaz_CLIArgs *args) {
-    SourceFileContext sfc;
-
-    const char *base_dir = "..";
-    const char *dir_sep  = chaz_OS_dir_sep();
-    const char *exe_ext  = chaz_OS_exe_ext();
-    const char *obj_ext  = chaz_CC_obj_ext();
-
-    char *core_dir  = chaz_Util_join(dir_sep, base_dir, "core", NULL);
-    char *cfc_dir   = chaz_Util_join(dir_sep, base_dir, "..", "compiler", "c",
-                                     NULL);
-    char *cfc_exe   = chaz_Util_join("", cfc_dir, dir_sep, "cfc", exe_ext,
-                                     NULL);
-    char *test_cfish_exe  = chaz_Util_join("", "t", dir_sep, "test_cfish",
-                                           exe_ext, NULL);
-    char *autogen_inc_dir = chaz_Util_join(dir_sep, "autogen", "include",
-                                           NULL);
-
-    chaz_MakeFile *makefile;
-    chaz_MakeVar  *var;
-    chaz_MakeRule *rule;
-    chaz_MakeRule *clean_rule;
-    chaz_MakeRule *distclean_rule;
-
-    chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-    chaz_CFlags *makefile_cflags;
-    chaz_CFlags *link_flags;
-    chaz_CFlags *test_cflags;
-
-    chaz_SharedLib *lib;
-    const char     *math_library = chaz_Floats_math_library();
-    char           *lib_filename;
-    char           *test_command;
-    char           *scratch;
-
-    printf("Creating Makefile...\n");
-
-    makefile = chaz_MakeFile_new();
-
-    /* Directories */
-
-    chaz_MakeFile_add_var(makefile, "BASE_DIR", base_dir);
-
-    /* C compiler */
-
-    chaz_MakeFile_add_var(makefile, "CC", chaz_CC_get_cc());
-
-    makefile_cflags = chaz_CC_new_cflags();
-
-    chaz_CFlags_enable_optimization(makefile_cflags);
-    chaz_CFlags_enable_debugging(makefile_cflags);
-    chaz_CFlags_disable_strict_aliasing(makefile_cflags);
-    chaz_CFlags_compile_shared_library(makefile_cflags);
-    chaz_CFlags_hide_symbols(makefile_cflags);
-    if (args->code_coverage) {
-        chaz_CFlags_enable_code_coverage(makefile_cflags);
-    }
-
-    chaz_CFlags_add_include_dir(makefile_cflags, ".");
-    chaz_CFlags_add_include_dir(makefile_cflags, autogen_inc_dir);
-
-    var = chaz_MakeFile_add_var(makefile, "CFLAGS", NULL);
-    chaz_MakeVar_append(var, chaz_CFlags_get_string(extra_cflags));
-    chaz_MakeVar_append(var, chaz_CFlags_get_string(makefile_cflags));
-    chaz_MakeVar_append(var, chaz_CC_get_cflags());
-
-    chaz_CFlags_destroy(makefile_cflags);
-
-    /* Object files */
-
-    var = chaz_MakeFile_add_var(makefile, "CLOWNFISH_OBJS", NULL);
-    sfc.var = var;
-
-    chaz_Make_list_files("src",        "c", S_c_file_callback, &sfc);
-    chaz_Make_list_files(core_dir,     "c", S_c_file_callback, &sfc);
-
-    scratch = chaz_Util_join("", "autogen", dir_sep, "source", dir_sep,
-                             "cfish_parcel", obj_ext, NULL);
-    chaz_MakeVar_append(var, scratch);
-    free(scratch);
-    scratch = chaz_Util_join("", "autogen", dir_sep, "source", dir_sep,
-                             "testcfish_parcel", obj_ext, NULL);
-    chaz_MakeVar_append(var, scratch);
-    free(scratch);
-
-    /* Clownfish header files */
-
-    var = chaz_MakeFile_add_var(makefile, "CLOWNFISH_HEADERS", NULL);
-    sfc.var = var;
-
-    chaz_Make_list_files(core_dir, "cfh", S_cfh_file_callback, &sfc);
-
-    /* Rules */
-
-    lib = chaz_SharedLib_new("cfish", cfish_version, cfish_major_version);
-    lib_filename = chaz_SharedLib_filename(lib);
-    chaz_MakeFile_add_rule(makefile, "all", lib_filename);
-
-    rule = chaz_MakeFile_add_rule(makefile, cfc_exe, NULL);
-    chaz_MakeRule_add_make_command(rule, cfc_dir, NULL);
-
-    rule = chaz_MakeFile_add_rule(makefile, "autogen", cfc_exe);
-    chaz_MakeRule_add_prereq(rule, "$(CLOWNFISH_HEADERS)");
-    scratch = chaz_Util_join("", cfc_exe, " --source=", core_dir,
-                             " --dest=autogen --header=cfc_header", NULL);
-    chaz_MakeRule_add_command(rule, scratch);
-    /* TODO: Find a way to touch the autogen directory on Windows. */
-    if (chaz_Make_shell_type() == CHAZ_OS_POSIX) {
-        chaz_MakeRule_add_command(rule, "touch autogen");
-    }
-    free(scratch);
-
-    /* Needed for parallel builds. */
-    scratch = chaz_Util_join(dir_sep, "autogen", "source", "cfish_parcel.c",
-                             NULL);
-    rule = chaz_MakeFile_add_rule(makefile, scratch, "autogen");
-    scratch = chaz_Util_join(dir_sep, "autogen", "source",
-                             "testcfish_parcel.c", NULL);
-    rule = chaz_MakeFile_add_rule(makefile, scratch, "autogen");
-    free(scratch);
-
-    chaz_MakeFile_add_rule(makefile, "$(CLOWNFISH_OBJS)", "autogen");
-
-    link_flags = chaz_CC_new_cflags();
-    chaz_CFlags_enable_debugging(link_flags);
-    if (math_library) {
-        chaz_CFlags_add_external_library(link_flags, math_library);
-    }
-    if (args->code_coverage) {
-        chaz_CFlags_enable_code_coverage(link_flags);
-    }
-    chaz_MakeFile_add_shared_lib(makefile, lib, "$(CLOWNFISH_OBJS)",
-                                 link_flags);
-    chaz_CFlags_destroy(link_flags);
-
-    test_cflags = chaz_CC_new_cflags();
-    chaz_CFlags_enable_optimization(test_cflags);
-    chaz_CFlags_add_include_dir(test_cflags, autogen_inc_dir);
-    chaz_CFlags_add_library(test_cflags, lib);
-    scratch = chaz_Util_join(dir_sep, "t", "test_cfish.c", NULL);
-    rule = chaz_MakeFile_add_compiled_exe(makefile, test_cfish_exe, scratch,
-                                          test_cflags);
-    free(scratch);
-    chaz_MakeRule_add_prereq(rule, lib_filename);
-    chaz_CFlags_destroy(test_cflags);
-
-    rule = chaz_MakeFile_add_rule(makefile, "test", test_cfish_exe);
-    if (strcmp(chaz_OS_shared_lib_ext(), ".so") == 0) {
-        test_command = chaz_Util_join(" ", "LD_LIBRARY_PATH=.", test_cfish_exe,
-                                      NULL);
-    }
-    else {
-        test_command = chaz_Util_strdup(test_cfish_exe);
-    }
-    chaz_MakeRule_add_command(rule, test_command);
-
-    if (args->code_coverage) {
-        rule = chaz_MakeFile_add_rule(makefile, "coverage", test_cfish_exe);
-        chaz_MakeRule_add_command(rule,
-                                  "lcov"
-                                  " --zerocounters"
-                                  " --directory $(BASE_DIR)");
-        chaz_MakeRule_add_command(rule, test_command);
-        chaz_MakeRule_add_command(rule,
-                                  "lcov"
-                                  " --capture"
-                                  " --directory $(BASE_DIR)"
-                                  " --base-directory ."
-                                  " --rc lcov_branch_coverage=1"
-                                  " --output-file clownfish.info");
-        chaz_MakeRule_add_command(rule,
-                                  "genhtml"
-                                  " --branch-coverage"
-                                  " --output-directory coverage"
-                                  " clownfish.info");
-    }
-
-    clean_rule = chaz_MakeFile_clean_rule(makefile);
-    chaz_MakeRule_add_rm_command(clean_rule, "$(CLOWNFISH_OBJS)");
-    chaz_MakeRule_add_recursive_rm_command(clean_rule, "autogen");
-
-    if (args->code_coverage) {
-        chaz_MakeRule_add_rm_command(clean_rule, "clownfish.info");
-        chaz_MakeRule_add_recursive_rm_command(clean_rule, "coverage");
-    }
-
-    chaz_MakeRule_add_make_command(clean_rule, cfc_dir, "clean");
-
-    distclean_rule = chaz_MakeFile_distclean_rule(makefile);
-    chaz_MakeRule_add_make_command(distclean_rule, cfc_dir, "distclean");
-
-    chaz_MakeFile_write(makefile);
-
-    chaz_MakeFile_destroy(makefile);
-    chaz_SharedLib_destroy(lib);
-    free(core_dir);
-    free(cfc_dir);
-    free(cfc_exe);
-    free(test_cfish_exe);
-    free(autogen_inc_dir);
-    free(lib_filename);
-    free(test_command);
-}
-
-int main(int argc, const char **argv) {
-    /* Initialize. */
-    struct chaz_CLIArgs args;
-    {
-        int result = chaz_Probe_parse_cli_args(argc, argv, &args);
-        if (!result) {
-            chaz_Probe_die_usage();
-        }
-        chaz_Probe_init(&args);
-        S_add_compiler_flags(&args);
-    }
-    {
-        int i;
-        for (i = 0; i < argc; i++) {
-            if (strncmp(argv[i], "--disable-threads", 17) == 0) {
-                chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-                chaz_CFlags_append(extra_cflags, "-DCFISH_NOTHREADS");
-                break;
-            }
-        }
-    }
-
-    /* Employ integer features but don't define stdint types in charmony.h. */
-    chaz_ConfWriter_append_conf(
-        "#define CHY_EMPLOY_INTEGERLIMITS\n"
-        "#define CHY_EMPLOY_INTEGERLITERALS\n"
-        "#define CHY_EMPLOY_INTEGERFORMATSTRINGS\n\n"
-    );
-
-    /* Run probe modules. Booleans, DirManip and LargeFiles are only needed for
-     * the Charmonizer tests.
-     */
-    chaz_BuildEnv_run();
-    chaz_DirManip_run();
-    chaz_Headers_run();
-    chaz_AtomicOps_run();
-    chaz_FuncMacro_run();
-    chaz_Booleans_run();
-    chaz_Integers_run();
-    chaz_Floats_run();
-    chaz_LargeFiles_run();
-    chaz_Memory_run();
-    chaz_UnusedVars_run();
-    chaz_VariadicMacros_run();
-
-    /* Write custom postamble. */
-    chaz_ConfWriter_append_conf(
-        "#ifdef CHY_HAS_SYS_TYPES_H\n"
-        "  #include <sys/types.h>\n"
-        "#endif\n\n"
-    );
-    chaz_ConfWriter_append_conf(
-        "#ifdef CHY_HAS_ALLOCA_H\n"
-        "  #include <alloca.h>\n"
-        "#elif defined(CHY_HAS_MALLOC_H)\n"
-        "  #include <malloc.h>\n"
-        "#elif defined(CHY_ALLOCA_IN_STDLIB_H)\n"
-        "  #include <stdlib.h>\n"
-        "#endif\n\n"
-    );
-    chaz_ConfWriter_append_conf(
-        "#ifdef CHY_HAS_WINDOWS_H\n"
-        "  /* Target Windows XP. */\n"
-        "  #ifndef WINVER\n"
-        "    #define WINVER 0x0500\n"
-        "  #endif\n"
-        "  #ifndef _WIN32_WINNT\n"
-        "    #define _WIN32_WINNT 0x0500\n"
-        "  #endif\n"
-        "#endif\n\n"
-    );
-
-    if (args.write_makefile) {
-        S_write_makefile(&args);
-    }
-
-    /* Clean up. */
-    chaz_Probe_clean_up();
-
-    return 0;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish.c b/clownfish/runtime/core/Clownfish.c
deleted file mode 100644
index 130b87a..0000000
--- a/clownfish/runtime/core/Clownfish.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Clownfish/Num.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/Err.h"
-
-void
-cfish_init_parcel() {
-    cfish_Bool_init_class();
-    cfish_Hash_init_class();
-    cfish_Err_init_class();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish.cfp
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish.cfp b/clownfish/runtime/core/Clownfish.cfp
deleted file mode 100644
index ae91f8a..0000000
--- a/clownfish/runtime/core/Clownfish.cfp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "name": "Clownfish",
-    "nickname": "Cfish",
-    "version": "v0.3.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/ByteBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/ByteBuf.c b/clownfish/runtime/core/Clownfish/ByteBuf.c
deleted file mode 100644
index c267d28..0000000
--- a/clownfish/runtime/core/Clownfish/ByteBuf.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_BYTEBUF
-#define C_CFISH_VIEWBYTEBUF
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#include "Clownfish/VTable.h"
-#include "Clownfish/ByteBuf.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Util/Memory.h"
-
-static void
-S_grow(ByteBuf *self, size_t size);
-
-ByteBuf*
-BB_new(size_t capacity) {
-    ByteBuf *self = (ByteBuf*)VTable_Make_Obj(BYTEBUF);
-    return BB_init(self, capacity);
-}
-
-ByteBuf*
-BB_init(ByteBuf *self, size_t capacity) {
-    size_t amount = capacity ? capacity : sizeof(int64_t);
-    self->buf   = NULL;
-    self->size  = 0;
-    self->cap   = 0;
-    S_grow(self, amount);
-    return self;
-}
-
-ByteBuf*
-BB_new_bytes(const void *bytes, size_t size) {
-    ByteBuf *self = (ByteBuf*)VTable_Make_Obj(BYTEBUF);
-    BB_init(self, size);
-    memcpy(self->buf, bytes, size);
-    self->size = size;
-    return self;
-}
-
-ByteBuf*
-BB_new_steal_bytes(void *bytes, size_t size, size_t capacity) {
-    ByteBuf *self = (ByteBuf*)VTable_Make_Obj(BYTEBUF);
-    return BB_init_steal_bytes(self, bytes, size, capacity);
-}
-
-ByteBuf*
-BB_init_steal_bytes(ByteBuf *self, void *bytes, size_t size,
-                    size_t capacity) {
-    self->buf  = (char*)bytes;
-    self->size = size;
-    self->cap  = capacity;
-    return self;
-}
-
-void
-BB_Destroy_IMP(ByteBuf *self) {
-    FREEMEM(self->buf);
-    SUPER_DESTROY(self, BYTEBUF);
-}
-
-ByteBuf*
-BB_Clone_IMP(ByteBuf *self) {
-    return BB_new_bytes(self->buf, self->size);
-}
-
-void
-BB_Set_Size_IMP(ByteBuf *self, size_t size) {
-    if (size > self->cap) {
-        THROW(ERR, "Can't set size to %u64 (greater than capacity of %u64)",
-              (uint64_t)size, (uint64_t)self->cap);
-    }
-    self->size = size;
-}
-
-char*
-BB_Get_Buf_IMP(ByteBuf *self) {
-    return self->buf;
-}
-
-size_t
-BB_Get_Size_IMP(ByteBuf *self) {
-    return self->size;
-}
-
-size_t
-BB_Get_Capacity_IMP(ByteBuf *self) {
-    return self->cap;
-}
-
-static CFISH_INLINE bool
-SI_equals_bytes(ByteBuf *self, const void *bytes, size_t size) {
-    if (self->size != size) { return false; }
-    return (memcmp(self->buf, bytes, self->size) == 0);
-}
-
-bool
-BB_Equals_IMP(ByteBuf *self, Obj *other) {
-    ByteBuf *const twin = (ByteBuf*)other;
-    if (twin == self)              { return true; }
-    if (!Obj_Is_A(other, BYTEBUF)) { return false; }
-    return SI_equals_bytes(self, twin->buf, twin->size);
-}
-
-bool
-BB_Equals_Bytes_IMP(ByteBuf *self, const void *bytes, size_t size) {
-    return SI_equals_bytes(self, bytes, size);
-}
-
-int32_t
-BB_Hash_Sum_IMP(ByteBuf *self) {
-    uint32_t       sum = 5381;
-    uint8_t *const buf = (uint8_t*)self->buf;
-
-    for (size_t i = 0, max = self->size; i < max; i++) {
-        sum = ((sum << 5) + sum) ^ buf[i];
-    }
-
-    return (int32_t)sum;
-}
-
-static CFISH_INLINE void
-SI_mimic_bytes(ByteBuf *self, const void *bytes, size_t size) {
-    if (size > self->cap) { S_grow(self, size); }
-    memmove(self->buf, bytes, size);
-    self->size = size;
-}
-
-void
-BB_Mimic_Bytes_IMP(ByteBuf *self, const void *bytes, size_t size) {
-    SI_mimic_bytes(self, bytes, size);
-}
-
-void
-BB_Mimic_IMP(ByteBuf *self, Obj *other) {
-    ByteBuf *twin = (ByteBuf*)CERTIFY(other, BYTEBUF);
-    SI_mimic_bytes(self, twin->buf, twin->size);
-}
-
-static CFISH_INLINE void
-SI_cat_bytes(ByteBuf *self, const void *bytes, size_t size) {
-    const size_t new_size = self->size + size;
-    if (new_size > self->cap) {
-        S_grow(self, Memory_oversize(new_size, sizeof(char)));
-    }
-    memcpy((self->buf + self->size), bytes, size);
-    self->size = new_size;
-}
-
-void
-BB_Cat_Bytes_IMP(ByteBuf *self, const void *bytes, size_t size) {
-    SI_cat_bytes(self, bytes, size);
-}
-
-void
-BB_Cat_IMP(ByteBuf *self, ByteBuf *other) {
-    SI_cat_bytes(self, other->buf, other->size);
-}
-
-static void
-S_grow(ByteBuf *self, size_t size) {
-    if (size > self->cap) {
-        size_t amount    = size;
-        size_t remainder = amount % sizeof(int64_t);
-        if (remainder) {
-            amount += sizeof(int64_t);
-            amount -= remainder;
-        }
-        self->buf = (char*)REALLOCATE(self->buf, amount);
-        self->cap = amount;
-    }
-}
-
-char*
-BB_Grow_IMP(ByteBuf *self, size_t size) {
-    if (size > self->cap) { S_grow(self, size); }
-    return self->buf;
-}
-
-int
-BB_compare(const void *va, const void *vb) {
-    ByteBuf *a = *(ByteBuf**)va;
-    ByteBuf *b = *(ByteBuf**)vb;
-    const size_t size = a->size < b->size ? a->size : b->size;
-
-    int32_t comparison = memcmp(a->buf, b->buf, size);
-
-    if (comparison == 0 && a->size != b->size) {
-        comparison = a->size < b->size ? -1 : 1;
-    }
-
-    return comparison;
-}
-
-int32_t
-BB_Compare_To_IMP(ByteBuf *self, Obj *other) {
-    CERTIFY(other, BYTEBUF);
-    return BB_compare(&self, &other);
-}
-
-/******************************************************************/
-
-ViewByteBuf*
-ViewBB_new(char *buf, size_t size) {
-    ViewByteBuf *self = (ViewByteBuf*)VTable_Make_Obj(VIEWBYTEBUF);
-    return ViewBB_init(self, buf, size);
-}
-
-ViewByteBuf*
-ViewBB_init(ViewByteBuf *self, char *buf, size_t size) {
-    self->cap  = 0;
-    self->buf  = buf;
-    self->size = size;
-    return self;
-}
-
-void
-ViewBB_Destroy_IMP(ViewByteBuf *self) {
-    Obj_Destroy_t super_duper_destroy = METHOD_PTR(OBJ, CFISH_Obj_Destroy);
-    super_duper_destroy((Obj*)self);
-}
-
-void
-ViewBB_Assign_Bytes_IMP(ViewByteBuf *self, char*buf, size_t size) {
-    self->buf  = buf;
-    self->size = size;
-}
-
-void
-ViewBB_Assign_IMP(ViewByteBuf *self, ByteBuf *other) {
-    self->buf  = other->buf;
-    self->size = other->size;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/ByteBuf.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/ByteBuf.cfh b/clownfish/runtime/core/Clownfish/ByteBuf.cfh
deleted file mode 100644
index 60b258c..0000000
--- a/clownfish/runtime/core/Clownfish/ByteBuf.cfh
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/**
- * Growable buffer holding arbitrary bytes.
- */
-
-class Clownfish::ByteBuf cnick BB inherits Clownfish::Obj {
-
-    char    *buf;
-    size_t   size;  /* number of valid bytes */
-    size_t   cap;   /* allocated bytes, including terminating null */
-
-    /**
-     * @param capacity initial capacity of the ByteBuf, in bytes.
-     */
-    inert incremented ByteBuf*
-    new(size_t capacity);
-
-    inert ByteBuf*
-    init(ByteBuf *self, size_t capacity);
-
-    /** Return a pointer to a new ByteBuf which holds a copy of the passed-in
-     * string.
-     */
-    inert incremented ByteBuf*
-    new_bytes(const void *bytes, size_t size);
-
-    /** Return a pointer to a new ByteBuf which assumes ownership of the
-     * passed-in string.
-     */
-    inert incremented ByteBuf*
-    new_steal_bytes(void *bytes, size_t size, size_t capacity);
-
-    /** Initialize the ByteBuf and assume ownership of the passed-in string.
-     */
-    public inert ByteBuf*
-    init_steal_bytes(ByteBuf *self, void *bytes, size_t size,
-                     size_t capacity);
-
-    /** Lexical comparison of two ByteBufs, with level of indirection set to
-     * please qsort and friends.
-     */
-    inert int
-    compare(const void *va, const void *vb);
-
-    /** Set the object's size member.  If greater than the object's capacity,
-     * throws an error.
-     */
-    void
-    Set_Size(ByteBuf *self, size_t size);
-
-    /** Accessor for "size" member.
-     */
-    size_t
-    Get_Size(ByteBuf *self);
-
-    /** Accessor for raw internal buffer.
-     */
-    nullable char*
-    Get_Buf(ByteBuf *self);
-
-    /** Return the number of bytes in the Object's allocation.
-     */
-    size_t
-    Get_Capacity(ByteBuf *self);
-
-    public void
-    Mimic(ByteBuf *self, Obj *other);
-
-    void
-    Mimic_Bytes(ByteBuf *self, const void *bytes, size_t size);
-
-    /** Concatenate the passed-in bytes onto the end of the ByteBuf. Allocate
-     * more memory as needed.
-     */
-    void
-    Cat_Bytes(ByteBuf *self, const void *bytes, size_t size);
-
-    /** Concatenate the contents of <code>other</code> onto the end of the
-     * original ByteBuf. Allocate more memory as needed.
-     */
-    void
-    Cat(ByteBuf *self, ByteBuf *other);
-
-    /** Assign more memory to the ByteBuf, if it doesn't already have enough
-     * room to hold <code>size</code> bytes.  Cannot shrink the allocation.
-     *
-     * @return a pointer to the raw buffer.
-     */
-    nullable char*
-    Grow(ByteBuf *self, size_t size);
-
-    /** Test whether the ByteBuf matches the passed-in bytes.
-     */
-    bool
-    Equals_Bytes(ByteBuf *self, const void *bytes, size_t size);
-
-    public int32_t
-    Compare_To(ByteBuf *self, Obj *other);
-
-    public incremented ByteBuf*
-    Clone(ByteBuf *self);
-
-    public void
-    Destroy(ByteBuf *self);
-
-    public bool
-    Equals(ByteBuf *self, Obj *other);
-
-    public int32_t
-    Hash_Sum(ByteBuf *self);
-}
-
-/**
- * A ByteBuf that doesn't own its own string.
- */
-class Clownfish::ViewByteBuf cnick ViewBB
-    inherits Clownfish::ByteBuf {
-
-    /** Return a pointer to a new "view" ByteBuf, offing a persective on the
-     * passed-in string.
-     */
-    inert incremented ViewByteBuf*
-    new(char *buf, size_t size);
-
-    inert incremented ViewByteBuf*
-    init(ViewByteBuf *self, char *buf, size_t size);
-
-    /** Assign buf and size members to the passed in values.
-     */
-    void
-    Assign_Bytes(ViewByteBuf *self, char *buf, size_t size);
-
-    /** Assign buf and size members from the passed-in ByteBuf.
-     */
-    void
-    Assign(ViewByteBuf *self, ByteBuf *other);
-
-    public void
-    Destroy(ViewByteBuf *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/CharBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.c b/clownfish/runtime/core/Clownfish/CharBuf.c
deleted file mode 100644
index 8dbeb36..0000000
--- a/clownfish/runtime/core/Clownfish/CharBuf.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_CHARBUF
-#define C_CFISH_STRING
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "Clownfish/CharBuf.h"
-
-#include "Clownfish/Err.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/Util/StringHelper.h"
-#include "Clownfish/VTable.h"
-
-// Helper function for throwing invalid UTF-8 error. Since THROW uses
-// a String internally, calling THROW with invalid UTF-8 would create an
-// infinite loop -- so we fwrite some of the bogus text to stderr and
-// invoke THROW with a generic message.
-#define DIE_INVALID_UTF8(text, size) \
-    S_die_invalid_utf8(text, size, __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
-static void
-S_die_invalid_utf8(const char *text, size_t size, const char *file, int line,
-                   const char *func);
-
-// Helper function for throwing invalid pattern error.
-static void
-S_die_invalid_pattern(const char *pattern);
-
-CharBuf*
-CB_new(size_t size) {
-    CharBuf *self = (CharBuf*)VTable_Make_Obj(CHARBUF);
-    return CB_init(self, size);
-}
-
-CharBuf*
-CB_init(CharBuf *self, size_t size) {
-    // Derive.
-    self->ptr = (char*)MALLOCATE(size + 1);
-
-    // Init.
-    *self->ptr = '\0'; // Empty string.
-
-    // Assign.
-    self->size = 0;
-    self->cap  = size + 1;
-
-    return self;
-}
-
-CharBuf*
-CB_new_from_str(String *string) {
-    return CB_new_from_trusted_utf8(string->ptr, string->size);
-}
-
-CharBuf*
-CB_new_from_utf8(const char *ptr, size_t size) {
-    if (!StrHelp_utf8_valid(ptr, size)) {
-        DIE_INVALID_UTF8(ptr, size);
-    }
-    return CB_new_from_trusted_utf8(ptr, size);
-}
-
-CharBuf*
-CB_new_from_trusted_utf8(const char *ptr, size_t size) {
-    CharBuf *self = (CharBuf*)VTable_Make_Obj(CHARBUF);
-
-    // Derive.
-    self->ptr = (char*)MALLOCATE(size + 1);
-
-    // Copy.
-    memcpy(self->ptr, ptr, size);
-
-    // Assign.
-    self->size      = size;
-    self->cap       = size + 1;
-    self->ptr[size] = '\0'; // Null terminate.
-
-    return self;
-}
-
-CharBuf*
-CB_newf(const char *pattern, ...) {
-    CharBuf *self = CB_new(strlen(pattern));
-    va_list args;
-    va_start(args, pattern);
-    CB_VCatF(self, pattern, args);
-    va_end(args);
-    return self;
-}
-
-void
-CB_Destroy_IMP(CharBuf *self) {
-    FREEMEM(self->ptr);
-    SUPER_DESTROY(self, CHARBUF);
-}
-
-char*
-CB_Grow_IMP(CharBuf *self, size_t size) {
-    if (size >= self->cap) {
-        self->cap = size + 1;
-        self->ptr = (char*)REALLOCATE(self->ptr, self->cap);
-    }
-    return self->ptr;
-}
-
-static void
-S_die_invalid_utf8(const char *text, size_t size, const char *file, int line,
-                   const char *func) {
-    fprintf(stderr, "Invalid UTF-8, aborting: '");
-    fwrite(text, sizeof(char), size < 200 ? size : 200, stderr);
-    if (size > 200) { fwrite("[...]", sizeof(char), 5, stderr); }
-    fprintf(stderr, "' (length %lu)\n", (unsigned long)size);
-    Err_throw_at(ERR, file, line, func, "Invalid UTF-8");
-}
-
-static void
-S_die_invalid_pattern(const char *pattern) {
-    size_t  pattern_len = strlen(pattern);
-    fprintf(stderr, "Invalid pattern, aborting: '");
-    fwrite(pattern, sizeof(char), pattern_len, stderr);
-    fprintf(stderr, "'\n");
-    THROW(ERR, "Invalid pattern.");
-}
-
-void
-CB_catf(CharBuf *self, const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    CB_VCatF(self, pattern, args);
-    va_end(args);
-}
-
-void
-CB_VCatF_IMP(CharBuf *self, const char *pattern, va_list args) {
-    size_t      pattern_len   = strlen(pattern);
-    const char *pattern_start = pattern;
-    const char *pattern_end   = pattern + pattern_len;
-    char        buf[64];
-
-    for (; pattern < pattern_end; pattern++) {
-        const char *slice_end = pattern;
-
-        // Consume all characters leading up to a '%'.
-        while (slice_end < pattern_end && *slice_end != '%') { slice_end++; }
-        if (pattern != slice_end) {
-            size_t size = slice_end - pattern;
-            CB_Cat_Trusted_Utf8(self, pattern, size);
-            pattern = slice_end;
-        }
-
-        if (pattern < pattern_end) {
-            pattern++; // Move past '%'.
-
-            switch (*pattern) {
-                case '%': {
-                        CB_Cat_Trusted_Utf8(self, "%", 1);
-                    }
-                    break;
-                case 'o': {
-                        Obj *obj = va_arg(args, Obj*);
-                        if (!obj) {
-                            CB_Cat_Trusted_Utf8(self, "[NULL]", 6);
-                        }
-                        else if (Obj_Is_A(obj, STRING)) {
-                            CB_Cat(self, (String*)obj);
-                        }
-                        else {
-                            String *string = Obj_To_String(obj);
-                            CB_Cat(self, string);
-                            DECREF(string);
-                        }
-                    }
-                    break;
-                case 'i': {
-                        int64_t val = 0;
-                        size_t size;
-                        if (pattern[1] == '8') {
-                            val = va_arg(args, int32_t);
-                            pattern++;
-                        }
-                        else if (pattern[1] == '3' && pattern[2] == '2') {
-                            val = va_arg(args, int32_t);
-                            pattern += 2;
-                        }
-                        else if (pattern[1] == '6' && pattern[2] == '4') {
-                            val = va_arg(args, int64_t);
-                            pattern += 2;
-                        }
-                        else {
-                            S_die_invalid_pattern(pattern_start);
-                        }
-                        size = sprintf(buf, "%" PRId64, val);
-                        CB_Cat_Trusted_Utf8(self, buf, size);
-                    }
-                    break;
-                case 'u': {
-                        uint64_t val = 0;
-                        size_t size;
-                        if (pattern[1] == '8') {
-                            val = va_arg(args, uint32_t);
-                            pattern += 1;
-                        }
-                        else if (pattern[1] == '3' && pattern[2] == '2') {
-                            val = va_arg(args, uint32_t);
-                            pattern += 2;
-                        }
-                        else if (pattern[1] == '6' && pattern[2] == '4') {
-                            val = va_arg(args, uint64_t);
-                            pattern += 2;
-                        }
-                        else {
-                            S_die_invalid_pattern(pattern_start);
-                        }
-                        size = sprintf(buf, "%" PRIu64, val);
-                        CB_Cat_Trusted_Utf8(self, buf, size);
-                    }
-                    break;
-                case 'f': {
-                        if (pattern[1] == '6' && pattern[2] == '4') {
-                            double num  = va_arg(args, double);
-                            char bigbuf[512];
-                            size_t size = sprintf(bigbuf, "%g", num);
-                            CB_Cat_Trusted_Utf8(self, bigbuf, size);
-                            pattern += 2;
-                        }
-                        else {
-                            S_die_invalid_pattern(pattern_start);
-                        }
-                    }
-                    break;
-                case 'x': {
-                        if (pattern[1] == '3' && pattern[2] == '2') {
-                            unsigned long val = va_arg(args, uint32_t);
-                            size_t size = sprintf(buf, "%.8lx", val);
-                            CB_Cat_Trusted_Utf8(self, buf, size);
-                            pattern += 2;
-                        }
-                        else {
-                            S_die_invalid_pattern(pattern_start);
-                        }
-                    }
-                    break;
-                case 's': {
-                        char *string = va_arg(args, char*);
-                        if (string == NULL) {
-                            CB_Cat_Trusted_Utf8(self, "[NULL]", 6);
-                        }
-                        else {
-                            size_t size = strlen(string);
-                            if (StrHelp_utf8_valid(string, size)) {
-                                CB_Cat_Trusted_Utf8(self, string, size);
-                            }
-                            else {
-                                CB_Cat_Trusted_Utf8(self, "[INVALID UTF8]", 14);
-                            }
-                        }
-                    }
-                    break;
-                default: {
-                        // Assume NULL-terminated pattern string, which
-                        // eliminates the need for bounds checking if '%' is
-                        // the last visible character.
-                        S_die_invalid_pattern(pattern_start);
-                    }
-            }
-        }
-    }
-}
-
-String*
-CB_To_String_IMP(CharBuf *self) {
-    return Str_new_from_trusted_utf8(self->ptr, self->size);
-}
-
-String*
-CB_Yield_String_IMP(CharBuf *self) {
-    String *retval
-        = Str_new_steal_trusted_utf8(self->ptr, self->size);
-    self->ptr  = NULL;
-    self->size = 0;
-    self->cap  = 0;
-    return retval;
-}
-
-void
-CB_Cat_Char_IMP(CharBuf *self, int32_t code_point) {
-    const size_t MAX_UTF8_BYTES = 4;
-    if (self->size + MAX_UTF8_BYTES >= self->cap) {
-        CB_Grow(self, Memory_oversize(self->size + MAX_UTF8_BYTES,
-                                     sizeof(char)));
-    }
-    char *end = self->ptr + self->size;
-    size_t count = StrHelp_encode_utf8_char(code_point, (uint8_t*)end);
-    self->size += count;
-    *(end + count) = '\0';
-}
-
-CharBuf*
-CB_Clone_IMP(CharBuf *self) {
-    return CB_new_from_trusted_utf8(self->ptr, self->size);
-}
-
-static CFISH_INLINE void
-SI_mimic_utf8(CharBuf *self, const char* ptr, size_t size) {
-    if (size >= self->cap) { CB_Grow(self, size); }
-    memmove(self->ptr, ptr, size);
-    self->size = size;
-    self->ptr[size] = '\0';
-}
-
-void
-CB_Mimic_Utf8_IMP(CharBuf *self, const char* ptr, size_t size) {
-    if (!StrHelp_utf8_valid(ptr, size)) {
-        DIE_INVALID_UTF8(ptr, size);
-    }
-    SI_mimic_utf8(self, ptr, size);
-}
-
-void
-CB_Mimic_IMP(CharBuf *self, Obj *other) {
-    const char *ptr;
-    size_t size;
-    if (Obj_Is_A(other, CHARBUF)) {
-        CharBuf *twin = (CharBuf*)other;
-        ptr  = twin->ptr;
-        size = twin->size;
-    }
-    else if (Obj_Is_A(other, STRING)) {
-        String *twin = (String*)other;
-        ptr  = twin->ptr;
-        size = twin->size;
-    }
-    else {
-        THROW(ERR, "CharBuf can't mimic %o", Obj_Get_Class_Name(other));
-    }
-    SI_mimic_utf8(self, ptr, size);
-}
-
-static CFISH_INLINE void
-SI_cat_utf8(CharBuf *self, const char* ptr, size_t size) {
-    const size_t new_size = self->size + size;
-    if (new_size >= self->cap) {
-        size_t amount = Memory_oversize(new_size, sizeof(char));
-        CB_Grow(self, amount);
-    }
-    memcpy(self->ptr + self->size, ptr, size);
-    self->size = new_size;
-    self->ptr[new_size] = '\0';
-}
-
-void
-CB_Cat_Utf8_IMP(CharBuf *self, const char* ptr, size_t size) {
-    if (!StrHelp_utf8_valid(ptr, size)) {
-        DIE_INVALID_UTF8(ptr, size);
-    }
-    SI_cat_utf8(self, ptr, size);
-}
-
-void
-CB_Cat_Trusted_Utf8_IMP(CharBuf *self, const char* ptr, size_t size) {
-    SI_cat_utf8(self, ptr, size);
-}
-
-void
-CB_Cat_IMP(CharBuf *self, String *string) {
-    SI_cat_utf8(self, string->ptr, string->size);
-}
-
-void
-CB_Set_Size_IMP(CharBuf *self, size_t size) {
-    if (size >= self->cap) {
-        THROW(ERR, "Can't set size of CharBuf beyond capacity");
-    }
-    self->size = size;
-}
-
-size_t
-CB_Get_Size_IMP(CharBuf *self) {
-    return self->size;
-}
-
-char*
-CB_Get_Ptr8_IMP(CharBuf *self) {
-    return self->ptr;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.cfh b/clownfish/runtime/core/Clownfish/CharBuf.cfh
deleted file mode 100644
index 77a6e32..0000000
--- a/clownfish/runtime/core/Clownfish/CharBuf.cfh
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/**
- * Growable buffer holding Unicode characters.
- */
-
-class Clownfish::CharBuf cnick CB
-    inherits Clownfish::Obj {
-
-    char    *ptr;
-    size_t   size;
-    size_t   cap;  /* allocated bytes, including terminating null */
-
-    inert incremented CharBuf*
-    new(size_t size);
-
-    inert CharBuf*
-    init(CharBuf *self, size_t size);
-
-    /** Return a new CharBuf which holds a copy of the passed-in String.
-     */
-    inert incremented CharBuf*
-    new_from_str(String *string);
-
-    /** Return a new CharBuf which holds a copy of the passed-in string.
-     * Check for UTF-8 validity.
-     */
-    inert incremented CharBuf*
-    new_from_utf8(const char *utf8, size_t size);
-
-    /** Return a new CharBuf which holds a copy of the passed-in string.  No
-     * validity checking is performed.
-     */
-    inert incremented CharBuf*
-    new_from_trusted_utf8(const char *utf8, size_t size);
-
-    /** Return a pointer to a new CharBuf which contains formatted data
-     * expanded according to CB_VCatF.
-     *
-     * Note: a user-supplied <code>pattern</code> string is a security hole
-     * and must not be allowed.
-     */
-    inert incremented CharBuf*
-    newf(const char *pattern, ...);
-
-    public void
-    Mimic(CharBuf *self, Obj *other);
-
-    void
-    Mimic_Utf8(CharBuf *self, const char *ptr, size_t size);
-
-    /** Concatenate the passed-in string onto the end of the CharBuf.
-     */
-    void
-    Cat_Utf8(CharBuf *self, const char *ptr, size_t size);
-
-    /** Concatenate the supplied text onto the end of the CharBuf.  Don't
-     * check for UTF-8 validity.
-     */
-    void
-    Cat_Trusted_Utf8(CharBuf *self, const char *ptr, size_t size);
-
-    /** Concatenate the contents of <code>string</code> onto the end of the
-     * caller.
-     */
-    void
-    Cat(CharBuf *self, String *string);
-
-    /** Concatenate formatted arguments.  Similar to the printf family, but
-     * only accepts minimal options (just enough for decent error messages).
-     *
-     * Objects:  %o
-     * char*:    %s
-     * integers: %i8 %i32 %i64 %u8 %u32 %u64
-     * floats:   %f64
-     * hex:      %x32
-     *
-     * Note that all Clownfish Objects, including CharBufs, are printed via
-     * %o (which invokes Obj_To_String()).
-     */
-    void
-    VCatF(CharBuf *self, const char *pattern, va_list args);
-
-    /** Invokes CB_VCatF to concatenate formatted arguments.  Note that this
-     * is only a function and not a method.
-     */
-    inert void
-    catf(CharBuf *self, const char *pattern, ...);
-
-    /** Concatenate one Unicode character onto the end of the CharBuf.
-     */
-    void
-    Cat_Char(CharBuf *self, int32_t code_point);
-
-    /** Assign more memory to the CharBuf, if it doesn't already have enough
-     * room to hold a string of <code>size</code> bytes.  Cannot shrink the
-     * allocation.
-     *
-     * @return a pointer to the raw buffer.
-     */
-    char*
-    Grow(CharBuf *self, size_t size);
-
-    /** Set the CharBuf's <code>size</code> attribute.
-     */
-    void
-    Set_Size(CharBuf *self, size_t size);
-
-    /** Get the CharBuf's <code>size</code> attribute.
-     */
-    size_t
-    Get_Size(CharBuf *self);
-
-    /** Return the internal backing array for the CharBuf if its internal
-     * encoding is UTF-8.  If it is not encoded as UTF-8 throw an exception.
-     */
-    char*
-    Get_Ptr8(CharBuf *self);
-
-    public incremented CharBuf*
-    Clone(CharBuf *self);
-
-    public void
-    Destroy(CharBuf *self);
-
-    public incremented String*
-    To_String(CharBuf *self);
-
-    /** Return the content of the CharBuf as String and clear the CharBuf.
-     * This is more efficient than To_String().
-     */
-    public incremented String*
-    Yield_String(CharBuf *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Err.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.c b/clownfish/runtime/core/Clownfish/Err.c
deleted file mode 100644
index 742ffcc..0000000
--- a/clownfish/runtime/core/Clownfish/Err.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_ERR
-#define C_CFISH_OBJ
-#define C_CFISH_VTABLE
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#include "Clownfish/Err.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/String.h"
-#include "Clownfish/VTable.h"
-#include "Clownfish/Util/Memory.h"
-
-Err*
-Err_new(String *mess) {
-    Err *self = (Err*)VTable_Make_Obj(ERR);
-    return Err_init(self, mess);
-}
-
-Err*
-Err_init(Err *self, String *mess) {
-    self->mess = mess;
-    return self;
-}
-
-void
-Err_Destroy_IMP(Err *self) {
-    DECREF(self->mess);
-    SUPER_DESTROY(self, ERR);
-}
-
-String*
-Err_To_String_IMP(Err *self) {
-    return (String*)INCREF(self->mess);
-}
-
-void
-Err_Cat_Mess_IMP(Err *self, String *mess) {
-    String *new_mess = Str_Cat(self->mess, mess);
-    DECREF(self->mess);
-    self->mess = new_mess;
-}
-
-// Fallbacks in case variadic macros aren't available.
-#ifndef CHY_HAS_VARIADIC_MACROS
-static String*
-S_str_vnewf(char *pattern, va_list args) {
-    CharBuf *buf = CB_new(strlen(pattern) + 10);
-    CB_VCatF(buf, pattern, args);
-    String *message = CB_Yield_String(buf);
-    DECREF(buf);
-    return message;
-}
-void
-THROW(VTable *vtable, char *pattern, ...) {
-    va_list args;
-
-    va_start(args, pattern);
-    String *message = S_str_vnewf(pattern, args);
-    va_end(args);
-
-    Err *err = (Err*)VTable_Make_Obj(vtable);
-    err = Err_init(err, message);
-    Err_do_throw(err);
-}
-void
-CFISH_WARN(char *pattern, ...) {
-    va_list args;
-
-    va_start(args, pattern);
-    String *message = S_str_vnewf(pattern, args);
-    va_end(args);
-
-    Err_warn_mess(message);
-}
-String*
-CFISH_MAKE_MESS(char *pattern, ...) {
-    va_list args;
-
-    va_start(args, pattern);
-    String *message = S_str_vnewf(pattern, args);
-    va_end(args);
-
-    return message;
-}
-#endif
-
-
-static String*
-S_vmake_mess(const char *file, int line, const char *func,
-             const char *pattern, va_list args) {
-    size_t guess_len = strlen(file)
-                       + (func ? strlen(func) : 0)
-                       + strlen(pattern)
-                       + 30;
-    CharBuf *buf = CB_new(guess_len);
-    CB_VCatF(buf, pattern, args);
-    if (func != NULL) {
-        CB_catf(buf, "\n\t%s at %s line %i32\n", func, file, (int32_t)line);
-    }
-    else {
-        CB_catf(buf, "\n\t%s line %i32\n", file, (int32_t)line);
-    }
-    String *message = CB_Yield_String(buf);
-    DECREF(buf);
-    return message;
-}
-
-String*
-Err_make_mess(const char *file, int line, const char *func,
-              const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    String *message = S_vmake_mess(file, line, func, pattern, args);
-    va_end(args);
-    return message;
-}
-
-void
-Err_warn_at(const char *file, int line, const char *func,
-            const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    String *message = S_vmake_mess(file, line, func, pattern, args);
-    va_end(args);
-    Err_warn_mess(message);
-}
-
-String*
-Err_Get_Mess_IMP(Err *self) {
-    return self->mess;
-}
-
-void
-Err_Add_Frame_IMP(Err *self, const char *file, int line, const char *func) {
-    CharBuf *buf = CB_new_from_str(self->mess);
-
-    if (!Str_Ends_With_Utf8(self->mess, "\n", 1)) {
-        CB_Cat_Char(buf, '\n');
-    }
-
-    if (func != NULL) {
-        CB_catf(buf, "\t%s at %s line %i32\n", func, file, (int32_t)line);
-    }
-    else {
-        CB_catf(buf, "\tat %s line %i32\n", file, (int32_t)line);
-    }
-
-    DECREF(self->mess);
-    self->mess = CB_Yield_String(buf);
-    DECREF(buf);
-}
-
-void
-Err_rethrow(Err *self, const char *file, int line, const char *func) {
-    Err_Add_Frame_IMP(self, file, line, func);
-    Err_do_throw(self);
-}
-
-void
-Err_throw_at(VTable *vtable, const char *file, int line,
-             const char *func, const char *pattern, ...) {
-    va_list args;
-
-    va_start(args, pattern);
-    String *message = S_vmake_mess(file, line, func, pattern, args);
-    va_end(args);
-
-    Err *err = (Err*)VTable_Make_Obj(vtable);
-    err = Err_init(err, message);
-    Err_do_throw(err);
-}
-
-// Inlined, slightly optimized version of Obj_is_a.
-static CFISH_INLINE bool
-SI_obj_is_a(Obj *obj, VTable *target_vtable) {
-    VTable *vtable = obj->vtable;
-
-    while (vtable != NULL) {
-        if (vtable == target_vtable) {
-            return true;
-        }
-        vtable = vtable->parent;
-    }
-
-    return false;
-}
-
-Obj*
-Err_downcast(Obj *obj, VTable *vtable, const char *file, int line,
-             const char *func) {
-    if (obj && !SI_obj_is_a(obj, vtable)) {
-        Err_throw_at(ERR, file, line, func, "Can't downcast from %o to %o",
-                     Obj_Get_Class_Name(obj), VTable_Get_Name(vtable));
-    }
-    return obj;
-}
-
-Obj*
-Err_certify(Obj *obj, VTable *vtable, const char *file, int line,
-            const char *func) {
-    if (!obj) {
-        Err_throw_at(ERR, file, line, func, "Object isn't a %o, it's NULL",
-                     VTable_Get_Name(vtable));
-    }
-    else if (!SI_obj_is_a(obj, vtable)) {
-        Err_throw_at(ERR, file, line, func, "Can't downcast from %o to %o",
-                     Obj_Get_Class_Name(obj), VTable_Get_Name(vtable));
-    }
-    return obj;
-}
-
-#ifdef CHY_HAS_WINDOWS_H
-
-#include <windows.h>
-
-char*
-Err_win_error() {
-    size_t buf_size = 256;
-    char *buf = (char*)MALLOCATE(buf_size);
-    size_t message_len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
-                                       NULL,       // message source table
-                                       GetLastError(),
-                                       0,          // language id
-                                       buf,
-                                       buf_size,
-                                       NULL        // empty va_list
-                                      );
-    if (message_len == 0) {
-        char unknown[] = "Unknown error";
-        size_t len = sizeof(unknown);
-        strncpy(buf, unknown, len);
-    }
-    else if (message_len > 1) {
-        // Kill stupid newline.
-        buf[message_len - 2] = '\0';
-    }
-    return buf;
-}
-
-#else
-
-char*
-Err_win_error() {
-    return NULL; // Never called.
-}
-
-#endif // CHY_HAS_WINDOWS_H
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Err.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.cfh b/clownfish/runtime/core/Clownfish/Err.cfh
deleted file mode 100644
index 348e0ed..0000000
--- a/clownfish/runtime/core/Clownfish/Err.cfh
+++ /dev/null
@@ -1,254 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-__C__
-typedef void 
-(*CFISH_Err_Attempt_t)(void *context);
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define Err_Attempt_t CFISH_Err_Attempt_t
-#endif
-__END_C__
-
-/**
- * Exception.
- *
- * Clownfish::Err is the base class for exceptions in the Clownfish object
- * hierarchy.
- *
- * The Err module also provides access to a per-thread Err shared variable via
- * set_error() and get_error().  It may be used to store an Err object
- * temporarily, so that calling code may choose how to handle a particular
- * error condition.
- */
-public class Clownfish::Err inherits Clownfish::Obj {
-
-    String *mess;
-
-    inert void
-    init_class();
-
-    inert incremented Err*
-    new(decremented String *mess);
-
-    inert Err*
-    init(Err *self, decremented String *mess);
-
-    public void
-    Destroy(Err *self);
-
-    public incremented String*
-    To_String(Err *self);
-
-    void*
-    To_Host(Err *self);
-
-    /** Concatenate the supplied argument onto the internal "mess".
-     */
-    public void
-    Cat_Mess(Err *self, String *mess);
-
-    public String*
-    Get_Mess(Err *self);
-
-    /** Add information about the current stack frame onto <code>mess</code>.
-     */
-    void
-    Add_Frame(Err *self, const char *file, int line, const char *func);
-
-    /** Set the value of "error", a per-thread Err shared variable.
-     */
-    public inert void
-    set_error(decremented Err *error);
-
-    /** Retrieve per-thread Err shared variable "error".
-     */
-    public inert nullable Err*
-    get_error();
-
-    /** Run <code>routine</code> within the host's exception handling
-     * environment, catching and returning any errors that occur.
-     * 
-     * If an unrecognized host exception is trapped, it will be wrapped in an
-     * Err so that it can be handled by Clownfish code.
-     *
-     * @return an Err, or NULL if no exception occurs.
-     */
-    public inert incremented nullable Err*
-    trap(CFISH_Err_Attempt_t routine, void *context);
-
-    /** Print an error message to stderr with some C contextual information.
-     * Usually invoked via the WARN(pattern, ...) macro.
-     */
-    inert void
-    warn_at(const char *file, int line, const char *func,
-            const char *pattern, ...);
-
-    /** Raise an exception. Usually invoked via the THROW macro.
-     */
-    inert void
-    throw_at(VTable *vtable, const char *file, int line, const char *func,
-               const char *pattern, ...);
-
-    /** Throw an existing exception after tacking on additional context data.
-     */
-    inert void
-    rethrow(Err *error, const char *file, int line, const char *func);
-
-    /** Raise an exception.  Clean up the supplied message by decrementing its
-     * refcount.
-     *
-     * @param vtable The vtable for the Err class to throw.
-     * @param message Error message, to be output verbatim.
-     */
-    inert void
-    throw_mess(VTable *vtable, decremented String *message);
-
-    /** Invoke host exception handling.
-     */
-    inert void
-    do_throw(decremented Err *self);
-
-    /** Invoke host warning mechanism.  Clean up the supplied message by
-     * decrementing its refcount.
-     *
-     * @param message Error message, to be output verbatim.
-     */
-    inert void
-    warn_mess(decremented String *message);
-
-    /** Create a formatted error message.  Ususally invoked via the MAKE_MESS
-     * macro.
-     */
-    inert String*
-    make_mess(const char *file, int line, const char *func,
-              const char *pattern, ...);
-
-    /** Verify that <code>obj</code> is either NULL or inherits from
-     * the class represented by <code>vtable</code>.
-     *
-     * @return the object.
-     */
-    inert nullable Obj*
-    downcast(Obj *obj, VTable *vtable, const char *file, int line,
-                const char *func);
-
-    /** Verify that <code>obj</code> is not NULL and inherits from the class
-     * represented by <code>vtable</code>.
-     *
-     * @return the object.
-     */
-    inert Obj*
-    certify(Obj *obj, VTable *vtable, const char *file, int line,
-            const char *func);
-
-    /** Verify that an object belongs to a subclass and not an abstract class.
-     */
-    inert inline void
-    abstract_class_check(Obj *obj, VTable *vtable);
-
-    /** On Windows, return a newly allocated buffer containing the string
-     * description for the the last error in the thread.
-     */
-    inert char*
-    win_error();
-}
-
-__C__
-#ifdef CFISH_HAS_FUNC_MACRO
- #define CFISH_ERR_FUNC_MACRO CFISH_FUNC_MACRO
-#else
- #define CFISH_ERR_FUNC_MACRO NULL
-#endif
-
-#define CFISH_ERR_ADD_FRAME(_error) \
-    CFISH_Err_Add_Frame(_error, __FILE__, __LINE__, \
-                        CFISH_ERR_FUNC_MACRO)
-
-#define CFISH_RETHROW(_error) \
-    cfish_Err_rethrow((cfish_Err*)_error, __FILE__, __LINE__, \
-                      CFISH_ERR_FUNC_MACRO)
-
-/** Macro version of cfish_Err_throw_at which inserts contextual information
- * automatically, provided that the compiler supports the necessary features.
- */
-#ifdef CFISH_HAS_VARIADIC_MACROS
- #ifdef CFISH_HAS_ISO_VARIADIC_MACROS
-  #define CFISH_THROW(_vtable, ...) \
-    cfish_Err_throw_at(_vtable, __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, \
-                       __VA_ARGS__)
-  #define CFISH_WARN(...) \
-    cfish_Err_warn_at(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, __VA_ARGS__)
-  #define CFISH_MAKE_MESS(...) \
-    cfish_Err_make_mess(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, \
-                        __VA_ARGS__)
- #elif defined(CFISH_HAS_GNUC_VARIADIC_MACROS)
-  #define CFISH_THROW(_vtable, args...) \
-    cfish_Err_throw_at(_vtable, __FILE__, __LINE__, \
-                       CFISH_ERR_FUNC_MACRO, ##args)
-  #define CFISH_WARN(args...) \
-    cfish_Err_warn_at(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, ##args)
-  #define CFISH_MAKE_MESS(args...) \
-    cfish_Err_make_mess(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, ##args)
- #endif
-#else
-  void
-  CFISH_THROW(cfish_VTable *vtable, char* format, ...);
-  void
-  CFISH_WARN(char* format, ...);
-  cfish_String*
-  CFISH_MAKE_MESS(char* format, ...);
-#endif
-
-#define CFISH_DOWNCAST(_obj, _vtable) \
-    cfish_Err_downcast((cfish_Obj*)(_obj), (_vtable), \
-                       __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
-
-
-#define CFISH_CERTIFY(_obj, _vtable) \
-    cfish_Err_certify((cfish_Obj*)(_obj), (_vtable), \
-                      __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
-
-static CFISH_INLINE void
-cfish_Err_abstract_class_check(cfish_Obj *obj, cfish_VTable *vtable) {
-    cfish_VTable *const my_vtable = (cfish_VTable*)((cfish_Dummy*)obj)->vtable;
-    if (my_vtable == vtable) {
-        cfish_String *mess = CFISH_MAKE_MESS("%o is an abstract class",
-                                              CFISH_Obj_Get_Class_Name(obj));
-        CFISH_Obj_Dec_RefCount(obj);
-        cfish_Err_throw_mess(CFISH_ERR, mess);
-    }
-}
-
-#define CFISH_ABSTRACT_CLASS_CHECK(_obj, _vtable) \
-    cfish_Err_abstract_class_check(((cfish_Obj*)_obj), _vtable)
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define THROW                 CFISH_THROW
-  #define RETHROW               CFISH_RETHROW
-  #define WARN                  CFISH_WARN
-  #define MAKE_MESS             CFISH_MAKE_MESS
-  #define ERR_ADD_FRAME         CFISH_ERR_ADD_FRAME
-  #define ERR_FUNC_MACRO        CFISH_ERR_FUNC_MACRO
-  #define DOWNCAST              CFISH_DOWNCAST
-  #define CERTIFY               CFISH_CERTIFY
-  #define ABSTRACT_CLASS_CHECK  CFISH_ABSTRACT_CLASS_CHECK
-#endif
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Hash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.c b/clownfish/runtime/core/Clownfish/Hash.c
deleted file mode 100644
index ed6cb6f..0000000
--- a/clownfish/runtime/core/Clownfish/Hash.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_HASH
-#define C_CFISH_HASHTOMBSTONE
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdlib.h>
-
-#include "Clownfish/VTable.h"
-
-#include "Clownfish/Hash.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/Util/Memory.h"
-
-static HashTombStone *TOMBSTONE;
-
-#define HashEntry cfish_HashEntry
-
-typedef struct HashEntry {
-    Obj     *key;
-    Obj     *value;
-    int32_t  hash_sum;
-} HashEntry;
-
-// Reset the iterator.  Hash_Iterate must be called to restart iteration.
-static CFISH_INLINE void
-SI_kill_iter(Hash *self);
-
-// Return the entry associated with the key, if any.
-static CFISH_INLINE HashEntry*
-SI_fetch_entry(Hash *self, Obj *key, int32_t hash_sum);
-
-// Double the number of buckets and redistribute all entries.
-static CFISH_INLINE HashEntry*
-SI_rebuild_hash(Hash *self);
-
-void
-Hash_init_class() {
-    TOMBSTONE = (HashTombStone*)VTable_Make_Obj(HASHTOMBSTONE);
-}
-
-Hash*
-Hash_new(uint32_t capacity) {
-    Hash *self = (Hash*)VTable_Make_Obj(HASH);
-    return Hash_init(self, capacity);
-}
-
-Hash*
-Hash_init(Hash *self, uint32_t capacity) {
-    // Allocate enough space to hold the requested number of elements without
-    // triggering a rebuild.
-    uint32_t requested_capacity = capacity < INT32_MAX ? capacity : INT32_MAX;
-    uint32_t threshold;
-    capacity = 16;
-    while (1) {
-        threshold = (capacity / 3) * 2;
-        if (threshold > requested_capacity) { break; }
-        capacity *= 2;
-    }
-
-    // Init.
-    self->size         = 0;
-    self->iter_tick    = -1;
-
-    // Derive.
-    self->capacity     = capacity;
-    self->entries      = (HashEntry*)CALLOCATE(capacity, sizeof(HashEntry));
-    self->threshold    = threshold;
-
-    return self;
-}
-
-void
-Hash_Destroy_IMP(Hash *self) {
-    if (self->entries) {
-        Hash_Clear(self);
-        FREEMEM(self->entries);
-    }
-    SUPER_DESTROY(self, HASH);
-}
-
-void
-Hash_Clear_IMP(Hash *self) {
-    HashEntry *entry       = (HashEntry*)self->entries;
-    HashEntry *const limit = entry + self->capacity;
-
-    // Iterate through all entries.
-    for (; entry < limit; entry++) {
-        if (!entry->key) { continue; }
-        DECREF(entry->key);
-        DECREF(entry->value);
-        entry->key       = NULL;
-        entry->value     = NULL;
-        entry->hash_sum  = 0;
-    }
-
-    self->size = 0;
-}
-
-void
-Hash_do_store(Hash *self, Obj *key, Obj *value,
-              int32_t hash_sum, bool use_this_key) {
-    HashEntry *entries = self->size >= self->threshold
-                         ? SI_rebuild_hash(self)
-                         : (HashEntry*)self->entries;
-    uint32_t       tick = hash_sum;
-    const uint32_t mask = self->capacity - 1;
-
-    while (1) {
-        tick &= mask;
-        HashEntry *entry = entries + tick;
-        if (entry->key == (Obj*)TOMBSTONE || !entry->key) {
-            if (entry->key == (Obj*)TOMBSTONE) {
-                // Take note of diminished tombstone clutter.
-                self->threshold++;
-            }
-            entry->key       = use_this_key
-                               ? key
-                               : Hash_Make_Key(self, key, hash_sum);
-            entry->value     = value;
-            entry->hash_sum  = hash_sum;
-            self->size++;
-            break;
-        }
-        else if (entry->hash_sum == hash_sum
-                 && Obj_Equals(key, entry->key)
-                ) {
-            DECREF(entry->value);
-            entry->value = value;
-            break;
-        }
-        tick++; // linear scan
-    }
-}
-
-void
-Hash_Store_IMP(Hash *self, Obj *key, Obj *value) {
-    Hash_do_store(self, key, value, Obj_Hash_Sum(key), false);
-}
-
-void
-Hash_Store_Utf8_IMP(Hash *self, const char *key, size_t key_len, Obj *value) {
-    StackString *key_buf = SSTR_WRAP_UTF8((char*)key, key_len);
-    Hash_do_store(self, (Obj*)key_buf, value,
-                  SStr_Hash_Sum(key_buf), false);
-}
-
-Obj*
-Hash_Make_Key_IMP(Hash *self, Obj *key, int32_t hash_sum) {
-    UNUSED_VAR(self);
-    UNUSED_VAR(hash_sum);
-    return Obj_Clone(key);
-}
-
-Obj*
-Hash_Fetch_Utf8_IMP(Hash *self, const char *key, size_t key_len) {
-    StackString *key_buf = SSTR_WRAP_UTF8(key, key_len);
-    return Hash_Fetch_IMP(self, (Obj*)key_buf);
-}
-
-static CFISH_INLINE HashEntry*
-SI_fetch_entry(Hash *self, Obj *key, int32_t hash_sum) {
-    uint32_t tick = hash_sum;
-    HashEntry *const entries = (HashEntry*)self->entries;
-    HashEntry *entry;
-
-    while (1) {
-        tick &= self->capacity - 1;
-        entry = entries + tick;
-        if (!entry->key) {
-            // Failed to find the key, so return NULL.
-            return NULL;
-        }
-        else if (entry->hash_sum == hash_sum
-                 && Obj_Equals(key, entry->key)
-                ) {
-            return entry;
-        }
-        tick++;
-    }
-}
-
-Obj*
-Hash_Fetch_IMP(Hash *self, Obj *key) {
-    HashEntry *entry = SI_fetch_entry(self, key, Obj_Hash_Sum(key));
-    return entry ? entry->value : NULL;
-}
-
-Obj*
-Hash_Delete_IMP(Hash *self, Obj *key) {
-    HashEntry *entry = SI_fetch_entry(self, key, Obj_Hash_Sum(key));
-    if (entry) {
-        Obj *value = entry->value;
-        DECREF(entry->key);
-        entry->key       = (Obj*)TOMBSTONE;
-        entry->value     = NULL;
-        entry->hash_sum  = 0;
-        self->size--;
-        self->threshold--; // limit number of tombstones
-        return value;
-    }
-    else {
-        return NULL;
-    }
-}
-
-Obj*
-Hash_Delete_Utf8_IMP(Hash *self, const char *key, size_t key_len) {
-    StackString *key_buf = SSTR_WRAP_UTF8(key, key_len);
-    return Hash_Delete_IMP(self, (Obj*)key_buf);
-}
-
-uint32_t
-Hash_Iterate_IMP(Hash *self) {
-    SI_kill_iter(self);
-    return self->size;
-}
-
-static CFISH_INLINE void
-SI_kill_iter(Hash *self) {
-    self->iter_tick = -1;
-}
-
-bool
-Hash_Next_IMP(Hash *self, Obj **key, Obj **value) {
-    while (1) {
-        if (++self->iter_tick >= (int32_t)self->capacity) {
-            // Bail since we've completed the iteration.
-            --self->iter_tick;
-            *key   = NULL;
-            *value = NULL;
-            return false;
-        }
-        else {
-            HashEntry *const entry
-                = (HashEntry*)self->entries + self->iter_tick;
-            if (entry->key && entry->key != (Obj*)TOMBSTONE) {
-                // Success!
-                *key   = entry->key;
-                *value = entry->value;
-                return true;
-            }
-        }
-    }
-}
-
-Obj*
-Hash_Find_Key_IMP(Hash *self, Obj *key, int32_t hash_sum) {
-    HashEntry *entry = SI_fetch_entry(self, key, hash_sum);
-    return entry ? entry->key : NULL;
-}
-
-VArray*
-Hash_Keys_IMP(Hash *self) {
-    Obj *key;
-    Obj *val;
-    VArray *keys = VA_new(self->size);
-    Hash_Iterate(self);
-    while (Hash_Next(self, &key, &val)) {
-        VA_Push(keys, INCREF(key));
-    }
-    return keys;
-}
-
-VArray*
-Hash_Values_IMP(Hash *self) {
-    Obj *key;
-    Obj *val;
-    VArray *values = VA_new(self->size);
-    Hash_Iterate(self);
-    while (Hash_Next(self, &key, &val)) { VA_Push(values, INCREF(val)); }
-    return values;
-}
-
-bool
-Hash_Equals_IMP(Hash *self, Obj *other) {
-    Hash    *twin = (Hash*)other;
-    Obj     *key;
-    Obj     *val;
-
-    if (twin == self)             { return true; }
-    if (!Obj_Is_A(other, HASH))   { return false; }
-    if (self->size != twin->size) { return false; }
-
-    Hash_Iterate(self);
-    while (Hash_Next(self, &key, &val)) {
-        Obj *other_val = Hash_Fetch(twin, key);
-        if (!other_val || !Obj_Equals(other_val, val)) { return false; }
-    }
-
-    return true;
-}
-
-uint32_t
-Hash_Get_Capacity_IMP(Hash *self) {
-    return self->capacity;
-}
-
-uint32_t
-Hash_Get_Size_IMP(Hash *self) {
-    return self->size;
-}
-
-static CFISH_INLINE HashEntry*
-SI_rebuild_hash(Hash *self) {
-    HashEntry *old_entries = (HashEntry*)self->entries;
-    HashEntry *entry       = old_entries;
-    HashEntry *limit       = old_entries + self->capacity;
-
-    SI_kill_iter(self);
-    self->capacity *= 2;
-    self->threshold = (self->capacity / 3) * 2;
-    self->entries   = (HashEntry*)CALLOCATE(self->capacity, sizeof(HashEntry));
-    self->size      = 0;
-
-    for (; entry < limit; entry++) {
-        if (!entry->key || entry->key == (Obj*)TOMBSTONE) {
-            continue;
-        }
-        Hash_do_store(self, entry->key, entry->value,
-                      entry->hash_sum, true);
-    }
-
-    FREEMEM(old_entries);
-
-    return (HashEntry*)self->entries;
-}
-
-/***************************************************************************/
-
-uint32_t
-HashTombStone_Get_RefCount_IMP(HashTombStone* self) {
-    CHY_UNUSED_VAR(self);
-    return 1;
-}
-
-HashTombStone*
-HashTombStone_Inc_RefCount_IMP(HashTombStone* self) {
-    return self;
-}
-
-uint32_t
-HashTombStone_Dec_RefCount_IMP(HashTombStone* self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Hash.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.cfh b/clownfish/runtime/core/Clownfish/Hash.cfh
deleted file mode 100644
index afa1904..0000000
--- a/clownfish/runtime/core/Clownfish/Hash.cfh
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/**
- * Hashtable.
- *
- * Values are stored by reference and may be any kind of Obj. By default, keys
- * are cloned and so must belong to a class that implements Clone(); however,
- * this behavior can be changed by overridding Make_Key(), e.g. to implement
- * efficient hash sets.
- */
-class Clownfish::Hash inherits Clownfish::Obj {
-
-    void          *entries;
-    uint32_t       capacity;
-    uint32_t       size;
-    uint32_t       threshold;    /* rehashing trigger point */
-    int32_t        iter_tick;    /* used when iterating */
-
-    inert void
-    init_class();
-
-    inert incremented Hash*
-    new(uint32_t capacity = 0);
-
-    /**
-     * @param capacity The number of elements that the hash will be asked to
-     * hold initially.
-     */
-    inert Hash*
-    init(Hash *self, uint32_t capacity = 0);
-
-    /** Empty the hash of all key-value pairs.
-     */
-    void
-    Clear(Hash *self);
-
-    /** Store a key-value pair.  If <code>key</code> is not already present,
-     * Make_Key() will be called to manufacture the internally used key.
-     */
-    void
-    Store(Hash *self, Obj *key, decremented Obj *value);
-
-    void
-    Store_Utf8(Hash *self, const char *str, size_t len,
-               decremented Obj *value);
-
-    /** Fetch the value associated with <code>key</code>.
-     *
-     * @return the value, or NULL if <code>key</code> is not present.
-     */
-    nullable Obj*
-    Fetch(Hash *self, Obj *key);
-
-    nullable Obj*
-    Fetch_Utf8(Hash *self, const char *key, size_t key_len);
-
-    /** Attempt to delete a key-value pair from the hash.
-     *
-     * @return the value if <code>key</code> exists and thus deletion
-     * succeeds; otherwise NULL.
-     */
-    incremented nullable Obj*
-    Delete(Hash *self, Obj *key);
-
-    incremented nullable Obj*
-    Delete_Utf8(Hash *self, const char *key, size_t key_ley);
-
-    /** Prepare to iterate over all the key-value pairs in the hash.
-     *
-     * @return the number of pairs which will be iterated over.
-     */
-    uint32_t
-    Iterate(Hash *self);
-
-    /** Retrieve the next key-value pair from the hash, setting the supplied
-     * pointers to point at them.
-     *
-     * @return true while iterating, false when the iterator has been
-     * exhausted.
-     */
-    bool
-    Next(Hash *self, Obj **key, Obj **value);
-
-    /** Search for a key which Equals the key supplied, and return the key
-     * rather than its value.
-     */
-    nullable Obj*
-    Find_Key(Hash *self, Obj *key, int32_t hash_sum);
-
-    /** Return an VArray of pointers to the hash's keys.
-     */
-    incremented VArray*
-    Keys(Hash *self);
-
-    /** Return an VArray of pointers to the hash's values.
-     */
-    incremented VArray*
-    Values(Hash *self);
-
-    /** Create a key to be stored within the hash entry.  Implementations must
-     * supply an object which produces the same Hash_Sum() value and tests
-     * true for Equals().  By default, calls Clone().
-     */
-    public incremented Obj*
-    Make_Key(Hash *self, Obj *key, int32_t hash_sum);
-
-    uint32_t
-    Get_Capacity(Hash *self);
-
-    /** Accessor for Hash's "size" member.
-     *
-     * @return the number of key-value pairs.
-     */
-    public uint32_t
-    Get_Size(Hash *self);
-
-    public bool
-    Equals(Hash *self, Obj *other);
-
-    public void
-    Destroy(Hash *self);
-}
-
-class Clownfish::Hash::HashTombStone
-    inherits Clownfish::Obj {
-
-    uint32_t
-    Get_RefCount(HashTombStone* self);
-
-    incremented HashTombStone*
-    Inc_RefCount(HashTombStone* self);
-
-    uint32_t
-    Dec_RefCount(HashTombStone* self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/LockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/LockFreeRegistry.c b/clownfish/runtime/core/Clownfish/LockFreeRegistry.c
deleted file mode 100644
index 2ad0205..0000000
--- a/clownfish/runtime/core/Clownfish/LockFreeRegistry.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_LOCKFREEREGISTRY
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "Clownfish/LockFreeRegistry.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/VTable.h"
-#include "Clownfish/Util/Atomic.h"
-#include "Clownfish/Util/Memory.h"
-
-typedef struct cfish_LFRegEntry {
-    Obj *key;
-    Obj *value;
-    int32_t hash_sum;
-    struct cfish_LFRegEntry *volatile next;
-} cfish_LFRegEntry;
-#define LFRegEntry cfish_LFRegEntry
-
-LockFreeRegistry*
-LFReg_new(size_t capacity) {
-    LockFreeRegistry *self
-        = (LockFreeRegistry*)VTable_Make_Obj(LOCKFREEREGISTRY);
-    return LFReg_init(self, capacity);
-}
-
-LockFreeRegistry*
-LFReg_init(LockFreeRegistry *self, size_t capacity) {
-    self->capacity = capacity;
-    self->entries  = CALLOCATE(capacity, sizeof(void*));
-    return self;
-}
-
-bool
-LFReg_Register_IMP(LockFreeRegistry *self, Obj *key, Obj *value) {
-    LFRegEntry  *new_entry = NULL;
-    int32_t      hash_sum  = Obj_Hash_Sum(key);
-    size_t       bucket    = (uint32_t)hash_sum  % self->capacity;
-    LFRegEntry  *volatile *entries = (LFRegEntry*volatile*)self->entries;
-    LFRegEntry  *volatile *slot    = &(entries[bucket]);
-
-    // Proceed through the linked list.  Bail out if the key has already been
-    // registered.
-FIND_END_OF_LINKED_LIST:
-    while (*slot) {
-        LFRegEntry *entry = *slot;
-        if (entry->hash_sum == hash_sum) {
-            if (Obj_Equals(key, entry->key)) {
-                return false;
-            }
-        }
-        slot = &(entry->next);
-    }
-
-    // We've found an empty slot. Create the new entry.
-    if (!new_entry) {
-        new_entry = (LFRegEntry*)MALLOCATE(sizeof(LFRegEntry));
-        new_entry->hash_sum  = hash_sum;
-        new_entry->key       = INCREF(key);
-        new_entry->value     = INCREF(value);
-        new_entry->next      = NULL;
-    }
-
-    /* Attempt to append the new node onto the end of the linked list.
-     * However, if another thread filled the slot since we found it (perhaps
-     * while we were allocating that new node), the compare-and-swap will
-     * fail.  If that happens, we have to go back and find the new end of the
-     * linked list, then try again. */
-    if (!Atomic_cas_ptr((void*volatile*)slot, NULL, new_entry)) {
-        goto FIND_END_OF_LINKED_LIST;
-    }
-
-    return true;
-}
-
-Obj*
-LFReg_Fetch_IMP(LockFreeRegistry *self, Obj *key) {
-    int32_t      hash_sum  = Obj_Hash_Sum(key);
-    size_t       bucket    = (uint32_t)hash_sum  % self->capacity;
-    LFRegEntry **entries   = (LFRegEntry**)self->entries;
-    LFRegEntry  *entry     = entries[bucket];
-
-    while (entry) {
-        if (entry->hash_sum  == hash_sum) {
-            if (Obj_Equals(key, entry->key)) {
-                return entry->value;
-            }
-        }
-        entry = entry->next;
-    }
-
-    return NULL;
-}
-
-void
-LFReg_Destroy_IMP(LockFreeRegistry *self) {
-    LFRegEntry **entries = (LFRegEntry**)self->entries;
-
-    for (size_t i = 0; i < self->capacity; i++) {
-        LFRegEntry *entry = entries[i];
-        while (entry) {
-            LFRegEntry *next_entry = entry->next;
-            DECREF(entry->key);
-            DECREF(entry->value);
-            FREEMEM(entry);
-            entry = next_entry;
-        }
-    }
-    FREEMEM(self->entries);
-
-    SUPER_DESTROY(self, LOCKFREEREGISTRY);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/LockFreeRegistry.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/LockFreeRegistry.cfh b/clownfish/runtime/core/Clownfish/LockFreeRegistry.cfh
deleted file mode 100644
index 2a3d62a..0000000
--- a/clownfish/runtime/core/Clownfish/LockFreeRegistry.cfh
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Specialized lock free hash table for storing VTables.
- */
-class Clownfish::LockFreeRegistry cnick LFReg inherits Clownfish::Obj {
-
-    size_t  capacity;
-    void   *entries;
-
-    inert incremented LockFreeRegistry*
-    new(size_t capacity);
-
-    inert LockFreeRegistry*
-    init(LockFreeRegistry *self, size_t capacity);
-
-    public void
-    Destroy(LockFreeRegistry *self);
-
-    bool
-    Register(LockFreeRegistry *self, Obj *key, Obj *value);
-
-    nullable Obj*
-    Fetch(LockFreeRegistry *self, Obj *key);
-
-    void*
-    To_Host(LockFreeRegistry *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Method.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Method.c b/clownfish/runtime/core/Clownfish/Method.c
deleted file mode 100644
index e7a72e5..0000000
--- a/clownfish/runtime/core/Clownfish/Method.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_METHOD
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Method.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/VTable.h"
-
-Method*
-Method_new(String *name, cfish_method_t callback_func, size_t offset) {
-    Method *self = (Method*)VTable_Make_Obj(METHOD);
-    return Method_init(self, name, callback_func, offset);
-}
-
-Method*
-Method_init(Method *self, String *name, cfish_method_t callback_func,
-            size_t offset) {
-    self->name          = Str_Clone(name);
-    self->host_alias    = NULL;
-    self->callback_func = callback_func;
-    self->offset        = offset;
-    self->is_excluded   = false;
-    return self;
-}
-
-void
-Method_Destroy_IMP(Method *self) {
-    THROW(ERR, "Insane attempt to destroy Method '%o'", self->name);
-}
-
-Obj*
-Method_Inc_RefCount_IMP(Method *self) {
-    return (Obj*)self;
-}
-
-uint32_t
-Method_Dec_RefCount_IMP(Method *self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
-uint32_t
-Method_Get_RefCount_IMP(Method *self) {
-    UNUSED_VAR(self);
-    // See comments in VTable.c
-    return 1;
-}
-
-String*
-Method_Get_Name_IMP(Method *self) {
-    return self->name;
-}
-
-String*
-Method_Get_Host_Alias_IMP(Method *self) {
-    return self->host_alias;
-}
-
-bool
-Method_Is_Excluded_From_Host_IMP(Method *self) {
-    return self->is_excluded;
-}
-
-


Mime
View raw message