aboutsummaryrefslogtreecommitdiff
path: root/src/nad_init.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2018-12-31 11:37:51 +0100
committerGitHub <noreply@github.com>2018-12-31 11:37:51 +0100
commit32f3ef47e55c38b0eabb6d781fee3944d3239414 (patch)
treeba2850500ee732559bada055dbab281ceff49a22 /src/nad_init.cpp
parent5c41d3a1078895ed096b416db15c91108bccad87 (diff)
parent0e0e0e475414ddeb75e0e140d8a3381a431036d9 (diff)
downloadPROJ-32f3ef47e55c38b0eabb6d781fee3944d3239414.tar.gz
PROJ-32f3ef47e55c38b0eabb6d781fee3944d3239414.zip
Merge pull request #1208 from rouault/merge_PJ_and_PJ_OBJ
Unify PJ_OBJ and PJ structures
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;