<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>doc_inner/doxygen/latex/load_8c_source.tex</title>
<meta name='robots' content='noindex,nofollow' />
<meta name='generator' content='GLOBAL-6.6.14' />
<meta http-equiv='Content-Style-Type' content='text/css' />
<link rel='stylesheet' type='text/css' href='../style.css' />
</head>
<body>
<a id='TOP' name='TOP'></a><h2 class='header'><a href='../mains.html'>root</a>/<a href='../files/2920.html'>doc_inner</a>/<a href='../files/2921.html'>doxygen</a>/<a href='../files/2922.html'>latex</a>/load_8c_source.tex</h2>
<em class='comment'>/* [<][>][^][v][top]<a href='#BOTTOM'>[bottom]</a><a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</em>
<hr />
<pre>
<a id='L1' name='L1'></a>\doxysection{load.\+c}
<a id='L2' name='L2'></a>\label{load_8c_source}\index{src/load.c@{src/load.c}}
<a id='L3' name='L3'></a>\textbf{ Go to the documentation of this file.}
<a id='L4' name='L4'></a>\begin{DoxyCode}{0}
<a id='L5' name='L5'></a>\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
<a id='L6' name='L6'></a>\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#include\ <string.h>}}
<a id='L7' name='L7'></a>\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include\ <assert.h>}}
<a id='L8' name='L8'></a>\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <stdlib.h>}}
<a id='L9' name='L9'></a>\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <ctype.h>}}
<a id='L10' name='L10'></a>\DoxyCodeLine{00006\ }
<a id='L11' name='L11'></a>\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ "{}word.h"{}}}
<a id='L12' name='L12'></a>\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ "{}struct.h"{}}}
<a id='L13' name='L13'></a>\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ "{}cerr.h"{}}}
<a id='L14' name='L14'></a>\DoxyCodeLine{00010\ }
<a id='L15' name='L15'></a>\DoxyCodeLine{00014\ \textcolor{keyword}{static}\ CERR\ cerr\_load[]\ =\ \{}
<a id='L16' name='L16'></a>\DoxyCodeLine{00015\ \ \ \ \ \{\ 210,\ \textcolor{stringliteral}{"{}load\ -\/\ memory\ overflow"{}}\ \},}
<a id='L17' name='L17'></a>\DoxyCodeLine{00016\ \ \ \ \ \{\ 211,\ \textcolor{stringliteral}{"{}object\ file\ not\ specified"{}}\ \},}
<a id='L18' name='L18'></a>\DoxyCodeLine{00017\ \ \ \ \ \{\ 212,\ \textcolor{stringliteral}{"{}invalid\ option"{}}\ \},}
<a id='L19' name='L19'></a>\DoxyCodeLine{00018\ \ \ \ \ \{\ 213,\ \textcolor{stringliteral}{"{}invalid\ argument"{}}\ \},}
<a id='L20' name='L20'></a>\DoxyCodeLine{00019\ \};}
<a id='L21' name='L21'></a>\DoxyCodeLine{00020\ }
<a id='L22' name='L22'></a>\DoxyCodeLine{00021\ \textcolor{comment}{/*\ load.hで定義された関数群\ */}}
<a id='L23' name='L23'></a>\DoxyCodeLine{00022\ \textcolor{keywordtype}{void}\ addcerrlist\_load()}
<a id='L24' name='L24'></a>\DoxyCodeLine{00023\ \{}
<a id='L25' name='L25'></a>\DoxyCodeLine{00024\ \ \ \ \ addcerrlist(ARRAYSIZE(cerr\_load),\ cerr\_load);}
<a id='L26' name='L26'></a>\DoxyCodeLine{00025\ \}}
<a id='L27' name='L27'></a>\DoxyCodeLine{00026\ }
<a id='L28' name='L28'></a>\DoxyCodeLine{00027\ WORD\ loadassemble(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *file,\ WORD\ start)}
<a id='L29' name='L29'></a>\DoxyCodeLine{00028\ \{}
<a id='L30' name='L30'></a>\DoxyCodeLine{00029\ \ \ \ \ FILE\ *fp\ =\ NULL;}
<a id='L31' name='L31'></a>\DoxyCodeLine{00030\ \ \ \ \ WORD\ end\ =\ 0;}
<a id='L32' name='L32'></a>\DoxyCodeLine{00031\ }
<a id='L33' name='L33'></a>\DoxyCodeLine{00032\ \ \ \ \ assert(file\ !=\ NULL);}
<a id='L34' name='L34'></a>\DoxyCodeLine{00033\ \ \ \ \ \textcolor{keywordflow}{if}((fp\ =\ fopen(file,\ \textcolor{stringliteral}{"{}rb"{}}))\ ==\ NULL)\ \{}
<a id='L35' name='L35'></a>\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ perror(file);}
<a id='L36' name='L36'></a>\DoxyCodeLine{00035\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
<a id='L37' name='L37'></a>\DoxyCodeLine{00036\ \ \ \ \ \}}
<a id='L38' name='L38'></a>\DoxyCodeLine{00037\ \ \ \ \ end\ =\ start\ +\ fread(sys-\/>memory\ +\ start,\ \textcolor{keyword}{sizeof}(WORD),\ sys-\/>memsize\ -\/\ start,\ fp);}
<a id='L39' name='L39'></a>\DoxyCodeLine{00038\ \ \ \ \ \textcolor{keywordflow}{if}(end\ ==\ sys-\/>memsize)\ \{}
<a id='L40' name='L40'></a>\DoxyCodeLine{00039\ \ \ \ \ \ \ \ \ setcerr(210,\ file);\ \ \ \ \textcolor{comment}{/*\ load\ -\/\ memory\ overflow\ */}}
<a id='L41' name='L41'></a>\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ fprintf(stderr,\ \textcolor{stringliteral}{"{}Load\ error\ -\/\ \%d:\ \%s\(\backslash\)n"{}},\ cerr-\/>num,\ cerr-\/>msg);}
<a id='L42' name='L42'></a>\DoxyCodeLine{00041\ \ \ \ \ \}}
<a id='L43' name='L43'></a>\DoxyCodeLine{00042\ \ \ \ \ fclose(fp);}
<a id='L44' name='L44'></a>\DoxyCodeLine{00043\ \ \ \ \ \textcolor{keywordflow}{return}\ end;}
<a id='L45' name='L45'></a>\DoxyCodeLine{00044\ \}}
<a id='L46' name='L46'></a>
<a id='L47' name='L47'></a>\end{DoxyCode}
</pre>
<hr />
<a id='BOTTOM' name='BOTTOM'></a>
<em class='comment'>/* [<][>][^][v]<a href='#TOP'>[top]</a>[bottom]<a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</em>
</body>
</html>