[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The functions in EB Library set the global variable eb_error
,
when they fail to accomplish a job.
The variable eb_error
stores an error code of the last error
raised in EB Library functions.
EB Library has error messages for all error codes.
eb_error_message()
returns the error messages according to
the current value of eb_error
.
fprintf(stderr, "failed to bind a book, %s\n", eb_error_message()); |
If eb_error
has been set to EB_ERR_TOO_LONG_FILENAME
, it
outputs the following error message.
failed to bind a book, too long filename. |
4.1 Tolerance to Error 4.2 Data Types 4.3 Global Variables 4.4 Functions 4.5 Error Codes
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An EB_Book
object has some state parameters.
Also whether the object is bound to a CD-ROM book or not is
one of the paramters.
Some of the functions which take a pointer to an EB_Book
object
as an argument expect that a certain parameter of the referred object
has been set beforehand.
For example, eb_path()
expects that the object is bound.
What's happen if do you give the unbound object to eb_path()
?
EB_Book book; eb_initialize(&book); eb_path(&book); /* What's happen? */ |
In this case, eb_path()
returns NULL
and sets
eb_error
to EB_ERR_UNBOUND_BOOK
.
Thus, EB library functions precisely reject objects whose required
parameter is not set.
However, the follwoing action makes your program abort.
eb_path(NULL); /* abort! */ |
EB Library functions doesn't inspect whether a pointer given as an
argument is NULL
, unless the function description says that it
accepts NULL
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Please include `eb/error.h' to use the data types described in this section:
#include <eb/error.h> |
The EB_Error_Code
type represents an error code defined in EB
Library.
EB Library defines EB_NUM_ERRORS
error types.
This type is defined from a signed integral type, so that you can compare
two codes by the ==
and !=
binomial operators.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Please include `eb/error.h' to set and/or refer the variables described in this section:
#include <eb/error.h> |
The functions in EB Library set the global variable eb_error
,
when the function fails to accomplish a job.
The variable eb_error
stores an error code of the last error
raised in EB Library functions.
The library functions never clears this variable, even when a job is
accomplished without an error.
eb_error
stores the latest error only.
When another error occurs, the library functions ovewrite this variable.
Also you may overwrite the variable in your program.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Please include `eb/error.h' to use the functions described in this section:
#include <eb/error.h> |
The function eb_error_message()
returns the error message
according to the current value of eb_error
.
If eb_error
is set to a valid error-code, it returns the
corresponding error message.
Otherwise, it returns the string "unknown error".
The maximum length of the message is EB_MAXLEN_ERROR_MESSAGE
.
This function never changes the value of eb_error
.
The function eb_error_message2()
returns the error message
according to the error code code.
If code represents a valid error-code, it returns the corresponding
error message.
Otherwise, it returns the string "unknown error".
The maximum length of the message is EB_MAXLEN_ERROR_MESSAGE
.
This function never changes the value of eb_error
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
EB Library defines the following error codes. Please include `eb/error.h' to use the error codes.
#include <eb/error.h> |
No error occured.
EB Library invoked malloc()
, but NULL
was returned.
This error code is obsoleted.
eb_bind()
or eb_bind_appendix()
failed because the given
filename was too long.
eb_search_word()
, eb_search_endword()
or
eb_search_exactword()
failed because the given word was too long.
eb_search_word()
, eb_search_endword()
or
eb_search_exactword()
failed because the given word had an
invalid character.
eb_search_word()
, eb_search_endword()
or
eb_search_exactword()
failed because the given word was empty.
getcwd()
or getwd()
failed.
EB Library failed to open a `CATALOG' or `CATALOGS' file in a book.
EB Library failed to open a `CATALOG' or `CATALOGS' file in an appendix.
EB Library failed to open a `LANGUAGE' file in a book.
EB Library failed to open a `START' or `HONMON' file in a book.
EB Library failed to open a font file (files at `GAIJI' directory) in a book.
EB Library failed to open an `APPENDIX' or `FUROKU' file in an appendix.
EB Library failed to read a `CATALOG' or `CATALOGS' file in an book.
EB Library failed to read a `CATALOG' or `CATALOGS' file in an appendix.
EB Library failed to read a `LANGUAGE' file in a book.
EB Library failed to read a `START' or `HONMON' file in a book.
EB Library failed to read a font file (files at `GAIJI' directory) in a book.
EB Library failed to read an `APPENDIX' or `FUROKU' file in an appendix.
EB Library failed to seek a `CATALOG' or `CATALOGS' file in an book.
EB Library failed to seek a `CATALOG' or `CATALOGS' file in an appendix.
EB Library failed to seek a `LANGUAGE' file in a book.
EB Library failed to seek a `START' or `HONMON' file in a book.
EB Library failed to seek a font file (files at `GAIJI' directory) in a book.
EB Library failed to seek an `APPENDIX' or `FUROKU' file in an appendix.
EB Library happened to meet an unexpected data in a `CATALOG' or `CATALOGS' file in a book.
EB Library happened to meet an unexpected data in a `CATALOG' or `CATALOGS' file in an appendix.
EB Library happened to meet an unexpected data in a `LANGUAGE' file in a book.
EB Library happened to meet an unexpected data in a `START' or `HONMON' file in a book.
EB Library happened to meet an unexpected data in a font file (files at `GAIJI' directory) in a book.
EB Library happened to meet an unexpected data in an `APPENDIX' or `FUROKU' file in an appendix.
The invoked EB Library function requires a bound EB_Book
object
as an argument, but the given object was not bound.
The invoked EB Library function requires a bound EB_Appendix
object as an argument,but the given object was not bound.
The book had no language data.
The book had no subbook.
The appendix had no subbook.
The current language in a book had no message.
The current subbook in a book had no font.
The current subbook in a book didn't have a `START' nor `HONMON' file.
The invoked function requires that an EB_Book
object given as an
argument had set the current language, but the given book didn't not set
it.
The invoked function requires that an EB_Book
object given as an
argument had set the current subbook, but the given book didn't set it.
The invoked function requires that an appendix given as an argument had set the current subbook, but the given appendix didn't set it.
The invoked function requires that an EB_Book
object given as an
argument had set the current font height, but the given book didn't set
it.
An EB_Book
object and a language code were given to a function,
but the bound book didn't have the language with the code.
An EB_Book
object and a subbook code were given to a function,
but the bound book didn't have the subbook with the code.
An EB_Appendix
object and a subbook code were given to a function,
but the bound appendix didn't have the subbook with the code.
An EB_Book
object and a message code were given to a function,
but the currnet language of the bound book the object didn't have
the message with the code.
An EB_Book
object and a font ehgiht were given to a function,
but the currnet subbook of the bound book didn't have the font with the
height.
An EB_Book
object and a character number was given to a function,
but the current subbook of the bound book didn't have bitmap data of the
character number.
An EB_Appendix
object and a character number was given to a
function, but the current subbook of the bound appendix didn't have
an alternation string of the character number.
eb_search_word()
, eb_search_endword()
or
eb_search_exactword()
failed because the book didn't support
the search method.
An invalid hook code was given to a function.
An hook function returned -1.
A continuation of getting text contetns was requested, but the content type was different from that given at the previous call.
The EB_Book
object was given to eb_hit_list()
,
eb_heading()
, eb_rawtext()
or eb_text()
, but the
current subbook was different from that given at the previous call.
The EB_Book
object was given to eb_hit_list()
,
eb_heading()
, eb_rawtext()
or eb_text()
, but the
object was different from that given at the previous call.
You invoked eb_hit_list()
, but you had not invoked
eb_search_word()
, eb_search_endword()
nor
eb_search_exactword()
beforehand.
You invoked eb_text()
, eb_heading()
or eb_rawtext()
but you had not invoked eb_seek()
beforehand.
An EB_Book
object and a multi search code was given to a function,
but the current subbook of the bound book didn't have a multi search
with the code.
An EB_Book
object and a mulit search entry code was given to a
function, but the current subbook of the bound book didn't have a multi
search entry with the code.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |