Routines in Pbdt_rtn.c

The file contains the following routines:


CVT_FILNAM_MAGID: Routine to convert a filename into a Magazine ID

/************************************************************************/
/*									                                    */
/*    CVT_FILNAM_MAGID - Convert a filename into a Magazine ID			*/
/*									                                    */
/*    Calling Format:							                        */
/*									                                    */
/*	    mgidbuf_ptr = CVT_FILNAM_MAGID (prtfil_ptr, inpbuf_ptr,			*/
/*										err_flag);			            */
/*									                                    */
/*    Where:								                            */
/*									                                    */
/*	    mgidbuf_ptr = Pointer to buffer holding Magazine ID		        */
/*		prtfil_ptr  = Pointer to log file (may be NULL)					*/
/*	    inpbuf_ptr  = Pointer to buffer holding file name	            */
/*		err_flag    = PSP_TRUE if errors are to be logged				*/
/*									                                    */
/*    This routine converts a file name into the associated Magazine	*/
/*	  ID, returning ********** if conversion fails.						*/
/*									                                    */
/************************************************************************/

CVT_NEWDATE: xxx

/************************************************************************/
/*																		*/
/*    CVT_NEWDATE - Convert a field containing date or issue details	*/
/*					in the new format into the old format.				*/
/*																		*/
/*    Calling Format:													*/
/*																		*/
/*		status = CVT_NEWDATE (date_ptr, buff_ptr, bufsize, prtfil_ptr);	*/
/*																		*/
/*    Where:															*/
/*																		*/
/*		status		= PSP_TRUE if publication details are valid			*/
/*					= PSP_FALSE otherwise								*/
/*		date_ptr    = Pointer to null-terminated buffer to convert		*/
/*		buff_ptr    = Pointer to buffer to hold converted date			*/
/*		bufsize     = Size of output buffer								*/
/*		prtfil_ptr  = Diagnostics file pointer.							*/
/*																		*/
/*	 This is simply a shell around CVT_NEW_INT and CVT_INT_OLD.			*/
/*																		*/
/*   The routine populates the datesegstr structures and will report	*/
/*	 any errors detected.												*/
/*																		*/
/************************************************************************/

FORMAT_PUBDET: Routine to format a set of publication details

/************************************************************************/
/*																		*/
/*    FORMAT_PUBDET - Format a set of publication details.				*/
/*																		*/
/*    Calling Format:													*/
/*																		*/
/*		FORMAT_PUBDET (outbuf_ptr, outbuflen, pubdet_ptr, fmtflag,		*/
/*					   prtfil_ptr);										*/
/*																		*/
/*    Where:															*/
/*																		*/
/*		output_ptr = Pointer to output buffer							*/
/*		outbuflen  = Size of output buffer								*/
/*		pubdet_ptr = Pointer to publication details						*/
/*		fmtflag	   = Flag indicating type of format required			*/
/*				   = FPDT_GENERAL (0) for default format				*/
/*				   = FPDT_BIBOTHER (1) for bibliography (not our book)	*/
/*				   = FPDT_BIBOURS (2) for bibliography (our book)		*/
/*				   = FPDT_MAGNAME (3) for magazine name/issue			*/
/*		prtfil_ptr = Diagnostics file pointer.							*/
/*																		*/
/*    This routine is just a shell around CVT_NEW_INT or CVT_OLD_INT	*/
/*	  and CVT_INT_EXT.													*/
/*																		*/
/************************************************************************/

PARSE_ISSUE: Routine to parse an issue field

/****************************************************************************/
/*																			*/
/*		PARSE_ISSUE - Parse an Issue Number string							*/
/*																			*/
/*    Calling Format:														*/
/*																			*/
/*		count = PARSE_ISSUE (buff_ptr, issbuf_ptr);							*/
/*																			*/
/*    Where:																*/
/*																			*/
/*		count        = number of characters translated						*/
/*					 = 0 if no issue number detected						*/
/*					 = -1 if issue detected but string is invalid			*/
/*		buff_ptr	 = Pointer to input string								*/
/*		issbuf_ptr   = Pointer to buffer to hold numeric issue number		*/
/*																			*/
/****************************************************************************/

PARSE_PUBDET: Routine to parse a set of Publication Details

/****************************************************************************/
/*																			*/
/*	  PARSE_PUBDET - Parse a set of publication details						*/
/*																			*/
/*    Calling Format:														*/
/*																			*/
/*		status = PARSE_PUBDET (buff_ptr, newabbptr_ptr, oldabbptr_ptr,		*/
/*							   dateptr_ptr, prtfil_ptr, error_flag);		*/
/*																			*/
/*    Where:																*/
/*																			*/
/*		status        = PSP_TRUE if item type is valid						*/
/*				      = PSP_FALSE otherwise									*/
/*		buff_ptr	  = Pointer to input string								*/
/*		newabbptr_ptr = Pointer to char* to hold ptr to new-style abbrev.	*/
/*		oldabbptr_ptr = Pointer to char* to hold ptr to old-style abbrev.	*/
/*		dateptr_ptr	  = Pointer to char* to hold ptr to numeric date equiv	*/
/*		prtfil_ptr    = Diagnostics file pointer							*/
/*		error_flag	  = PSP_TRUE if errors are to be reported				*/
/*					  = PSP_FALSE otherwise									*/
/*																			*/
/*    This routine parses a set of publication details along the lines of:	*/
/*																			*/
/*    Argosy Weekly [v  7 #7, Whole number 319, January 12, 1889]			*/
/*																			*/
/*  into the format used by the catalogue programs:							*/
/*																			*/
/*    |AGW|1889|Jan12|(v7:7)|(#319)|										*/
/*  or  1889AGWJan12														*/
/*																			*/
/****************************************************************************/

PARSE_VOLUME: Routine to parse a volume/issue field

/****************************************************************************/
/*																			*/
/*		PARSE_VOLUME - Parse a set of Volume/Issue string					*/
/*																			*/
/*    Calling Format:														*/
/*																			*/
/*		count = PARSE_VOLUME (buff_ptr, volbuf_ptr, issbuf_ptr);			*/
/*																			*/
/*    Where:																*/
/*																			*/
/*		count        = number of characters translated						*/
/*					 = 0 if no volume number detected						*/
/*					 = -1 if volume detected but string is invalid			*/
/*		buff_ptr	 = Pointer to input string								*/
/*		volbuf_ptr   = Pointer to buffer to hold numeric volume number		*/
/*		issbuf_ptr   = Pointer to buffer to hold numeric issue number		*/
/*																			*/
/****************************************************************************/

VAL_PUBDET: Routine to validate a set of publication details

/************************************************************************/
/*																		*/
/*    VAL_PUBDET - Validate a buffer containing publication details		*/
/*																		*/
/*    Calling Format:													*/
/*																		*/
/*		status = VAL_PUBDET (pubdet_ptr, yearbuf_ptr, abbbuf_ptr,		*/
/*							 prtfil_ptr);								*/
/*																		*/
/*    Where:															*/
/*																		*/
/*		status		= PSP_TRUE if publication details are valid			*/
/*					= PSP_FALSE otherwise								*/
/*		yearbuf_ptr	= pointer to char[5] to hold year part of date		*/
/*		abbbuf_ptr	= optional pointer to char[8] to hold abbreviation	*/
/*		prtfil_ptr = Diagnostics file pointer.							*/
/*																		*/
/*    This routine checks the input buffer to see if it contains a		*/
/*    valid set of publication details.  It first checks that the		*/
/*	  abbreviation if valid and then calls CVT_OLD_INT or CVT_NEW_INT	*/
/*	  as appropriate.													*/
/*																		*/
/*    The routine will report any errors detected.						*/
/*																		*/
/************************************************************************/