\doxysection{include/cmem.h File Reference} \label{cmem_8h}\index{include/cmem.h@{include/cmem.h}} {\ttfamily \#include $<$stdio.\+h$>$}\newline {\ttfamily \#include $<$stdlib.\+h$>$}\newline {\ttfamily \#include $<$string.\+h$>$}\newline {\ttfamily \#include $<$assert.\+h$>$}\newline {\ttfamily \#include $<$stdbool.\+h$>$}\newline Include dependency graph for cmem.\+h\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h__incl} \end{center} \end{figure} This graph shows which files directly or indirectly include this file\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h__dep__incl} \end{center} \end{figure} \doxysubsection*{Macros} \begin{DoxyCompactItemize} \item \#define \textbf{ ARRAYSIZE}(array)~(sizeof(array)/sizeof(array[0])) \begin{DoxyCompactList}\small\item\em 配列のサイズを返すマクロ \end{DoxyCompactList}\item \#define \textbf{ FREE}(ptr)~\{free(ptr); ptr = NULL;\} \begin{DoxyCompactList}\small\item\em メモリを解放するマクロ \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Functions} \begin{DoxyCompactItemize} \item void $\ast$ \textbf{ malloc\+\_\+chk} (size\+\_\+t size, const char $\ast$tag) \begin{DoxyCompactList}\small\item\em mallocを実行し、0で初期化する \end{DoxyCompactList}\item void $\ast$ \textbf{ calloc\+\_\+chk} (size\+\_\+t nmemb, size\+\_\+t size, const char $\ast$tag) \begin{DoxyCompactList}\small\item\em 領域の数とサイズを指定してメモリーを確保するcallocを実行する \end{DoxyCompactList}\item char $\ast$ \textbf{ strdup\+\_\+chk} (const char $\ast$s, const char $\ast$tag) \begin{DoxyCompactList}\small\item\em malloc\+\_\+chkを実行してメモリを確保し、コピーした文字列を返す \end{DoxyCompactList}\item char $\ast$ \textbf{ strndup\+\_\+chk} (const char $\ast$s, size\+\_\+t len, const char $\ast$tag) \begin{DoxyCompactList}\small\item\em malloc\+\_\+chkを実行してメモリを確保し、コピーした文字列の指定した長さの部分を返す \end{DoxyCompactList}\item void \textbf{ strip\+\_\+end} (char $\ast$s) \begin{DoxyCompactList}\small\item\em 文字列の末尾から、改行と空白とタブを削除する \end{DoxyCompactList}\item void \textbf{ strip\+\_\+casl2\+\_\+comment} (char $\ast$s) \begin{DoxyCompactList}\small\item\em 文字列から「\textquotesingle{}」以降の文字列を\+CASL IIのコメントとして削除する。「\textquotesingle{}\textquotesingle{}」の場合は除く \end{DoxyCompactList}\item char $\ast$ \textbf{ strrev} (const char $\ast$s) \begin{DoxyCompactList}\small\item\em 逆にした文字列を返す \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Macro Definition Documentation} \mbox{\label{cmem_8h_abd34d9a0fac0c592a7b76395011bb370}} \index{cmem.h@{cmem.h}!ARRAYSIZE@{ARRAYSIZE}} \index{ARRAYSIZE@{ARRAYSIZE}!cmem.h@{cmem.h}} \doxysubsubsection{ARRAYSIZE} {\footnotesize\ttfamily \#define ARRAYSIZE(\begin{DoxyParamCaption}\item[{}]{array }\end{DoxyParamCaption})~(sizeof(array)/sizeof(array[0]))} 配列のサイズを返すマクロ Definition at line 14 of file cmem.\+h. \mbox{\label{cmem_8h_a105949c59c998e38aad80266afac92bf}} \index{cmem.h@{cmem.h}!FREE@{FREE}} \index{FREE@{FREE}!cmem.h@{cmem.h}} \doxysubsubsection{FREE} {\footnotesize\ttfamily \#define FREE(\begin{DoxyParamCaption}\item[{}]{ptr }\end{DoxyParamCaption})~\{free(ptr); ptr = NULL;\}} メモリを解放するマクロ Definition at line 21 of file cmem.\+h. \doxysubsection{Function Documentation} \mbox{\label{cmem_8h_a813e5efb91f0a88da833734ab014cd79}} \index{cmem.h@{cmem.h}!calloc\_chk@{calloc\_chk}} \index{calloc\_chk@{calloc\_chk}!cmem.h@{cmem.h}} \doxysubsubsection{calloc\_chk()} {\footnotesize\ttfamily void$\ast$ calloc\+\_\+chk (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{nmemb, }\item[{size\+\_\+t}]{size, }\item[{const char $\ast$}]{tag }\end{DoxyParamCaption})} 領域の数とサイズを指定してメモリーを確保するcallocを実行する メモリを確保できない場合はエラーを出力して終了 \begin{DoxyReturn}{Returns} なし \end{DoxyReturn} \begin{DoxyParams}{Parameters} {\em nmemb} & 領域の数 \\ \hline {\em size} & 領域1個あたりのメモリーサイズ \\ \hline {\em tag} & エラーメッセージなどで表示されるタグ \\ \hline \end{DoxyParams} Definition at line 14 of file cmem.\+c. Here is the caller graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h_a813e5efb91f0a88da833734ab014cd79_icgraph} \end{center} \end{figure} \mbox{\label{cmem_8h_ac4bb1c10fec6837713f1f3c9fabfccb5}} \index{cmem.h@{cmem.h}!malloc\_chk@{malloc\_chk}} \index{malloc\_chk@{malloc\_chk}!cmem.h@{cmem.h}} \doxysubsubsection{malloc\_chk()} {\footnotesize\ttfamily void$\ast$ malloc\+\_\+chk (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{size, }\item[{const char $\ast$}]{tag }\end{DoxyParamCaption})} mallocを実行し、0で初期化する メモリを確保できない場合はエラーを出力して終了 \begin{DoxyReturn}{Returns} なし \end{DoxyReturn} \begin{DoxyParams}{Parameters} {\em size} & メモリーのサイズ \\ \hline {\em tag} & エラーメッセージなどで表示されるタグ \\ \hline \end{DoxyParams} Definition at line 3 of file cmem.\+c. Here is the caller graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h_ac4bb1c10fec6837713f1f3c9fabfccb5_icgraph} \end{center} \end{figure} \mbox{\label{cmem_8h_a6eee1bd49d57eafb3ed883038caff8e1}} \index{cmem.h@{cmem.h}!strdup\_chk@{strdup\_chk}} \index{strdup\_chk@{strdup\_chk}!cmem.h@{cmem.h}} \doxysubsubsection{strdup\_chk()} {\footnotesize\ttfamily char$\ast$ strdup\+\_\+chk (\begin{DoxyParamCaption}\item[{const char $\ast$}]{s, }\item[{const char $\ast$}]{tag }\end{DoxyParamCaption})} malloc\+\_\+chkを実行してメモリを確保し、コピーした文字列を返す \begin{DoxyReturn}{Returns} コピーした文字列 \end{DoxyReturn} \begin{DoxyParams}{Parameters} {\em s} & 文字列 \\ \hline {\em tag} & エラーメッセージなどで表示されるタグ \\ \hline \end{DoxyParams} Definition at line 25 of file cmem.\+c. Here is the call graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=212pt]{cmem_8h_a6eee1bd49d57eafb3ed883038caff8e1_cgraph} \end{center} \end{figure} Here is the caller graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h_a6eee1bd49d57eafb3ed883038caff8e1_icgraph} \end{center} \end{figure} \mbox{\label{cmem_8h_aab7f4dbb7c0a7e7acbd4a7e035c9263c}} \index{cmem.h@{cmem.h}!strip\_casl2\_comment@{strip\_casl2\_comment}} \index{strip\_casl2\_comment@{strip\_casl2\_comment}!cmem.h@{cmem.h}} \doxysubsubsection{strip\_casl2\_comment()} {\footnotesize\ttfamily void strip\+\_\+casl2\+\_\+comment (\begin{DoxyParamCaption}\item[{char $\ast$}]{s }\end{DoxyParamCaption})} 文字列から「\textquotesingle{}」以降の文字列を\+CASL IIのコメントとして削除する。「\textquotesingle{}\textquotesingle{}」の場合は除く \begin{DoxyReturn}{Returns} なし \end{DoxyReturn} \begin{DoxyParams}{Parameters} {\em s} & 文字列 \\ \hline \end{DoxyParams} Definition at line 55 of file cmem.\+c. Here is the caller graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h_aab7f4dbb7c0a7e7acbd4a7e035c9263c_icgraph} \end{center} \end{figure} \mbox{\label{cmem_8h_a20f2e2b05241b8d97e218e4184b97bac}} \index{cmem.h@{cmem.h}!strip\_end@{strip\_end}} \index{strip\_end@{strip\_end}!cmem.h@{cmem.h}} \doxysubsubsection{strip\_end()} {\footnotesize\ttfamily void strip\+\_\+end (\begin{DoxyParamCaption}\item[{char $\ast$}]{s }\end{DoxyParamCaption})} 文字列の末尾から、改行と空白とタブを削除する \begin{DoxyReturn}{Returns} なし \end{DoxyReturn} \begin{DoxyParams}{Parameters} {\em s} & 文字列 \\ \hline \end{DoxyParams} Definition at line 48 of file cmem.\+c. Here is the caller graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h_a20f2e2b05241b8d97e218e4184b97bac_icgraph} \end{center} \end{figure} \mbox{\label{cmem_8h_a0c1f4db31db96ea105fb5d5e2f840334}} \index{cmem.h@{cmem.h}!strndup\_chk@{strndup\_chk}} \index{strndup\_chk@{strndup\_chk}!cmem.h@{cmem.h}} \doxysubsubsection{strndup\_chk()} {\footnotesize\ttfamily char$\ast$ strndup\+\_\+chk (\begin{DoxyParamCaption}\item[{const char $\ast$}]{s, }\item[{size\+\_\+t}]{len, }\item[{const char $\ast$}]{tag }\end{DoxyParamCaption})} malloc\+\_\+chkを実行してメモリを確保し、コピーした文字列の指定した長さの部分を返す \begin{DoxyReturn}{Returns} コピーした文字列 \end{DoxyReturn} \begin{DoxyParams}{Parameters} {\em s} & 文字列 \\ \hline {\em len} & 文字列の長さ \\ \hline {\em tag} & エラーメッセージなどで表示されるタグ \\ \hline \end{DoxyParams} Definition at line 33 of file cmem.\+c. Here is the call graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=319pt]{cmem_8h_a0c1f4db31db96ea105fb5d5e2f840334_cgraph} \end{center} \end{figure} Here is the caller graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h_a0c1f4db31db96ea105fb5d5e2f840334_icgraph} \end{center} \end{figure} \mbox{\label{cmem_8h_a489097ef8a0c813afcf5605524ce9ce8}} \index{cmem.h@{cmem.h}!strrev@{strrev}} \index{strrev@{strrev}!cmem.h@{cmem.h}} \doxysubsubsection{strrev()} {\footnotesize\ttfamily char$\ast$ strrev (\begin{DoxyParamCaption}\item[{const char $\ast$}]{s }\end{DoxyParamCaption})} 逆にした文字列を返す \begin{DoxyReturn}{Returns} 逆にしたした文字列 \end{DoxyReturn} \begin{DoxyParams}{Parameters} {\em s} & 文字列 \\ \hline \end{DoxyParams} Definition at line 71 of file cmem.\+c. Here is the call graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=290pt]{cmem_8h_a489097ef8a0c813afcf5605524ce9ce8_cgraph} \end{center} \end{figure} Here is the caller graph for this function\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{cmem_8h_a489097ef8a0c813afcf5605524ce9ce8_icgraph} \end{center} \end{figure}