/*****************************************************************************/
/***                                                                       ***/
/***                             open_files()                              ***/
/***           Opens input and output raster files for r.example	   ***/
/***                    Jo Wood, V1.1, 13th September, 1995                ***/
/***                                                                       ***/
/*****************************************************************************/

#include "example.h"

open_files()
{
    /* Open existing files and set the input file descriptors */

    if ( (fd_rast1_in=G_open_cell_old(rast1_in_name,mapset1_in)) <0)
    {
        char err[256];
        sprintf(err,"ERROR: Problem opening first input file.");
        G_fatal_error(err);
    }
    
    if ( (fd_rast2_in=G_open_cell_old(rast2_in_name,mapset2_in)) <0)
    {
        char err[256];
        sprintf(err,"ERROR: Problem opening second input file.");
        G_fatal_error(err);
    }
    

    /* Open new file and set the output file descriptor. */

    if ( (fd_out=G_open_cell_new(rast_out_name)) <0)
    {
        char err[256];
        sprintf(err,"ERROR: Problem opening output file.");
        G_fatal_error(err);
    }

}

