[GRASS5] Need help porting C code

  This is not directly related to the development of GRASS5, so I hope I'm
not too out of line. I would greatly appreciate some guidance from linux
programmers in porting my first DOS C program to linux.

  The program takes an ARC/Info .grd file (the exported DEM) and creates an
ASCII x, y, z file from it. I wrote this about 6 years ago and used it
extensively to get DEM data into MapInfo. Since I still can't migrate all my
existing MI data to GRASS, I'm stuck with the former to complete projects on
schedule. Ergo, I need to translate some ARC/Info DEMs (.grd files) from
within the linux environment.

  If you contact me off-list, I'll forward the three small files (.c,
Makefile and the .rsp file for the linker) privately. Of course, if this
tool is useful to the GRASS community in general, I'll contribute it without
reservation.

TIA,

Rich

Dr. Richard B. Shepard, President

                       Applied Ecosystem Services, Inc. (TM)
              Making environmentally-responsible mining happen. (SM)
                       --------------------------------
            2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Thu, Jul 13, 2000 at 08:10:09AM -0700, Rich Shepard wrote:

  This is not directly related to the development of GRASS5, so I hope I'm
not too out of line. I would greatly appreciate some guidance from linux
programmers in porting my first DOS C program to linux.

Because this might be a question of general interested I answer it
on the list. :slight_smile:

Porting C programs to GNU/Linux is mostly easy.
GNU/Linux and most other unix have standard ANSI-C compilers and conform
mostly to the POSIX system standard. The only thing you have to port is
if you use system specifc libaries or system calls.

If your program just deals with reading, translating and writing text
or binary formats it should be portable right away. Two pitfalls are the
different line endings in text format and the binary option for reading
and writing binary files. You also make sure the endianess is conserved
for all cases.

  If you contact me off-list, I'll forward the three small files (.c,
Makefile and the .rsp file for the linker) privately. Of course, if this
tool is useful to the GRASS community in general, I'll contribute it without
reservation.

I would appreciate if you put it unter a free software license
and make it available online somewhere. If you think GPL is too strong
for your small tool, you can consider LGPL or the MIT style license.

Thanks,
  Bernhard

--
Professional Service around Free Software (intevation.net)
The FreeGIS Project (freegis.org)
Association for a Free Informational Infrastructure (ffii.org)