lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [5/9] Remove Charmonizer from repo
Date Mon, 10 Mar 2014 20:40:09 GMT
http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/LargeFiles.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/LargeFiles.c b/charmonizer/src/Charmonizer/Probe/LargeFiles.c
deleted file mode 100644
index c394245..0000000
--- a/charmonizer/src/Charmonizer/Probe/LargeFiles.c
+++ /dev/null
@@ -1,322 +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 "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Probe/LargeFiles.h"
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-/* Module vars. */
-static struct {
-    char off64_type[10];
-} chaz_LargeFiles = { "" };
-
-/* Sets of symbols which might provide large file support for stdio. */
-typedef struct chaz_LargeFiles_stdio64_combo {
-    const char *includes;
-    const char *fopen_command;
-    const char *ftell_command;
-    const char *fseek_command;
-} chaz_LargeFiles_stdio64_combo;
-
-/* Sets of symbols which might provide large file support for unbuffered i/o.
- */
-typedef struct chaz_LargeFiles_unbuff_combo {
-    const char *includes;
-    const char *lseek_command;
-    const char *pread64_command;
-} chaz_LargeFiles_unbuff_combo;
-
-/* Check for a 64-bit file pointer type.
- */
-static int
-chaz_LargeFiles_probe_off64(void);
-
-/* Check what name 64-bit ftell, fseek go by.
- */
-static void
-chaz_LargeFiles_probe_stdio64(void);
-static int
-chaz_LargeFiles_try_stdio64(chaz_LargeFiles_stdio64_combo *combo);
-
-/* Probe for 64-bit unbuffered i/o.
- */
-static void
-chaz_LargeFiles_probe_unbuff(void);
-
-/* Check for a 64-bit lseek.
- */
-static int
-chaz_LargeFiles_probe_lseek(chaz_LargeFiles_unbuff_combo *combo);
-
-/* Check for a 64-bit pread.
- */
-static int
-chaz_LargeFiles_probe_pread64(chaz_LargeFiles_unbuff_combo *combo);
-
-void
-chaz_LargeFiles_run(void) {
-    int found_off64_t = false;
-    const char *stat_includes = "#include <stdio.h>\n#include <sys/stat.h>";
-
-    chaz_ConfWriter_start_module("LargeFiles");
-
-    /* Find off64_t or equivalent. */
-    found_off64_t = chaz_LargeFiles_probe_off64();
-    if (found_off64_t) {
-        chaz_ConfWriter_add_def("HAS_64BIT_OFFSET_TYPE", NULL);
-        chaz_ConfWriter_add_def("off64_t",  chaz_LargeFiles.off64_type);
-    }
-
-    /* See if stdio variants with 64-bit support exist. */
-    chaz_LargeFiles_probe_stdio64();
-
-    /* Probe for 64-bit versions of lseek and pread (if we have an off64_t). */
-    if (found_off64_t) {
-        chaz_LargeFiles_probe_unbuff();
-    }
-
-    /* Make checks needed for testing. */
-    if (chaz_HeadCheck_check_header("sys/stat.h")) {
-        chaz_ConfWriter_append_conf("#define CHAZ_HAS_SYS_STAT_H\n");
-    }
-    if (chaz_HeadCheck_check_header("io.h")) {
-        chaz_ConfWriter_append_conf("#define CHAZ_HAS_IO_H\n");
-    }
-    if (chaz_HeadCheck_check_header("fcntl.h")) {
-        chaz_ConfWriter_append_conf("#define CHAZ_HAS_FCNTL_H\n");
-    }
-    if (chaz_HeadCheck_contains_member("struct stat", "st_size", stat_includes)) {
-        chaz_ConfWriter_append_conf("#define CHAZ_HAS_STAT_ST_SIZE\n");
-    }
-    if (chaz_HeadCheck_contains_member("struct stat", "st_blocks", stat_includes)) {
-        chaz_ConfWriter_append_conf("#define CHAZ_HAS_STAT_ST_BLOCKS\n");
-    }
-
-    chaz_ConfWriter_end_module();
-}
-
-static int
-chaz_LargeFiles_probe_off64(void) {
-    static const char off64_code[] =
-        CHAZ_QUOTE(  %s                                        )
-        CHAZ_QUOTE(  #include <stdio.h>                        )
-        CHAZ_QUOTE(  int main()                                )
-        CHAZ_QUOTE(  {                                         )
-        CHAZ_QUOTE(      printf("%%d", (int)sizeof(%s));       )
-        CHAZ_QUOTE(      return 0;                             )
-        CHAZ_QUOTE(  }                                         );
-    char code_buf[sizeof(off64_code) + 100];
-    int i;
-    int success = false;
-    static const char* off64_options[] = {
-        "off64_t",
-        "off_t",
-        "__int64",
-        "long"
-    };
-    int num_off64_options = sizeof(off64_options) / sizeof(off64_options[0]);
-
-    for (i = 0; i < num_off64_options; i++) {
-        const char *candidate = off64_options[i];
-        char *output;
-        size_t output_len;
-        int has_sys_types_h = chaz_HeadCheck_check_header("sys/types.h");
-        const char *sys_types_include = has_sys_types_h
-                                        ? "#include <sys/types.h>"
-                                        : "";
-
-        /* Execute the probe. */
-        sprintf(code_buf, off64_code, sys_types_include, candidate);
-        output = chaz_CC_capture_output(code_buf, &output_len);
-        if (output != NULL) {
-            long sizeof_candidate = strtol(output, NULL, 10);
-            free(output);
-            if (sizeof_candidate == 8) {
-                strcpy(chaz_LargeFiles.off64_type, candidate);
-                success = true;
-                break;
-            }
-        }
-    }
-    return success;
-}
-
-static int
-chaz_LargeFiles_try_stdio64(chaz_LargeFiles_stdio64_combo *combo) {
-    static const char stdio64_code[] =
-        CHAZ_QUOTE(  %s                                         )
-        CHAZ_QUOTE(  #include <stdio.h>                         )
-        CHAZ_QUOTE(  int main() {                               )
-        CHAZ_QUOTE(      %s pos;                                )
-        CHAZ_QUOTE(      FILE *f;                               )
-        CHAZ_QUOTE(      f = %s("_charm_stdio64", "w");         )
-        CHAZ_QUOTE(      if (f == NULL) return -1;              )
-        CHAZ_QUOTE(      printf("%%d", (int)sizeof(%s));        )
-        CHAZ_QUOTE(      pos = %s(stdout);                      )
-        CHAZ_QUOTE(      %s(stdout, 0, SEEK_SET);               )
-        CHAZ_QUOTE(      return 0;                              )
-        CHAZ_QUOTE(  }                                          );
-    char *output = NULL;
-    size_t output_len;
-    char code_buf[sizeof(stdio64_code) + 200];
-    int success = false;
-
-    /* Prepare the source code. */
-    sprintf(code_buf, stdio64_code, combo->includes,
-            chaz_LargeFiles.off64_type, combo->fopen_command,
-            chaz_LargeFiles.off64_type, combo->ftell_command,
-            combo->fseek_command);
-
-    /* Verify compilation and that the offset type has 8 bytes. */
-    output = chaz_CC_capture_output(code_buf, &output_len);
-    if (output != NULL) {
-        long size = strtol(output, NULL, 10);
-        if (size == 8) {
-            success = true;
-        }
-        free(output);
-    }
-
-    if (!chaz_Util_remove_and_verify("_charm_stdio64")) {
-        chaz_Util_die("Failed to remove '_charm_stdio64'");
-    }
-
-    return success;
-}
-
-static void
-chaz_LargeFiles_probe_stdio64(void) {
-    int i;
-    static chaz_LargeFiles_stdio64_combo stdio64_combos[] = {
-        { "#include <sys/types.h>\n", "fopen64",   "ftello64",  "fseeko64"  },
-        { "#include <sys/types.h>\n", "fopen",     "ftello64",  "fseeko64"  },
-        { "#include <sys/types.h>\n", "fopen",     "ftello",    "fseeko"    },
-        { "",                         "fopen",     "ftell",     "fseek"     },
-        { "",                         "fopen",     "_ftelli64", "_fseeki64" },
-        { "",                         "fopen",     "ftell",     "fseek"     },
-        { NULL, NULL, NULL, NULL }
-    };
-
-    for (i = 0; stdio64_combos[i].includes != NULL; i++) {
-        chaz_LargeFiles_stdio64_combo combo = stdio64_combos[i];
-        if (chaz_LargeFiles_try_stdio64(&combo)) {
-            chaz_ConfWriter_add_def("HAS_64BIT_STDIO", NULL);
-            chaz_ConfWriter_add_def("fopen64",  combo.fopen_command);
-            chaz_ConfWriter_add_def("ftello64", combo.ftell_command);
-            chaz_ConfWriter_add_def("fseeko64", combo.fseek_command);
-            break;
-        }
-    }
-}
-
-static int
-chaz_LargeFiles_probe_lseek(chaz_LargeFiles_unbuff_combo *combo) {
-    static const char lseek_code[] =
-        CHAZ_QUOTE( %s                                                       )
-        CHAZ_QUOTE( #include <stdio.h>                                       )
-        CHAZ_QUOTE( int main() {                                             )
-        CHAZ_QUOTE(     int fd;                                              )
-        CHAZ_QUOTE(     fd = open("_charm_lseek", O_WRONLY | O_CREAT, 0666); )
-        CHAZ_QUOTE(     if (fd == -1) { return -1; }                         )
-        CHAZ_QUOTE(     %s(fd, 0, SEEK_SET);                                 )
-        CHAZ_QUOTE(     printf("%%d", 1);                                    )
-        CHAZ_QUOTE(     if (close(fd)) { return -1; }                        )
-        CHAZ_QUOTE(     return 0;                                            )
-        CHAZ_QUOTE( }                                                        );
-    char code_buf[sizeof(lseek_code) + 100];
-    char *output = NULL;
-    size_t output_len;
-    int success = false;
-
-    /* Verify compilation. */
-    sprintf(code_buf, lseek_code, combo->includes, combo->lseek_command);
-    output = chaz_CC_capture_output(code_buf, &output_len);
-    if (output != NULL) {
-        success = true;
-        free(output);
-    }
-
-    if (!chaz_Util_remove_and_verify("_charm_lseek")) {
-        chaz_Util_die("Failed to remove '_charm_lseek'");
-    }
-
-    return success;
-}
-
-static int
-chaz_LargeFiles_probe_pread64(chaz_LargeFiles_unbuff_combo *combo) {
-    /* Code for checking 64-bit pread.  The pread call will fail, but that's
-     * fine as long as it compiles. */
-    static const char pread64_code[] =
-        CHAZ_QUOTE(  %s                                     )
-        CHAZ_QUOTE(  #include <stdio.h>                     )
-        CHAZ_QUOTE(  int main() {                           )
-        CHAZ_QUOTE(      int fd = 20;                       )
-        CHAZ_QUOTE(      char buf[1];                       )
-        CHAZ_QUOTE(      printf("1");                       )
-        CHAZ_QUOTE(      %s(fd, buf, 1, 1);                 )
-        CHAZ_QUOTE(      return 0;                          )
-        CHAZ_QUOTE(  }                                      );
-    char code_buf[sizeof(pread64_code) + 100];
-    char *output = NULL;
-    size_t output_len;
-    int success = false;
-
-    /* Verify compilation. */
-    sprintf(code_buf, pread64_code, combo->includes, combo->pread64_command);
-    output = chaz_CC_capture_output(code_buf, &output_len);
-    if (output != NULL) {
-        success = true;
-        free(output);
-    }
-
-    return success;
-}
-
-static void
-chaz_LargeFiles_probe_unbuff(void) {
-    static chaz_LargeFiles_unbuff_combo unbuff_combos[] = {
-        { "#include <unistd.h>\n#include <fcntl.h>\n", "lseek64",   "pread64" },
-        { "#include <unistd.h>\n#include <fcntl.h>\n", "lseek",     "pread"      },
-        { "#include <io.h>\n#include <fcntl.h>\n",     "_lseeki64", "NO_PREAD64" },
-        { NULL, NULL, NULL }
-    };
-    int i;
-
-    for (i = 0; unbuff_combos[i].lseek_command != NULL; i++) {
-        chaz_LargeFiles_unbuff_combo combo = unbuff_combos[i];
-        if (chaz_LargeFiles_probe_lseek(&combo)) {
-            chaz_ConfWriter_add_def("HAS_64BIT_LSEEK", NULL);
-            chaz_ConfWriter_add_def("lseek64", combo.lseek_command);
-            break;
-        }
-    }
-    for (i = 0; unbuff_combos[i].pread64_command != NULL; i++) {
-        chaz_LargeFiles_unbuff_combo combo = unbuff_combos[i];
-        if (chaz_LargeFiles_probe_pread64(&combo)) {
-            chaz_ConfWriter_add_def("HAS_64BIT_PREAD", NULL);
-            chaz_ConfWriter_add_def("pread64", combo.pread64_command);
-            break;
-        }
-    }
-};
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/LargeFiles.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/LargeFiles.h b/charmonizer/src/Charmonizer/Probe/LargeFiles.h
deleted file mode 100644
index 5142dc2..0000000
--- a/charmonizer/src/Charmonizer/Probe/LargeFiles.h
+++ /dev/null
@@ -1,64 +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.
- */
-
-/* Charmonizer/Probe/LargeFiles.h
- */
-
-#ifndef H_CHAZ_LARGE_FILES
-#define H_CHAZ_LARGE_FILES
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-
-/* The LargeFiles module attempts to detect these symbols or alias them to
- * synonyms:
- *
- * off64_t
- * fopen64
- * ftello64
- * fseeko64
- * lseek64
- * pread64
- *
- * If off64_t or its equivalent is available, this will be defined:
- *
- * HAS_64BIT_OFFSET_TYPE
- *
- * If 64-bit variants of fopen, ftell, and fseek are available, this will be
- * defined:
- *
- * HAS_64BIT_STDIO
- *
- * If 64-bit variants of pread and lseek are available, then corresponding
- * symbols will be defined:
- *
- * HAS_64BIT_PREAD
- * HAS_64BIT_LSEEK
- *
- * Use of the off64_t symbol may require sys/types.h.
- */
-void chaz_LargeFiles_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_LARGE_FILES */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Memory.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Memory.c b/charmonizer/src/Charmonizer/Probe/Memory.c
deleted file mode 100644
index 947f212..0000000
--- a/charmonizer/src/Charmonizer/Probe/Memory.c
+++ /dev/null
@@ -1,123 +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 "Charmonizer/Probe/Memory.h"
-#include "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/* Probe for alloca() or equivalent. */
-static void
-chaz_Memory_probe_alloca(void);
-
-void
-chaz_Memory_run(void) {
-    chaz_ConfWriter_start_module("Memory");
-
-    chaz_Memory_probe_alloca();
-
-    chaz_ConfWriter_end_module();
-}
-
-static void
-chaz_Memory_probe_alloca(void) {
-    static const char alloca_code[] =
-        "#include <%s>\n"
-        CHAZ_QUOTE(  int main() {                   )
-        CHAZ_QUOTE(      void *foo = %s(1);         )
-        CHAZ_QUOTE(      return 0;                  )
-        CHAZ_QUOTE(  }                              );
-    int has_sys_mman_h = false;
-    int has_alloca_h   = false;
-    int has_malloc_h   = false;
-    int need_stdlib_h  = false;
-    int has_alloca     = false;
-    int has_builtin_alloca    = false;
-    int has_underscore_alloca = false;
-    char code_buf[sizeof(alloca_code) + 100];
-
-    {
-        /* OpenBSD needs sys/types.h for sys/mman.h to work and mmap() to be
-         * available. Everybody else that has sys/mman.h should have
-         * sys/types.h as well. */
-        const char *mman_headers[] = {
-            "sys/types.h",
-            "sys/mman.h",
-            NULL
-        };
-        if (chaz_HeadCheck_check_many_headers((const char**)mman_headers)) {
-            has_sys_mman_h = true;
-            chaz_ConfWriter_add_def("HAS_SYS_MMAN_H", NULL);
-        }
-    }
-
-    /* Unixen. */
-    sprintf(code_buf, alloca_code, "alloca.h", "alloca");
-    if (chaz_CC_test_compile(code_buf)) {
-        has_alloca_h = true;
-        has_alloca   = true;
-        chaz_ConfWriter_add_def("HAS_ALLOCA_H", NULL);
-        chaz_ConfWriter_add_def("alloca", "alloca");
-    }
-    if (!has_alloca) {
-        /*
-         * FIXME: Under MinGW, alloca is defined in malloc.h. This probe
-         * produces compiler warnings but works regardless. These warnings
-         * are subsequently repeated during the build.
-         */
-        sprintf(code_buf, alloca_code, "stdlib.h", "alloca");
-        if (chaz_CC_test_compile(code_buf)) {
-            has_alloca    = true;
-            need_stdlib_h = true;
-            chaz_ConfWriter_add_def("ALLOCA_IN_STDLIB_H", NULL);
-            chaz_ConfWriter_add_def("alloca", "alloca");
-        }
-    }
-    if (!has_alloca) {
-        sprintf(code_buf, alloca_code, "stdio.h", /* stdio.h is filler */
-                "__builtin_alloca");
-        if (chaz_CC_test_compile(code_buf)) {
-            has_builtin_alloca = true;
-            chaz_ConfWriter_add_def("alloca", "__builtin_alloca");
-        }
-    }
-
-    /* Windows. */
-    if (!(has_alloca || has_builtin_alloca)) {
-        sprintf(code_buf, alloca_code, "malloc.h", "alloca");
-        if (chaz_CC_test_compile(code_buf)) {
-            has_malloc_h = true;
-            has_alloca   = true;
-            chaz_ConfWriter_add_def("HAS_MALLOC_H", NULL);
-            chaz_ConfWriter_add_def("alloca", "alloca");
-        }
-    }
-    if (!(has_alloca || has_builtin_alloca)) {
-        sprintf(code_buf, alloca_code, "malloc.h", "_alloca");
-        if (chaz_CC_test_compile(code_buf)) {
-            has_malloc_h = true;
-            has_underscore_alloca = true;
-            chaz_ConfWriter_add_def("HAS_MALLOC_H", NULL);
-            chaz_ConfWriter_add_def("chy_alloca", "_alloca");
-        }
-    }
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Memory.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Memory.h b/charmonizer/src/Charmonizer/Probe/Memory.h
deleted file mode 100644
index 69d2c2c..0000000
--- a/charmonizer/src/Charmonizer/Probe/Memory.h
+++ /dev/null
@@ -1,52 +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.
- */
-
-/* Charmonizer/Probe/Memory.h
- */
-
-#ifndef H_CHAZ_MEMORY
-#define H_CHAZ_MEMORY
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The Memory module attempts to detect these symbols or alias them to
- * synonyms:
- *
- * alloca
- *
- * These following symbols will be defined if the associated headers are
- * available:
- *
- * HAS_SYS_MMAN_H          <sys/mman.h>
- * HAS_ALLOCA_H            <alloca.h>
- * HAS_MALLOC_H            <malloc.h>
- *
- * Defined if alloca() is available via stdlib.h:
- *
- * ALLOCA_IN_STDLIB_H
- */
-void chaz_Memory_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_MEMORY */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/RegularExpressions.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/RegularExpressions.c b/charmonizer/src/Charmonizer/Probe/RegularExpressions.c
deleted file mode 100644
index 60a9034..0000000
--- a/charmonizer/src/Charmonizer/Probe/RegularExpressions.c
+++ /dev/null
@@ -1,57 +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 "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Probe/RegularExpressions.h"
-
-void
-chaz_RegularExpressions_run(void) {
-    int has_regex_h     = chaz_HeadCheck_check_header("regex.h");
-    int has_pcre_h      = chaz_HeadCheck_check_header("pcre.h");
-    int has_pcreposix_h = chaz_HeadCheck_check_header("pcreposix.h");
-
-    chaz_ConfWriter_start_module("RegularExpressions");
-
-    /* PCRE headers. */
-    if (has_pcre_h) {
-        chaz_ConfWriter_add_def("HAS_PCRE_H", NULL);
-    }
-    if (has_pcreposix_h) {
-        chaz_ConfWriter_add_def("HAS_PCREPOSIX_H", NULL);
-    }
-
-    /* Check for OS X enhanced regexes. */
-    if (has_regex_h) {
-        const char *reg_enhanced_code =
-            CHAZ_QUOTE(  #include <regex.h>                             )
-            CHAZ_QUOTE(  int main(int argc, char **argv) {              )
-            CHAZ_QUOTE(      regex_t re;                                )
-            CHAZ_QUOTE(      if (regcomp(&re, "^", REG_ENHANCED)) {     )
-            CHAZ_QUOTE(          return 1;                              )
-            CHAZ_QUOTE(      }                                          )
-            CHAZ_QUOTE(      return 0;                                  )
-            CHAZ_QUOTE(  }                                              );
-
-        if (chaz_CC_test_compile(reg_enhanced_code)) {
-            chaz_ConfWriter_add_def("HAS_REG_ENHANCED", NULL);
-        }
-    }
-
-    chaz_ConfWriter_end_module();
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/RegularExpressions.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/RegularExpressions.h b/charmonizer/src/Charmonizer/Probe/RegularExpressions.h
deleted file mode 100644
index 7bf6ec1..0000000
--- a/charmonizer/src/Charmonizer/Probe/RegularExpressions.h
+++ /dev/null
@@ -1,38 +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.
- */
-
-/* Charmonizer/Probe/RegularExpressions.h -- regular expressions.
- */
-
-#ifndef H_CHAZ_REGULAREXPRESSIONS
-#define H_CHAZ_REGULAREXPRESSIONS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Run the RegularExpressions module.
- */
-void chaz_RegularExpressions_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_REGULAREXPRESSIONS */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Strings.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Strings.c b/charmonizer/src/Charmonizer/Probe/Strings.c
deleted file mode 100644
index 9a1a288..0000000
--- a/charmonizer/src/Charmonizer/Probe/Strings.c
+++ /dev/null
@@ -1,93 +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 "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Probe/Strings.h"
-
-/* Check for C99-compatible snprintf and possible replacements.
- */
-static void
-chaz_Strings_probe_c99_snprintf(void);
-
-void
-chaz_Strings_run(void) {
-    chaz_ConfWriter_start_module("Strings");
-
-    /* Check for C99 snprintf. */
-    chaz_Strings_probe_c99_snprintf();
-
-    chaz_ConfWriter_end_module();
-}
-
-static void
-chaz_Strings_probe_c99_snprintf(void) {
-    static const char snprintf_code[] =
-        CHAZ_QUOTE(  #include <stdio.h>                             )
-        CHAZ_QUOTE(  int main() {                                   )
-        CHAZ_QUOTE(      char buf[4];                               )
-        CHAZ_QUOTE(      int  result;                               )
-        CHAZ_QUOTE(      result = snprintf(buf, 4, "%s", "12345");  )
-        CHAZ_QUOTE(      printf("%d", result);                      )
-        CHAZ_QUOTE(      return 0;                                  )
-        CHAZ_QUOTE(  }                                              );
-    static const char detect__scprintf_code[] =
-        CHAZ_QUOTE(  #include <stdio.h>                             )
-        CHAZ_QUOTE(  int main() {                                   )
-        CHAZ_QUOTE(      int  result;                               )
-        CHAZ_QUOTE(      result = _scprintf("%s", "12345");         )
-        CHAZ_QUOTE(      printf("%d", result);                      )
-        CHAZ_QUOTE(      return 0;                                  )
-        CHAZ_QUOTE(  }                                              );
-    static const char detect__snprintf_code[] =
-        CHAZ_QUOTE(  #include <stdio.h>                             )
-        CHAZ_QUOTE(  int main() {                                   )
-        CHAZ_QUOTE(      char buf[6];                               )
-        CHAZ_QUOTE(      int  result;                               )
-        CHAZ_QUOTE(      result = _snprintf(buf, 6, "%s", "12345"); )
-        CHAZ_QUOTE(      printf("%d", result);                      )
-        CHAZ_QUOTE(      return 0;                                  )
-        CHAZ_QUOTE(  }                                              );
-    char   *output = NULL;
-    size_t  output_len;
-
-    /* If the buffer passed to snprintf is too small, verify that snprintf
-     * returns the length of the untruncated string which would have been
-     * written to a large enough buffer.
-     */
-    output = chaz_CC_capture_output(snprintf_code, &output_len);
-    if (output != NULL) {
-        long result = strtol(output, NULL, 10);
-        if (result == 5) {
-            chaz_ConfWriter_add_def("HAS_C99_SNPRINTF", NULL);
-        }
-        free(output);
-    }
-
-    /* Test for _scprintf and _snprintf found in the MSVCRT.
-     */
-    output = chaz_CC_capture_output(detect__scprintf_code, &output_len);
-    if (output != NULL) {
-        chaz_ConfWriter_add_def("HAS__SCPRINTF", NULL);
-        free(output);
-    }
-    output = chaz_CC_capture_output(detect__snprintf_code, &output_len);
-    if (output != NULL) {
-        chaz_ConfWriter_add_def("HAS__SNPRINTF", NULL);
-        free(output);
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Strings.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Strings.h b/charmonizer/src/Charmonizer/Probe/Strings.h
deleted file mode 100644
index 031459d..0000000
--- a/charmonizer/src/Charmonizer/Probe/Strings.h
+++ /dev/null
@@ -1,39 +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.
- */
-
-/* Charmonizer/Probe/Strings.h
- */
-
-#ifndef H_CHAZ_STRINGS
-#define H_CHAZ_STRINGS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The Strings module attempts to detect whether snprintf works as specified
- * by the C99 standard. It also looks for system-specific functions which can
- * be used to emulate snprintf.
- */
-void chaz_Strings_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_STRINGS */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/SymbolVisibility.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/SymbolVisibility.c b/charmonizer/src/Charmonizer/Probe/SymbolVisibility.c
deleted file mode 100644
index 6639a4f..0000000
--- a/charmonizer/src/Charmonizer/Probe/SymbolVisibility.c
+++ /dev/null
@@ -1,77 +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 "Charmonizer/Probe/SymbolVisibility.h"
-#include "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-static const char chaz_SymbolVisibility_symbol_exporting_code[] =
-    CHAZ_QUOTE(  %s int exported_function() {   )
-    CHAZ_QUOTE(      return 42;                 )
-    CHAZ_QUOTE(  }                              )
-    CHAZ_QUOTE(  int main() {                   )
-    CHAZ_QUOTE(      return 0;                  )
-    CHAZ_QUOTE(  }                              );
-
-void
-chaz_SymbolVisibility_run(void) {
-    chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();
-    int can_control_visibility = false;
-    char code_buf[sizeof(chaz_SymbolVisibility_symbol_exporting_code) + 100];
-
-    chaz_ConfWriter_start_module("SymbolVisibility");
-    chaz_CFlags_set_warnings_as_errors(temp_cflags);
-
-    /* Windows. */
-    if (!can_control_visibility) {
-        char export_win[] = "__declspec(dllexport)";
-        sprintf(code_buf, chaz_SymbolVisibility_symbol_exporting_code,
-                export_win);
-        if (chaz_CC_test_compile(code_buf)) {
-            can_control_visibility = true;
-            chaz_ConfWriter_add_def("EXPORT", export_win);
-            chaz_ConfWriter_add_def("IMPORT", "__declspec(dllimport)");
-        }
-    }
-
-    /* GCC. */
-    if (!can_control_visibility) {
-        char export_gcc[] = "__attribute__ ((visibility (\"default\")))";
-        sprintf(code_buf, chaz_SymbolVisibility_symbol_exporting_code,
-                export_gcc);
-        if (chaz_CC_test_compile(code_buf)) {
-            can_control_visibility = true;
-            chaz_ConfWriter_add_def("EXPORT", export_gcc);
-            chaz_ConfWriter_add_def("IMPORT", NULL);
-        }
-    }
-
-    chaz_CFlags_clear(temp_cflags);
-
-    /* Default. */
-    if (!can_control_visibility) {
-        chaz_ConfWriter_add_def("EXPORT", NULL);
-        chaz_ConfWriter_add_def("IMPORT", NULL);
-    }
-
-    chaz_ConfWriter_end_module();
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/SymbolVisibility.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/SymbolVisibility.h b/charmonizer/src/Charmonizer/Probe/SymbolVisibility.h
deleted file mode 100644
index 10a4a6f..0000000
--- a/charmonizer/src/Charmonizer/Probe/SymbolVisibility.h
+++ /dev/null
@@ -1,36 +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.
- */
-
-/* Charmonizer/Probe/SymbolVisibility.h
- */
-
-#ifndef H_CHAZ_SYMBOLVISIBILITY
-#define H_CHAZ_SYMBOLVISIBILITY
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void chaz_SymbolVisibility_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_SYMBOLVISIBILITY */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/UnusedVars.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/UnusedVars.c b/charmonizer/src/Charmonizer/Probe/UnusedVars.c
deleted file mode 100644
index f9e7e1b..0000000
--- a/charmonizer/src/Charmonizer/Probe/UnusedVars.c
+++ /dev/null
@@ -1,36 +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 "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Probe/UnusedVars.h"
-#include <string.h>
-#include <stdio.h>
-
-
-void
-chaz_UnusedVars_run(void) {
-    chaz_ConfWriter_start_module("UnusedVars");
-
-    /* Write the macros (no test, these are the same everywhere). */
-    chaz_ConfWriter_add_def("UNUSED_VAR(x)", "((void)x)");
-    chaz_ConfWriter_add_def("UNREACHABLE_RETURN(type)", "return (type)0");
-
-    chaz_ConfWriter_end_module();
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/UnusedVars.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/UnusedVars.h b/charmonizer/src/Charmonizer/Probe/UnusedVars.h
deleted file mode 100644
index 23b761d..0000000
--- a/charmonizer/src/Charmonizer/Probe/UnusedVars.h
+++ /dev/null
@@ -1,46 +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.
- */
-
-/* Charmonizer/Probe/UnusedVars.h
- */
-
-#ifndef H_CHAZ_UNUSED_VARS
-#define H_CHAZ_UNUSED_VARS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-
-/* Run the UnusedVars module.
- *
- * These symbols are exported:
- *
- * UNUSED_VAR(var)
- * UNREACHABLE_RETURN(type)
- *
- */
-void chaz_UnusedVars_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_UNUSED_VARS */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/VariadicMacros.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/VariadicMacros.c b/charmonizer/src/Charmonizer/Probe/VariadicMacros.c
deleted file mode 100644
index ab70dfd..0000000
--- a/charmonizer/src/Charmonizer/Probe/VariadicMacros.c
+++ /dev/null
@@ -1,80 +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 "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Probe/VariadicMacros.h"
-#include <string.h>
-#include <stdio.h>
-
-
-/* Code for verifying ISO-style variadic macros. */
-static const char chaz_VariadicMacros_iso_code[] =
-    CHAZ_QUOTE(  #include <stdio.h>                                    )
-    CHAZ_QUOTE(  #define ISO_TEST(fmt, ...) \\                         )
-    "                printf(fmt, __VA_ARGS__)                        \n"
-    CHAZ_QUOTE(  int main() {                                          )
-    CHAZ_QUOTE(      ISO_TEST("%d %d", 1, 1);                          )
-    CHAZ_QUOTE(      return 0;                                         )
-    CHAZ_QUOTE(  }                                                     );
-
-/* Code for verifying GNU-style variadic macros. */
-static const char chaz_VariadicMacros_gnuc_code[] =
-    CHAZ_QUOTE(  #include <stdio.h>                                    )
-    CHAZ_QUOTE(  #define GNU_TEST(fmt, args...) printf(fmt, ##args)    )
-    CHAZ_QUOTE(  int main() {                                          )
-    CHAZ_QUOTE(      GNU_TEST("%d %d", 1, 1);                          )
-    CHAZ_QUOTE(      return 0;                                         )
-    CHAZ_QUOTE(  }                                                     );
-
-void
-chaz_VariadicMacros_run(void) {
-    char *output;
-    size_t output_len;
-    int has_varmacros      = false;
-    int has_iso_varmacros  = false;
-    int has_gnuc_varmacros = false;
-
-    chaz_ConfWriter_start_module("VariadicMacros");
-
-    /* Test for ISO-style variadic macros. */
-    output = chaz_CC_capture_output(chaz_VariadicMacros_iso_code, &output_len);
-    if (output != NULL) {
-        has_varmacros = true;
-        has_iso_varmacros = true;
-        chaz_ConfWriter_add_def("HAS_VARIADIC_MACROS", NULL);
-        chaz_ConfWriter_add_def("HAS_ISO_VARIADIC_MACROS", NULL);
-        free(output);
-    }
-
-    /* Test for GNU-style variadic macros. */
-    output = chaz_CC_capture_output(chaz_VariadicMacros_gnuc_code, &output_len);
-    if (output != NULL) {
-        has_gnuc_varmacros = true;
-        if (has_varmacros == false) {
-            has_varmacros = true;
-            chaz_ConfWriter_add_def("HAS_VARIADIC_MACROS", NULL);
-        }
-        chaz_ConfWriter_add_def("HAS_GNUC_VARIADIC_MACROS", NULL);
-        free(output);
-    }
-
-    chaz_ConfWriter_end_module();
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/VariadicMacros.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/VariadicMacros.h b/charmonizer/src/Charmonizer/Probe/VariadicMacros.h
deleted file mode 100644
index ef624b8..0000000
--- a/charmonizer/src/Charmonizer/Probe/VariadicMacros.h
+++ /dev/null
@@ -1,52 +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.
- */
-
-/* Charmonizer/Probe/VariadicMacros.h
- */
-
-#ifndef H_CHAZ_VARIADIC_MACROS
-#define H_CHAZ_VARIADIC_MACROS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-
-/* Run the VariadicMacros module.
- *
- * If your compiler supports ISO-style variadic macros, this will be defined:
- *
- * HAS_ISO_VARIADIC_MACROS
- *
- * If your compiler supports GNU-style variadic macros, this will be defined:
- *
- * HAS_GNUC_VARIADIC_MACROS
- *
- * If you have at least one of the above, this will be defined:
- *
- * HAS_VARIADIC_MACROS
- */
-void chaz_VariadicMacros_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_VARIADIC_MACROS */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test.c b/charmonizer/src/Charmonizer/Test.c
deleted file mode 100644
index 868375b..0000000
--- a/charmonizer/src/Charmonizer/Test.c
+++ /dev/null
@@ -1,205 +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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "Charmonizer/Test.h"
-
-struct chaz_TestBatch {
-    unsigned test_num;
-    unsigned num_tests;
-    unsigned num_passed;
-    unsigned num_failed;
-    unsigned num_skipped;
-};
-
-chaz_TestBatch*
-chaz_Test_current = NULL;
-
-void
-chaz_Test_init(void) {
-    /* Unbuffer stdout. */
-    int check_val = setvbuf(stdout, NULL, _IONBF, 0);
-    if (check_val != 0) {
-        fprintf(stderr, "Failed when trying to unbuffer stdout\n");
-    }
-}
-
-chaz_TestBatch*
-chaz_Test_new_batch(unsigned num_tests) {
-    chaz_TestBatch *batch = (chaz_TestBatch*)malloc(sizeof(chaz_TestBatch));
-    if (!batch) {
-        fprintf(stderr, "Out of memory\n");
-        return NULL;
-    }
-
-    /* Assign. */
-    batch->num_tests       = num_tests;
-
-    /* Initialize. */
-    batch->test_num        = 0;
-    batch->num_passed      = 0;
-    batch->num_failed      = 0;
-    batch->num_skipped     = 0;
-
-    return batch;
-}
-
-chaz_TestBatch*
-chaz_Test_start(unsigned num_tests) {
-    if (chaz_Test_current) {
-        fprintf(stderr, "Already started testing\n");
-        return NULL;
-    }
-    chaz_Test_init();
-    chaz_Test_current = chaz_Test_new_batch(num_tests);
-    CHAZ_TEST_PLAN(chaz_Test_current);
-    return chaz_Test_current;
-}
-
-int
-chaz_Test_finish(void) {
-    int remainder = chaz_Test_current->num_tests
-                    - chaz_Test_current->num_passed
-                    - chaz_Test_current->num_skipped;
-    free(chaz_Test_current);
-    chaz_Test_current = NULL;
-    return !remainder;
-}
-
-void
-chaz_Test_plan(chaz_TestBatch *batch) {
-    printf("1..%u\n", batch->num_tests);
-}
-
-void
-chaz_Test_ok(chaz_TestBatch *batch, int value, const char *message) {
-    /* Increment test number. */
-    batch->test_num++;
-
-    /* Test condition and pass or fail. */
-    if (value) {
-        printf("ok %u - %s\n", batch->test_num, message);
-        batch->num_passed++;
-    }
-    else {
-        printf("not ok %u - %s\n", batch->test_num, message);
-        batch->num_failed++;
-    }
-}
-
-void
-chaz_Test_str_eq(chaz_TestBatch *batch, const char *got,
-                 const char *expected, const char *message) {
-    /* Increment test number. */
-    batch->test_num++;
-
-    /* Test condition and pass or fail. */
-    if (strcmp(expected, got) == 0) {
-        printf("ok %u - %s\n", batch->test_num, message);
-        batch->num_passed++;
-    }
-    else {
-        printf("not ok %u - Expected '%s', got '%s'\n    # %s\n",
-               batch->test_num, expected, got, message);
-        batch->num_failed++;
-    }
-}
-
-
-void
-chaz_Test_pass(chaz_TestBatch *batch, const char *message) {
-    /* Increment test number. */
-    batch->test_num++;
-
-    /* Indicate pass, update pass counter. */
-    printf("ok %u - %s\n", batch->test_num, message);
-    batch->num_passed++;
-}
-
-void
-chaz_Test_fail(chaz_TestBatch *batch, const char *message) {
-    /* Increment test number. */
-    batch->test_num++;
-
-    /* Indicate failure, update pass counter. */
-    printf("not ok %u - %s\n", batch->test_num, message);
-    batch->num_failed++;
-}
-
-void
-chaz_Test_long_eq(chaz_TestBatch *batch, long got, long expected,
-                  const char *message) {
-    /* Increment test number. */
-    batch->test_num++;
-
-    if (expected == got) {
-        printf("ok %u - %s\n", batch->test_num, message);
-        batch->num_passed++;
-    }
-    else {
-        printf("not ok %u - Expected '%ld', got '%ld'\n    # %s",
-               batch->test_num, expected, got, message);
-        batch->num_failed++;
-    }
-}
-
-void
-chaz_Test_double_eq(chaz_TestBatch *batch, double got, double expected,
-                    double slop, const char *message) {
-    double diff = expected - got;
-    if (diff < 0) {
-        diff = 0 - diff;
-    }
-
-    /* Increment test number. */
-    batch->test_num++;
-
-    /* Evaluate condition and pass or fail. */
-    if (diff < slop) {
-        printf("ok %u - %s\n", batch->test_num, message);
-        batch->num_passed++;
-    }
-    else {
-        printf("not ok %u - Expected '%f', got '%f'\n    # %s\n",
-               batch->test_num, expected, got, message);
-        batch->num_failed++;
-    }
-}
-
-void
-chaz_Test_skip(chaz_TestBatch *batch, const char *message) {
-    /* Increment test number. */
-    batch->test_num++;
-
-    /* Indicate that test is being skipped, update pass counter. */
-    printf("ok %u # SKIP %s\n", batch->test_num, message);
-    batch->num_skipped++;
-}
-
-void
-chaz_Test_skip_remaining(chaz_TestBatch *batch, const char *message) {
-    unsigned remaining = batch->num_tests - batch->test_num;
-
-    /* Indicate that tests are being skipped, update skip counter. */
-    printf("# Skipping all %u remaining tests: %s\n", remaining, message);
-    while (batch->test_num < batch->num_tests) {
-        chaz_Test_skip(batch, "");
-    }
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test.h b/charmonizer/src/Charmonizer/Test.h
deleted file mode 100644
index d876c38..0000000
--- a/charmonizer/src/Charmonizer/Test.h
+++ /dev/null
@@ -1,140 +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.
- */
-
-/* Charmonizer/Test.h - test Charmonizer's output.
- */
-
-#ifndef H_CHAZ_TEST
-#define H_CHAZ_TEST
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "Charmonizer/Core/Defines.h"
-
-typedef struct chaz_TestBatch chaz_TestBatch;
-
-/* Begin a test run.
- */
-chaz_TestBatch*
-chaz_Test_start(unsigned num_tests);
-
-/* End a test run.  Returns true if all tests were run and there were no
- * failures, false otherwise.
- */
-int
-chaz_Test_finish(void);
-
-/* Unbuffer stdout.  Perform any other setup needed.
- */
-void
-chaz_Test_init(void);
-
-/* Constructor for TestBatch.
- */
-chaz_TestBatch*
-chaz_Test_new_batch(unsigned num_tests);
-
-#define CHAZ_TEST_PLAN              chaz_Test_plan
-void
-chaz_Test_plan(chaz_TestBatch *batch);
-
-#define CHAZ_TEST_OK(_expression, _message) \
-    chaz_Test_ok(chaz_Test_current, (_expression), (_message))
-void
-chaz_Test_ok(chaz_TestBatch *batch, int expression, const char *message);
-
-#define CHAZ_TEST_STR_EQ(_got, _expected, _message) \
-    chaz_Test_str_eq(chaz_Test_current, (_got), (_expected), (_message))
-void
-chaz_Test_str_eq(chaz_TestBatch *batch, const char *got,
-                 const char *expected, const char *message);
-
-#define CHAZ_TEST_PASS(_message) \
-    chaz_Test_pass(chaz_Test_current, (_message))
-void
-chaz_Test_pass(chaz_TestBatch *batch, const char *message);
-
-#define CHAZ_TEST_FAIL(_message) \
-    chaz_Test_fail(chaz_Test_current, (_message))
-void
-chaz_Test_fail(chaz_TestBatch *batch, const char *message);
-
-#define CHAZ_TEST_LONG_EQ(_got, _expected, _message) \
-    chaz_Test_long_eq(chaz_Test_current, (_got), (_expected), (_message))
-void
-chaz_Test_long_eq(chaz_TestBatch *batch, long got, long expected,
-                  const char *message);
-
-#define CHAZ_TEST_DOUBLE_EQ(_got, _expected, _slop, _message) \
-    chaz_Test_double_eq(chaz_Test_current, (_got), (_expected), (_slop), \
-                        (_message))
-void
-chaz_Test_double_eq(chaz_TestBatch *batch, double got, double expected,
-                    double slop, const char *message);
-
-/* Print a message indicating that a test was skipped and update batch.
- */
-#define CHAZ_TEST_SKIP(_message) \
-    chaz_Test_skip(chaz_Test_current, (_message))
-void
-chaz_Test_skip(chaz_TestBatch *batch, const char *message);
-
-/* Print a message indicating that all remaining tests will be skipped and
- * then call SKIP once for each.
- */
-#define CHAZ_TEST_SKIP_REMAINING(_message) \
-    chaz_Test_skip_remaining(chaz_Test_current, (_message))
-void
-chaz_Test_skip_remaining(chaz_TestBatch* batch, const char *message);
-
-/* Global TestBatch implicitly accessed by testing macros. */
-extern chaz_TestBatch *chaz_Test_current;
-
-#ifdef CHAZ_USE_SHORT_NAMES
-  #define Test_start                   chaz_Test_start
-  #define Test_finish                  chaz_Test_finish
-  #define OK                           CHAZ_TEST_OK
-  #define STR_EQ                       CHAZ_TEST_STR_EQ
-  #define LONG_EQ                      CHAZ_TEST_LONG_EQ
-  #define DOUBLE_EQ                    CHAZ_TEST_DOUBLE_EQ
-  #define PASS                         CHAZ_TEST_PASS
-  #define FAIL                         CHAZ_TEST_FAIL
-  #define SKIP                         CHAZ_TEST_SKIP
-  #define SKIP_REMAINING               CHAZ_TEST_SKIP_REMAINING
-  #define TestBatch                    chaz_TestBatch
-  #define Test_init                    chaz_Test_init
-  #define Test_new_batch               chaz_Test_new_batch
-  #define Test_plan                    chaz_Test_plan
-  #define PLAN                         CHAZ_TEST_PLAN
-  #define Test_str_eq                  chaz_Test_str_eq
-  #define Test_long_eq                 chaz_Test_long_eq
-  #define Test_double_eq               chaz_Test_double_eq
-  #define Test_pass                    chaz_Test_pass
-  #define Test_fail                    chaz_Test_fail
-  #define Test_skip                    chaz_Test_skip
-  #define Test_skip_remaining          chaz_Test_skip_remaining
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_TEST */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test/TestDirManip.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test/TestDirManip.c b/charmonizer/src/Charmonizer/Test/TestDirManip.c
deleted file mode 100644
index 626f5af..0000000
--- a/charmonizer/src/Charmonizer/Test/TestDirManip.c
+++ /dev/null
@@ -1,71 +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 CHAZ_USE_SHORT_NAMES
-
-#include "Charmonizer/Test.h"
-#include <stdio.h>
-#include <string.h>
-#include "charmony.h"
-#ifdef HAS_DIRENT_H
-  #include <dirent.h>
-#endif
-#ifdef HAS_SYS_STAT_H
-  #include <sys/stat.h>
-#endif
-#ifdef HAS_SYS_TYPES_H
-  #include <sys/stat.h>
-#endif
-#ifdef HAS_UNISTD_H
-  #include <unistd.h>
-#endif
-#ifdef HAS_DIRECT_H
-  #include <direct.h>
-#endif
-
-static void
-S_run_tests(void) {
-    LONG_EQ(0, makedir("_chaz_test_dir", 0777), "makedir");
-    LONG_EQ(0, makedir("_chaz_test_dir" DIR_SEP "deep", 0777),
-            "makedir with DIR_SEP");
-    LONG_EQ(0, rmdir("_chaz_test_dir" DIR_SEP "deep"), "rmdir with DIR_SEP");
-    LONG_EQ(0, rmdir("_chaz_test_dir"), "rmdir");
-#ifdef CHY_HAS_DIRENT_D_NAMLEN
-    {
-        struct dirent entry;
-        entry.d_namlen = 5;
-        LONG_EQ(5, entry.d_namlen, "d_namlen");
-    }
-#else
-    SKIP("no d_namlen member on this platform");
-#endif
-#ifdef CHY_HAS_DIRENT_D_TYPE
-    {
-        struct dirent entry;
-        entry.d_type = 5;
-        LONG_EQ(5, entry.d_type, "d_type");
-    }
-#else
-    SKIP("no d_type member on this platform");
-#endif
-}
-
-int main(int argc, char **argv) {
-    Test_start(6);
-    S_run_tests();
-    return !Test_finish();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test/TestFuncMacro.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test/TestFuncMacro.c b/charmonizer/src/Charmonizer/Test/TestFuncMacro.c
deleted file mode 100644
index dded9bb..0000000
--- a/charmonizer/src/Charmonizer/Test/TestFuncMacro.c
+++ /dev/null
@@ -1,63 +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 CHAZ_USE_SHORT_NAMES
-
-#include "charmony.h"
-#include <string.h>
-#include "Charmonizer/Test.h"
-
-#ifdef INLINE
-static INLINE const char* S_inline_function() {
-    return "inline works";
-}
-#endif
-
-static void
-S_run_tests(void) {
-
-#ifdef HAS_FUNC_MACRO
-    STR_EQ(FUNC_MACRO, "S_run_tests", "FUNC_MACRO");
-#else
-    SKIP("no FUNC_MACRO");
-#endif
-
-#ifdef HAS_ISO_FUNC_MACRO
-    STR_EQ(__func__, "S_run_tests", "HAS_ISO_FUNC_MACRO");
-#else
-    SKIP("no ISO_FUNC_MACRO");
-#endif
-
-#ifdef HAS_GNUC_FUNC_MACRO
-    STR_EQ(__FUNCTION__, "S_run_tests", "HAS_GNUC_FUNC_MACRO");
-#else
-    SKIP("no GNUC_FUNC_MACRO");
-#endif
-
-#ifdef INLINE
-    PASS(S_inline_function());
-#else
-    SKIP("no INLINE functions");
-#endif
-}
-
-
-int main(int argc, char **argv) {
-    Test_start(4);
-    S_run_tests();
-    return !Test_finish();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test/TestHeaders.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test/TestHeaders.c b/charmonizer/src/Charmonizer/Test/TestHeaders.c
deleted file mode 100644
index 210b7f6..0000000
--- a/charmonizer/src/Charmonizer/Test/TestHeaders.c
+++ /dev/null
@@ -1,164 +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 CHAZ_USE_SHORT_NAMES
-
-#include "charmony.h"
-#include <string.h>
-#include "Charmonizer/Test.h"
-
-#ifdef HAS_ASSERT_H
-  #include <assert.h>
-#endif
-#ifdef HAS_CTYPE_H
-  #include <ctype.h>
-#endif
-#ifdef HAS_ERRNO_H
-  #include <errno.h>
-#endif
-#ifdef HAS_FLOAT_H
-  #include <float.h>
-#endif
-#ifdef HAS_LIMITS_H
-  #include <limits.h>
-#endif
-#ifdef HAS_LOCALE_H
-  #include <locale.h>
-#endif
-#ifdef HAS_MATH_H
-  #include <math.h>
-#endif
-#ifdef HAS_SETJMP_H
-  #include <setjmp.h>
-#endif
-#ifdef HAS_SIGNAL_H
-  #include <signal.h>
-#endif
-#ifdef HAS_STDARG_H
-  #include <stdarg.h>
-#endif
-#ifdef HAS_STDDEF_H
-  #include <stddef.h>
-#endif
-#ifdef HAS_STDIO_H
-  #include <stdio.h>
-#endif
-#ifdef HAS_STDLIB_H
-  #include <stdlib.h>
-#endif
-#ifdef HAS_STRING_H
-  #include <string.h>
-#endif
-#ifdef HAS_TIME_H
-  #include <time.h>
-#endif
-
-#ifdef HAS_CPIO_H
-  #include <cpio.h>
-#endif
-#ifdef HAS_DIRENT_H
-  #include <dirent.h>
-#endif
-#ifdef HAS_FCNTL_H
-  #include <fcntl.h>
-#endif
-#ifdef HAS_GRP_H
-  #include <grp.h>
-#endif
-#ifdef HAS_PWD_H
-  #include <pwd.h>
-#endif
-#ifdef HAS_SYS_STAT_H
-  #include <sys/stat.h>
-#endif
-#ifdef HAS_SYS_TIMES_H
-  #include <sys/times.h>
-#endif
-#ifdef HAS_SYS_TYPES_H
-  #include <sys/types.h>
-#endif
-#ifdef HAS_SYS_UTSNAME_H
-  #include <sys/utsname.h>
-#endif
-#ifdef HAS_WAIT_H
-  #include <wait.h>
-#endif
-#ifdef HAS_TAR_H
-  #include <tar.h>
-#endif
-#ifdef HAS_TERMIOS_H
-  #include <termios.h>
-#endif
-#ifdef HAS_UNISTD_H
-  #include <unistd.h>
-#endif
-#ifdef HAS_UTIME_H
-  #include <utime.h>
-#endif
-
-#if defined(HAS_C89) || defined(HAS_C90)
-  #include <assert.h>
-  #include <ctype.h>
-  #include <errno.h>
-  #include <float.h>
-  #include <limits.h>
-  #include <locale.h>
-  #include <math.h>
-  #include <setjmp.h>
-  #include <signal.h>
-  #include <stdarg.h>
-  #include <stddef.h>
-  #include <stdio.h>
-  #include <stdlib.h>
-  #include <string.h>
-  #include <time.h>
-#endif
-
-#ifdef HAS_POSIX
-  #include <cpio.h>
-  #include <dirent.h>
-  #include <fcntl.h>
-  #include <grp.h>
-  #include <pwd.h>
-  #include <sys/stat.h>
-  #include <sys/times.h>
-  #include <sys/types.h>
-  #include <sys/utsname.h>
-  #include <sys/wait.h>
-  #include <tar.h>
-  #include <termios.h>
-  #include <unistd.h>
-  #include <utime.h>
-#endif
-
-static void
-S_run_tests(void) {
-    PASS("Compiled successfully with all detected headers");
-
-    /* Don't bother checking all -- just use stdio as an example. */
-#ifdef HAS_STDIO_H
-    PASS("stdio.h should have been detected");
-#else
-    FAIL("stdio.h should have been detected");
-#endif
-}
-
-int main(int argc, char **argv) {
-    Test_start(2);
-    S_run_tests();
-    return !Test_finish();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test/TestIntegers.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test/TestIntegers.c b/charmonizer/src/Charmonizer/Test/TestIntegers.c
deleted file mode 100644
index 175affe..0000000
--- a/charmonizer/src/Charmonizer/Test/TestIntegers.c
+++ /dev/null
@@ -1,125 +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 CHAZ_USE_SHORT_NAMES
-#define CHY_EMPLOY_BOOLEANS
-#define CHY_EMPLOY_INTEGERTYPES
-
-#include "Charmonizer/Test.h"
-#include "charmony.h"
-#include <stdio.h>
-#include <string.h>
-
-static void
-S_run_tests(TestBatch *batch) {
-    {
-        long one = 1;
-        long big_endian = !(*((char *)(&one)));
-#ifdef BIG_END
-        OK(big_endian, "BIG_END");
-#else
- #if defined(LITTLE_END)
-        OK(!big_endian, "LITTLE_END");
- #else
-        FAIL("Either BIG_END or LITTLE_END should be defined");
- #endif
-#endif
-    }
-
-    LONG_EQ(SIZEOF_CHAR,  sizeof(char),  "SIZEOF_CHAR");
-    LONG_EQ(SIZEOF_SHORT, sizeof(short), "SIZEOF_SHORT");
-    LONG_EQ(SIZEOF_INT,   sizeof(int),   "SIZEOF_INT");
-    LONG_EQ(SIZEOF_LONG,  sizeof(long),  "SIZEOF_LONG");
-    LONG_EQ(SIZEOF_PTR,   sizeof(void*), "SIZEOF_PTR");
-
-#ifdef HAS_LONG_LONG
-    LONG_EQ(SIZEOF_LONG_LONG, sizeof(long long),
-            "HAS_LONG_LONG and SIZEOF_LONG_LONG");
-#else
-    SKIP("No 'long long' type");
-#endif
-
-    {
-        bool the_truth = true;
-        OK(the_truth, "bool true");
-        OK(!false, "false is false");
-    }
-#ifdef HAS_INT8_T
-    {
-        int8_t foo = -100;
-        uint8_t bar = 200;
-        LONG_EQ(foo, -100, "int8_t is signed");
-        LONG_EQ(bar, 200, "uint8_t is unsigned");
-        LONG_EQ(sizeof(int8_t), 1, "i8_t is 1 byte");
-        LONG_EQ(sizeof(uint8_t), 1, "u8_t is 1 byte");
-        LONG_EQ(INT8_MAX,  127, "INT8_MAX");
-        LONG_EQ(INT8_MIN, -128, "INT8_MIN");
-        LONG_EQ(UINT8_MAX,  255, "UINT8_MAX");
-    }
-#endif
-#ifdef HAS_INT16_T
-    {
-        int16_t foo = -100;
-        uint16_t bar = 30000;
-        LONG_EQ(foo, -100, "int16_t is signed");
-        LONG_EQ(bar, 30000, "uint16_t is unsigned");
-        LONG_EQ(sizeof(int16_t), 2, "int16_t is 2 bytes");
-        LONG_EQ(sizeof(uint16_t), 2, "uint16_t is 2 bytes");
-        LONG_EQ(INT16_MAX,  32767, "INT16_MAX");
-        LONG_EQ(INT16_MIN, -32768, "INT16_MIN");
-        LONG_EQ(UINT16_MAX,  65535, "UINT16_MAX");
-    }
-#endif
-#ifdef HAS_INT32_T
-    {
-        int32_t foo = -100;
-        uint32_t bar = 4000000000UL;
-        OK((foo == -100), "int32_t is signed");
-        OK((bar == 4000000000UL), "uint32_t is unsigned");
-        OK((sizeof(int32_t) == 4), "int32_t is 4 bytes");
-        OK((sizeof(uint32_t) == 4), "uint32_t is 4 bytes");
-        OK((INT32_MAX == INT32_C(2147483647)), "INT32_MAX");
-        /* The (-2147483647 - 1) avoids a compiler warning. */
-        OK((INT32_MIN == -INT32_C(2147483647) - 1), "INT32_MIN");
-        OK((UINT32_MAX == UINT32_C(4294967295)), "UINT32_MAX");
-    }
-#endif
-#ifdef HAS_INT64_T
-    {
-        char buf[100];
-        int64_t foo = -100;
-        uint64_t bar = UINT64_C(18000000000000000000);
-        OK((foo == -100), "int64_t is signed");
-        OK((bar == UINT64_C(18000000000000000000)), "uint64_t is unsigned");
-        OK((sizeof(int64_t) == 8), "int64_t is 8 bytes");
-        OK((sizeof(uint64_t) == 8), "uint64_t is 8 bytes");
-        OK((INT64_MAX == INT64_C(0x7FFFFFFFFFFFFFFF)), "INT64_MAX");
-        OK((INT64_MIN == -INT64_C(0x7FFFFFFFFFFFFFFF) - 1), "INT64_MIN");
-        OK((UINT64_MAX == UINT64_C(0xFFFFFFFFFFFFFFFF)), "UINT64_MAX");
-        sprintf(buf, "%"PRId64, foo);
-        STR_EQ(buf, "-100", "PRId64");
-        sprintf(buf, "%"PRIu64, bar);
-        STR_EQ(buf, "18000000000000000000", "PRIu64");
-    }
-#endif
-}
-
-int main(int argc, char **argv) {
-    TestBatch *batch = Test_start(39);
-    S_run_tests(batch);
-    return !Test_finish();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test/TestLargeFiles.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test/TestLargeFiles.c b/charmonizer/src/Charmonizer/Test/TestLargeFiles.c
deleted file mode 100644
index d6c317a..0000000
--- a/charmonizer/src/Charmonizer/Test/TestLargeFiles.c
+++ /dev/null
@@ -1,280 +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 CHAZ_USE_SHORT_NAMES
-
-#include "charmony.h"
-#include <string.h>
-#include <errno.h>
-
-#ifdef CHAZ_HAS_SYS_TYPES_H
-  #include <sys/types.h>
-#endif
-#ifdef CHAZ_HAS_FCNTL_H
-  #include <fcntl.h> /* open, fcntl flags */
-#endif
-#ifdef CHY_HAS_UNISTD_H
-  #include <unistd.h> /* close */
-#endif
-#ifdef CHAZ_HAS_IO_H
-  #include <io.h>
-#endif
-
-#include <stdio.h>
-#include "Charmonizer/Test.h"
-
-#if (defined(HAS_64BIT_STDIO) \
-     && defined(CHAZ_HAS_STAT_ST_SIZE) \
-     && defined(CHAZ_HAS_STAT_ST_BLOCKS))
-#define STAT_TESTS_ENABLED
-
-#include <sys/stat.h>
-
-/* Determine whether we can use sparse files.
- */
-static int 
-S_check_sparse_files(void);
-
-/* Helper for check_sparse_files().
- */
-static int
-S_test_sparse_file(long offset, struct stat *st);
-
-/* See if trying to write a 5 GB file in a subprocess bombs out.  If it
- * doesn't, then the test suite can safely verify large file support.
- */
-static int
-S_can_create_big_files(void);
-
-#endif /* criteria for defining STAT_TESTS_ENABLED */
-
-#ifdef O_LARGEFILE
-  #define LARGEFILE_OPEN_FLAG O_LARGEFILE
-#else
-  #define LARGEFILE_OPEN_FLAG 0
-#endif
-
-static void
-S_run_tests(void) {
-    FILE *fh;
-    off64_t offset;
-    int check_val;
-    char check_char;
-    int fd;
-
-    /* A little over 4 GB, and a little over 2 GB. */
-    off64_t gb4_plus = ((off64_t)0x7FFFFFFF << 1) + 100;
-    off64_t gb2_plus = (off64_t)0x7FFFFFFF + 200;
-
-    LONG_EQ(sizeof(off64_t), 8, "off64_t type has 8 bytes");
-
-#ifndef HAS_64BIT_STDIO
-    SKIP_REMAINING("No stdio large file support");
-    return;
-#endif
-#ifndef STAT_TESTS_ENABLED
-    SKIP_REMAINING("Need stat with st_size and st_blocks");
-    return;
-#else
-    /* Check for sparse files. */
-    if (!S_check_sparse_files()) {
-        SKIP_REMAINING("Can't verify large file support "
-                       "without sparse files");
-        return;
-    }
-    if (!S_can_create_big_files()) {
-        SKIP_REMAINING("Unsafe to create 5GB sparse files on this system");
-        return;
-    }
-
-    fh = fopen64("_charm_large_file_test", "w+");
-    if (fh == NULL) {
-        SKIP_REMAINING("Failed to open file");
-        return;
-    }
-
-    check_val = fseeko64(fh, gb4_plus, SEEK_SET);
-    LONG_EQ(check_val, 0, "fseeko64 above 4 GB");
-
-    offset = ftello64(fh);
-    OK((offset == gb4_plus), "ftello64 above 4 GB");
-
-    check_val = fprintf(fh, "X");
-    LONG_EQ(check_val, 1, "print above 4 GB");
-
-    check_val = fseeko64(fh, gb2_plus, SEEK_SET);
-    LONG_EQ(check_val, 0, "fseeko64 above 2 GB");
-
-    offset = ftello64(fh);
-    OK((offset == gb2_plus), "ftello64 above 2 GB");
-
-    check_val = fseeko64(fh, -1, SEEK_END);
-    LONG_EQ(check_val, 0, "seek to near end");
-
-    check_char = fgetc(fh);
-    LONG_EQ(check_char, 'X', "read value after multiple seeks");
-
-    check_val = fclose(fh);
-    LONG_EQ(check_val, 0, "fclose succeeds after all that");
-
-    /* Truncate, just in case the call to remove fails. */
-    fh = fopen64("_charm_large_file_test", "w+");
-    if (fh != NULL) {
-        fclose(fh);
-    }
-    remove("_charm_large_file_test");
-
-#ifndef HAS_64BIT_LSEEK
-    SKIP_REMAINING("No 64-bit lseek");
-    return;
-#else
-    fd = open("_charm_large_file_test",
-              O_RDWR | O_CREAT | LARGEFILE_OPEN_FLAG, 0666);
-    if (fd == -1) {
-        FAIL("open failed");
-        SKIP_REMAINING("open failed");
-        return;
-    }
-
-    offset = lseek64(fd, gb4_plus, SEEK_SET);
-    OK(offset == gb4_plus, "lseek64 above 4 GB");
-
-    offset = lseek64(fd, 0, SEEK_CUR);
-    OK(offset == gb4_plus, "lseek64 in place above 4 GB");
-
-    check_val = write(fd, "X", 1);
-    LONG_EQ(check_val, 1, "write() above 4 GB");
-
-    offset = lseek64(fd, gb2_plus, SEEK_SET);
-    OK(offset == gb2_plus, "lseek64 above 2 GB");
-
-    offset = lseek64(fd, 0, SEEK_CUR);
-    OK((offset == gb2_plus), "lseek64 in place above 2 GB");
-
-    offset = lseek64(fd, -1, SEEK_END);
-    OK(offset == gb4_plus, "seek to near end");
-
-    check_val = read(fd, &check_char, 1);
-    LONG_EQ(check_val, 1, "read() after multiple lseek64 calls");
-    LONG_EQ(check_char, 'X',
-            "read() correct data after multiple lseek64 calls");
-#ifdef HAS_64BIT_PREAD
-    check_char = 0;
-    check_val = pread64(fd, &check_char, 1, gb4_plus);
-    LONG_EQ(check_val, 1, "pread64");
-    LONG_EQ(check_char, 'X', "pread64() correct data");
-#else
-    SKIP("no pread64");
-    SKIP("no pread64");
-#endif
-
-    check_val = close(fd);
-    LONG_EQ(check_val, 0, "close succeeds after all that");
-#endif
-
-    /* Truncate, just in case the call to remove fails. */
-    fh = fopen64("_charm_large_file_test", "w+");
-    if (fh != NULL) {
-        fclose(fh);
-    }
-    remove("_charm_large_file_test");
-#endif /* STAT_TESTS_ENABLED */
-}
-
-#ifdef STAT_TESTS_ENABLED
-
-static int
-S_check_sparse_files(void) {
-    struct stat st_a, st_b;
-
-    /* Write and stat a 1 MB file and a 2 MB file, both of them sparse. */
-    if (!S_test_sparse_file(1000000, &st_a)) { return false; }
-    if (!S_test_sparse_file(2000000, &st_b)) { return false; }
-    if (st_a.st_size != 1000001 || st_b.st_size != 2000001) {
-        return false;
-    }
-
-    /* See if two files with very different lengths have the same block size. */
-    return st_a.st_blocks == st_b.st_blocks ? true : false;
-}
-
-static int
-S_test_sparse_file(long offset, struct stat *st) {
-    FILE *sparse_fh;
-    int result = false;
-
-    /* Make sure the file's not there, then open. */
-    remove("_charm_sparse");
-    if ((sparse_fh = fopen64("_charm_sparse", "w+")) == NULL) {
-        return false;
-    }
-
-    /* Seek fh to [offset], write a byte, close file. */
-    if ((fseeko64(sparse_fh, offset, SEEK_SET)) != -1) {
-        if ((fprintf(sparse_fh, "X")) == 1) {
-            result = true;
-        }
-    }
-    if (fclose(sparse_fh)) {
-        result = false;
-    }
-
-    /* Stat the file. */
-    stat("_charm_sparse", st);
-
-    remove("_charm_sparse");
-    return result;
-}
-
-static int
-S_can_create_big_files(void) {
-    int result = 0;
-    FILE *fh = fopen64("_charm_large_file_test", "w+");
-    if (!fh) {
-        return false;
-    }
-    else {
-        /* Bail unless seek succeeds. */
-        int64_t check_seek = fseeko64(fh, INT64_C(5000000000), SEEK_SET);
-        if (check_seek != -1) {
-            /* Bail unless we write successfully. */
-            if (fprintf(fh, "X") == 1) {
-                result = true;
-            }
-        }
-        if (fclose(fh)) {
-            result = false;
-        }
-    }
-
-    /* Truncate, just in case the call to remove fails. */
-    fh = fopen64("_charm_large_file_test", "w");
-    if (fh != NULL) {
-        fclose(fh);
-    }
-    remove("_charm_large_file_test");
-
-    return result;
-}
-
-#endif /* STAT_TESTS_ENABLED */
-
-int main(int argc, char **argv) {
-    Test_start(20);
-    S_run_tests();
-    return !Test_finish();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test/TestUnusedVars.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test/TestUnusedVars.c b/charmonizer/src/Charmonizer/Test/TestUnusedVars.c
deleted file mode 100644
index 09c3b04..0000000
--- a/charmonizer/src/Charmonizer/Test/TestUnusedVars.c
+++ /dev/null
@@ -1,42 +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 CHAZ_USE_SHORT_NAMES
-
-#include "charmony.h"
-#include "Charmonizer/Test.h"
-
-static void
-S_run_tests(void) {
-#ifdef UNUSED_VAR
-    PASS("UNUSED_VAR macro is defined");
-#else
-    FAIL("UNUSED_VAR macro is defined");
-#endif
-
-#ifdef UNREACHABLE_RETURN
-    PASS("UNREACHABLE_RETURN macro is defined");
-#else
-    FAIL("UNREACHABLE_RETURN macro is defined");
-#endif
-}
-
-int main(int argc, char **argv) {
-    Test_start(2);
-    S_run_tests();
-    return !Test_finish();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Test/TestVariadicMacros.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Test/TestVariadicMacros.c b/charmonizer/src/Charmonizer/Test/TestVariadicMacros.c
deleted file mode 100644
index 4bfadfb..0000000
--- a/charmonizer/src/Charmonizer/Test/TestVariadicMacros.c
+++ /dev/null
@@ -1,69 +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 CHAZ_USE_SHORT_NAMES
-
-#include "charmony.h"
-#include <string.h>
-#include <stdio.h>
-#include "Charmonizer/Test.h"
-
-static void
-S_run_tests(void) {
-    char buf[10];
-    int really_has_var_macs = false;
-
-#if defined(HAS_ISO_VARIADIC_MACROS) || defined(HAS_GNUC_VARIADIC_MACROS)
-  #ifdef HAS_VARIADIC_MACROS
-    PASS("#defines agree");
-  #else
-    FAIL(0, "#defines agree");
-  #endif
-#else
-    SKIP_REMAINING("No variadic macro support");
-    return;
-#endif
-
-
-#ifdef HAS_ISO_VARIADIC_MACROS
- #define ISO_TEST(buffer, fmt, ...) \
-    sprintf(buffer, fmt, __VA_ARGS__)
-    really_has_var_macs = true;
-    ISO_TEST(buf, "%s", "iso");
-    STR_EQ(buf, "iso", "ISO variadic macros work");
-#else
-    SKIP("No ISO variadic macros");
-#endif
-
-#ifdef HAS_GNUC_VARIADIC_MACROS
- #define GNU_TEST(buffer, fmt, args...) \
-    sprintf(buffer, fmt, ##args )
-    really_has_var_macs = true;
-    GNU_TEST(buf, "%s", "gnu");
-    STR_EQ(buf, "gnu", "GNUC variadic macros work");
-#else
-    SKIP("No GNUC variadic macros");
-#endif
-
-    OK(really_has_var_macs, "either ISO or GNUC");
-}
-
-int main(int argc, char **argv) {
-    Test_start(4);
-    S_run_tests();
-    return !Test_finish();
-}
-


Mime
View raw message