null+****@clear*****
null+****@clear*****
2012年 4月 10日 (火) 11:38:56 JST
Kouhei Sutou 2012-04-10 11:38:56 +0900 (Tue, 10 Apr 2012)
New Revision: 8052d241820b4a9329b256a31c6919eb13bd17e3
Log:
Move constants to mrn_constants.hpp
Copied files:
mrn_constants.hpp
(from mrn_sys.hpp)
Modified files:
Makefile.am
lib/mrn_index_table_name.hpp
lib/mrn_path_mapper.hpp
mrn_sys.hpp
Modified: Makefile.am (+1 -0)
===================================================================
--- Makefile.am 2012-04-10 10:06:55 +0900 (d0d6e98)
+++ Makefile.am 2012-04-10 11:38:56 +0900 (69f9d38)
@@ -8,6 +8,7 @@ ACLOCAL_AMFLAGS = $$ACLOCAL_ARGS
noinst_HEADERS = \
mrn_macro.h \
mrn_sys.hpp \
+ mrn_constants.hpp \
ha_mroonga.hpp \
mrn_table.hpp \
mrn_err.h \
Modified: lib/mrn_index_table_name.hpp (+1 -1)
===================================================================
--- lib/mrn_index_table_name.hpp 2012-04-10 10:06:55 +0900 (d178d05)
+++ lib/mrn_index_table_name.hpp 2012-04-10 11:38:56 +0900 (b21a8fb)
@@ -21,7 +21,7 @@
#ifndef MRN_INDEX_TABLE_NAME_MAPPER_HPP_
#define MRN_INDEX_TABLE_NAME_HPP_
-#include "mrn_sys.hpp"
+#include <mrn_constants.hpp>
namespace mrn {
class IndexTableName {
Modified: lib/mrn_path_mapper.hpp (+1 -1)
===================================================================
--- lib/mrn_path_mapper.hpp 2012-04-10 10:06:55 +0900 (ca4115e)
+++ lib/mrn_path_mapper.hpp 2012-04-10 11:38:56 +0900 (018d58e)
@@ -22,7 +22,7 @@
#ifndef MRN_PATH_MAPPER_HPP_
#define MRN_PATH_MAPPER_HPP_
-#include "mrn_sys.hpp"
+#include <mrn_constants.hpp>
namespace mrn {
class PathMapper {
Copied: mrn_constants.hpp (+4 -14) 78%
===================================================================
--- mrn_sys.hpp 2012-04-10 10:06:55 +0900 (90d20cd)
+++ mrn_constants.hpp 2012-04-10 11:38:56 +0900 (6ebce2b)
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2010 Tetsuro IKEDA
Copyright(C) 2011 Kentoku SHIBA
@@ -18,15 +19,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _mrn_sys_hpp
-#define _mrn_sys_hpp
+#ifndef MRN_CONSTANTS_HPP_
+#define MRN_CONSTANTS_HPP_
#include <groonga.h>
-#include "mrn_macro.h"
-MRN_BEGIN_DECLS
-
-/* constants */
#define MRN_BUFFER_SIZE 1024
#define MRN_MAX_KEY_SIZE GRN_TABLE_MAX_KEY_SIZE
#if defined(MAX_PATH)
@@ -47,11 +44,4 @@ MRN_BEGIN_DECLS
# define MRN_PARSER_DEFAULT "TokenBigram"
#endif
-/* functions */
-bool mrn_hash_put(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj *value);
-bool mrn_hash_get(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj **value);
-bool mrn_hash_remove(grn_ctx *ctx, grn_hash *hash, const char *key);
-
-MRN_END_DECLS
-
-#endif /* _mrn_sys_hpp */
+#endif /* MRN_CONSTANTS_HPP_ */
Modified: mrn_sys.hpp (+0 -21)
===================================================================
--- mrn_sys.hpp 2012-04-10 10:06:55 +0900 (90d20cd)
+++ mrn_sys.hpp 2012-04-10 11:38:56 +0900 (23c2f1a)
@@ -26,27 +26,6 @@
MRN_BEGIN_DECLS
-/* constants */
-#define MRN_BUFFER_SIZE 1024
-#define MRN_MAX_KEY_SIZE GRN_TABLE_MAX_KEY_SIZE
-#if defined(MAX_PATH)
-# define MRN_MAX_PATH_SIZE (MAX_PATH + 1)
-#elif defined(PATH_MAX)
-# define MRN_MAX_PATH_SIZE (PATH_MAX)
-#elif defined(MAXPATHLEN)
-# define MRN_MAX_PATH_SIZE (MAXPATHLEN)
-#else
-# define MRN_MAX_PATH_SIZE (256)
-#endif
-#define MRN_DB_FILE_SUFFIX ".mrn"
-#define MRN_LOG_FILE_PATH "groonga.log"
-#define MRN_COLUMN_NAME_ID "_id"
-#define MRN_COLUMN_NAME_KEY "_key"
-#define MRN_COLUMN_NAME_SCORE "_score"
-#ifndef MRN_PARSER_DEFAULT
-# define MRN_PARSER_DEFAULT "TokenBigram"
-#endif
-
/* functions */
bool mrn_hash_put(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj *value);
bool mrn_hash_get(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj **value);