Design for ASCII2DDR

ASCII2DDR is a DDR format conversion application that runs under the LAS environment. ASCII2DDR will convert an ASCII DDR file to binary format. The ASCII DDR file is created by the DSPDDR application output being output to a file.

Design Tree

ASCII2DDR
      |
      |----ascii2ddr
                |
                |------c_inlas
                |
                |------get_par
                |          |
                |          |------p_find
                |          |
                |          |------c_getsys
                |          |
                |          |------c_getnam
                |          |
                |          |------access
                |          |
                |          |------p_find
                |          |
                |          |------c_cmhost
                |          |
                |          |------access
                |
                |------parse_ascddr
                |            |
                |            |------fopen
                |            |
                |            |------read_criticals
                |            |              |
                |            |              |------skip_line
                |            |              |         |
                |            |              |         |------fgets
                |            |              |         |
                |            |              |         |------feof
                |            |              |
                |            |              |------read_line
                |            |              |         |
                |            |              |         |------fgets
                |            |              |         |
                |            |              |         |------feof
                |            |              |
                |            |              |------sscanf
                |            |              |
                |            |              |------c_low2up
                |            |              |
                |            |              |------skip_line
                |            |
                |            |------read_noncriticals
                |            |              |
                |            |              |------get_proj_code
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |
                |            |              |------get_zone_code
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |
                |            |              |------get_datum_code
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |
                |            |              |------get_proj_parms
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_check_proj_params
                |            |              |
                |            |              |------get_corn_coords
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |
                |            |              |------get_proj_dist
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |
                |            |              |------get_proj_unit
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |             |
                |            |              |             |------c_low2up
                |            |              |
                |            |              |------get_inc
                |            |              |         |
                |            |              |         |------read_line
                |            |              |         |
                |            |              |         |------sscanf
                |            |              |         |
                |            |              |         |------c_low2up
                |            |              |
                |            |              |------get_mast_coords
                |            |              |             |
                |            |              |             |------read_line
                |            |              |             |
                |            |              |             |------sscanf
                |            |              |             |
                |            |              |             |------c_low2up
                |            |
                |            |------read_bddrs
                |            |          |
                |            |          |------skip_line
                |            |          |
                |            |          |------read_line
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------skip_line
                |            |          |
                |            |          |------read_line
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------c_low2up
                |            |          |
                |            |          |------read_line
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------c_low2up
                |            |          |
                |            |          |------skip_line
                |            |          |
                |            |          |------read_line
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------read_line
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------read_line
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------read_line
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------read_line
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------sscanf
                |            |          |
                |            |          |------fgets
                |            |          |
                |            |          |------feof
                |            |
                |            |------fclose
                |
                |------c_install_cleanup_handler
                |
                |------c_putddr
                |
                |------c_putbdr
                |
                |------c_lused
                |
                |------c_remove_cleanup_handler
                |
                |------c_complt

Module Designs

Appropriate error handling will be used throughout this application. The return status of all routine, support function, and system calls will be verified for successful completion. If any return status indicates a function or system call failed, appropriate action will be taken. This constitutes of either issuing a warning message and continuing execution of the program, or issuing a fatal error message and returning E_FAIL to the calling routine. This failure status will continue to be passed up through the function calls until the main function of the application receives the failure status, which will cause the application to free allocated memory for the DDR and BDDR structures and exit.

1. ASCII2DDR ------> Main function

    Algorithm:


2. ascii2ddr ------> Contains the main function which calls the routine to parse the ASCII DDR file and writes the retrieved information to the binary DDR file.
    Algorithm:


3. get_par ------> This function retrieves the parameters from TAE and verifies that they are correct.
    Algorithm:


4. parse_ascddr ------> This function reads the DDR field values, validating each as it is read in, and places the values into DDR and BDDR structures.
    Algorithm:


5. read_criticals ------> This function reads the critical DDR field values, validating each as it is read in. These are the field values that will cause the application to exit with a fatal error if they are invalid.
    Algorithm:


6. skip_line ------> This function skips the next line in the ASCII DDR file.
    Algorithm:


7. read_line ------> This function reads the next line from the ASCII DDR file.
    Algorithm:


8. read_noncriticals ------> This function calls the routines to read the non-critical DDR field values.
    Algorithm:


9. get_proj_code ------> This function retrieves the projection code and projection code validity flag and validates them.
    Algorithm:


10. get_zone_code ------> This function retrieves the zone code and zone code validity flag and validates them.
    Algorithm:


11. get_datum_code ------> This function retrieves the datum code and datum code validity flag and validates them.
    Algorithm:


12. get_proj_parms ------> This function retrieves the projection parameters and projection parameters validity flag and validates them.
    Algorithm:


13. get_corn_coords ------> This function retrieves the corner coordinates and corner coordinates validity flag and validates them.
    Algorithm:


14. get_proj_dist ------> This function retrieves the projection distance and projection distance validity flag and validates them.
    Algorithm:


15. get_proj_unit ------> This function retrieves the projection units and projection units validity flag and validates them.
    Algorithm:


16. get_inc ------> This function retrieves the line/sample increments and the line/sample increments' vaidity flag and validates them.
    Algorithm:


17. get_mast_coords ------> This function retrieves the master coordinates and validates them.
    Algorithm:


18. read_bddrs ------> This function reads the BDDR field values, validating each as it is read in.
    Algorithm:


19. signal_cleanup ------> Signal handling routine.
    Algorithm:


20. cleanup_files ------> This function removes the output DDR file that was created if the application gets terminated during processing and $DELFLG is set.
    Algorithm: