From: Fedor Yudanov Date: Wed, 17 Apr 2013 11:31:27 +0000 (+0700) Subject: #50 - documentation using RDoc X-Git-Tag: v1.2.12~296^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11646925e1a9c0db1c4688a4785c20c5735c8136;p=platform%2Fupstream%2Fejdb.git #50 - documentation using RDoc --- diff --git a/rbejdb/src/rbbson.c b/rbejdb/src/rbbson.c index 9909790..1b3a961 100644 --- a/rbejdb/src/rbbson.c +++ b/rbejdb/src/rbbson.c @@ -1,9 +1,22 @@ +/************************************************************************************************** + * Ruby BSON API for EJDB database library http://ejdb.org + * Copyright (C) 2012-2013 Softmotions Ltd + * + * This file is part of EJDB. + * EJDB is free software; you can redistribute it and/or modify it under the terms of + * the GNU Lesser General Public License as published by the Free Software Foundation; either + * version 2.1 of the License or any later version. EJDB is distributed in the hope + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * You should have received a copy of the GNU Lesser General Public License along with EJDB; + * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA. + *************************************************************************************************/ #include "rbbson.h" #include -#include #include -#include #define BSON_CONTEXT_RUBY_CLASS "EJDB_BSON_CONTEXT" #define BSON_RUBY_CLASS "EJDB_BSON" diff --git a/rbejdb/src/rbejdb.c b/rbejdb/src/rbejdb.c index bf8ba58..2dec8ef 100644 --- a/rbejdb/src/rbejdb.c +++ b/rbejdb/src/rbejdb.c @@ -1212,7 +1212,7 @@ void EJDB_results_each(VALUE self) { * call-seq: * results.count -> Number * - * Returns total number of query result objects + * Returns total number of query result objects. */ VALUE EJDB_results_count(VALUE self) { RBEJDB_RESULTS* rbresults; @@ -1240,11 +1240,19 @@ VALUE EJDB_results_log(VALUE self) { return rbresults->log ? rb_str_new2(TCXSTRPTR(rbresults->log)) : Qnil; } -void EJDB_results_close(VALUE self) { +/* + * call-seq: + * results.close -> nil + * + * Closes query results and immediately frees memory taken for results. + * Calling this method invalidates results container and any further access attempts will cause +RuntimeError+. + */ +VALUE EJDB_results_close(VALUE self) { RBEJDB_RESULTS* rbresults; Data_Get_Struct(self, RBEJDB_RESULTS, rbresults); close_ejdb_results_internal(rbresults); + return Qnil; } /* @@ -1351,6 +1359,8 @@ Init_rbejdb() { rb_define_private_method(ejdbBinaryClass, "initialize", RUBY_METHOD_FUNC(EJDB_binary_init), 1); rb_define_method(ejdbBinaryClass, "each", RUBY_METHOD_FUNC(EJDB_binary_each), 0); - /* :nodoc: */ + /* + * Internal EJDB class. :nodoc: + */ ejdbQueryClass = rb_define_class("EJDBQuery", rb_cObject); } \ No newline at end of file