aboutsummaryrefslogtreecommitdiff
path: root/src/nad_init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/nad_init.cpp')
-rw-r--r--src/nad_init.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/nad_init.cpp b/src/nad_init.cpp
index 1e2b150d..d9701e70 100644
--- a/src/nad_init.cpp
+++ b/src/nad_init.cpp
@@ -33,7 +33,8 @@
#include <stdlib.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/************************************************************************/
/* swap_words() */
@@ -73,9 +74,10 @@ static void swap_words( void *data_in, int word_size, int word_count )
/* Load the data portion of a ctable formatted grid. */
/************************************************************************/
-int nad_ctable_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
+int nad_ctable_load( projCtx ctx, struct CTABLE *ct, struct projFileAPI_t* fileapi )
{
+ PAFile fid = (PAFile)fileapi;
size_t a_size;
pj_ctx_fseek( ctx, fid, sizeof(struct CTABLE), SEEK_SET );
@@ -104,8 +106,9 @@ int nad_ctable_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
/* Read the header portion of a "ctable" format grid. */
/************************************************************************/
-struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
+struct CTABLE *nad_ctable_init( projCtx ctx, struct projFileAPI_t* fileapi )
{
+ PAFile fid = (PAFile)fileapi;
struct CTABLE *ct;
int id_end;
@@ -148,9 +151,10 @@ struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
/* Load the data portion of a ctable2 formatted grid. */
/************************************************************************/
-int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
+int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, struct projFileAPI_t* fileapi )
{
+ PAFile fid = (PAFile)fileapi;
size_t a_size;
pj_ctx_fseek( ctx, fid, 160, SEEK_SET );
@@ -188,8 +192,9 @@ int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
/* Read the header portion of a "ctable2" format grid. */
/************************************************************************/
-struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid )
+struct CTABLE *nad_ctable2_init( projCtx ctx, struct projFileAPI_t* fileapi )
{
+ PAFile fid = (PAFile)fileapi;
struct CTABLE *ct;
int id_end;
char header[160];
@@ -274,10 +279,10 @@ struct CTABLE *nad_init(projCtx ctx, char *name)
return nullptr;
}
- ct = nad_ctable_init( ctx, fid );
+ ct = nad_ctable_init( ctx, (struct projFileAPI_t*)fid );
if( ct != nullptr )
{
- if( !nad_ctable_load( ctx, ct, fid ) )
+ if( !nad_ctable_load( ctx, ct, (struct projFileAPI_t*)fid ) )
{
nad_free( ct );
ct = nullptr;