From 6375639917a913c542967b33be01003a2b67c144 Mon Sep 17 00:00:00 2001 From: David Siaw Date: Mon, 26 Aug 2019 02:08:33 +0900 Subject: [PATCH] fix lots of warnings and make logo not so big --- README.md | 13 ++ doc/mruby_logo_red_icon.png | Bin 3755 -> 8561 bytes include/mruby.h | 236 +++++++++++++++++++----------------- include/mruby/error.h | 8 +- include/mruby/string.h | 115 +++++++++--------- include/mruby/variable.h | 3 - src/class.c | 3 +- tasks/doc.rake | 10 ++ 8 files changed, 212 insertions(+), 176 deletions(-) diff --git a/README.md b/README.md index 863560ebc..ec3492530 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,19 @@ Or $ ruby ./minirake test +## Building documentation + +There are two sets of documentation in mruby: the mruby API (generated by yard) and C API (Doxygen) + +To build both of them, simply go + + rake doc + +You can also view them in your browser + + rake view_api + rake view_capi + ## How to customize mruby (mrbgems) mruby contains a package manager called *mrbgems*. To create extensions diff --git a/doc/mruby_logo_red_icon.png b/doc/mruby_logo_red_icon.png index 0849085428d7ef7aeb64bab479ab501f611fff1c..9006c84eb9c2077ef14f11f039418a318ce0b5dc 100644 GIT binary patch literal 8561 zcmV-%A&%aOP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1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LQUSn6^T#j?ge|*W6qwe6Ud_TUNP2b!-bS!b^iNk2WINwdB zd*|z4G_9%$h5v3zqb0rece^Q!&RQN zv-uj+TkXWO^|!IJlyAyZ@7xhJpZj5%@g(E%g}u*eLae`AssZu=45`;!CU1;1;6f2% znH)c%7Xps!Z@EfSrm>N;g6&swCqq`I$wWG4!3)8%_3OQmR7BdE202%e7Ka#3R@=sNTN{0A6Kv#$Dr1R4Iv4UHcwGx9pKce16qwsvo%R<1T$1#QhpBJvnod?MK9Q(s1?aiv6K_H))AY?FJl))|$W1zWBB z(?u@o6?X+B3Oj5m`9yS_c;w7aks#fY49>;y`O^NWi5E;1x14#tHxMgqP@k*OXOa%n zzeP$zo(@}^vO~ocySX+{bP0fWXMgx!eGY|FOZpu<)q}Ci%J|~*aF%9Tyg)2JQw5+C zk>ns38DHv@x6b1g9n5cdC*2Bp`nS~h0kY=TVr3x`X7GP__>)UjLGYar4LS1PBWG#| KGpN^d!~PG;fHFk@ diff --git a/include/mruby.h b/include/mruby.h index 87ccd8c05..52c233211 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -177,7 +177,16 @@ struct mrb_context { # define MRB_METHOD_CACHE_SIZE (1<<7) #endif -typedef mrb_value (*mrb_func_t)(struct mrb_state *mrb, mrb_value); +/** + * Function pointer type for a function callable by mruby. + * + * The arguments to the function are stored on the mrb_state. To get them see mrb_get_args + * + * @param mrb The mruby state + * @param self The self object + * @return [mrb_value] The function's return value + */ +typedef mrb_value (*mrb_func_t)(struct mrb_state *mrb, mrb_value self); #ifdef MRB_METHOD_TABLE_INLINE typedef uintptr_t mrb_method_t; @@ -292,9 +301,9 @@ typedef struct mrb_state { * //free(TheAnimals); * } * - * @param [mrb_state *] mrb The current mruby state. - * @param [const char *] name The name of the defined class. - * @param [struct RClass *] super The new class parent. + * @param mrb The current mruby state. + * @param name The name of the defined class. + * @param super The new class parent. * @return [struct RClass *] Reference to the newly defined class. * @see mrb_define_class_under */ @@ -303,12 +312,12 @@ MRB_API struct RClass *mrb_define_class(mrb_state *mrb, const char *name, struct /** * Defines a new module. * - * @param [mrb_state *] mrb_state* The current mruby state. - * @param [const char *] char* The name of the module. + * @param mrb The current mruby state. + * @param name The name of the module. * @return [struct RClass *] Reference to the newly defined module. */ -MRB_API struct RClass *mrb_define_module(mrb_state *, const char*); -MRB_API mrb_value mrb_singleton_class(mrb_state*, mrb_value); +MRB_API struct RClass *mrb_define_module(mrb_state *mrb, const char *name); +MRB_API mrb_value mrb_singleton_class(mrb_state *mrb, mrb_value val); /** * Include a module in another class or module. @@ -317,11 +326,11 @@ MRB_API mrb_value mrb_singleton_class(mrb_state*, mrb_value); * module B * include A * end - * @param [mrb_state *] mrb_state* The current mruby state. - * @param [struct RClass *] RClass* A reference to module or a class. - * @param [struct RClass *] RClass* A reference to the module to be included. + * @param mrb The current mruby state. + * @param cla A reference to module or a class. + * @param included A reference to the module to be included. */ -MRB_API void mrb_include_module(mrb_state*, struct RClass*, struct RClass*); +MRB_API void mrb_include_module(mrb_state *mrb, struct RClass *cla, struct RClass *included); /** * Prepends a module in another class or module. @@ -330,11 +339,11 @@ MRB_API void mrb_include_module(mrb_state*, struct RClass*, struct RClass*); * module B * prepend A * end - * @param [mrb_state *] mrb_state* The current mruby state. - * @param [struct RClass *] RClass* A reference to module or a class. - * @param [struct RClass *] RClass* A reference to the module to be prepended. + * @param mrb The current mruby state. + * @param cla A reference to module or a class. + * @param prepended A reference to the module to be prepended. */ -MRB_API void mrb_prepend_module(mrb_state*, struct RClass*, struct RClass*); +MRB_API void mrb_prepend_module(mrb_state *mrb, struct RClass *cla, struct RClass *prepended); /** * Defines a global function in ruby. @@ -343,7 +352,6 @@ MRB_API void mrb_prepend_module(mrb_state*, struct RClass*, struct RClass*); * * Example: * - * !!!c * mrb_value example_method(mrb_state* mrb, mrb_value self) * { * puts("Executing example command!"); @@ -355,11 +363,11 @@ MRB_API void mrb_prepend_module(mrb_state*, struct RClass*, struct RClass*); * mrb_define_method(mrb, mrb->kernel_module, "example_method", example_method, MRB_ARGS_NONE()); * } * - * @param [mrb_state *] mrb The MRuby state reference. - * @param [struct RClass *] cla The class pointer where the method will be defined. - * @param [const char *] name The name of the method being defined. - * @param [mrb_func_t] func The function pointer to the method definition. - * @param [mrb_aspec] aspec The method parameters declaration. + * @param mrb The MRuby state reference. + * @param cla The class pointer where the method will be defined. + * @param name The name of the method being defined. + * @param func The function pointer to the method definition. + * @param aspec The method parameters declaration. */ MRB_API void mrb_define_method(mrb_state *mrb, struct RClass *cla, const char *name, mrb_func_t func, mrb_aspec aspec); @@ -382,14 +390,20 @@ MRB_API void mrb_define_method(mrb_state *mrb, struct RClass *cla, const char *n * foo = mrb_define_class(mrb, "Foo", mrb->object_class); * mrb_define_class_method(mrb, foo, "bar", bar_method, MRB_ARGS_NONE()); * } - * @param [mrb_state *] mrb_state* The MRuby state reference. - * @param [struct RClass *] RClass* The class where the class method will be defined. - * @param [const char *] char* The name of the class method being defined. - * @param [mrb_func_t] mrb_func_t The function pointer to the class method definition. - * @param [mrb_aspec] mrb_aspec The method parameters declaration. + * @param mrb The MRuby state reference. + * @param cla The class where the class method will be defined. + * @param name The name of the class method being defined. + * @param fun The function pointer to the class method definition. + * @param aspec The method parameters declaration. */ -MRB_API void mrb_define_class_method(mrb_state *, struct RClass *, const char *, mrb_func_t, mrb_aspec); -MRB_API void mrb_define_singleton_method(mrb_state*, struct RObject*, const char*, mrb_func_t, mrb_aspec); +MRB_API void mrb_define_class_method(mrb_state *mrb, struct RClass *cla, const char *name, mrb_func_t fun, mrb_aspec aspec); + +/** + * Defines a singleton method + * + * @see mrb_define_class_method + */ +MRB_API void mrb_define_singleton_method(mrb_state *mrb, struct RObject *cla, const char *name, mrb_func_t fun, mrb_aspec aspec); /** * Defines a module function. @@ -410,13 +424,13 @@ MRB_API void mrb_define_singleton_method(mrb_state*, struct RObject*, const char * foo = mrb_define_module(mrb, "Foo"); * mrb_define_module_function(mrb, foo, "bar", bar_method, MRB_ARGS_NONE()); * } - * @param [mrb_state *] mrb_state* The MRuby state reference. - * @param [struct RClass *] RClass* The module where the module function will be defined. - * @param [const char *] char* The name of the module function being defined. - * @param [mrb_func_t] mrb_func_t The function pointer to the module function definition. - * @param [mrb_aspec] mrb_aspec The method parameters declaration. + * @param mrb The MRuby state reference. + * @param cla The module where the module function will be defined. + * @param name The name of the module function being defined. + * @param fun The function pointer to the module function definition. + * @param aspec The method parameters declaration. */ -MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*, mrb_func_t, mrb_aspec); +MRB_API void mrb_define_module_function(mrb_state *mrb, struct RClass *cla, const char *name, mrb_func_t fun, mrb_aspec aspec); /** * Defines a constant. @@ -439,12 +453,12 @@ MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*, * mrb_value * mrb_example_gem_final(mrb_state* mrb){ * } - * @param [mrb_state *] mrb_state* The MRuby state reference. - * @param [struct RClass *] RClass* A class or module the constant is defined in. - * @param [const char *] name The name of the constant being defined. - * @param [mrb_value] mrb_value The value for the constant. + * @param mrb The MRuby state reference. + * @param cla A class or module the constant is defined in. + * @param name The name of the constant being defined. + * @param val The value for the constant. */ -MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_value); +MRB_API void mrb_define_const(mrb_state* mrb, struct RClass* cla, const char *name, mrb_value val); /** * Undefines a method. @@ -490,11 +504,11 @@ MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_ * * mrb_example_gem_final(mrb_state* mrb){ * } - * @param [mrb_state*] mrb_state* The mruby state reference. - * @param [struct RClass*] RClass* A class the method will be undefined from. - * @param [const char*] const char* The name of the method to be undefined. + * @param mrb The mruby state reference. + * @param cla The class the method will be undefined from. + * @param name The name of the method to be undefined. */ -MRB_API void mrb_undef_method(mrb_state*, struct RClass*, const char*); +MRB_API void mrb_undef_method(mrb_state *mrb, struct RClass *cla, const char *name); MRB_API void mrb_undef_method_id(mrb_state*, struct RClass*, mrb_sym); /** @@ -530,11 +544,11 @@ MRB_API void mrb_undef_method_id(mrb_state*, struct RClass*, mrb_sym); * void * mrb_example_gem_final(mrb_state* mrb){ * } - * @param [mrb_state*] mrb_state* The mruby state reference. - * @param [RClass*] RClass* A class the class method will be undefined from. - * @param [const char*] const char* The name of the class method to be undefined. + * @param mrb The mruby state reference. + * @param cls A class the class method will be undefined from. + * @param name The name of the class method to be undefined. */ -MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*); +MRB_API void mrb_undef_class_method(mrb_state *mrb, struct RClass *cls, const char *name); /** * Initialize a new object instance of c class. @@ -558,10 +572,10 @@ MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*); * obj = mrb_obj_new(mrb, example_class, 0, NULL); # => ExampleClass.new * mrb_p(mrb, obj); // => Kernel#p * } - * @param [mrb_state*] mrb The current mruby state. - * @param [RClass*] c Reference to the class of the new object. - * @param [mrb_int] argc Number of arguments in argv - * @param [const mrb_value *] argv Array of mrb_value to initialize the object + * @param mrb The current mruby state. + * @param c Reference to the class of the new object. + * @param argc Number of arguments in argv + * @param argv Array of mrb_value to initialize the object * @return [mrb_value] The newly initialized object */ MRB_API mrb_value mrb_obj_new(mrb_state *mrb, struct RClass *c, mrb_int argc, const mrb_value *argv); @@ -587,8 +601,8 @@ MRB_INLINE mrb_value mrb_class_new_instance(mrb_state *mrb, mrb_int argc, const * mrb_p(mrb, obj); // => Kernel#p * } * - * @param [mrb_state*] mrb The current mruby state. - * @param [struct RClass *] super The super class or parent. + * @param mrb The current mruby state. + * @param super The super class or parent. * @return [struct RClass *] Reference to the new class. */ MRB_API struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super); @@ -604,7 +618,7 @@ MRB_API struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super); * example_module = mrb_module_new(mrb); * } * - * @param [mrb_state*] mrb The current mruby state. + * @param mrb The current mruby state. * @return [struct RClass *] Reference to the new module. */ MRB_API struct RClass * mrb_module_new(mrb_state *mrb); @@ -631,24 +645,24 @@ MRB_API struct RClass * mrb_module_new(mrb_state *mrb); * } * } * - * @param [mrb_state*] mrb The current mruby state. - * @param [const char *] name A string representing the name of the class. + * @param mrb The current mruby state. + * @param name A string representing the name of the class. * @return [mrb_bool] A boolean value. */ MRB_API mrb_bool mrb_class_defined(mrb_state *mrb, const char *name); /** * Gets a class. - * @param [mrb_state*] mrb The current mruby state. - * @param [const char *] name The name of the class. + * @param mrb The current mruby state. + * @param name The name of the class. * @return [struct RClass *] A reference to the class. */ MRB_API struct RClass * mrb_class_get(mrb_state *mrb, const char *name); /** * Gets a exception class. - * @param [mrb_state*] mrb The current mruby state. - * @param [const char *] name The name of the class. + * @param mrb The current mruby state. + * @param name The name of the class. * @return [struct RClass *] A reference to the class. */ MRB_API struct RClass * mrb_exc_get(mrb_state *mrb, const char *name); @@ -677,35 +691,35 @@ MRB_API struct RClass * mrb_exc_get(mrb_state *mrb, const char *name); * } * } * - * @param [mrb_state*] mrb The current mruby state. - * @param [struct RClass *] outer The name of the outer class. - * @param [const char *] name A string representing the name of the inner class. + * @param mrb The current mruby state. + * @param outer The name of the outer class. + * @param name A string representing the name of the inner class. * @return [mrb_bool] A boolean value. */ MRB_API mrb_bool mrb_class_defined_under(mrb_state *mrb, struct RClass *outer, const char *name); /** * Gets a child class. - * @param [mrb_state*] mrb The current mruby state. - * @param [struct RClass *] outer The name of the parent class. - * @param [const char *] name The name of the class. + * @param mrb The current mruby state. + * @param outer The name of the parent class. + * @param name The name of the class. * @return [struct RClass *] A reference to the class. */ MRB_API struct RClass * mrb_class_get_under(mrb_state *mrb, struct RClass *outer, const char *name); /** * Gets a module. - * @param [mrb_state*] mrb The current mruby state. - * @param [const char *] name The name of the module. + * @param mrb The current mruby state. + * @param name The name of the module. * @return [struct RClass *] A reference to the module. */ MRB_API struct RClass * mrb_module_get(mrb_state *mrb, const char *name); /** * Gets a module defined under another module. - * @param [mrb_state*] mrb The current mruby state. - * @param [struct RClass *] outer The name of the outer module. - * @param [const char *] name The name of the module. + * @param mrb The current mruby state. + * @param outer The name of the outer module. + * @param name The name of the module. * @return [struct RClass *] A reference to the module. */ MRB_API struct RClass * mrb_module_get_under(mrb_state *mrb, struct RClass *outer, const char *name); @@ -719,8 +733,8 @@ MRB_API mrb_value mrb_notimplement_m(mrb_state*, mrb_value); * * Equivalent to: * Object#dup - * @param [mrb_state*] mrb The current mruby state. - * @param [mrb_value] obj Object to be duplicate. + * @param mrb The current mruby state. + * @param obj Object to be duplicate. * @return [mrb_value] The newly duplicated object. */ MRB_API mrb_value mrb_obj_dup(mrb_state *mrb, mrb_value obj); @@ -760,9 +774,9 @@ MRB_API mrb_value mrb_obj_dup(mrb_state *mrb, mrb_value obj); * } * } * - * @param [mrb_state*] mrb The current mruby state. - * @param [struct RClass *] c A reference to a class. - * @param [mrb_sym] mid A symbol referencing a method id. + * @param mrb The current mruby state. + * @param c A reference to a class. + * @param mid A symbol referencing a method id. * @return [mrb_bool] A boolean value. */ MRB_API mrb_bool mrb_obj_respond_to(mrb_state *mrb, struct RClass* c, mrb_sym mid); @@ -770,10 +784,10 @@ MRB_API mrb_bool mrb_obj_respond_to(mrb_state *mrb, struct RClass* c, mrb_sym mi /** * Defines a new class under a given module * - * @param [mrb_state*] mrb The current mruby state. - * @param [struct RClass *] outer Reference to the module under which the new class will be defined - * @param [const char *] name The name of the defined class - * @param [struct RClass *] super The new class parent + * @param mrb The current mruby state. + * @param outer Reference to the module under which the new class will be defined + * @param name The name of the defined class + * @param super The new class parent * @return [struct RClass *] Reference to the newly defined class * @see mrb_define_class */ @@ -854,7 +868,7 @@ MRB_API struct RClass * mrb_define_module_under(mrb_state *mrb, struct RClass *o * | `I` | inline struct | void * | | * | `&` | block | {mrb_value} | &! raises exception if no block given. | * | `*` | rest arguments | {mrb_value} *, {mrb_int} | Receive the rest of arguments as an array; `*!` avoid copy of the stack. | - * | | | optional | | After this spec following specs would be optional. | + * | \| | optional | | After this spec following specs would be optional. | * | `?` | optional given | {mrb_bool} | `TRUE` if preceding argument is given. Used to check optional argument is given. | * * @see mrb_get_args @@ -865,7 +879,7 @@ typedef const char *mrb_args_format; * Retrieve arguments from mrb_state. * * @param mrb The current MRuby state. - * @param format [mrb_args_format] is a list of format specifiers + * @param format is a list of format specifiers * @param ... The passing variadic arguments must be a pointer of retrieving type. * @return the number of arguments retrieved. * @see mrb_args_format @@ -898,6 +912,8 @@ MRB_API mrb_value* mrb_get_argv(mrb_state *mrb); /** * Call existing ruby functions. * + * Example: + * * #include * #include * #include "mruby/compile.h" @@ -914,15 +930,16 @@ MRB_API mrb_value* mrb_get_argv(mrb_state *mrb); * mrb_funcall(mrb, obj, "method_name", 1, mrb_fixnum_value(i)); * fclose(fp); * mrb_close(mrb); - * } - * @param [mrb_state*] mrb_state* The current mruby state. - * @param [mrb_value] mrb_value A reference to an mruby value. - * @param [const char*] const char* The name of the method. - * @param [mrb_int] mrb_int The number of arguments the method has. - * @param [...] ... Variadic values(not type safe!). - * @return [mrb_value] mrb_value mruby function value. + * } + * + * @param mrb The current mruby state. + * @param val A reference to an mruby value. + * @param name The name of the method. + * @param argc The number of arguments the method has. + * @param ... Variadic values(not type safe!). + * @return [mrb_value] mruby function value. */ -MRB_API mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, mrb_int,...); +MRB_API mrb_value mrb_funcall(mrb_state *mrb, mrb_value val, const char *name, mrb_int argc, ...); /** * Call existing ruby functions. This is basically the type safe version of mrb_funcall. * @@ -944,15 +961,15 @@ MRB_API mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, mrb_int,...); * fclose(fp); * mrb_close(mrb); * } - * @param [mrb_state*] mrb_state* The current mruby state. - * @param [mrb_value] mrb_value A reference to an mruby value. - * @param [mrb_sym] mrb_sym The symbol representing the method. - * @param [mrb_int] mrb_int The number of arguments the method has. - * @param [const mrb_value*] mrb_value* Pointer to the object. + * @param mrb The current mruby state. + * @param val A reference to an mruby value. + * @param name_sym The symbol representing the method. + * @param argc The number of arguments the method has. + * @param obj Pointer to the object. * @return [mrb_value] mrb_value mruby function value. * @see mrb_funcall */ -MRB_API mrb_value mrb_funcall_argv(mrb_state*, mrb_value, mrb_sym, mrb_int, const mrb_value*); +MRB_API mrb_value mrb_funcall_argv(mrb_state *mrb, mrb_value val, mrb_sym name_sym, mrb_int argc, const mrb_value* obj); /** * Call existing ruby functions with a block. */ @@ -960,16 +977,19 @@ MRB_API mrb_value mrb_funcall_with_block(mrb_state*, mrb_value, mrb_sym, mrb_int /** * Create a symbol * + * Example: + * * # Ruby style: * :pizza # => :pizza * * // C style: * mrb_sym m_sym = mrb_intern_lit(mrb, "pizza"); // => :pizza - * @param [mrb_state*] mrb_state* The current mruby state. - * @param [const char*] const char* The name of the method. + * + * @param mrb The current mruby state. + * @param str The string to be symbolized * @return [mrb_sym] mrb_sym A symbol. */ -MRB_API mrb_sym mrb_intern_cstr(mrb_state*,const char*); +MRB_API mrb_sym mrb_intern_cstr(mrb_state *mrb, const char* str); MRB_API mrb_sym mrb_intern(mrb_state*,const char*,size_t); MRB_API mrb_sym mrb_intern_static(mrb_state*,const char*,size_t); #define mrb_intern_lit(mrb, lit) mrb_intern_static(mrb, lit, mrb_strlen_lit(lit)) @@ -1220,31 +1240,31 @@ MRB_API mrb_bool mrb_obj_is_instance_of(mrb_state *mrb, mrb_value obj, struct RC MRB_API mrb_bool mrb_func_basic_p(mrb_state *mrb, mrb_value obj, mrb_sym mid, mrb_func_t func); -/* +/** * Resume a Fiber * - * @mrbgem mruby-fiber + * Implemented in mruby-fiber */ MRB_API mrb_value mrb_fiber_resume(mrb_state *mrb, mrb_value fib, mrb_int argc, const mrb_value *argv); -/* +/** * Yield a Fiber * - * @mrbgem mruby-fiber + * Implemented in mruby-fiber */ MRB_API mrb_value mrb_fiber_yield(mrb_state *mrb, mrb_int argc, const mrb_value *argv); -/* +/** * Check if a Fiber is alive * - * @mrbgem mruby-fiber + * Implemented in mruby-fiber */ MRB_API mrb_value mrb_fiber_alive_p(mrb_state *mrb, mrb_value fib); -/* +/** * FiberError reference * - * @mrbgem mruby-fiber + * Implemented in mruby-fiber */ #define E_FIBER_ERROR (mrb_exc_get(mrb, "FiberError")) MRB_API void mrb_stack_extend(mrb_state*, mrb_int); diff --git a/include/mruby/error.h b/include/mruby/error.h index 5aa8bbda9..15855f96e 100644 --- a/include/mruby/error.h +++ b/include/mruby/error.h @@ -69,14 +69,14 @@ mrb_break_value_set(struct RBreak *brk, mrb_value val) /** * Protect * - * @mrbgem mruby-error + * Implemented in the mruby-error mrbgem */ MRB_API mrb_value mrb_protect(mrb_state *mrb, mrb_func_t body, mrb_value data, mrb_bool *state); /** * Ensure * - * @mrbgem mruby-error + * Implemented in the mruby-error mrbgem */ MRB_API mrb_value mrb_ensure(mrb_state *mrb, mrb_func_t body, mrb_value b_data, mrb_func_t ensure, mrb_value e_data); @@ -84,7 +84,7 @@ MRB_API mrb_value mrb_ensure(mrb_state *mrb, mrb_func_t body, mrb_value b_data, /** * Rescue * - * @mrbgem mruby-error + * Implemented in the mruby-error mrbgem */ MRB_API mrb_value mrb_rescue(mrb_state *mrb, mrb_func_t body, mrb_value b_data, mrb_func_t rescue, mrb_value r_data); @@ -92,7 +92,7 @@ MRB_API mrb_value mrb_rescue(mrb_state *mrb, mrb_func_t body, mrb_value b_data, /** * Rescue exception * - * @mrbgem mruby-error + * Implemented in the mruby-error mrbgem */ MRB_API mrb_value mrb_rescue_exceptions(mrb_state *mrb, mrb_func_t body, mrb_value b_data, mrb_func_t rescue, mrb_value r_data, diff --git a/include/mruby/string.h b/include/mruby/string.h index 84a6c4665..fd078b9f3 100644 --- a/include/mruby/string.h +++ b/include/mruby/string.h @@ -136,9 +136,8 @@ MRB_API mrb_int mrb_str_index(mrb_state*, mrb_value, const char*, mrb_int, mrb_i * Appends self to other. Returns self as a concatenated string. * * - * Example: + * Example: * - * !!!c * int * main(int argc, * char **argv) @@ -160,32 +159,30 @@ MRB_API mrb_int mrb_str_index(mrb_state*, mrb_value, const char*, mrb_int, mrb_i * // Concatenates str2 to str1. * mrb_str_concat(mrb, str1, str2); * - * // Prints new Concatenated Ruby string. - * mrb_p(mrb, str1); + * // Prints new Concatenated Ruby string. + * mrb_p(mrb, str1); * - * mrb_close(mrb); - * return 0; - * } + * mrb_close(mrb); + * return 0; + * } * - * - * Result: + * Result: * * => "abcdef" * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] self String to concatenate. - * @param [mrb_value] other String to append to self. + * @param mrb The current mruby state. + * @param self String to concatenate. + * @param other String to append to self. * @return [mrb_value] Returns a new String appending other to self. */ -MRB_API void mrb_str_concat(mrb_state*, mrb_value, mrb_value); +MRB_API void mrb_str_concat(mrb_state *mrb, mrb_value self, mrb_value other); /** * Adds two strings together. * * - * Example: + * Example: * - * !!!c * int * main(int argc, * char **argv) @@ -212,41 +209,41 @@ MRB_API void mrb_str_concat(mrb_state*, mrb_value, mrb_value); * // Concatenates both Ruby strings. * c = mrb_str_plus(mrb, a, b); * - * // Prints new Concatenated Ruby string. - * mrb_p(mrb, c); + * // Prints new Concatenated Ruby string. + * mrb_p(mrb, c); * - * mrb_close(mrb); - * return 0; - * } + * mrb_close(mrb); + * return 0; + * } * * - * Result: + * Result: * * => "abc" # First string * => "def" # Second string * => "abcdef" # First & Second concatenated. * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] a First string to concatenate. - * @param [mrb_value] b Second string to concatenate. + * @param mrb The current mruby state. + * @param a First string to concatenate. + * @param b Second string to concatenate. * @return [mrb_value] Returns a new String containing a concatenated to b. */ -MRB_API mrb_value mrb_str_plus(mrb_state*, mrb_value, mrb_value); +MRB_API mrb_value mrb_str_plus(mrb_state *mrb, mrb_value a, mrb_value b); /** * Converts pointer into a Ruby string. * - * @param [mrb_state] mrb The current mruby state. - * @param [void*] p The pointer to convert to Ruby string. + * @param mrb The current mruby state. + * @param p The pointer to convert to Ruby string. * @return [mrb_value] Returns a new Ruby String. */ -MRB_API mrb_value mrb_ptr_to_str(mrb_state *, void*); +MRB_API mrb_value mrb_ptr_to_str(mrb_state *mrb, void *p); /** * Returns an object as a Ruby string. * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] obj An object to return as a Ruby string. + * @param mrb The current mruby state. + * @param obj An object to return as a Ruby string. * @return [mrb_value] An object as a Ruby string. */ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj); @@ -257,7 +254,6 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj); * * Example: * - * !!!c * int * main(int argc, * char **argv) @@ -282,11 +278,11 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj); * * Result: * - * => "Hello" + * => "Hello" * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] str The Ruby string to resize. - * @param [mrb_value] len The length. + * @param mrb The current mruby state. + * @param str The Ruby string to resize. + * @param len The length. * @return [mrb_value] An object as a Ruby string. */ MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len); @@ -294,9 +290,8 @@ MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len); /** * Returns a sub string. * - * Example: + * Example: * - * !!!c * int * main(int argc, * char const **argv) @@ -322,14 +317,14 @@ MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len); * return 0; * } * - * Result: + * Result: * * => "He" * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] str Ruby string. - * @param [mrb_int] beg The beginning point of the sub-string. - * @param [mrb_int] len The end point of the sub-string. + * @param mrb The current mruby state. + * @param str Ruby string. + * @param beg The beginning point of the sub-string. + * @param len The end point of the sub-string. * @return [mrb_value] An object as a Ruby sub-string. */ MRB_API mrb_value mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len); @@ -338,8 +333,8 @@ MRB_API mrb_value mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb * Returns a Ruby string type. * * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] str Ruby string. + * @param mrb The current mruby state. + * @param str Ruby string. * @return [mrb_value] A Ruby string. */ MRB_API mrb_value mrb_ensure_string_type(mrb_state *mrb, mrb_value str); @@ -364,8 +359,8 @@ MRB_API mrb_int mrb_string_value_len(mrb_state *mrb, mrb_value str); * Duplicates a string object. * * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] str Ruby string. + * @param mrb The current mruby state. + * @param str Ruby string. * @return [mrb_value] Duplicated Ruby string. */ MRB_API mrb_value mrb_str_dup(mrb_state *mrb, mrb_value str); @@ -373,8 +368,8 @@ MRB_API mrb_value mrb_str_dup(mrb_state *mrb, mrb_value str); /** * Returns a symbol from a passed in Ruby string. * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] self Ruby string. + * @param mrb The current mruby state. + * @param self Ruby string. * @return [mrb_value] A symbol. */ MRB_API mrb_value mrb_str_intern(mrb_state *mrb, mrb_value self); @@ -393,9 +388,9 @@ MRB_API mrb_value mrb_str_to_str(mrb_state *mrb, mrb_value str); /** * Returns true if the strings match and false if the strings don't match. * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] str1 Ruby string to compare. - * @param [mrb_value] str2 Ruby string to compare. + * @param mrb The current mruby state. + * @param str1 Ruby string to compare. + * @param str2 Ruby string to compare. * @return [mrb_value] boolean value. */ MRB_API mrb_bool mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2); @@ -403,10 +398,10 @@ MRB_API mrb_bool mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2); /** * Returns a concatenated string comprised of a Ruby string and a C string. * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] str Ruby string. - * @param [const char *] ptr A C string. - * @param [size_t] len length of C string. + * @param mrb The current mruby state. + * @param str Ruby string. + * @param ptr A C string. + * @param len length of C string. * @return [mrb_value] A Ruby string. * @see mrb_str_cat_cstr */ @@ -415,9 +410,9 @@ MRB_API mrb_value mrb_str_cat(mrb_state *mrb, mrb_value str, const char *ptr, si /** * Returns a concatenated string comprised of a Ruby string and a C string. * - * @param [mrb_state] mrb The current mruby state. - * @param [mrb_value] str Ruby string. - * @param [const char *] ptr A C string. + * @param mrb The current mruby state. + * @param str Ruby string. + * @param ptr A C string. * @return [mrb_value] A Ruby string. * @see mrb_str_cat */ @@ -446,8 +441,8 @@ MRB_API int mrb_str_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2); * - Caller can modify returned string without affecting Ruby string * (e.g. it can be used for mkstemp(3)). * - * @param [mrb_state *] mrb The current mruby state. - * @param [mrb_value] str Ruby string. Must be an instance of String. + * @param mrb The current mruby state. + * @param str Ruby string. Must be an instance of String. * @return [char *] A newly allocated C string. */ MRB_API char *mrb_str_to_cstr(mrb_state *mrb, mrb_value str); diff --git a/include/mruby/variable.h b/include/mruby/variable.h index 8ae33304d..6e918cf57 100644 --- a/include/mruby/variable.h +++ b/include/mruby/variable.h @@ -97,18 +97,15 @@ MRB_API void mrb_gv_set(mrb_state *mrb, mrb_sym sym, mrb_value val); * * Example: * - * !!!ruby * # Ruby style * $value = nil * - * !!!c * // C style * mrb_sym sym = mrb_intern_lit(mrb, "$value"); * mrb_gv_remove(mrb, sym); * * @param mrb The mruby state reference * @param sym The name of the global variable - * @param val The value of the global variable */ MRB_API void mrb_gv_remove(mrb_state *mrb, mrb_sym sym); diff --git a/src/class.c b/src/class.c index 43540dc3b..2be56a004 100644 --- a/src/class.c +++ b/src/class.c @@ -409,7 +409,7 @@ mrb_module_get(mrb_state *mrb, const char *name) /*! * Defines a class under the namespace of \a outer. * \param outer a class which contains the new class. - * \param id name of the new class + * \param name name of the new class * \param super a class from which the new class will derive. * NULL means \c Object class. * \return the created class @@ -1769,6 +1769,7 @@ mrb_alias_method(mrb_state *mrb, struct RClass *c, mrb_sym a, mrb_sym b) /*! * Defines an alias of a method. + * \param mrb the mruby state * \param klass the class which the original method belongs to * \param name1 a new name for the method * \param name2 the original name of the method diff --git a/tasks/doc.rake b/tasks/doc.rake index ab34b33b1..4aec2d0a1 100644 --- a/tasks/doc.rake +++ b/tasks/doc.rake @@ -36,3 +36,13 @@ end desc 'clean all built docs' task :clean_doc => [:clean_api_doc, :clean_capi_doc] do end + +desc 'clean all built docs' +task :view_api => [:api_doc] do + sh 'xdg-open doc/api/index.html' +end + +desc 'clean all built docs' +task :view_capi => [:capi_doc] do + sh 'xdg-open doc/capi/html/index.html' +end