\section{dkc\-String.c File Reference}
\label{dkcString_8c}\index{dkcString.c@{dkcString.c}}
{\tt \#include \char`\"{}dkc\-String.h\char`\"{}}\par
{\tt \#include \char`\"{}dkc\-Stdio.h\char`\"{}}\par
{\tt \#include \char`\"{}dkc\-OSIndependent.h\char`\"{}}\par
{\tt \#include $<$limits.h$>$}\par


Include dependency graph for dkc\-String.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=202pt]{dkcString_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
{\bf BOOL} {\bf dkc\-Is\-SJIS1} ({\bf BYTE} c)
\begin{CompactList}\small\item\em cがSJISの１バイト目の時TRUE(1) \item\end{CompactList}\item 
{\bf BOOL} {\bf dkc\-Is\-SJIS2} ({\bf BYTE} c)
\begin{CompactList}\small\item\em cがSJISの２バイト目の時TRUE(1) \item\end{CompactList}\item 
int WINAPI {\bf dkc\-SJIS\_\-Str\-Chr\-Search} (const char $\ast$s, char c)
\begin{CompactList}\small\item\em SJIS文字を除外して文字を検索 最初に見つかった位置を返す -1なら見つからない. \item\end{CompactList}\item 
int WINAPI {\bf dkc\-SJIS\_\-Str\-Chr\-Search\-Last} (const char $\ast$s, char c)
\begin{CompactList}\small\item\em SJIS文字を除外して文字を検索 最後に見つかった位置を返す -1なら見つからない. \item\end{CompactList}\item 
int WINAPI {\bf dkc\-SJIS\_\-Str\-Chr\-Search\-Tail} (const char $\ast$s, size\_\-t len, char c)
\item 
int WINAPI {\bf dkc\-SJIS\_\-Str\-Chr\-Search\-In\-Str} (const char $\ast$s, const char $\ast$c)
\item 
int WINAPI {\bf dkc\-SJIS\_\-Str\-Chr\-Search\-In\-Str\-Last} (const char $\ast$s, const char $\ast$c)
\begin{CompactList}\small\item\em It has not tested. \item\end{CompactList}\item 
int WINAPI {\bf dkc\-SJIS\_\-Search\-Path\-Sep} (const char $\ast$s)
\begin{CompactList}\small\item\em パスセパレータが最初に見つかった位置を返す。 -1は見つからない \item\end{CompactList}\item 
int WINAPI {\bf dkc\-SJIS\_\-Search\-Path\-Sep\-Last} (const char $\ast$s)
\begin{CompactList}\small\item\em パスセパレータが最期に見つかった位置を返す。 -1は見つからない \item\end{CompactList}\item 
int WINAPI {\bf dkc\-Str\-Str} (const char $\ast$dest, const char $\ast$src)
\item 
int WINAPI {\bf dkc\-BMStr\-Str} (const char $\ast$dest, const char $\ast$src)
\item 
{\bf DKC\_\-STRING} $\ast$WINAPI {\bf dkc\-Alloc\-String} (size\_\-t size)
\item 
int WINAPI {\bf dkc\-Free\-String} ({\bf DKC\_\-STRING} $\ast$$\ast$ptr)
\item 
int WINAPI {\bf dkc\-String\-Copy} ({\bf DKC\_\-STRING} $\ast$ptr, const char $\ast$str, size\_\-t size)
\item 
int WINAPI {\bf dkc\-String\-Concatenate} ({\bf DKC\_\-STRING} $\ast$ptr, const char $\ast$str, size\_\-t size)
\begin{CompactList}\small\item\em {\tt http://www.google.com/search?num=50\&hl=ja\&lr=lang\_\-ja\&q=strcat+cat\%82\%c6\%82\%cd} \item\end{CompactList}\item 
int WINAPI {\bf dkc\-String\-Insert} ({\bf DKC\_\-STRING} $\ast$ptr, size\_\-t point, const char $\ast$str, size\_\-t size)
\item 
int WINAPI {\bf dkc\-String\-Erase} ({\bf DKC\_\-STRING} $\ast$ptr, size\_\-t point, size\_\-t len)
\item 
int WINAPI {\bf dkc\-String\-Replace} ({\bf DKC\_\-STRING} $\ast$ptr, size\_\-t begin\_\-, size\_\-t end\_\-, const char $\ast$str, size\_\-t size)
\item 
size\_\-t {\bf dkc\-String\-Size} (const {\bf DKC\_\-STRING} $\ast$ptr)
\item 
size\_\-t {\bf dkc\-String\-Num} (const {\bf DKC\_\-STRING} $\ast$ptr)
\begin{CompactList}\small\item\em 文字列の文字数を返す。内部streamをstrlenにかけたものを保存しておいたものを取得。 \item\end{CompactList}\item 
const char $\ast$WINAPI {\bf dkc\-String\-Pointer} (const {\bf DKC\_\-STRING} $\ast$ptr)
\item 
int WINAPI {\bf dkc\-String\-Get\-Buffer} (const {\bf DKC\_\-STRING} $\ast$ptr, char $\ast$buffer, size\_\-t buffsize)
\begin{CompactList}\small\item\em DKC\_\-STRINGの内部文字列をバッファにぶち込む. \item\end{CompactList}\end{CompactItemize}


\subsection{Function Documentation}
\index{dkcString.c@{dkc\-String.c}!dkcAllocString@{dkcAllocString}}
\index{dkcAllocString@{dkcAllocString}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DKC\_\-STRING}$\ast$ WINAPI dkc\-Alloc\-String (size\_\-t {\em size})}\label{dkcString_8c_a20}


\index{dkcString.c@{dkc\-String.c}!dkcBMStrStr@{dkcBMStrStr}}
\index{dkcBMStrStr@{dkcBMStrStr}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-BMStr\-Str (const char $\ast$ {\em dest}, const char $\ast$ {\em src})}\label{dkcString_8c_a19}


strstrをBM法でやってみたもの \begin{Desc}
\item[Returns:]最初に見つかった位置を返す -1なら見つからない /\end{Desc}
\begin{Desc}
\item[Note:]It has not tested. \end{Desc}
\index{dkcString.c@{dkc\-String.c}!dkcFreeString@{dkcFreeString}}
\index{dkcFreeString@{dkcFreeString}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-Free\-String ({\bf DKC\_\-STRING} $\ast$$\ast$ {\em ptr})}\label{dkcString_8c_a21}


\index{dkcString.c@{dkc\-String.c}!dkcIsSJIS1@{dkcIsSJIS1}}
\index{dkcIsSJIS1@{dkcIsSJIS1}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf BOOL} dkc\-Is\-SJIS1 ({\bf BYTE} {\em c})}\label{dkcString_8c_a8}


cがSJISの１バイト目の時TRUE(1) 

\index{dkcString.c@{dkc\-String.c}!dkcIsSJIS2@{dkcIsSJIS2}}
\index{dkcIsSJIS2@{dkcIsSJIS2}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf BOOL} dkc\-Is\-SJIS2 ({\bf BYTE} {\em c})}\label{dkcString_8c_a9}


cがSJISの２バイト目の時TRUE(1) 

\index{dkcString.c@{dkc\-String.c}!dkcSJIS_SearchPathSep@{dkcSJIS\_\-SearchPathSep}}
\index{dkcSJIS_SearchPathSep@{dkcSJIS\_\-SearchPathSep}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-SJIS\_\-Search\-Path\-Sep (const char $\ast$ {\em s})}\label{dkcString_8c_a15}


パスセパレータが最初に見つかった位置を返す。 -1は見つからない 

\index{dkcString.c@{dkc\-String.c}!dkcSJIS_SearchPathSepLast@{dkcSJIS\_\-SearchPathSepLast}}
\index{dkcSJIS_SearchPathSepLast@{dkcSJIS\_\-SearchPathSepLast}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-SJIS\_\-Search\-Path\-Sep\-Last (const char $\ast$ {\em s})}\label{dkcString_8c_a16}


パスセパレータが最期に見つかった位置を返す。 -1は見つからない 

\index{dkcString.c@{dkc\-String.c}!dkcSJIS_StrChrSearch@{dkcSJIS\_\-StrChrSearch}}
\index{dkcSJIS_StrChrSearch@{dkcSJIS\_\-StrChrSearch}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-SJIS\_\-Str\-Chr\-Search (const char $\ast$ {\em s}, char {\em c})}\label{dkcString_8c_a10}


SJIS文字を除外して文字を検索 最初に見つかった位置を返す -1なら見つからない. 

\index{dkcString.c@{dkc\-String.c}!dkcSJIS_StrChrSearchInStr@{dkcSJIS\_\-StrChrSearchInStr}}
\index{dkcSJIS_StrChrSearchInStr@{dkcSJIS\_\-StrChrSearchInStr}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-SJIS\_\-Str\-Chr\-Search\-In\-Str (const char $\ast$ {\em s}, const char $\ast$ {\em c})}\label{dkcString_8c_a13}


複数の文字定数を検索指定できるdkc\-SJIS\_\-Str\-Chr\-Search() /\begin{Desc}
\item[Note:]It has not tested. \end{Desc}
\index{dkcString.c@{dkc\-String.c}!dkcSJIS_StrChrSearchInStrLast@{dkcSJIS\_\-StrChrSearchInStrLast}}
\index{dkcSJIS_StrChrSearchInStrLast@{dkcSJIS\_\-StrChrSearchInStrLast}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-SJIS\_\-Str\-Chr\-Search\-In\-Str\-Last (const char $\ast$ {\em s}, const char $\ast$ {\em c})}\label{dkcString_8c_a14}


It has not tested. 

\index{dkcString.c@{dkc\-String.c}!dkcSJIS_StrChrSearchLast@{dkcSJIS\_\-StrChrSearchLast}}
\index{dkcSJIS_StrChrSearchLast@{dkcSJIS\_\-StrChrSearchLast}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-SJIS\_\-Str\-Chr\-Search\-Last (const char $\ast$ {\em s}, char {\em c})}\label{dkcString_8c_a11}


SJIS文字を除外して文字を検索 最後に見つかった位置を返す -1なら見つからない. 

\index{dkcString.c@{dkc\-String.c}!dkcSJIS_StrChrSearchTail@{dkcSJIS\_\-StrChrSearchTail}}
\index{dkcSJIS_StrChrSearchTail@{dkcSJIS\_\-StrChrSearchTail}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-SJIS\_\-Str\-Chr\-Search\-Tail (const char $\ast$ {\em s}, size\_\-t {\em len}, char {\em c})}\label{dkcString_8c_a12}


SJIS文字を除外して文字を後ろから検索 \begin{Desc}
\item[Returns:]後ろから検索して最初に見つかった位置を返す -1なら見つからない \end{Desc}
\begin{Desc}
\item[Note:]It has not tested. \end{Desc}
\index{dkcString.c@{dkc\-String.c}!dkcStringConcatenate@{dkcStringConcatenate}}
\index{dkcStringConcatenate@{dkcStringConcatenate}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-String\-Concatenate ({\bf DKC\_\-STRING} $\ast$ {\em ptr}, const char $\ast$ {\em str}, size\_\-t {\em size})}\label{dkcString_8c_a23}


{\tt http://www.google.com/search?num=50\&hl=ja\&lr=lang\_\-ja\&q=strcat+cat\%82\%c6\%82\%cd} 

\index{dkcString.c@{dkc\-String.c}!dkcStringCopy@{dkcStringCopy}}
\index{dkcStringCopy@{dkcStringCopy}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-String\-Copy ({\bf DKC\_\-STRING} $\ast$ {\em ptr}, const char $\ast$ {\em str}, size\_\-t {\em size})}\label{dkcString_8c_a22}


\index{dkcString.c@{dkc\-String.c}!dkcStringErase@{dkcStringErase}}
\index{dkcStringErase@{dkcStringErase}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-String\-Erase ({\bf DKC\_\-STRING} $\ast$ {\em ptr}, size\_\-t {\em point}, size\_\-t {\em len})}\label{dkcString_8c_a25}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ptr\mbox{[}in\mbox{]}\mbox{[}out\mbox{]}}]{\bf dkc\-Alloc\-String()}{\rm (p.\,\pageref{dkcString_8c_a20})}で確保したポインタ \item[{\em point\mbox{[}in\mbox{]}}]何文字目以降を削除するのか \item[{\em len\mbox{[}in\mbox{]}}]pointから何文字Eraseするか。 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]edk\_\-SUCCEEDEDなら完全成功。\par
 edk\_\-Not\_\-Satisfactoryならlenが大きすぎる等の理由から一応処理は出来たが要求した結果にはならなかった。\par
 その他はエラー \end{Desc}
\begin{Desc}
\item[{\bf Todo}]test \end{Desc}
\index{dkcString.c@{dkc\-String.c}!dkcStringGetBuffer@{dkcStringGetBuffer}}
\index{dkcStringGetBuffer@{dkcStringGetBuffer}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-String\-Get\-Buffer (const {\bf DKC\_\-STRING} $\ast$ {\em ptr}, char $\ast$ {\em buffer}, size\_\-t {\em buffsize})}\label{dkcString_8c_a30}


DKC\_\-STRINGの内部文字列をバッファにぶち込む. 

\index{dkcString.c@{dkc\-String.c}!dkcStringInsert@{dkcStringInsert}}
\index{dkcStringInsert@{dkcStringInsert}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-String\-Insert ({\bf DKC\_\-STRING} $\ast$ {\em ptr}, size\_\-t {\em point}, const char $\ast$ {\em str}, size\_\-t {\em size})}\label{dkcString_8c_a24}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ptr\mbox{[}in\mbox{]}\mbox{[}out\mbox{]}}]{\bf dkc\-Alloc\-String()}{\rm (p.\,\pageref{dkcString_8c_a20})}で確保したポインタ \item[{\em point\mbox{[}in\mbox{]}}]何文字目以降に曾}入するのか \item[{\em str\mbox{[}in\mbox{]}}]曾}入したい文字列 \item[{\em size\mbox{[}in\mbox{]}}]strの文字数。 \end{description}
\end{Desc}
\begin{Desc}
\item[{\bf Todo}]テストをする。この関数の実装は醜いので直す。 \end{Desc}
\index{dkcString.c@{dkc\-String.c}!dkcStringNum@{dkcStringNum}}
\index{dkcStringNum@{dkcStringNum}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}size\_\-t dkc\-String\-Num (const {\bf DKC\_\-STRING} $\ast$ {\em ptr})}\label{dkcString_8c_a28}


文字列の文字数を返す。内部streamをstrlenにかけたものを保存しておいたものを取得。 

\index{dkcString.c@{dkc\-String.c}!dkcStringPointer@{dkcStringPointer}}
\index{dkcStringPointer@{dkcStringPointer}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ WINAPI dkc\-String\-Pointer (const {\bf DKC\_\-STRING} $\ast$ {\em ptr})}\label{dkcString_8c_a29}


\index{dkcString.c@{dkc\-String.c}!dkcStringReplace@{dkcStringReplace}}
\index{dkcStringReplace@{dkcStringReplace}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-String\-Replace ({\bf DKC\_\-STRING} $\ast$ {\em ptr}, size\_\-t {\em begin\_\-}, size\_\-t {\em end\_\-}, const char $\ast$ {\em str}, size\_\-t {\em size})}\label{dkcString_8c_a26}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ptr\mbox{[}in\mbox{]}\mbox{[}out\mbox{]}}]{\bf dkc\-Alloc\-String()}{\rm (p.\,\pageref{dkcString_8c_a20})}で確保したポインタ \item[{\em begin\_\-\mbox{[}in\mbox{]}}]何処から(何文字目から \item[{\em end\_\-\mbox{[}in\mbox{]}}]何処まで(何文字目まで)注意：begin\_\-からn byteまで　とかではない。 \item[{\em str\mbox{[}in\mbox{]}}]置換したい文字列 \item[{\em size\mbox{[}in\mbox{]}}]strの文字数。 \end{description}
\end{Desc}
\begin{Desc}
\item[{\bf Todo}]テストをする。この関数の実装は醜いので直す。 \end{Desc}
\index{dkcString.c@{dkc\-String.c}!dkcStringSize@{dkcStringSize}}
\index{dkcStringSize@{dkcStringSize}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}size\_\-t dkc\-String\-Size (const {\bf DKC\_\-STRING} $\ast$ {\em ptr})}\label{dkcString_8c_a27}


\index{dkcString.c@{dkc\-String.c}!dkcStrStr@{dkcStrStr}}
\index{dkcStrStr@{dkcStrStr}!dkcString.c@{dkc\-String.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int WINAPI dkc\-Str\-Str (const char $\ast$ {\em dest}, const char $\ast$ {\em src})}\label{dkcString_8c_a17}


strstrのWrapper \begin{Desc}
\item[Returns:]最初に見つかった位置を返す -1なら見つからない \end{Desc}
