Revision 10988 branches/v10/libraries/libjni-gdal/src/gdal_interfaz.c
gdal_interfaz.c | ||
---|---|---|
56 | 56 |
#include "es_gva_cit_jgdal_JNIBase.h" |
57 | 57 |
#include "gdal.h" |
58 | 58 |
#include "cpl_string.h" |
59 |
#include "signal.h" |
|
59 | 60 |
|
60 | 61 |
|
61 | 62 |
|
... | ... | |
71 | 72 |
GDALDatasetH *dataset; |
72 | 73 |
jlong jresult = 0 ; |
73 | 74 |
FILE *fich; |
74 |
|
|
75 |
|
|
75 | 76 |
pszFilename = (*env)->GetStringUTFChars(env, pszF, 0); |
76 | 77 |
|
77 | 78 |
fich=fopen( pszFilename, "r" ); |
... | ... | |
99 | 100 |
/******************************************************************************/ |
100 | 101 |
// OpenArray |
101 | 102 |
/******************************************************************************/ |
103 |
void handler(int n) { |
|
104 |
raise(SIGALRM); |
|
105 |
} |
|
102 | 106 |
|
103 |
|
|
104 | 107 |
JNIEXPORT jlong JNICALL Java_es_gva_cit_jgdal_Gdal_openArrayNat |
105 | 108 |
(JNIEnv *env, jobject obj, jbyteArray pszF, jint acc){ |
106 | 109 |
|
... | ... | |
110 | 113 |
jlong jresult = 0 ; |
111 | 114 |
FILE *fich; |
112 | 115 |
jsize longitud = 0, i; |
113 |
char *p;
|
|
114 |
|
|
116 |
signal(SIGSEGV, handler);
|
|
117 |
|
|
115 | 118 |
longitud = (*env)->GetArrayLength(env, pszF); |
116 | 119 |
pszFilename = (*env)->GetByteArrayElements(env, pszF, 0); |
117 | 120 |
|
... | ... | |
157 | 160 |
|
158 | 161 |
int res=-1; |
159 | 162 |
GDALDatasetH *dt = (GDALDatasetH *) 0 ; |
160 |
|
|
161 |
dt = *(GDALDatasetH **)&cPtr;
|
|
163 |
|
|
164 |
dt = *(GDALDatasetH **)&cPtr; |
|
162 | 165 |
if(dt!=NULL) |
163 | 166 |
res = GDALGetRasterXSize(dt); |
164 | 167 |
|
... | ... | |
501 | 504 |
return typeName; |
502 | 505 |
} |
503 | 506 |
|
504 |
|
|
507 |
|
Also available in: Unified diff