cdds_openpr - open printout file

SYNOPSIS

#include "cdds.h"

int cdds_openpr(pname, id);

const char *pname
const char *id

[ Description | Examples ]


DESCRIPTION

cdds_openpr() first checks the command line for a user request of online help via the help= switch using cdds_switch. If help is requested, a standard header is written to the console and the return value is 1 (or 2 if non-DDS command arguments are present). Otherwise, a unique print file is opened up, a standard header is written to it, and the return value is 0. The print file is created using the program name, pname. If the file cannot be opened, the return value is -1. If a file is already opened, the return value is -2. The standard header is written by cdds_prthdr() using the program name, pname, and RCS Id, id (see NOTE on RCS). The other print routines can write to this print file.

NOTE: The RCS Id is a Revision Control Sysem keyword (CVS, RCS or Subversion). However, this parameters is really no longer used if the DDS Application makefiles are used. Instead, a svn_version.c file is created in the object directory and built into the code with the current subversion revision number. That way the revision number in the code will always reflect the latest revision number in the repository.

ier=cdds_openpr("filt", "$Id: openpr.html 57 2009-02-11 23:09:37Z ehlersjw $");
if (ier != 0) help();
...
cdds_prterr("illegal value=%f\n", value);
...
cdds_prtmsg("offset = %d\nangle =%f\n", ofst, angle);
...
if(!cdds_errors()) {
   ...
   cdds_prtcon("%d% complete\n", pct);
}
...
cdds_closepr();
     

SEE ALSO

cdds_prtmsg print message
cdds_prtcon print message to console
cdds_prterr print error message
cdds_errors check for print errors
cdds_closepr close out & termination
    

AUTHOR

Jerry Ehlers, BP America (May 2003)