passing string argument to external C function

From: James McPhee <jmcphee_at_nyahnyahspammersnyahnyah>
Date: Tue, 30 Jan 2007 18:02:29 -0800

Dear All,

I'm trying to implement a ncl-callable external C routine that
unpacks binary data. I have been able to compile and link the
original C source code (obtained from third party) and the C wrapper
code (mine) into a shared object that then I try to load using the
"external" command in ncl.

The idea is to pass the filename (a string) of the dataset to the
external function from NCL. However, when I try to do this the
unpacking routine complains. It seems that the value of the string is
being lost somewhere, possibly during the call to NclGetArgValue in
the wrapper routine. I've been playing around A LOT with this and
can't find the source of the error. I tried reproducing some of the
examples found in the NCL website (cquad, arcln) but those only
illustrate the case of double arguments. Disclaimer: I'm not much of
a C programmer :-(

I'm attaching my source files and a sample dataset. I'll be grateful
if someone could provide advice...

James

James McPhee
Profesor Asistente, Departamento de Ingenieria Civil
Facultad de Ciencias Fisicas y Matematicas, Universidad de Chile
Av. Blanco Encalada 2002 piso 3
Santiago, Chile
tel: +56-2-9784400
jmcphee_at_ing.uchile.cl
http://www.cec.uchile.cl/~jmcphee

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Jan 30 2007 - 19:02:29 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 05 2007 - 10:20:04 MST