Editing
Graphics development with vplot
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Handling errors== Device routines SHOULD NOT simply exit when they get a fatal error! All errors should be handled via the provided utility routine "ERR"! <syntaxhighlight lang="c"> #include "err.h" ERR (type, filter, fmt, a1, a2, a3) int type; char *filter; char *fmt; double a1, a2, a3; </syntaxhighlight> "Type" is one of the possibilities from "err.h". Currently there are three possibilities: COMMENT, WARN, FATAL. Case COMMENT is just for making remarks, not really error messages per se. Case WARN should be used when something is wrong, but the filter can take reasonable corrective action. Case FATAL is for errors that should cause abnormal termination of the program. Calls to ERR with type FATAL will not return. "Filter" should be the name of the filter generating the error or comment as you want it to appear in the message. Normally this should just be the variable "name" defined in <dev>conf.c. From here on ERR has the same syntax as "printf", except that ERR will automatically throw a carriage-return line-feed on for you (so you don't want to end with "\n"). After ERR has been called with type FATAL, dovplot and frontend will do necessary cleaning up, in the process calling dev.close. Device-dependent cleaning up should be done by that routine at that time. The define ERR is used so that conflicts with other subroutines named "error", "err", etc, can be avoided. Currently "ERR" is defined to be "filtererror", a name we haven't had any trouble with.
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information