nl_response

Synopsis

    
    #include "nortlib.h"
    int nl_response;
    int set_response(int newval);
    

Description

The nl_response setting determines how most all nortlib functions react to errors. nl_response may be set to any value acceptable as a level argument to nl_error() or msg(). By default, nl_response is set to 3, which means any error in a nortlib function will be considered a fatal error. By changing the setting to 1, an error will simply be reported as a warning.

The philosophy here is that if you have not taken steps to handle an error condition, then the error condition cannot be tolerated. This makes it possible to write simple programs simply and to find out if more sophisticated error handling is required. In many cases, additional error handling will not be required; If your program need to communicate with a particular server and the server cannot be located, that probably should be a fatal error, and no further programming is required to make it so. Additional code is only required when you wish to selectively tolerate specific errors.

set_response() is a convenient way to manipulate nl_response. It sets nl_response to a new value and returns the old value so that it can be saved and restored after the current operation is completed.

Returns

set_response() returns the old value of nl_response so that it can be saved and restored.

See Also

nl_error().

Source File

/usr/local/src/nortlib/nlresp.c

Alphabetical List
Subject List
Return to Manuals Page
webmaster@huarp.harvard.edu
Copyright 2001 by the President and Fellows of Harvard College