libnewPidf/libPidfUtil Documentation

written by Carrie Gonzalez and Joey Mukherjee -
CGonzalez@swri.org

Table of contents

  1. Overview
  2. libnewPidf information
    1. PIDF Documentation
    2. ReadPidf
    3. Adding structures to the PIDF
    4. Adding fields to the PIDF
  3. libPidfUtil information

Overview

libnewPidf is very tightly coupled with libPidfUtil. The reasons are mainly historical; however, it does not make sense to call libnewPidf on its own. Therefore, there is no "real" public interface to libnewPidf. The routine used to access the PIDF is ReadPidf and this is actually in libPidfUtil. When linking, make sure you reference libPidfUtil after libnewPidf. When compiling, the only header file one needs is libPidfUtil.h.

libPidfUtil is made up several routines which may not be documented currently. This will eventually change.

Adding Structures to the PIDF

  1. Create a new .c file that has the appropriate keywords in it. (I copy DataQual.c and edit it to the new one)
  2. Add an entry in ReadPidfRec.
  3. Add the prototype to pidf.h
  4. Add any defines to pidf_defs.h
  5. Add to Imakefile

Adding Fields to the PIDF

To add new fields to the PIDF (programming experience necessary) :

The file you will need to edit are :

pidf.h pidf_ret.h newRead.c

  1. Decide on what the keywords should be. It is recommended that you make them somewhat meaningful to the reader of the PIDF even if he uses a builder. Also decide whether it is an int, char, string, int list, char list, or string list.
  2. Add the keyword to the PIDF.
  3. Determine a "what" value to be used by ReadPidf. (i.e. BINSWPINDEX). It is recommended that you use something similar to what is in the PIDF. Make it all uppercase with no underscores and add it to the file "pidf.h" as part of the PIDF enumerated type.
  4. Add the "what" value and PIDF keyword to the appropriate ".c" file. (i.e. if its a Scan keyword, it goes in Sweep.c, a Binning keyword goes in "Bin.c")
  5. Add the "what" value to the routines CheckReturnType and PIDF_Return_Code in newRead.c.
  6. Add the error code to pidf_ret.h. It is recommended that you use FORMAT_ERR_. Also change the PIDF_STOP define.
  7. Add the error msg in libErrorMsgs in pidf_err_str.c.