Vis5D Documentation
<<< Previous | The v5dimport Utility | Next >>>

# Adding support for new file format

v5dimport was written so that adding code to read new file formats should be easy. The source code for v5dimport is in the `src/` subdirectory (see especially `v5dimport.c` and `file_i.c`). Look for the comment:

    /*** ADD NEW FORMATS HERE ***/

to see where code has to be added to support a new file format.

Basically, you need to write two new functions. One which scans your file format to build a list of grid_info structs. The other reads the actual grid data from your file given a grid_info struct. These functions should be put in a new file named `read_foo.c` where foo is the name of your file format. Then, update the `file.c` file to use your functions. Use the existing `read_*.c` files as a guide.

<<< Previous | Home | Next >>>
Using v5dimport's text interface | Up | Notes on specific file formats