From 51c6a6ac6b1583e95d0c49e6aebc4f27aea18f38 Mon Sep 17 00:00:00 2001 From: "Navaneeth.K.N" Date: Sat, 28 Jul 2012 23:30:39 +0530 Subject: [PATCH] Renaming all files to remove the unncessary prefix --- CMakeLists.txt | 39 ++++++++++++------------- varnam-api.h => api.h | 6 ++-- {foreign => deps}/CMakeLists.txt | 6 ++-- {foreign => deps}/snprintf.c | 2 +- {foreign => deps}/sqlite3.c | 0 {foreign => deps}/sqlite3.h | 0 {foreign => deps}/sqlite3ext.h | 0 learn.c | 14 ++++----- renderer/ml_unicode.c | 8 ++--- renderer/renderers.h | 4 +-- rendering.c | 11 ++++--- rendering.h | 4 +-- varnam-result-codes.h => result-codes.h | 2 +- varnam-strbuf.c => strbuf.c | 6 ++-- varnam-symbol-table.c => symbol-table.c | 12 ++++---- varnam-symbol-table.h => symbol-table.h | 4 +-- varnam-token.c => token.c | 10 +++---- varnam-token.h => token.h | 4 +-- varnam-tl.c => transliterate.c | 16 +++++----- varnam-trie.c => trie.c | 6 ++-- varnam-trie.h => trie.h | 2 +- varnam-util.c => util.c | 6 ++-- varnam-util.h => util.h | 4 +-- varnam.c | 16 +++++----- varnam.h | 8 ++--- varnam-array.c => varray.c | 4 +-- varnam-array.h => varray.h | 4 +-- varnam-types.h => vtypes.h | 2 +- vword.c | 4 +-- vword.h | 2 +- varnam-words-table.c => words-table.c | 13 +++++---- varnam-words-table.h => words-table.h | 4 +-- 32 files changed, 111 insertions(+), 112 deletions(-) rename varnam-api.h => api.h (99%) rename {foreign => deps}/CMakeLists.txt (84%) rename {foreign => deps}/snprintf.c (99%) rename {foreign => deps}/sqlite3.c (100%) rename {foreign => deps}/sqlite3.h (100%) rename {foreign => deps}/sqlite3ext.h (100%) rename varnam-result-codes.h => result-codes.h (97%) rename varnam-strbuf.c => strbuf.c (98%) rename varnam-symbol-table.c => symbol-table.c (99%) rename varnam-symbol-table.h => symbol-table.h (97%) rename varnam-token.c => token.c (96%) rename varnam-token.h => token.h (96%) rename varnam-tl.c => transliterate.c (92%) rename varnam-trie.c => trie.c (98%) rename varnam-trie.h => trie.h (98%) rename varnam-util.c => util.c (99%) rename varnam-util.h => util.h (99%) rename varnam-array.c => varray.c (98%) rename varnam-array.h => varray.h (97%) rename varnam-types.h => vtypes.h (99%) rename varnam-words-table.c => words-table.c (98%) rename varnam-words-table.h => words-table.h (96%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1594e39..35225aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ project(varnam) message ("Generating project ${PROJECT_NAME}") set(VARNAM_LIBRARY_NAME "varnam") -set(FOREIGN_LIBRARY_NAME "foreign-functions") +set(DEPS_LIBRARY_NAME "deps") set(VARNAM_VERSION_MAJOR 1) set(VARNAM_VERSION_MINOR 0) @@ -27,14 +27,14 @@ add_definitions(-DHAVE_SNPRINTF -DPREFER_PORTABLE_SNPRINTF -DNEED_ASPRINTF) # Append the source files here list (APPEND VARNAM_SOURCES - varnam-util.c - varnam-trie.c - varnam-strbuf.c - varnam-tl.c - varnam-symbol-table.c - varnam-words-table.c - varnam-array.c - varnam-token.c + util.c + trie.c + strbuf.c + transliterate.c + symbol-table.c + words-table.c + varray.c + token.c vword.c learn.c rendering.c @@ -45,16 +45,15 @@ list (APPEND VARNAM_SOURCES # Append the header files here. this will get copied to include directory list (APPEND VARNAM_INCLUDE_FILES varnam.h - varnam-api.h - varnam-result-codes.h - varnam-trie.h - varnam-types.h - varnam-util.h - varnam-symbol-table.h + api.h + result-codes.h + vtypes.h + util.h + varray.h ) -# Build foreign functions -add_subdirectory(foreign) +# Build dependencies +add_subdirectory(deps) # Build tests add_subdirectory(tests) @@ -68,15 +67,15 @@ SET_TARGET_PROPERTIES(${VARNAM_LIBRARY_NAME} PROPERTIES INSTALL ( TARGETS ${VARNAM_LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) INSTALL ( FILES ${VARNAM_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/lib${VARNAM_LIBRARY_NAME}) -INSTALL ( FILES foreign/sqlite3.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/lib${VARNAM_LIBRARY_NAME}/foreign) +INSTALL ( FILES deps/sqlite3.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/lib${VARNAM_LIBRARY_NAME}/deps) IF(CMAKE_COMPILER_IS_GNUCC) # sqlite requires pthread and dl - target_link_libraries(${VARNAM_LIBRARY_NAME} ${FOREIGN_LIBRARY_NAME} pthread dl) + target_link_libraries(${VARNAM_LIBRARY_NAME} ${DEPS_LIBRARY_NAME} pthread dl) ENDIF() IF(MSVC) - target_link_libraries(${VARNAM_LIBRARY_NAME} ${FOREIGN_LIBRARY_NAME}) + target_link_libraries(${VARNAM_LIBRARY_NAME} ${DEPS_LIBRARY_NAME}) ENDIF() add_custom_target(vstfiles diff --git a/varnam-api.h b/api.h similarity index 99% rename from varnam-api.h rename to api.h index ac6b0ae..2492545 100644 --- a/varnam-api.h +++ b/api.h @@ -21,9 +21,9 @@ #define VARNAM_API_H_INCLUDED_093510 #include -#include "varnam-types.h" -#include "varnam-util.h" -#include "varnam-array.h" +#include "vtypes.h" +#include "util.h" +#include "varray.h" /** * Initializes the varnam library. diff --git a/foreign/CMakeLists.txt b/deps/CMakeLists.txt similarity index 84% rename from foreign/CMakeLists.txt rename to deps/CMakeLists.txt index 774217e..6e8fd0d 100644 --- a/foreign/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 2.6) -project (foreign_functions) +project (deps) message ("Generating project ${PROJECT_NAME}") # This builds the 3rd party code that we uses. It uses very less level of warnings @@ -20,9 +20,9 @@ ENDIF() add_definitions(-DSQLITE_CASE_SENSITIVE_LIKE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS) -list (APPEND FOREIGN_SOURCES +list (APPEND DEPS_SOURCES snprintf.c sqlite3.c ) -add_library (${FOREIGN_LIBRARY_NAME} STATIC ${FOREIGN_SOURCES}) +add_library (${DEPS_LIBRARY_NAME} STATIC ${DEPS_SOURCES}) diff --git a/foreign/snprintf.c b/deps/snprintf.c similarity index 99% rename from foreign/snprintf.c rename to deps/snprintf.c index 9b1891d..2a6771c 100755 --- a/foreign/snprintf.c +++ b/deps/snprintf.c @@ -284,7 +284,7 @@ /* NO USER SERVICABLE PARTS FOLLOWING THIS POINT */ /* ============================================= */ -#include "../varnam-util.h" +#include "../util.h" #define PORTABLE_SNPRINTF_VERSION_MAJOR 2 #define PORTABLE_SNPRINTF_VERSION_MINOR 2 diff --git a/foreign/sqlite3.c b/deps/sqlite3.c similarity index 100% rename from foreign/sqlite3.c rename to deps/sqlite3.c diff --git a/foreign/sqlite3.h b/deps/sqlite3.h similarity index 100% rename from foreign/sqlite3.h rename to deps/sqlite3.h diff --git a/foreign/sqlite3ext.h b/deps/sqlite3ext.h similarity index 100% rename from foreign/sqlite3ext.h rename to deps/sqlite3ext.h diff --git a/learn.c b/learn.c index facb3dc..cc49f91 100644 --- a/learn.c +++ b/learn.c @@ -17,13 +17,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "varnam-api.h" -#include "varnam-types.h" -#include "varnam-array.h" -#include "varnam-util.h" -#include "varnam-result-codes.h" -#include "varnam-symbol-table.h" -#include "varnam-words-table.h" +#include "api.h" +#include "vtypes.h" +#include "varray.h" +#include "util.h" +#include "result-codes.h" +#include "symbol-table.h" +#include "words-table.h" static strbuf* sanitize_word (varnam *handle, const char *word) diff --git a/renderer/ml_unicode.c b/renderer/ml_unicode.c index ba605db..8b2e294 100644 --- a/renderer/ml_unicode.c +++ b/renderer/ml_unicode.c @@ -20,10 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include #include "renderers.h" -#include "../varnam-util.h" -#include "../varnam-types.h" -#include "../varnam-result-codes.h" -#include "../varnam-symbol-table.h" +#include "../util.h" +#include "../vtypes.h" +#include "../result-codes.h" +#include "../symbol-table.h" #define RENDER_VALUE2_TAG "render_value2" #define CHIL_TAG "chill" diff --git a/renderer/renderers.h b/renderer/renderers.h index feed612..747f19d 100644 --- a/renderer/renderers.h +++ b/renderer/renderers.h @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifndef RENDERING_RENDERERS_H_INCLUDED_105305 #define RENDERING_RENDERERS_H_INCLUDED_105305 -#include "../varnam-types.h" -#include "../varnam-util.h" +#include "../vtypes.h" +#include "../util.h" int ml_unicode_renderer(varnam *handle, diff --git a/rendering.c b/rendering.c index 3124f31..2b34e19 100644 --- a/rendering.c +++ b/rendering.c @@ -19,14 +19,13 @@ #include #include -#include "varnam-symbol-table.h" -#include "varnam-result-codes.h" -#include "varnam-array.h" -#include "varnam-types.h" +#include "symbol-table.h" +#include "result-codes.h" +#include "varray.h" +#include "vtypes.h" #include "rendering.h" #include "vword.h" -#include "varnam-api.h" -#include "varnam-array.h" +#include "api.h" static vtoken_renderer* get_renderer(varnam *handle) diff --git a/rendering.h b/rendering.h index 79c0eae..3c8345d 100644 --- a/rendering.h +++ b/rendering.h @@ -16,8 +16,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "varnam-types.h" -#include "varnam-array.h" +#include "vtypes.h" +#include "varray.h" #ifndef RENDERING_H_INCLUDED_200624 #define RENDERING_H_INCLUDED_200624 diff --git a/varnam-result-codes.h b/result-codes.h similarity index 97% rename from varnam-result-codes.h rename to result-codes.h index 7f34a7a..67f7095 100644 --- a/varnam-result-codes.h +++ b/result-codes.h @@ -1,4 +1,4 @@ -/* varnam-result-codes.h +/* Specifies the return codes * * Copyright (C) Navaneeth.K.N * diff --git a/varnam-strbuf.c b/strbuf.c similarity index 98% rename from varnam-strbuf.c rename to strbuf.c index d117366..46d6be7 100644 --- a/varnam-strbuf.c +++ b/strbuf.c @@ -1,4 +1,4 @@ -/* strbuf.c - dynamically growing string buffer +/* Dynamically growing string buffer * * Copyright (C) Navaneeth.K.N * @@ -22,8 +22,8 @@ #include #include -#include "varnam-util.h" -#include "varnam-array.h" +#include "util.h" +#include "varray.h" static int grow_buffer(struct strbuf *string) { diff --git a/varnam-symbol-table.c b/symbol-table.c similarity index 99% rename from varnam-symbol-table.c rename to symbol-table.c index e2dfa4b..2af64b8 100644 --- a/varnam-symbol-table.c +++ b/symbol-table.c @@ -19,12 +19,12 @@ #include #include -#include "varnam-symbol-table.h" -#include "varnam-util.h" -#include "varnam-types.h" -#include "varnam-result-codes.h" -#include "varnam-api.h" -#include "varnam-token.h" +#include "symbol-table.h" +#include "util.h" +#include "vtypes.h" +#include "result-codes.h" +#include "api.h" +#include "token.h" int ensure_schema_exists(varnam *handle, char **msg) diff --git a/varnam-symbol-table.h b/symbol-table.h similarity index 97% rename from varnam-symbol-table.h rename to symbol-table.h index e431ecd..fe093a5 100644 --- a/varnam-symbol-table.h +++ b/symbol-table.h @@ -20,8 +20,8 @@ #ifndef VARNAM_SYMBOL_TABLE_H_INCLUDED_120215 #define VARNAM_SYMBOL_TABLE_H_INCLUDED_120215 -#include "varnam-types.h" -#include "varnam-array.h" +#include "vtypes.h" +#include "varray.h" /** * checks the schema availability. this function will create it when necessary diff --git a/varnam-token.c b/token.c similarity index 96% rename from varnam-token.c rename to token.c index d65a771..2b8078e 100644 --- a/varnam-token.c +++ b/token.c @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include -#include "varnam-token.h" -#include "varnam-types.h" -#include "varnam-util.h" -#include "varnam-array.h" -#include "varnam-result-codes.h" +#include "token.h" +#include "vtypes.h" +#include "util.h" +#include "varray.h" +#include "result-codes.h" static void initialize_token (vtoken *tok, diff --git a/varnam-token.h b/token.h similarity index 96% rename from varnam-token.h rename to token.h index 1d72767..44bb46a 100644 --- a/varnam-token.h +++ b/token.h @@ -20,8 +20,8 @@ #ifndef VARNAM_TOKEN_H_INCLUDED_090112 #define VARNAM_TOKEN_H_INCLUDED_090112 -#include "varnam-types.h" -#include "varnam-array.h" +#include "vtypes.h" +#include "varray.h" struct token* Token(int id, int type, int match_type, const char* pattern, const char* value1, const char* value2, const char* tag); diff --git a/varnam-tl.c b/transliterate.c similarity index 92% rename from varnam-tl.c rename to transliterate.c index f7baaa7..6dc441b 100644 --- a/varnam-tl.c +++ b/transliterate.c @@ -19,14 +19,14 @@ #include #include -#include "foreign/sqlite3.h" -#include "varnam-api.h" -#include "varnam-util.h" -#include "varnam-types.h" -#include "varnam-result-codes.h" -#include "varnam-symbol-table.h" -#include "varnam-array.h" -#include "varnam-token.h" +#include "deps/sqlite3.h" +#include "api.h" +#include "util.h" +#include "vtypes.h" +#include "result-codes.h" +#include "symbol-table.h" +#include "varray.h" +#include "token.h" #include "vword.h" #include "rendering.h" diff --git a/varnam-trie.c b/trie.c similarity index 98% rename from varnam-trie.c rename to trie.c index 0d4dbc8..295a3c4 100644 --- a/varnam-trie.c +++ b/trie.c @@ -22,9 +22,9 @@ #include #include -#include "varnam-util.h" -#include "varnam-trie.h" -#include "varnam-result-codes.h" +#include "util.h" +#include "trie.h" +#include "result-codes.h" static struct trie *trie_new(const char *label, void *value) { diff --git a/varnam-trie.h b/trie.h similarity index 98% rename from varnam-trie.h rename to trie.h index 176b0e3..c52e680 100644 --- a/varnam-trie.h +++ b/trie.h @@ -20,7 +20,7 @@ #ifndef TRIE_H_INCLUDED_095519 #define TRIE_H_INCLUDED_095519 -#include "varnam-util.h" +#include "util.h" struct trie { int root; /* if 1, then this is root */ diff --git a/varnam-util.c b/util.c similarity index 99% rename from varnam-util.c rename to util.c index efb39cc..31932b2 100644 --- a/varnam-util.c +++ b/util.c @@ -1,4 +1,4 @@ -/* util.c +/* Utility functions * * Copyright (C) 2010 Navaneeth.K.N * @@ -22,8 +22,8 @@ #include #include -#include "varnam-util.h" -#include "varnam-types.h" +#include "util.h" +#include "vtypes.h" /** * substr(str,start,length,output) writes length characters of str beginning with start to substring. diff --git a/varnam-util.h b/util.h similarity index 99% rename from varnam-util.h rename to util.h index 55c676f..a4dc906 100644 --- a/varnam-util.h +++ b/util.h @@ -27,8 +27,8 @@ typedef int bool; #define false 0 #define true 1 -#include "varnam-array.h" -#include "varnam-types.h" +#include "varray.h" +#include "vtypes.h" #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) diff --git a/varnam.c b/varnam.c index d8b86f5..b2c1cdd 100644 --- a/varnam.c +++ b/varnam.c @@ -20,14 +20,14 @@ #include #include -#include "varnam-array.h" -#include "varnam-api.h" -#include "varnam-types.h" -#include "varnam-util.h" -#include "varnam-result-codes.h" -#include "varnam-symbol-table.h" -#include "varnam-words-table.h" -#include "varnam-token.h" +#include "varray.h" +#include "api.h" +#include "vtypes.h" +#include "util.h" +#include "result-codes.h" +#include "symbol-table.h" +#include "words-table.h" +#include "token.h" #include "renderer/renderers.h" static struct varnam_internal* diff --git a/varnam.h b/varnam.h index 86af4f9..7f4f207 100644 --- a/varnam.h +++ b/varnam.h @@ -22,9 +22,9 @@ #include -#include "varnam-util.h" -#include "varnam-types.h" -#include "varnam-result-codes.h" -#include "varnam-api.h" +#include "util.h" +#include "vtypes.h" +#include "result-codes.h" +#include "api.h" #endif diff --git a/varnam-array.c b/varray.c similarity index 98% rename from varnam-array.c rename to varray.c index 00c7de6..4e40d0a 100644 --- a/varnam-array.c +++ b/varray.c @@ -20,8 +20,8 @@ #include #include #include -#include "varnam-array.h" -#include "varnam-util.h" +#include "varray.h" +#include "util.h" varray* varray_init() diff --git a/varnam-array.h b/varray.h similarity index 97% rename from varnam-array.h rename to varray.h index fcc83bc..98536a4 100644 --- a/varnam-array.h +++ b/varray.h @@ -19,8 +19,8 @@ #ifndef VARNAM_ARRAY_H_INCLUDED_0924 #define VARNAM_ARRAY_H_INCLUDED_0924 -#include "varnam-types.h" -#include "varnam-util.h" +#include "vtypes.h" +#include "util.h" /** * Array to hold pointers. This expands automatically. diff --git a/varnam-types.h b/vtypes.h similarity index 99% rename from varnam-types.h rename to vtypes.h index b29d729..dd96e39 100644 --- a/varnam-types.h +++ b/vtypes.h @@ -19,7 +19,7 @@ #ifndef VARNAMLIB_H_INCLUDED_103830 #define VARNAMLIB_H_INCLUDED_103830 -#include "foreign/sqlite3.h" +#include "deps/sqlite3.h" #define VARNAM_SYMBOL_MAX 30 #define VARNAM_LIB_TEMP_BUFFER_SIZE 100 diff --git a/vword.c b/vword.c index bc4c4e1..38509bc 100644 --- a/vword.c +++ b/vword.c @@ -19,8 +19,8 @@ #include #include "vword.h" -#include "varnam-types.h" -#include "varnam-array.h" +#include "vtypes.h" +#include "varray.h" static void initialize_word(vword *word, const char *text, int confidence) diff --git a/vword.h b/vword.h index 9732e66..1e22857 100644 --- a/vword.h +++ b/vword.h @@ -20,7 +20,7 @@ #ifndef VWORD_H_INCLUDED_0631 #define VWORD_H_INCLUDED_0631 -#include "varnam-types.h" +#include "vtypes.h" /* * Constructor for vword diff --git a/varnam-words-table.c b/words-table.c similarity index 98% rename from varnam-words-table.c rename to words-table.c index 9f457b4..c281831 100644 --- a/varnam-words-table.c +++ b/words-table.c @@ -18,13 +18,14 @@ #include -#include "varnam-symbol-table.h" -#include "varnam-util.h" -#include "varnam-types.h" -#include "varnam-result-codes.h" -#include "varnam-api.h" -#include "varnam-token.h" +#include "symbol-table.h" +#include "util.h" +#include "vtypes.h" +#include "result-codes.h" +#include "api.h" +#include "token.h" #include "rendering.h" +#include "varray.h" #define MAXIMUM_PATTERNS_TO_LEARN 150 diff --git a/varnam-words-table.h b/words-table.h similarity index 96% rename from varnam-words-table.h rename to words-table.h index b7852b7..668fb84 100644 --- a/varnam-words-table.h +++ b/words-table.h @@ -20,8 +20,8 @@ #ifndef VARNAM_WORDS_TABLE_H_INCLUDED #define VARNAM_WORDS_TABLE_H_INCLUDED -#include "varnam-types.h" -#include "varnam-array.h" +#include "vtypes.h" +#include "varray.h" int vwt_ensure_schema_exists(varnam *handle);