\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-2.pdf) /Creator (Cheatography) /Author (Ryan Johnson (CITguy)) /Subject (Extending Ruby with C - Part 2 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 2 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Ryan Johnson (CITguy)} via \textcolor{DarkBackground}{\uline{cheatography.com/138/cs/249/}}} \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 11th 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 - Common Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{int {\bf{rb\_respond\_to}}(VALUE self, ID method) =\textgreater{} 0|nonzero} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_thread\_create}}(VALUE (*func)(), void *data)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Runs {\emph{func}} in new thread, passing {\emph{data}} as an arg.} \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_obj\_is\_instance\_of}}(VALUE obj, VALUE klass) =\textgreater{} Qtrue|Qfalse} \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_obj\_is\_kind\_of}}(VALUE obj, VALUE klass)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns Qtrue if {\emph{klass}} is superclass of {\emph{obj}} class.} \tn % Row Count 12 (+ 4) \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 - Exceptions}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_raise}}(V exception, const char *fmt, ...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Raises {\emph{exception}}. {\emph{fmt}} and args used like in printf.} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_fatal}}(const char *fmt, ...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Raises Fatal exception, terminating process. No rescue blocks called, but ensure blocks will be called. {\emph{fmt}} and args used like in printf.} \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_bug}}(const char *fmt, ...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Terminates process immediately-{}-no handlers of any sort called. {\emph{fmt}} and args are interpreted like printf. {\emph{Call only if a fatal bug has been exposed.}}} \tn % Row Count 13 (+ 5) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_sys\_fail}} (const char *msg)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Raises a platform-specific exception corresponding to last known system error, with the given {\emph{msg}}.} \tn % Row Count 17 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_rescue}}(V (*body)(), V args, V (*rescue)(), V rargs)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Executes body with given {\emph{args}}. If StandardError exception raised, execute {\emph{rescue}} with given {\emph{rargs}}.} \tn % Row Count 22 (+ 5) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_ensure}}(V (*body)(), V args, V (*rescue)(), V eargs)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Executes body with given {\emph{args}}. Whether or not an exception is raised, execute {\emph{ensure}} with given {\emph{rargs}} after {\emph{body}} has completed.} \tn % Row Count 27 (+ 5) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_protect}}(V (*body)(), V args, int *result)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Executes {\emph{body}} with given {\emph{args}} and returns nonzero in {\emph{result}} if any exception raised.} \tn % Row Count 31 (+ 4) \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 - Exceptions (cont)}} \tn % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_notimplement}}()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Raises NotImpError exception to indicate enclosed function is NYI, or not available on platform.} \tn % Row Count 4 (+ 4) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_exit}}(int status)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Exits Ruby with given {\emph{status}}. Raises SystemExit exception and calls registered exit functions/finalizers.} \tn % Row Count 8 (+ 4) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_warn}}(const char *fmt, ...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Unconditionally issues warning message to standard error. {\emph{fmt}} and args used like in printf.} \tn % Row Count 11 (+ 3) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_warning}}(const char *fmt, ...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Conditionally issues a warning message to standard error if Ruby was invoked with the -w flag. {\emph{fmt}} and args used like in printf.} \tn % Row Count 15 (+ 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 - Array Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_new}}()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns new Array with default size.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_new2}}(long length)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns new Array of given {\emph{length}}.} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_new3}}(long length, ...)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns new Array of given {\emph{length}} and populated with remaining arguments.} \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_new4}}(long length, VALUE *values)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns new Array of given {\emph{length}} and populated with C array {\emph{values}}.} \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_ary\_store}}(VALUE self, long index, VALUE value)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Stores {\emph{value}} at {\emph{index}} in array {\emph{self}}.} \tn % Row Count 13 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_push}}(VALUE self, VALUE value)} \tn % Row Count 14 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_pop}}(VALUE self)} \tn % Row Count 15 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_shift}}(VALUE self)} \tn % Row Count 16 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_unshift}}(VALUE self, VALUE value)} \tn % Row Count 17 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_ary\_entry}}(VALUE self, long index)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns array {\emph{self}}'s element at {\emph{index}}.} \tn % Row Count 19 (+ 2) \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 - Iterators}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_iter\_break}}()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Breaks out of enclosing iterator block.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_each}}(VALUE obj)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Invokes 'each' method of the given {\emph{obj}}.} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_yield}}(VALUE arg)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Transfers execution to iterator block in the current context, passing {\emph{arg}} as an argument. Multiple values may be passed in an array.} \tn % Row Count 8 (+ 4) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{int {\bf{rb\_block\_given\_p}}()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Nonzero if yield would execute a block in current context-{}-that is, if a code block was passed to current method and is available to be called.} \tn % Row Count 13 (+ 5) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_iterate}}(VALUE (*method)(), VALUE args, VALUE (*block)(), VALUE arg2)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Invokes {\emph{method}} with {\emph{args}} and block {\emph{block}}. Yield from that method will invoke {\emph{block}} with arg given to yield and second arg {\emph{arg2}}.} \tn % Row Count 18 (+ 5) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_catch}}(const char *tag, VALUE (*proc)(), VALUE value)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Equivalent to Ruby catch.} \tn % Row Count 21 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_throw}}(const char *tag, VALUE value)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Equivalent to Ruby throw.} \tn % Row Count 23 (+ 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 - Hash Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_hash\_new}}()} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_hash\_aref}}(VALUE self, VALUE key)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns element corresponding to {\emph{key}} in {\emph{self}}.} \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_hash\_aset}}(VALUE self, VALUE key, VALUE value)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Sets value for {\emph{key}} to {\emph{value}} in {\emph{self}}. Returns {\emph{self}}.} \tn % Row Count 8 (+ 4) \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 - Accessing Variables}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_iv\_get}}(V obj, char *name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns instance var {\emph{name}} (must specify "@" prefix) from given {\emph{obj}}.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_ivar\_get}}(V obj, ID name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns instance var {\emph{name}} from given {\emph{obj}}.} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_iv\_set}}(V obj, char *name, V value) =\textgreater{} value} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Sets instance var {\emph{name}} (must specify "@" prefix) in given {\emph{obj}} to {\emph{value}}.} \tn % Row Count 9 (+ 4) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_ivar\_set}}(V obj, ID name, V value)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Sets instance var {\emph{name}} in {\emph{obj}} to {\emph{value}}.} \tn % Row Count 11 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_gv\_set}}(const char *name, V value) =\textgreater{} value} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Sets global var {\emph{name}} ("\$" prefix optional) to {\emph{value}}.} \tn % Row Count 15 (+ 4) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_gv\_get}}(const char *name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns global var {\emph{name}} ("\$" prefix optional).} \tn % Row Count 18 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_cvar\_set}}(V class, ID name, V val)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Sets class var {\emph{name}} in {\emph{class}} to {\emph{value}}.} \tn % Row Count 20 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_cvar\_get}}(V class, ID name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns class var {\emph{name}} from given {\emph{class}}.} \tn % Row Count 22 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{int {\bf{rb\_cvar\_defined}}(V class, ID name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Qtrue if class var {\emph{name}} has been defined for {\emph{class}}.} \tn % Row Count 25 (+ 3) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{void {\bf{rb\_cv\_set}}(V class, const char *name, V val)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Sets class var {\emph{name}} (must specify "@@" prefix) in given {\emph{class}} to {\emph{value}}.} \tn % Row Count 29 (+ 4) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{V {\bf{rb\_cv\_get}}(V class, const char *name)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns class var {\emph{name}} (must specify a "@@" prefix) from given {\emph{class}}.} \tn % Row Count 32 (+ 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 - String Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_str\_new}}(const char *src, long length)=\textgreater{}String} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Initialized with {\emph{length}} chars from {\emph{src}}.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_str\_new2}}(const char *src) =\textgreater{} String} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Initialized with null-terminated C string {\emph{src}}.} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_str\_dup}}(VALUE str) =\textgreater{} String} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Duplicated from {\emph{str}}.} \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_str\_cat}}(VALUE self, const char *src, long length) =\textgreater{} self} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Concatenates {\emph{length}} chars from {\emph{src}} onto {\emph{self}}.} \tn % Row Count 12 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_str\_concat}}(VALUE self, VALUE other) =\textgreater{} self} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Concatenates {\emph{other}} onto String {\emph{self}}.} \tn % Row Count 15 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{VALUE {\bf{rb\_str\_split}}(VALUE self, const char *delim)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns array of String objects created by splitting {\emph{self}} on {\emph{delim}}.} \tn % Row Count 19 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}