\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Ryan Johnson (CITguy)} \pdfinfo{ /Title (extending-ruby-with-c-part-1.pdf) /Creator (Cheatography) /Author (Ryan Johnson (CITguy)) /Subject (Extending Ruby with C - Part 1 Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{CC0000} \definecolor{LightBackground}{HTML}{FBEFEF} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Extending Ruby with C - Part 1 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Ryan Johnson (CITguy)} via \textcolor{DarkBackground}{\uline{cheatography.com/138/cs/248/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Ryan Johnson (CITguy) \\ \uline{cheatography.com/citguy} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 15th February, 2012.\\ Updated 13th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Define Objects}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_define\_class}}(char *name, V superclass)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines new class at top level with given {\emph{name}} and {\emph{superclass}}.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_define\_module}}(char *name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines new module at top level with given {\emph{name}}.} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_define\_class\_under}}(V under, char *name, V superclass)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines nested class under class or module {\emph{under}}.} \tn % Row Count 10 (+ 4) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_define\_module\_under}}(V parent, V module)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines nested module under class or module {\emph{under}}.} \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_include\_module}}(V parent, V module)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Includes given {\emph{module}} into class or module {\emph{parent}}.} \tn % Row Count 16 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_extend\_object}}(V obj, V module)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Extends {\emph{obj}} with {\emph{module}}.} \tn % Row Count 18 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_require}}(const char *name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Equiv. to "require *name." Returns Qtrue or Qfalse.} \tn % Row Count 21 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V = VALUE} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Calling Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_funcall}}(V recv, ID id, int argc, ...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Invokes method given by {\emph{id}} in object {\emph{recv}} with given number of args {\emph{argc}} and args themselves.} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_funcall2}}(V recv, ID id, int argc, V *args)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Invokes method given by {\emph{id}} in object {\emph{recv}} with given number of args {\emph{argc}} and args themselves given in C array {\emph{args}}.} \tn % Row Count 9 (+ 5) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_funcall3}}(V recv, ID id, int argc, V *args)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Same as {\emph{rb\_funcall2}}, but will not call private methods.} \tn % Row Count 13 (+ 4) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_apply}}(V recv, ID name, int argc, V args)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Invokes method given by {\emph{id}} in object {\emph{recv}} with given number of args {\emph{argc}} and the args themselves given in Ruby Array {\emph{args}}.} \tn % Row Count 17 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{ID {\bf{rb\_intern}}(char *name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns ID for given {\emph{name}}. If name does not exist, a symbol table entry will be created for it.} \tn % Row Count 21 (+ 4) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{char * {\bf{rb\_id2name}}(ID id)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns a name for the given {\emph{id}}.} \tn % Row Count 23 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_call\_super}}(int argc, V *args)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Calls current method in superclass of current object.} \tn % Row Count 26 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V = VALUE} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Object Status}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{OBJ\_TAINT}}(VALUE obj)} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{OBJ\_FREEZE}}(VALUE obj)} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{int {\bf{OBJ\_TAINTED}}(VALUE obj) =\textgreater{} 0|nonzero} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{int {\bf{OBJ\_FROZEN}}(VALUE obj) =\textgreater{} 0|nonzero} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Defining Variables and Constants}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_const}}(VALUE classmod, char *name, VALUE value)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines constant in class or module {\emph{classmod}}, with given {\emph{name}} and {\emph{value}}.} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_global\_const}}(char *name, VALUE value)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines global constant with given {\emph{name}} and {\emph{value}}.} \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_variable}}(const char *name, VALUE *object)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Exports address of given {\emph{object}} that was created in C, to the Ruby namespace as {\emph{name}}. To Ruby, this will be a global variable, so {\emph{name}} should have "\$" prefix. Be sure to honor Ruby's rules for allowed variable names.} \tn % Row Count 15 (+ 7) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_class\_variable}}(VALUE class, const char *name, VALUE val)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines class variable {\emph{name}} (must specify "@@" prefix) in given {\emph{class}}, initialized to {\emph{value}}.} \tn % Row Count 20 (+ 5) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_virtual\_variable}}(const char *name, VALUE (*getter)(), void (*setter)())} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Exports virtual variable to Ruby namespace as global {\emph{\$name}}. No actual storage exists for variable; attempts to get/set value will call the appropriate functions.} \tn % Row Count 26 (+ 6) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_hooked\_variable}}(const cahr *name, VALUE *variable, VALUE (*getter)(), void (*setter)())} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines functions to be called when reading/writing to {\emph{variable}}. (See also {\bf{rb\_define\_virtual\_variable}}.)} \tn % Row Count 32 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Defining Variables and Constants (cont)}} \tn % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_readonly\_variable}}(const char *name, VALUE *value)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Same as rb\_define\_variable, but read-only from Ruby.} \tn % Row Count 4 (+ 4) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_attr}}(VALUE variable, const char *name, int read, int write)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Creates accessor methods for given {\emph{variable}}, with given {\emph{name}}. If {\emph{read}} is nonzero, crate read method; if {\emph{write}} is nonzero, create write method.} \tn % Row Count 10 (+ 6) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_global\_variable}}(VALUE *obj)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Registers given address with garbage collector.} \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Security Status}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Check\_SafeStr}}(VALUE str)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Raises SecurityError if current safe level \textgreater{} 0 and {\emph{str}} is tainted, or a TypeError if {\emph{str}} is not a T\_STRING.} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{int {\bf{rb\_safe\_level}}()} \tn % Row Count 5 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_secure}}(int level)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Raises SecurityError if {\emph{level}} \textless{}= current safe level.} \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_set\_safe\_level}}(int newlevel)} \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Defining Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_method}}(V classmod, char *name, V (*func)(), int argc);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines instance method in class or module {\emph{classmod}} with given {\emph{name}}, implemented by C function {\emph{func}} and taking {\emph{argc}} args. {\emph{({\bf{See Ruby C - Function Prototype}})}}} \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_module\_function}}(V classmod, char *name, V (*func)(), int argc);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines method in class {\emph{classmod}} with given {\emph{name}}, implemented by C function {\emph{func}} taking {\emph{argc}} args.} \tn % Row Count 11 (+ 5) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_global\_function}}(char *name, V (*func)(), int argc);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines global function (private Kernel method) with given {\emph{name}}, implemented by C function {\emph{func}} and taking {\emph{argc}} args.} \tn % Row Count 16 (+ 5) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_singleton\_method}}(V classmod, char *name, V (*func)(), int argc);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines singleton method in class {\emph{classmod}} with given {\emph{name}}, implemented by C function {\emph{func}} taking {\emph{argc}} args.} \tn % Row Count 21 (+ 5) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{int {\bf{rb\_scan\_args}}(int argc, V *argv, char *fmt, ...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Scans argument list and assigns to variables similar to scanf: {\emph{fmt}} is string containing zero, one, or two digits followed by optional flag chars. First char indicates count of mandatory args; second is count of optional args. A "*" means to pack remaining args into Ruby array. A "\&" means attached code block will be taken and assigned to given variable (Qnil will be assigned if no code block given). After {\emph{fmt}} string, pointers to VALUE are given to which args are assigned.} \tn % Row Count 34 (+ 13) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Defining Methods (cont)}} \tn % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_undef\_method}}(V classmod, const char *name);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Undefines method {\emph{name}} in class or module {\emph{classmod}}.} \tn % Row Count 4 (+ 4) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_define\_alias}}(V classmod, const char *newname, const char *oldname);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Defines alias for {\emph{oldname}} in class or module {\emph{classmod}}.} \tn % Row Count 8 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V = VALUE} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ruby C - Function Prototype}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{(argc) {\bf{0..17}} VALUE func({\emph{VALUE self, VALUE arg...}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}C function will be called with this many arguments.} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{(argc) {\bf{-1}} VALUE func({\emph{int argc, VALUE *argv, VALUE self}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}C function will be given a variable number of arguments passed as a C array.} \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{(argc) {\bf{-2}} VALUE func({\emph{VALUE self, VALUE args}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}C function will be given a variable number of arguments passed as a Ruby array.} \tn % Row Count 11 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}