Skip to content

Commit

Permalink
stubbed some new slides, include code for example (oops)
Browse files Browse the repository at this point in the history
  • Loading branch information
jberger committed Jun 4, 2012
1 parent 14a6fed commit 163d65f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions BabyXS/babyxs.tex
Expand Up @@ -180,4 +180,16 @@ \section{The Code}
\end{block}
\end{frame}

\begin{frame}{Perl Module}

\end{frame}

\begin{frame}{Building}

\end{frame}

\begin{frame}{Other C Connections}

\end{frame}

\end{document}
11 changes: 11 additions & 0 deletions BabyXS/code/av.c
@@ -0,0 +1,11 @@
AV* foo () {
AV* ret = newAV();
/* fix mortalization */
sv_2mortal((SV*)ret);

av_push(ret, newSViv(1));
av_push(ret, newSVpvf("%s", "bar"));

/* return [ 1, "bar" ] */
return ret;
}
13 changes: 13 additions & 0 deletions BabyXS/code/av.tex
@@ -0,0 +1,13 @@
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n}{AV}\PY{o}{*} \PY{n+nf}{foo} \PY{p}{(}\PY{p}{)} \PY{p}{\PYZob{}}
\PY{n}{AV}\PY{o}{*} \PY{n}{ret} \PY{o}{=} \PY{n}{newAV}\PY{p}{(}\PY{p}{)}\PY{p}{;}
\PY{c+cm}{/* fix mortalization */}
\PY{n}{sv\PYZus{}2mortal}\PY{p}{(}\PY{p}{(}\PY{n}{SV}\PY{o}{*}\PY{p}{)}\PY{n}{ret}\PY{p}{)}\PY{p}{;}
\PY{n}{av\PYZus{}push}\PY{p}{(}\PY{n}{ret}\PY{p}{,} \PY{n}{newSViv}\PY{p}{(}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{)}\PY{p}{;}
\PY{n}{av\PYZus{}push}\PY{p}{(}\PY{n}{ret}\PY{p}{,} \PY{n}{newSVpvf}\PY{p}{(}\PY{l+s}{"}\PY{l+s}{\PYZpc{}s}\PY{l+s}{"}\PY{p}{,} \PY{l+s}{"}\PY{l+s}{bar}\PY{l+s}{"}\PY{p}{)}\PY{p}{)}\PY{p}{;}
\PY{c+cm}{/* return [ 1, "bar" ] */}
\PY{k}{return} \PY{n}{ret}\PY{p}{;}
\PY{p}{\PYZcb{}}
\end{Verbatim}

0 comments on commit 163d65f

Please sign in to comment.