~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to swig/perl/R_slope_aspect/r_slope_aspect/opennew.c

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <stdlib.h>
2
 
#include <grass/gis.h>
3
 
#include <grass/glocale.h>
4
 
 
5
 
 
6
 
int opennew(char *name, RASTER_MAP_TYPE wr_type)
7
 
{
8
 
    int fd;
9
 
 
10
 
    if (G_legal_filename(name) < 0)
11
 
        G_fatal_error(_("<%s> is an illegal file name"), name);
12
 
 
13
 
    if (wr_type < 0)            /* default fp type */
14
 
        fd = G_open_fp_cell_new(name);
15
 
    else
16
 
        fd = G_open_raster_new(name, wr_type);
17
 
 
18
 
    if (fd < 0)
19
 
        G_fatal_error(_("Failed in attempt to open %s"), name);
20
 
 
21
 
    return fd;
22
 
}