Repository: SETI/rms-cspyce (language: python)

Issue:
These cspyce methods are sure to error.
I suspect that the following functions in the list below are broken.

The three items in the list are the function name, the ARGNAMES for that function as calculated by cspyce, and the actual arguments of cspyce1.<function name>.  These are all the cases in which the lists have different number of elements.  

The definition in cspyce2 of say, dafps is

```
def dafps(dc, ic): 
    return cspyce1.dafps(dc, ic)
```

Since `cspyce1.dafps` takes 3 arguments, this is certain to fail.  I need to investigate further how cspyce calculates the ARGNAMES list.  It is clearly not working.  In an ideal word, the two lists would be nearly identical, beyond just having the same length.

```
dafps ['dc', 'ic'] ['nd', 'ni', 'nsum']
dlabbs_error ['handle'] ['handle', 'recno', 'begin', 'end']
dskp02 ['handle', 'dladsc', 'start'] ['handle', 'dladsc', 'start', 'room', 'n', 'plates']
dskv02 ['handle', 'dladsc', 'start'] ['handle', 'dladsc', 'start', 'room', 'n', 'vrtces']
dskxsi ['pri', 'target', 'srflst', 'et', 'fixref', 'vertex', 'raydir'] ['pri', 'target', 'nsurf', 'srflst', 'et', 'fixref', 'vertex', 'raydir']
dskxsi_error ['pri', 'target', 'srflst', 'et', 'fixref', 'vertex', 'raydir'] ['pri', 'target', 'nsurf', 'srflst', 'et', 'fixref', 'vertex', 'raydir']
dskxv ['pri', 'target', 'srflst', 'et', 'fixref', 'vtxarr', 'dirarr'] ['pri', 'target', 'nsurf', 'et', 'fixref', 'nrays', 'n2', 'n3', 'nv', 'xptarr', 'n4', 'fndarr']
ekaced ['handle', 'segno', 'recno', 'column', 'dvals', 'isnull'] ['handle', 'segno', 'recno', 'CONST_STRING', 'nvals', 'dvals', 'isnull']
ekacei ['handle', 'segno', 'recno', 'column', 'ivals', 'isnull'] ['handle', 'segno', 'recno', 'CONST_STRING', 'nvals', 'ivals', 'isnull']
ekaclc ['handle', 'segno', 'column', 'cvals', 'entszs', 'nlflgs', 'rcptrs'] ['handle', 'segno', 'column', 'vallen', 'cvals', 'entszs', 'nlflgs', 'rcptrs']
ekbseg ['handle', 'tabnam', 'cnames', 'decls'] ['handle', 'CONST_STRING', 'ncols', 'declen', 'decls']
ekifld ['handle', 'tabnam', 'nrows', 'cnames', 'decls'] ['handle', 'tabnam', 'nrows', 'ncols', 'declen', 'decls']
ekopn ['fname', 'ifname'] ['arg1', 'arg2', 'ncomch']
ekpsel ['query'] ['query', 'tabs', 'n4', 'cols', 'n5']
ekpsel_error ['query'] ['query', 'tabs', 'n4', 'cols', 'n5']
ekrcec ['handle', 'segno', 'recno', 'column'] ['handle', 'segno', 'recno', 'CONST_STRING', 'cvalen', 'nvals', 'cvals']
ekssum ['handle', 'segno'] ['handle', 'segno', 'nrows', 'cnames', 'n1']
ekuced ['handle', 'segno', 'recno', 'column', 'dvals', 'isnull'] ['handle', 'segno', 'recno', 'CONST_STRING', 'nvals', 'dvals', 'isnull']
ekucei ['handle', 'segno', 'recno', 'column', 'ivals', 'isnull'] ['handle', 'segno', 'recno', 'CONST_STRING', 'nvals', 'ivals', 'isnull']
fovray ['inst', 'raydir', 'rframe', 'abcorr', 'obsrvr', 'et'] ['inst', 'raydir', 'rframe', 'abcorr', 'obsrvr', 'et', 'visibl']
fovtrg ['inst', 'target', 'tshape', 'tframe', 'abcorr', 'obsrvr', 'et'] ['inst', 'target', 'tshape', 'tframe', 'abcorr', 'obsrvr', 'et', 'visibl']
gfevnt ['step', 'gquant', 'qpnams', 'qcpars', 'qdpars', 'qipars', 'qlpars', 'op', 'refval', 'tol', 'adjust', 'rpt', 'et0', 'et1'] ['step', 'gquant', 'qnpars', 'qpnams', 'qcpars', 'qdpars', 'qipars', 'qlpars', 'op', 'refval', 'tol', 'adjust', 'rpt', 'et0', 'et1']
isordv ['array'] ['array', 'n']
orderc ['array'] ['ndim', 'n', 'iorder']
orderd ['array'] ['array', 'n', 'iorder']
orderi ['array'] ['array', 'n', 'iorder']
qderiv ['f0', 'f2', 'delta'] ['ndim', 'ndim1', 'delta', 'ndim2', 'dfdt']
reordd ['iorder', 'array'] ['iorder', 'ndim', 'array']
reordi ['iorder', 'array'] ['iorder', 'ndim', 'array']
reordl ['iorder', 'array'] ['iorder', 'ndim', 'array']
shelld ['array'] ['ndim', 'array']
shelli ['array'] ['ndim', 'array']
spksfs ['body', 'et'] ['body', 'et', 'idlen', 'ident']
spksfs_error ['body', 'et'] ['body', 'et', 'idlen', 'ident']
```
These cspyce methods are sure to error.
I suspect that the following functions in the list below are broken.

The three items in the list are the function name, the ARGNAMES for that function as calculated by cspyce, and the actual arguments of cspyce1.<function name>.  These are all the cases in which the lists have different number of elements.  

The definition in cspyce2 of say, dafps is

```
def dafps(dc, ic): 
    return cspyce1.dafps(dc, ic)
```

Since `cspyce1.dafps` takes 3 arguments, this is certain to fail.  I need to investigate further how cspyce calculates the ARGNAMES list.  It is clearly not working.  In an ideal word, the two lists would be nearly identical, beyond just having the same length.

```
dafps ['dc', 'ic'] ['nd', 'ni', 'nsum']
dlabbs_error ['handle'] ['handle', 'recno', 'begin', 'end']
dskp02 ['handle', 'dladsc', 'start'] ['handle', 'dladsc', 'start', 'room', 'n', 'plates']
dskv02 ['handle', 'dladsc', 'start'] ['handle', 'dladsc', 'start', 'room', 'n', 'vrtces']
dskxsi ['pri', 'target', 'srflst', 'et', 'fixref', 'vertex', 'raydir'] ['pri', 'target', 'nsurf', 'srflst', 'et', 'fixref', 'vertex', 'raydir']
dskxsi_error ['pri', 'target', 'srflst', 'et', 'fixref', 'vertex', 'raydir'] ['pri', 'target', 'nsurf', 'srflst', 'et', 'fixref', 'vertex', 'raydir']
dskxv ['pri', 'target', 'srflst', 'et', 'fixref', 'vtxarr', 'dirarr'] ['pri', 'target', 'nsurf', 'et', 'fixref', 'nrays', 'n2', 'n3', 'nv', 'xptarr', 'n4', 'fndarr']
ekaced ['handle', 'segno', 'recno', 'column', 'dvals', 'isnull'] ['handle', 'segno', 'recno', 'CONST_STRING', 'nvals', 'dvals', 'isnull']
ekacei ['handle', 'segno', 'recno', 'column', 'ivals', 'isnull'] ['handle', 'segno', 'recno', 'CONST_STRING', 'nvals', 'ivals', 'isnull']
ekaclc ['handle', 'segno', 'column', 'cvals', 'entszs', 'nlflgs', 'rcptrs'] ['handle', 'segno', 'column', 'vallen', 'cvals', 'entszs', 'nlflgs', 'rcptrs']
ekbseg ['handle', 'tabnam', 'cnames', 'decls'] ['handle', 'CONST_STRING', 'ncols', 'declen', 'decls']
ekifld ['handle', 'tabnam', 'nrows', 'cnames', 'decls'] ['handle', 'tabnam', 'nrows', 'ncols', 'declen', 'decls']
ekopn ['fname', 'ifname'] ['arg1', 'arg2', 'ncomch']
ekpsel ['query'] ['query', 'tabs', 'n4', 'cols', 'n5']
ekpsel_error ['query'] ['query', 'tabs', 'n4', 'cols', 'n5']
ekrcec ['handle', 'segno', 'recno', 'column'] ['handle', 'segno', 'recno', 'CONST_STRING', 'cvalen', 'nvals', 'cvals']
ekssum ['handle', 'segno'] ['handle', 'segno', 'nrows', 'cnames', 'n1']
ekuced ['handle', 'segno', 'recno', 'column', 'dvals', 'isnull'] ['handle', 'segno', 'recno', 'CONST_STRING', 'nvals', 'dvals', 'isnull']
ekucei ['handle', 'segno', 'recno', 'column', 'ivals', 'isnull'] ['handle', 'segno', 'recno', 'CONST_STRING', 'nvals', 'ivals', 'isnull']
fovray ['inst', 'raydir', 'rframe', 'abcorr', 'obsrvr', 'et'] ['inst', 'raydir', 'rframe', 'abcorr', 'obsrvr', 'et', 'visibl']
fovtrg ['inst', 'target', 'tshape', 'tframe', 'abcorr', 'obsrvr', 'et'] ['inst', 'target', 'tshape', 'tframe', 'abcorr', 'obsrvr', 'et', 'visibl']
gfevnt ['step', 'gquant', 'qpnams', 'qcpars', 'qdpars', 'qipars', 'qlpars', 'op', 'refval', 'tol', 'adjust', 'rpt', 'et0', 'et1'] ['step', 'gquant', 'qnpars', 'qpnams', 'qcpars', 'qdpars', 'qipars', 'qlpars', 'op', 'refval', 'tol', 'adjust', 'rpt', 'et0', 'et1']
isordv ['array'] ['array', 'n']
orderc ['array'] ['ndim', 'n', 'iorder']
orderd ['array'] ['array', 'n', 'iorder']
orderi ['array'] ['array', 'n', 'iorder']
qderiv ['f0', 'f2', 'delta'] ['ndim', 'ndim1', 'delta', 'ndim2', 'dfdt']
reordd ['iorder', 'array'] ['iorder', 'ndim', 'array']
reordi ['iorder', 'array'] ['iorder', 'ndim', 'array']
reordl ['iorder', 'array'] ['iorder', 'ndim', 'array']
shelld ['array'] ['ndim', 'array']
shelli ['array'] ['ndim', 'array']
spksfs ['body', 'et'] ['body', 'et', 'idlen', 'ident']
spksfs_error ['body', 'et'] ['body', 'et', 'idlen', 'ident']
```


Discussion / hints:

Fix patch:
diff --git a/cspyce/cspyce1.py b/cspyce/cspyce1.py
index b9c63429..b424c64a 100644
--- a/cspyce/cspyce1.py
+++ b/cspyce/cspyce1.py
@@ -510,15 +510,15 @@ def dafgsr_error(handle, recno, begin, end):
 
     return data
 
-def dlabbs_error(handle, recno, begin, end):
-    (dladsc, found) = cspyce0.dafgsr(handle, recno, begin, end)
+def dlabbs_error(handle):
+    (dlabbs, found) = cspyce0.dlabbs(handle)
     if not found:
         chkin('dlabbs_error')
-        setmsg('DLA segment not found for handle {}'.format(handle))
+        setmsg(f'DLA segment not found for handle {handle}')
         sigerr('SPICE(DASFILEREADFAILED)')
         chkout('dlabbs_error')
 
-    return dladsc
+    return dlabbs
 
 def dlabfs_error(handle):
     (dladsc, found) = cspyce0.dlabfs(handle)
@@ -560,8 +560,8 @@ def dskx02_error(handle, dladsc, vertex, raydir):
 
     return [plid, xpt]
 
-def dskxsi_error(pri, target, nsurf, srflst, et, fixref, vertex, raydir):
-    (xpt, handle, dladsc, dskdsc, dc, ic, found) = cspyce0.dskxsi(pri, target, nsurf,
+def dskxsi_error(pri, target, srflst, et, fixref, vertex, raydir):
+    (xpt, handle, dladsc, dskdsc, dc, ic, found) = cspyce0.dskxsi(pri, target,
                                                                   srflst, et, fixref,
                                                                   vertex, raydir)
     if not found:
@@ -615,10 +615,8 @@ def ekgi_error(selidx, row, elment):
 
     return [idata, null]
 
-def ekpsel_error(query, tabs, n4, cols, n5):
-    (xbegs, xends, xtypes, xclass, tabs, cols, error, errmsg) = cspyce0.ekpsel(query,
-                                                                               tabs, n4,
-                                                                               cols, n5)
+def ekpsel_error(query):
+    (xbegs, xends, xtypes, xclass, tabs, cols, error, errmsg) = cspyce0.ekpsel(query)
     if error:
         chkin('ekpsel_error')
         setmsg(errmsg)
@@ -662,8 +660,8 @@ def kinfo_error(file):
 
     return [filtyp, srcfil, handle]
 
-def spksfs_error(body, et, idlen, ident):
-    (handle, descr, ident, found) = cspyce0.spksfs(body, et, idlen, ident)
+def spksfs_error(body, et,):
+    (handle, descr, ident, found) = cspyce0.spksfs(body, et)
     if not found:
         chkin('spksfs_error')
         setmsg('SPK segment not found for body "{}", time {}'.format(body, et))
@@ -1243,7 +1241,12 @@ def _vectorize_arglist(arglist, k):
 #     globals()[sename] = efunc
 #     globals()[vfname] = vfunc
 
-del func, vfunc, efunc, vefunc
+# These are temporary variables used by cspyce1.py whose values happen to be
+# functions with an ARGNAMES property.  We don't want cspyce2.py to think that
+# these are actual functions it needs to know about.  So we remove them from the
+# namespace.
+del func, efunc, vfunc, vefunc
+
 
 ################################################################################
 # Set defaults at initialization
diff --git a/swig/cspyce0.i b/swig/cspyce0.i
index 50146ff5..9691c4bb 100644
--- a/swig/cspyce0.i
+++ b/swig/cspyce0.i
@@ -33,6 +33,7 @@
 #define MESSAGELEN 1024 // max length of an error message including null
 #define NAMELEN 65      // table names can be 64 plus one null
 #define NPLATES 10000   // max number of DSK plates or vertices
+#define SIDLEN 41       // maximum length of segment id, from spkpvn_c.c
 #define TIMELEN 60      // max length of a time string including null
 #define WINDOWS 120000  // max time windows returned
 
@@ -132,15 +133,15 @@ void refchg_(SpiceInt    *frame1,
              SpiceDouble *et,
              SpiceDouble *rotate);
 
-int stcf01_(ConstSpiceChar *catnam,
+SpiceInt stcf01_(ConstSpiceChar *catnam,
             SpiceDouble    *westra,
             SpiceDouble    *eastra,
             SpiceDouble    *sthdec,
             SpiceDouble    *nthdec,
             SpiceInt       *nstars,
-            int            catnam_len);
+            SpiceInt       catnam_len);
 
-int stcg01_(SpiceInt    *index,
+SpiceInt stcg01_(SpiceInt    *index,
             SpiceDouble *ra,
             SpiceDouble *dec,
             SpiceDouble *rasig,
@@ -148,22 +149,22 @@ int stcg01_(SpiceInt    *index,
             SpiceInt    *catnum,
             SpiceChar   *sptype,
             SpiceDouble *vmag,
-            int         sptype_len);
+            SpiceInt    sptype_len);
 
-int stcl01_(ConstSpiceChar *catfnm,
+SpiceInt stcl01_(ConstSpiceChar *catfnm,
             SpiceChar      *tabnam,
             SpiceInt       *handle,
-            int            catfnm_len,
-            int            tabnam_len);
+            SpiceInt       catfnm_len,
+            SpiceInt       tabnam_len);
 
 void stlabx_(ConstSpiceDouble pobj[3],
              ConstSpiceDouble vobs[3],
              SpiceDouble      corpos[3]);
 
 // From cspyce_typemaps.i
-void set_python_exception_flag(int flag);
-int get_python_exception_flag(void);
-char *get_message_after_reset(int option);
+void set_python_exception_flag(SpiceInt flag);
+SpiceInt get_python_exception_flag(void);
+char *get_message_after_reset(SpiceInt option);
 void reset_messages(void);
 
 %}
@@ -1001,12 +1002,12 @@ VECTORIZE_i_2d_s__dLM_dN_d_b(ckgpav, ckgpav_c, 3, 3, 3)
 %rename (ckobj) my_ckobj_c;
 %apply (void RETURN_VOID) {void my_ckobj_c};
 %apply (ConstSpiceChar *CONST_STRING)    {ConstSpiceChar *ck};
-%apply (SpiceInt OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt bodids[MAXIDS], int *bodies)};
+%apply (SpiceInt OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt bodids[MAXIDS], SpiceInt *bodies)};
 
 %inline %{
     void my_ckobj_c(
         ConstSpiceChar *ck,
-        SpiceInt bodids[MAXIDS], int *bodies)
+        SpiceInt bodids[MAXIDS], SpiceInt *bodies)
     {
         int j;
         SPICEINT_CELL(ids, MAXIDS);
@@ -2462,8 +2463,8 @@ VECTORIZE_3d_dX__dN(edlimb, edlimb_c, NELLIPSE)
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
 %apply (SpiceDouble *OUTPUT)          {SpiceDouble *trgepc};
 %apply (SpiceDouble OUT_ARRAY1[ANY])  {SpiceDouble obspos[3]};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                                {(SpiceDouble **trmpts, int *dim1, int *dim2)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                                {(SpiceDouble **trmpts, SpiceInt *dim1, SpiceInt *dim2)};
 
 %inline %{
     void my_edterm_c(
@@ -2477,7 +2478,7 @@ VECTORIZE_3d_dX__dN(edlimb, edlimb_c, NELLIPSE)
         SpiceInt       npts,
         SpiceDouble    *trgepc,
         SpiceDouble    obspos[3],
-        SpiceDouble    **trmpts, int *dim1, int *dim2)
+        SpiceDouble    **trmpts, SpiceInt *dim1, SpiceInt *dim2)
     {
         *trmpts = NULL;
         *dim1 = 0;
@@ -3156,6 +3157,7 @@ extern SpiceBoolean failed_c(void);
 %apply (ConstSpiceChar    *CONST_STRING) {ConstSpiceChar *rframe};
 %apply (ConstSpiceChar    *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar    *CONST_STRING) {ConstSpiceChar *obsrvr};
+%apply (SpiceBoolean      *OUTPUT)       {SpiceBoolean *visibl};
 
 %inline %{
     void my_fovray_c(
@@ -3459,13 +3461,13 @@ extern void furnsh_c(
 
 %rename (gcpool) gcpool_c;
 %apply (void RETURN_VOID) {void gcpool_c};
-%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, char OUT_STRINGS[ANY][ANY])
-        {(SpiceInt room, SpiceInt lenout, SpiceInt *n, char cvals[KERVALS][KERVALLEN])};
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
+        {(SpiceInt room, SpiceInt lenout, SpiceInt *n, SpiceChar cvals[KERVALS][KERVALLEN])};
 
 extern void gcpool_c(
         ConstSpiceChar *CONST_STRING,
         SpiceInt       start,
-        SpiceInt room, SpiceInt lenout, SpiceInt *n, char cvals[KERVALS][KERVALLEN],
+        SpiceInt room, SpiceInt lenout, SpiceInt *n, SpiceChar cvals[KERVALS][KERVALLEN],
         SpiceBoolean   *OUTPUT
 );
 
@@ -3598,7 +3600,7 @@ VECTORIZE_5d__dN(georec, georec_c, 3)
 %apply (SpiceInt DIM1, SpiceChar OUT_STRING[ANY])
                         {(SpiceInt framelen, SpiceChar frame[NAMELEN])};
 %apply (SpiceDouble OUT_ARRAY1[ANY]) {SpiceDouble bsight[3]};
-%apply (int *SIZE1, int *SIZE2, SpiceDouble OUT_ARRAY2[ANY][ANY])
+%apply (SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceDouble OUT_ARRAY2[ANY][ANY])
                         {(SpiceInt *size1, SpiceInt *size2, SpiceDouble bounds[FOVSHAPE][3])};
 
 %inline %{
@@ -3742,13 +3744,13 @@ extern void gipool_c(
 
 %rename (gnpool) gnpool_c;
 %apply (void RETURN_VOID) {void gnpool_c};
-%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, char OUT_STRINGS[ANY][ANY])
-        {(SpiceInt room, SpiceInt lenout, SpiceInt *n, char kvars[KERVALS][NAMELEN])};
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
+        {(SpiceInt room, SpiceInt lenout, SpiceInt *n, SpiceChar kvars[KERVALS][NAMELEN])};
 
 extern void gnpool_c(
         ConstSpiceChar *CONST_STRING,
         SpiceInt       start,
-        SpiceInt room, SpiceInt lenout, SpiceInt *n, char kvars[KERVALS][NAMELEN],
+        SpiceInt room, SpiceInt lenout, SpiceInt *n, SpiceChar kvars[KERVALS][NAMELEN],
         SpiceBoolean   *OUTPUT
 );
 
@@ -4627,8 +4629,8 @@ VECTORIZE_3d__dN(latrec, latrec_c, 3)
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *fixref};
 %apply (ConstSpiceDouble IN_ARRAY2[][ANY], SpiceInt DIM1)
                             {(ConstSpiceDouble lonlat[][2], SpiceInt npts)};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                            {(SpiceDouble **srfpts, int *sdim1, int *sdim2)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                            {(SpiceDouble **srfpts, SpiceInt *sdim1, SpiceInt *sdim2)};
 
 %inline %{
     void my_latsrf_c(
@@ -4637,7 +4639,7 @@ VECTORIZE_3d__dN(latrec, latrec_c, 3)
         SpiceDouble      et,
         ConstSpiceChar   *fixref,
         ConstSpiceDouble lonlat[][2], SpiceInt npts,
-        SpiceDouble      **srfpts, int *sdim1, int *sdim2)
+        SpiceDouble      **srfpts, SpiceInt *sdim1, SpiceInt *sdim2)
     {
         *srfpts = NULL;
         *sdim1 = 0;
@@ -4790,12 +4792,12 @@ extern void ldpool_c(
 %apply (ConstSpiceDouble IN_ARRAY1[ANY]) {ConstSpiceDouble refvec[3]};
 %apply (SpiceInt **OUT_ARRAY1, SpiceInt *SIZE1)
                                {(SpiceInt **npts, SpiceInt *ndim1)};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                               {(SpiceDouble **points, int *pdim1, int *pdim2)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                               {(SpiceDouble **epochs, int *edim1)};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                               {(SpiceDouble **tangts, int *tdim1, int *tdim2)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                               {(SpiceDouble **points, SpiceInt *pdim1, SpiceInt *pdim2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                               {(SpiceDouble **epochs, SpiceInt *edim1)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                               {(SpiceDouble **tangts, SpiceInt *tdim1, SpiceInt *tdim2)};
 
 %inline %{
     void my_limbpt_c(
@@ -4814,9 +4816,9 @@ extern void ldpool_c(
         SpiceInt         maxn,
         SpiceInt         **npts,
         SpiceInt         *ndim1,
-        SpiceDouble **points, int *pdim1, int *pdim2,
-        SpiceDouble **epochs, int *edim1,
-        SpiceDouble **tangts, int *tdim1, int *tdim2)
+        SpiceDouble **points, SpiceInt *pdim1, SpiceInt *pdim2,
+        SpiceDouble **epochs, SpiceInt *edim1,
+        SpiceDouble **tangts, SpiceInt *tdim1, SpiceInt *tdim2)
     {
         *npts = NULL;
         *ndim1 = 0;
@@ -5093,13 +5095,13 @@ VECTORIZE_dXY__dMN(mequ, mequ_c, 3, 3)
 %apply (void RETURN_VOID) {void my_mequg_c};
 %apply (SpiceDouble *IN_ARRAY2, SpiceInt  DIM1, SpiceInt DIM2)
                           {(SpiceDouble *m1, SpiceInt nr, SpiceInt nc)};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                          {(SpiceDouble **matrix, int *nr_out, int *nc_out)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                          {(SpiceDouble **matrix, SpiceInt *nr_out, SpiceInt *nc_out)};
 
 %inline %{
     void my_mequg_c(
         SpiceDouble *m1,    SpiceInt nr, SpiceInt nc,
-        SpiceDouble **matrix, int *nr_out, int *nc_out)
+        SpiceDouble **matrix, SpiceInt *nr_out, SpiceInt *nc_out)
     {
         *matrix = NULL;
         *nr_out = 0;
@@ -5122,7 +5124,7 @@ VECTORIZE_dXY__dMN(mequ, mequ_c, 3, 3)
 
     void my_mequg_nomalloc(
         ConstSpiceDouble *m1, SpiceInt nr, SpiceInt nc,
-        SpiceDouble  *matrix, int *nr_out, int *nc_out)
+        SpiceDouble  *matrix, SpiceInt *nr_out, SpiceInt *nc_out)
     {
         mequg_c(m1, nr, nc, matrix);
         *nr_out = nr;
@@ -5355,7 +5357,7 @@ VECTORIZE_dXY_dX__dN(mtxv, mtxv_c, 3)
     void my_mtxvg_nomalloc(
         ConstSpiceDouble *m1, SpiceInt nr1, SpiceInt nc1,
         ConstSpiceDouble *v2, SpiceInt nr2,
-        SpiceDouble      *v3, int      *nr3)
+        SpiceDouble      *v3, SpiceInt *nr3)
     {
         if (!my_assert_eq(nr1, nr2, "mtxvg",
             "Array dimension mismatch in mtxvg: "
@@ -5558,14 +5560,14 @@ VECTORIZE_dXY_dXY__dMN(mxmt, mxmt_c, 3, 3)
                         {(SpiceDouble *m1, SpiceInt nr1, SpiceInt nc1)};
 %apply (SpiceDouble *IN_ARRAY2, SpiceInt  DIM1, SpiceInt  DIM2)
                         {(SpiceDouble *m2, SpiceInt nr2, SpiceInt nc2)};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                        {(SpiceDouble **m3, int *nr3, int *nc3)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                        {(SpiceDouble **m3, SpiceInt *nr3, SpiceInt *nc3)};
 
 %inline %{
     void my_mxmtg_c(
         SpiceDouble  *m1, SpiceInt nr1, SpiceInt nc1,
         SpiceDouble  *m2, SpiceInt nr2, SpiceInt nc2,
-        SpiceDouble **m3, int     *nr3, int     *nc3)
+        SpiceDouble **m3, SpiceInt *nr3, SpiceInt *nc3)
     {
         *m3 = NULL;
         *nr3 = 0;
@@ -5593,7 +5595,7 @@ VECTORIZE_dXY_dXY__dMN(mxmt, mxmt_c, 3, 3)
     void my_mxmtg_nomalloc(
         SpiceDouble *m1, SpiceInt nr1, SpiceInt nc1,
         SpiceDouble *m2, SpiceInt nr2, SpiceInt nc2,
-        SpiceDouble *m3, int     *nr3, int     *nc3)
+        SpiceDouble *m3, SpiceInt *nr3, SpiceInt *nc3)
     {
         if (!my_assert_eq(nc1, nc2, "mxmtg",
             "Array dimension mismatch in mxmtg: "
@@ -5675,14 +5677,14 @@ VECTORIZE_dXY_dX__dN(mxv, mxv_c, 3)
                           {(SpiceDouble *m1, SpiceInt nr1, SpiceInt nc1)};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(SpiceDouble *v2, SpiceInt nr2)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                          {(SpiceDouble **v3, int *nr3)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                          {(SpiceDouble **v3, SpiceInt *nr3)};
 
 %inline %{
     void my_mxvg_c(
         SpiceDouble  *m1, SpiceInt nr1, SpiceInt nc1,
         SpiceDouble  *v2, SpiceInt nr2,
-        SpiceDouble **v3, int      *nr3)
+        SpiceDouble **v3, SpiceInt *nr3)
     {
         *v3 = NULL;
         *nr3 = 0;
@@ -5708,7 +5710,7 @@ VECTORIZE_dXY_dX__dN(mxv, mxv_c, 3)
     void my_mxvg_nomalloc(
         SpiceDouble *m1, SpiceInt nr1, SpiceInt nc1,
         SpiceDouble *v2, SpiceInt nr2,
-        SpiceDouble *v3, int     *nr3)
+        SpiceDouble *v3, SpiceInt *nr3)
     {
         if (!my_assert_eq(nc1, nr2, "mxvg",
             "Array dimension mismatch in mxvg: "
@@ -6166,14 +6168,14 @@ VECTORIZE_dX_2d__dN(oscltx, oscltx_c, SPICE_OSCLTX_NELTS)
 %apply (void RETURN_VOID) {void my_pckcov_c};
 %apply (ConstSpiceChar *CONST_STRING)
                           {ConstSpiceChar *pck};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                          {(SpiceDouble cover[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                          {(SpiceDouble cover[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_pckcov_c(
         ConstSpiceChar *pck,
         SpiceInt idcode,
-        SpiceDouble cover[WINDOWS][2], int *intervals)
+        SpiceDouble cover[WINDOWS][2], SpiceInt *intervals)
     {
         int j;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -8816,14 +8818,14 @@ VECTORIZE_i_d_2s_dX_dX__dN_d_d(spkaps, spkaps_c, 6)
 %rename (spkcov) my_spkcov_c;
 %apply (void RETURN_VOID) {void my_spkcov_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *spk};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                        {(SpiceDouble cover[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                        {(SpiceDouble cover[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_spkcov_c(
         ConstSpiceChar *spk,
         SpiceInt       idcode,
-        SpiceDouble    cover[WINDOWS][2], int *intervals)
+        SpiceDouble    cover[WINDOWS][2], SpiceInt *intervals)
     {
         int j;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -9146,12 +9148,12 @@ VECTORIZE_i_d_2s_dX__dN_d_d(spkltc, spkltc_c, 6)
 %rename (spkobj) my_spkobj_c;
 %apply (void RETURN_VOID) {void my_spkobj_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *spk};
-%apply (SpiceInt OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt ids[MAXIDS], int *bodies)};
+%apply (SpiceInt OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt ids[MAXIDS], SpiceInt *bodies)};
 
 %inline %{
     void my_spkobj_c(
         ConstSpiceChar *spk,
-        SpiceInt ids[MAXIDS], int *bodies)
+        SpiceInt ids[MAXIDS], SpiceInt *bodies)
     {
         int j;
         SPICEINT_CELL(cells, MAXIDS);
@@ -9382,8 +9384,8 @@ extern void srfcss_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *fixref};
 %apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY])
                           {(SpiceInt npts, ConstSpiceDouble srfpts[][3])};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                          {(SpiceDouble **normls, int *dim1, int *dim2)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                          {(SpiceDouble **normls, SpiceInt *dim1, SpiceInt *dim2)};
 
 %inline %{
     void my_srfnrm_c(
@@ -9392,7 +9394,7 @@ extern void srfcss_c(
         SpiceDouble    et,
         ConstSpiceChar *fixref,
         SpiceInt npts, ConstSpiceDouble srfpts[][3],
-        SpiceDouble **normls, int *dim1, int *dim2)
+        SpiceDouble **normls, SpiceInt *dim1, SpiceInt *dim2)
     {
         *normls = NULL;
         *dim1 = 0;
@@ -10401,12 +10403,12 @@ VECTORIZE_2s_d__dMN(sxform, sxform_c, 6, 6)
 %apply (ConstSpiceDouble IN_ARRAY1[ANY]) {ConstSpiceDouble refvec[3]};
 %apply (SpiceInt **OUT_ARRAY1, SpiceInt *SIZE1)
                                {(SpiceInt **npts, SpiceInt *ndim1)};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                               {(SpiceDouble **points, int *pdim1, int *pdim2)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                               {(SpiceDouble **epochs, int *edim1)};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                               {(SpiceDouble **trmvcs, int *tdim1, int *tdim2)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                               {(SpiceDouble **points, SpiceInt *pdim1, SpiceInt *pdim2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                               {(SpiceDouble **epochs, SpiceInt *edim1)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                               {(SpiceDouble **trmvcs, SpiceInt *tdim1, SpiceInt *tdim2)};
 
 
 %inline %{
@@ -10426,9 +10428,9 @@ VECTORIZE_2s_d__dMN(sxform, sxform_c, 6, 6)
         SpiceDouble      soltol,
         SpiceInt         maxn,
         SpiceInt    **npts,   SpiceInt *ndim1,
-        SpiceDouble **points, int      *pdim1, int *pdim2,
-        SpiceDouble **epochs, int      *edim1,
-        SpiceDouble **trmvcs, int      *tdim1, int *tdim2)
+        SpiceDouble **points, SpiceInt *pdim1, SpiceInt *pdim2,
+        SpiceDouble **epochs, SpiceInt *edim1,
+        SpiceDouble **trmvcs, SpiceInt *tdim1, SpiceInt *tdim2)
     {
         *npts = NULL;
         *ndim1 = 0;
@@ -11144,14 +11146,14 @@ VECTORIZE_dX__dN_d(unorm, unorm_c, 3)
 %apply (void RETURN_VOID) {void my_unormg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                              {(ConstSpiceDouble *v1, SpiceInt ndim)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                             {(SpiceDouble **vector, int *nd2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                             {(SpiceDouble **vector, SpiceInt *nd2)};
 %apply (SpiceDouble *OUTPUT) {SpiceDouble *vmag};
 
 %inline %{
     void my_unormg_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        SpiceDouble **vector, int      *nd2,
+        SpiceDouble **vector, SpiceInt *nd2,
         SpiceDouble    *vmag)
     {
         *vector = NULL;
@@ -11172,7 +11174,7 @@ VECTORIZE_dX__dN_d(unorm, unorm_c, 3)
     }
 
     void my_unormg_nomalloc(ConstSpiceDouble *v1, SpiceInt ndim,
-                            SpiceDouble  *vector, int      *nd2,
+                            SpiceDouble  *vector, SpiceInt *nd2,
                             SpiceDouble    *vmag)
     {
         unormg_c(v1, ndim, vector, vmag);
@@ -11274,16 +11276,16 @@ VECTORIZE_dX_dX__dN(vadd, vadd_c, 3)
 %apply (void RETURN_VOID) {void my_vaddg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(ConstSpiceDouble *v1, SpiceInt ndim)};
-%apply (ConstSpiceDouble *IN_ARRAY1, int DIM1)
-                          {(ConstSpiceDouble *v2, int nd2)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                          {(SpiceDouble **v3, int *nd3)};
+%apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
+                          {(ConstSpiceDouble *v2, SpiceInt nd2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                          {(SpiceDouble **v3, SpiceInt *nd3)};
 
 %inline %{
     void my_vaddg_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        ConstSpiceDouble *v2, int      nd2,
-        SpiceDouble     **v3, int     *nd3)
+        ConstSpiceDouble *v2, SpiceInt nd2,
+        SpiceDouble     **v3, SpiceInt *nd3)
     {
         SpiceDouble *result = NULL;
 
@@ -11309,8 +11311,8 @@ VECTORIZE_dX_dX__dN(vadd, vadd_c, 3)
     }
 
     void my_vaddg_nomalloc(ConstSpiceDouble *v1, SpiceInt ndim,
-                    ConstSpiceDouble *v2, int      nd2,
-                    SpiceDouble      *v3, int     *nd3)
+                    ConstSpiceDouble *v2, SpiceInt nd2,
+                    SpiceDouble      *v3, SpiceInt *nd3)
     {
         if (!my_assert_eq(ndim, nd2, "vaddg",
             "Vector dimension mismatch in vaddg: "
@@ -11419,13 +11421,13 @@ VECTORIZE_dX_dX__RETURN_d(vdist, vdist_c)
 %apply (SpiceDouble RETURN_DOUBLE) {SpiceDouble my_vdistg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                                 {(ConstSpiceDouble *v1, SpiceInt ndim)};
-%apply (ConstSpiceDouble *IN_ARRAY1, int DIM1)
-                                {(ConstSpiceDouble *v2, int nd2)};
+%apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
+                                {(ConstSpiceDouble *v2, SpiceInt nd2)};
 
 %inline %{
     SpiceDouble my_vdistg_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        ConstSpiceDouble *v2, int nd2)
+        ConstSpiceDouble *v2, SpiceInt nd2)
     {
         if (!my_assert_eq(ndim, nd2, "vdistg",
             "Vector dimension mismatch in vdistg: "
@@ -11498,13 +11500,13 @@ VECTORIZE_dX_dX__RETURN_d(vdot, vdot_c)
 %apply (SpiceDouble RETURN_DOUBLE) {SpiceDouble my_vdotg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                                    {(ConstSpiceDouble *v1, SpiceInt ndim)};
-%apply (ConstSpiceDouble *IN_ARRAY1, int DIM1)
-                                   {(ConstSpiceDouble *v2, int nd2)};
+%apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
+                                   {(ConstSpiceDouble *v2, SpiceInt nd2)};
 
 %inline %{
     SpiceDouble my_vdotg_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        ConstSpiceDouble *v2, int nd2)
+        ConstSpiceDouble *v2, SpiceInt nd2)
     {
         if (!my_assert_eq(ndim, nd2, "vdotg",
             "Vector dimension mismatch in vdotg: "
@@ -11576,13 +11578,13 @@ VECTORIZE_dX__dN(vequ, vequ_c, 3)
 %apply (void RETURN_VOID) {void my_vequg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(ConstSpiceDouble *v1, SpiceInt ndim)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                          {(SpiceDouble **v2, int *nd2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                          {(SpiceDouble **v2, SpiceInt *nd2)};
 
 %inline %{
     void my_vequg_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        SpiceDouble     **v2, int      *nd2)
+        SpiceDouble     **v2, SpiceInt *nd2)
     {
         *v2 = NULL;
         *nd2 = 0;
@@ -11603,7 +11605,7 @@ VECTORIZE_dX__dN(vequ, vequ_c, 3)
 
     void my_vequg_nomalloc(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        SpiceDouble      *v2, int      *nd2)
+        SpiceDouble      *v2, SpiceInt *nd2)
     {
         vequg_c(v1, ndim, v2);
         *nd2 = ndim;
@@ -11672,13 +11674,13 @@ VECTORIZE_dX__dN(vhat, vhat_c, 3)
 %apply (void RETURN_VOID) {void my_vhatg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(ConstSpiceDouble  *v1, SpiceInt ndim)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                          {(SpiceDouble **v2, int *nd2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                          {(SpiceDouble **v2, SpiceInt *nd2)};
 
 %inline %{
     void my_vhatg_c(
         ConstSpiceDouble  *v1, SpiceInt ndim,
-        SpiceDouble      **v2, int      *nd2)
+        SpiceDouble      **v2, SpiceInt *nd2)
     {
         *v2 = NULL;
         *nd2 = 0;
@@ -11699,7 +11701,7 @@ VECTORIZE_dX__dN(vhat, vhat_c, 3)
 
     void my_vhatg_nomalloc(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        SpiceDouble      *v2, int      *nd2)
+        SpiceDouble      *v2, SpiceInt *nd2)
     {
         vhatg_c(v1, ndim, v2);
         *nd2 = ndim;
@@ -11834,18 +11836,18 @@ VECTORIZE_d_dX_d_dX__dN(vlcom, vlcom_c, 3)
 %apply (void RETURN_VOID) {void my_vlcomg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(ConstSpiceDouble  *v1, SpiceInt n)};
-%apply (ConstSpiceDouble *IN_ARRAY1, int DIM1)
-                          {(ConstSpiceDouble  *v2, int    nd2)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                          {(SpiceDouble **v3, int *nd3)};
+%apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
+                          {(ConstSpiceDouble  *v2, SpiceInt    nd2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                          {(SpiceDouble **v3, SpiceInt *nd3)};
 
 %inline %{
     void my_vlcomg_c(
         SpiceDouble       a,
         ConstSpiceDouble *v1, SpiceInt n,
         SpiceDouble       b,
-        ConstSpiceDouble *v2, int nd2,
-        SpiceDouble     **v3, int *nd3)
+        ConstSpiceDouble *v2, SpiceInt nd2,
+        SpiceDouble     **v3, SpiceInt *nd3)
     {
         *v3 = NULL;
         *nd3 = 0;
@@ -11872,8 +11874,8 @@ VECTORIZE_d_dX_d_dX__dN(vlcom, vlcom_c, 3)
         SpiceDouble       a,
         ConstSpiceDouble *v1, SpiceInt  n,
         SpiceDouble       b,
-        ConstSpiceDouble *v2, int nd2,
-        SpiceDouble      *v3, int *nd3)
+        ConstSpiceDouble *v2, SpiceInt nd2,
+        SpiceDouble      *v3, SpiceInt *nd3)
     {
         if (!my_assert_eq(n, nd2, "vlcomg",
             "Vector dimension mismatch in vlcomg: "
@@ -11912,13 +11914,13 @@ VECTORIZE_d_di_d_di__di(vlcomg, my_vlcomg_nomalloc)
 %apply (void RETURN_VOID) {void my_vminug_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(ConstSpiceDouble  *v1,  SpiceInt ndim)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                          {(SpiceDouble **v2, int *nd2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                          {(SpiceDouble **v2, SpiceInt *nd2)};
 
 %inline %{
     void my_vminug_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        SpiceDouble     **v2, int      *nd2)
+        SpiceDouble     **v2, SpiceInt *nd2)
     {
         *v2 = NULL;
         *nd2 = 0;
@@ -11939,7 +11941,7 @@ VECTORIZE_d_di_d_di__di(vlcomg, my_vlcomg_nomalloc)
 
     void my_vminug_nomalloc(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        SpiceDouble      *v2, int      *nd2)
+        SpiceDouble      *v2, SpiceInt *nd2)
     {
         vminug_c(v1, ndim, v2);
         *nd2 = ndim;
@@ -12294,13 +12296,13 @@ VECTORIZE_dX_dX__RETURN_d(vrel, vrel_c)
 %apply (SpiceDouble RETURN_DOUBLE) {void my_vrelg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(ConstSpiceDouble *v1, SpiceInt ndim)};
-%apply (ConstSpiceDouble *IN_ARRAY1, int DIM1)
-                          {(ConstSpiceDouble *v2, int nd2)};
+%apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
+                          {(ConstSpiceDouble *v2, SpiceInt nd2)};
 
 %inline %{
     SpiceDouble my_vrelg_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        ConstSpiceDouble *v2, int nd2)
+        ConstSpiceDouble *v2, SpiceInt nd2)
     {
         if (!my_assert_eq(ndim, nd2, "vrelg",
             "Vector dimension mismatch in vrelg: "
@@ -12416,14 +12418,14 @@ VECTORIZE_d_dX__dN(vscl, vscl_c, 3)
 %apply (void RETURN_VOID) {void my_vsclg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(ConstSpiceDouble  *v1, SpiceInt ndim)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                          {(SpiceDouble **v2, int *nd2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                          {(SpiceDouble **v2, SpiceInt *nd2)};
 
 %inline %{
     void my_vsclg_c(
         SpiceDouble      s,
         ConstSpiceDouble *v1, SpiceInt  ndim,
-        SpiceDouble     **v2, int *nd2)
+        SpiceDouble     **v2, SpiceInt *nd2)
     {
         *v2 = NULL;
         *nd2 = 0;
@@ -12445,7 +12447,7 @@ VECTORIZE_d_dX__dN(vscl, vscl_c, 3)
     void my_vsclg_nomalloc(
         SpiceDouble s,
         ConstSpiceDouble   *v1, SpiceInt  ndim,
-        SpiceDouble        *v2, int       *nd2)
+        SpiceDouble        *v2, SpiceInt  *nd2)
     {
         vsclg_c(s, v1, ndim, v2);
         *nd2 = ndim;
@@ -12518,13 +12520,13 @@ VECTORIZE_dX_dX__RETURN_d(vsep, vsep_c)
 %apply (SpiceDouble RETURN_DOUBLE) {SpiceDouble my_vsepg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                                    {(ConstSpiceDouble *v1, SpiceInt ndim)};
-%apply (ConstSpiceDouble *IN_ARRAY1, int  DIM1)
-                                   {(ConstSpiceDouble *v2, int nd2)};
+%apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt  DIM1)
+                                   {(ConstSpiceDouble *v2, SpiceInt nd2)};
 
 %inline %{
     SpiceDouble my_vsepg_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        ConstSpiceDouble *v2, int nd2)
+        ConstSpiceDouble *v2, SpiceInt nd2)
     {
         if (!my_assert_eq(ndim, nd2, "vsepg",
             "Vector dimension mismatch in vsepg: "
@@ -12601,16 +12603,16 @@ VECTORIZE_dX_dX__dN(vsub, vsub_c, 3)
 %apply (void RETURN_VOID) {void my_vsubg_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                           {(ConstSpiceDouble  *v1, SpiceInt ndim)};
-%apply (ConstSpiceDouble   *IN_ARRAY1, int DIM1)
-                          {(ConstSpiceDouble  *v2, int nd2)};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1)
-                          {(SpiceDouble **v3, int *nd3)};
+%apply (ConstSpiceDouble   *IN_ARRAY1, SpiceInt DIM1)
+                          {(ConstSpiceDouble  *v2, SpiceInt nd2)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1)
+                          {(SpiceDouble **v3, SpiceInt *nd3)};
 
 %inline %{
     void my_vsubg_c(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        ConstSpiceDouble *v2, int      nd2,
-        SpiceDouble     **v3, int     *nd3)
+        ConstSpiceDouble *v2, SpiceInt nd2,
+        SpiceDouble     **v3, SpiceInt *nd3)
     {
         *v3 = NULL;
         *nd3 = 0;
@@ -12635,8 +12637,8 @@ VECTORIZE_dX_dX__dN(vsub, vsub_c, 3)
 
     void my_vsubg_nomalloc(
         ConstSpiceDouble *v1, SpiceInt ndim,
-        ConstSpiceDouble *v2, int      nd2,
-        SpiceDouble      *v3, int     *nd3)
+        ConstSpiceDouble *v2, SpiceInt nd2,
+        SpiceDouble      *v3, SpiceInt *nd3)
     {
         if (!my_assert_eq(ndim, nd2, "vsubg",
             "Vector dimension mismatch in vsubg: "
@@ -12717,18 +12719,18 @@ VECTORIZE_dX_dXY_dX__RETURN_d(vtmv, vtmv_c)
 
 %rename (vtmvg) my_vtmvg_c;
 %apply (SpiceDouble RETURN_DOUBLE) {SpiceDouble my_vtmvg_c};
-%apply (SpiceDouble *IN_ARRAY1, int DIM1)
-                    {(SpiceDouble *v1, int nrow1)};
-%apply (SpiceDouble *IN_ARRAY1, int DIM1)
-                    {(SpiceDouble *v2, int ncol2)};
+%apply (SpiceDouble *IN_ARRAY1, SpiceInt DIM1)
+                    {(SpiceDouble *v1, SpiceInt nrow1)};
+%apply (SpiceDouble *IN_ARRAY1, SpiceInt DIM1)
+                    {(SpiceDouble *v2, SpiceInt ncol2)};
 %apply (SpiceDouble *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2)
                     {(SpiceDouble *matrix, SpiceInt nrow, SpiceInt ncol)};
 
 %inline %{
     SpiceDouble my_vtmvg_c(
-        SpiceDouble *v1, int nrow1,
+        SpiceDouble *v1, SpiceInt nrow1,
         SpiceDouble *matrix, SpiceInt nrow, SpiceInt ncol,
-        SpiceDouble *v2, int ncol2)
+        SpiceDouble *v2, SpiceInt ncol2)
     {
         if (!my_assert_eq(nrow1, nrow, "vtmvg",
             "Array dimension mismatch in vtmvg: "
@@ -13065,13 +13067,13 @@ VECTORIZE_dXY__dMN(xpose, xpose_c, 3, 3)
 %apply (void RETURN_VOID) {void my_xposeg_c};
 %apply (ConstSpiceDouble *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2)
                 {(ConstSpiceDouble *matrix, SpiceInt nrow, SpiceInt ncol)};
-%apply (SpiceDouble **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-                {(SpiceDouble **xposem, int *nrow1,  int *nc1)};
+%apply (SpiceDouble **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                {(SpiceDouble **xposem, SpiceInt *nrow1,  SpiceInt *nc1)};
 
 %inline %{
     void my_xposeg_c(
-        ConstSpiceDouble *matrix, SpiceInt nrow, SpiceInt  ncol,
-        SpiceDouble     **xposem, int    *nrow1,     int *nc1)
+        ConstSpiceDouble *matrix, SpiceInt nrow,   SpiceInt  ncol,
+        SpiceDouble     **xposem, SpiceInt *nrow1, SpiceInt *nc1)
     {
         *xposem = NULL;
         *nrow1 = 0;
@@ -13094,7 +13096,7 @@ VECTORIZE_dXY__dMN(xpose, xpose_c, 3, 3)
 
     void my_xposeg_nomalloc(
         ConstSpiceDouble *matrix, SpiceInt nrow, SpiceInt  ncol,
-        SpiceDouble      *xposem, int    *nrow1,     int *nc1)
+        SpiceDouble      *xposem, SpiceInt *nrow1, SpiceInt *nc1)
     {
         xposeg_c(matrix, nrow, ncol, xposem);
         *nrow1 = ncol;
diff --git a/swig/cspyce0_part2.i b/swig/cspyce0_part2.i
index df36734d..c470860f 100644
--- a/swig/cspyce0_part2.i
+++ b/swig/cspyce0_part2.i
@@ -448,12 +448,12 @@ extern SpiceInt bsrchi_c(
 %apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1) {(SpiceDouble **dpdxs, SpiceInt *n)};
 
 // Copied from vectorize.i
-%apply (ConstSpiceDouble *IN_ARRAY12, int DIM1, int DIM2)
-                    {(ConstSpiceDouble *in21, int in21_dim1, int in21_dim2)};
-%apply (ConstSpiceDouble *IN_ARRAY01, int DIM1)
-                    {(ConstSpiceDouble *in12, int in12_dim1)};
-%apply (SpiceDouble **OUT_ARRAY12, int *SIZE1, int *SIZE2)
-                    {(SpiceDouble **out21, int *out21_dim1, int *out21_dim2)};
+%apply (ConstSpiceDouble *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2)
+                    {(ConstSpiceDouble *in21, SpiceInt in21_dim1, SpiceInt in21_dim2)};
+%apply (ConstSpiceDouble *IN_ARRAY01, SpiceInt DIM1)
+                    {(ConstSpiceDouble *in12, SpiceInt in12_dim1)};
+%apply (SpiceDouble **OUT_ARRAY12, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                    {(SpiceDouble **out21, SpiceInt *out21_dim1, SpiceInt *out21_dim2)};
 
 %inline %{
     void my_chbder_c(
@@ -492,11 +492,11 @@ extern SpiceInt bsrchi_c(
     // the rightmost dimension of the returned axis is variable.
 
     void chbder_vector(
-        ConstSpiceDouble *in21, int in21_dim1, int in21_dim2,
+        ConstSpiceDouble *in21, SpiceInt in21_dim1, SpiceInt in21_dim2,
         SpiceDouble x2s[2],
-        ConstSpiceDouble *in12, int in12_dim1,
+        ConstSpiceDouble *in12, SpiceInt in12_dim1,
         SpiceInt nderiv,
-        SpiceDouble **out21, int *out21_dim1, int *out21_dim2)
+        SpiceDouble **out21, SpiceInt *out21_dim1, SpiceInt *out21_dim2)
     {
         char *my_name = "chbder_vector";
 
@@ -765,7 +765,7 @@ extern void ckfrot_c(
 );
 
 //Vector version
-VECTORIZE_i_d_dXY__i_b(ckfrot, ckfrot_c)
+VECTORIZE_i_d__dMN_i_b(ckfrot, ckfrot_c, 3, 3)
 
 /***********************************************************************
 * -Procedure ckfxfm_c ( CK frame, find state transformation )
@@ -808,7 +808,7 @@ extern void ckfxfm_c(
 );
 
 //Vector version
-VECTORIZE_i_d_dXY__i_b(ckfxfm, ckfxfm_c)
+VECTORIZE_i_d__dMN_i_b(ckfxfm, ckfxfm_c, 6, 6)
 
 /***********************************************************************
 * -Procedure ckgr02_c ( C-kernel, get record, type 02 )
@@ -875,14 +875,14 @@ extern void ckgr02_c(
 %rename (ckgr03) my_ckgr03_c;
 %apply (void RETURN_VOID) {void my_ckgr03_c};
 %apply (ConstSpiceDouble IN_ARRAY1[ANY]) {ConstSpiceDouble descr[5]};
-%apply (SpiceDouble **OUT_ARRAY1, int *SIZE1) {(SpiceDouble **record, int *size)};
+%apply (SpiceDouble **OUT_ARRAY1, SpiceInt *SIZE1) {(SpiceDouble **record, SpiceInt *size)};
 
 %inline %{
     void my_ckgr03_c(
         SpiceInt         handle,
         ConstSpiceDouble descr[5],
         SpiceInt         recno,
-        SpiceDouble      **record, int *size)
+        SpiceDouble      **record, SpiceInt *size)
     {
         SpiceDouble dcd[2];
         SpiceInt    icd[6];
@@ -1530,7 +1530,7 @@ extern void cvpool_c(
 
 %rename (dafac) dafac_c;
 %apply (void RETURN_VOID) {void dafac_c};
-%apply (int DIM1, int DIM2, ConstSpiceChar *IN_STRINGS)
+%apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
                     {(SpiceInt n, SpiceInt buflen, ConstSpiceChar *buffer)};
 
 extern void dafac_c(
@@ -1640,12 +1640,12 @@ extern void dafdc_c(
 
 %rename (dafec) dafec_c;
 %apply (void RETURN_VOID) {void dafec_c};
-%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, char OUT_STRINGS[ANY][ANY])
-        {(SpiceInt bufsiz, SpiceInt buffln, SpiceInt *n, char buffer[COMMENTS][COMMENTLEN])};
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
+        {(SpiceInt bufsiz, SpiceInt buffln, SpiceInt *n, SpiceChar buffer[COMMENTS][COMMENTLEN])};
 
 extern void dafec_c(
         SpiceInt     handle,
-        SpiceInt     bufsiz, SpiceInt buffln, SpiceInt *n, char buffer[COMMENTS][COMMENTLEN],
+        SpiceInt     bufsiz, SpiceInt buffln, SpiceInt *n, SpiceChar buffer[COMMENTS][COMMENTLEN],
         SpiceBoolean *OUTPUT
 );
 
@@ -1726,8 +1726,8 @@ extern void dafgh_c(
 
 %rename (dafgsr) my_dafgsr_c;
 %apply (void RETURN_VOID) {void my_dafgsr_c};
-%apply (SpiceDouble OUT_ARRAY1[ANY], int *SIZE1)
-                    {(SpiceDouble data[DAFSIZE], int *size)};
+%apply (SpiceDouble OUT_ARRAY1[ANY], SpiceInt *SIZE1)
+                    {(SpiceDouble data[DAFSIZE], SpiceInt *size)};
 
 %inline %{
     void my_dafgsr_c(
@@ -1735,7 +1735,7 @@ extern void dafgh_c(
         SpiceInt     recno,
         SpiceInt     begin,
         SpiceInt     end,
-        SpiceDouble  data[DAFSIZE], int *size,
+        SpiceDouble  data[DAFSIZE], SpiceInt *size,
         SpiceBoolean *found)
     {
         dafgsr_c(handle, recno, begin, end, data, found);
@@ -1834,13 +1834,13 @@ extern void dafopw_c(
 %apply (void RETURN_VOID) {void my_dafps_c};
 %apply (SpiceInt DIM1, ConstSpiceDouble *IN_ARRAY1) {(SpiceInt nd, ConstSpiceDouble *dc)};
 %apply (SpiceInt DIM1, ConstSpiceInt *IN_ARRAY1) {(SpiceInt ni, ConstSpiceInt *ic)};
-%apply (SpiceDouble OUT_ARRAY[ANY], int *SIZE1) {(SpiceDouble sum[DAFSIZE], int *nsum)};
+%apply (SpiceDouble OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceDouble sum[DAFSIZE], SpiceInt *nsum)};
 
 %inline %{
     void my_dafps_c(
         SpiceInt nd, ConstSpiceDouble *dc,
         SpiceInt ni, ConstSpiceInt *ic,
-        SpiceDouble sum[DAFSIZE], int *nsum)
+        SpiceDouble sum[DAFSIZE], SpiceInt *nsum)
     {
         dafps_c(nd, ni, dc, ic, sum);
         *nsum = nd + (ni + 1)/2 + 1;
@@ -1954,7 +1954,7 @@ extern void dafrs_c(
 
 %rename (dasac) dasac_c;
 %apply (void RETURN_VOID) {void dasac_c};
-%apply (int DIM1, int DIM2, ConstSpiceChar *IN_STRINGS)
+%apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
                     {(SpiceInt n, SpiceInt buflen, ConstSpiceChar *buffer)};
 
 extern void dasac_c(
@@ -2144,12 +2144,12 @@ extern void dasdc_c(
 
 %rename (dasec) dasec_c;
 %apply (void RETURN_VOID) {void dasec_c};
-%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, char OUT_STRINGS[ANY][ANY])
-            {(SpiceInt bufsiz, SpiceInt buffln, SpiceInt *n, char buffer[COMMENTS][COMMENTLEN])};
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
+            {(SpiceInt bufsiz, SpiceInt buffln, SpiceInt *n, SpiceChar buffer[COMMENTS][COMMENTLEN])};
 
 extern void dasec_c(
         SpiceInt     handle,
-        SpiceInt     bufsiz, SpiceInt buffln, SpiceInt *n, char buffer[COMMENTS][COMMENTLEN],
+        SpiceInt     bufsiz, SpiceInt buffln, SpiceInt *n, SpiceChar buffer[COMMENTS][COMMENTLEN],
         SpiceBoolean *OUTPUT
 );
 
@@ -2440,7 +2440,7 @@ extern void dasopw_c(
 
 %rename (dasrdc) dasrdc_c;
 %apply (void RETURN_VOID) {void dasrdc_c};
-%apply (char *INOUT_ARRAY1) {char *data};
+%apply (SpiceChar *INOUT_ARRAY1) {SpiceChar *data};
 
 extern void dasrdc_c(
         SpiceInt handle,
@@ -2449,7 +2449,7 @@ extern void dasrdc_c(
         SpiceInt bpos,
         SpiceInt epos,
         SpiceInt datlen,
-        char *data
+        SpiceChar *data
 );
 
 //CSPYCE_TYPE:data:byte_array[][]
@@ -3501,12 +3501,12 @@ extern void dskn02_c(
 %rename (dskobj) my_dskobj_c;
 %apply (void RETURN_VOID) {void my_dskobj_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *dskfnm};
-%apply (SpiceInt OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt bodids[MAXIDS], int *count)};
+%apply (SpiceInt OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt bodids[MAXIDS], SpiceInt *count)};
 
 %inline %{
     void my_dskobj_c(
         ConstSpiceChar *dskfnm,
-        SpiceInt bodids[MAXIDS], int *count)
+        SpiceInt bodids[MAXIDS], SpiceInt *count)
     {
         int j;
         SPICEINT_CELL(ids, MAXIDS);
@@ -3665,13 +3665,13 @@ extern void dskrb2_c(
 %rename (dsksrf) my_dsksrf_c;
 %apply (void RETURN_VOID) {void my_dsksrf_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *dskfnm};
-%apply (SpiceInt OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt srfids[MAXIDS], int *count)};
+%apply (SpiceInt OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt srfids[MAXIDS], SpiceInt *count)};
 
 %inline %{
     void my_dsksrf_c(
         ConstSpiceChar *dskfnm,
         SpiceInt bodyid,
-        SpiceInt srfids[MAXIDS], int *count)
+        SpiceInt srfids[MAXIDS], SpiceInt *count)
     {
         int j;
         SPICEINT_CELL(ids, MAXIDS);
@@ -4047,9 +4047,9 @@ extern void dskx02_c(
                             {(SpiceInt nrays, ConstSpiceDouble vtxarr[][3])};
 %apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY])
                             {(SpiceInt n2, ConstSpiceDouble dirarr[][3])};
-%apply (SpiceInt *DIM1, SpiceInt *DIM2, SpiceDouble **OUT_ARRAY2)
+%apply (SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceDouble **OUT_ARRAY2)
                             {(SpiceInt *n3, SpiceInt *nv, SpiceDouble **xptarr)};
-%apply (SpiceInt *DIM1, SpiceBoolean **OUT_ARRAY1)
+%apply (SpiceInt *SIZE1, SpiceBoolean **OUT_ARRAY1)
                             {(SpiceInt *n4, SpiceBoolean **fndarr)};
 
 %inline %{
@@ -4384,11 +4384,12 @@ extern void ekacei_c(
 * wkindx    I-O  Work space for column index.
 ***********************************************************************/
 
+// TODO(FY): Create the right typemap for cvals, or use an existing one and throw away unused value?
 %rename (ekaclc) my_ekaclc_c;
 %apply (void RETURN_VOID) {void my_ekaclc_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *column};
-%apply (SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
-                    {(SpiceInt vallen, ConstSpiceChar *cvals)};
+%apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
+                    {(SpiceInt ignore, SpiceInt vallen, ConstSpiceChar *cvals)};
 %apply (ConstSpiceInt     IN_ARRAY1[]) {ConstSpiceInt     entszs[]};
 %apply (ConstSpiceBoolean IN_ARRAY1[]) {ConstSpiceBoolean nlflgs[]};
 %apply (ConstSpiceInt     IN_ARRAY1[]) {ConstSpiceInt     rcptrs[]};
@@ -4398,7 +4399,7 @@ extern void ekacei_c(
         SpiceInt          handle,
         SpiceInt          segno,
         ConstSpiceChar    *column,
-        SpiceInt          vallen, ConstSpiceChar *cvals,
+        SpiceInt          ignore, SpiceInt vallen, ConstSpiceChar *cvals,
         ConstSpiceInt     entszs[],
         ConstSpiceBoolean nlflgs[],
         ConstSpiceInt     rcptrs[])
@@ -4584,21 +4585,26 @@ extern void ekappr_c(
 * segno      O   Segment number.
 ***********************************************************************/
 
-%rename (ekbseg) ekbseg_c;
+%rename (ekbseg) my_ekbseg_c;
 %apply (void RETURN_VOID) {void ekbseg_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *tabnam};
 %apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
             {(SpiceInt ncols, SpiceInt cnamln, ConstSpiceChar *cnames)};
-%apply (SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
-                {(SpiceInt declen, ConstSpiceChar *decls)};
+%apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
+                {(SpiceInt ignore, SpiceInt declen, ConstSpiceChar *decls)};
+%apply (SpiceInt *OUTPUT) {SpiceInt *segno};
 
-extern void ekbseg_c(
+%inline %{
+extern void my_ekbseg_c(
         SpiceInt       handle,
-        ConstSpiceChar *CONST_STRING,
-        SpiceInt       ncols,   SpiceInt cnamln, ConstSpiceChar *cnames,
-        SpiceInt       declen,  ConstSpiceChar *decls,
-        SpiceInt       *OUTPUT
-);
+        ConstSpiceChar *tabnam,
+        SpiceInt       ncols,  SpiceInt cnamln, ConstSpiceChar *cnames,
+        SpiceInt       ignore, SpiceInt  declen,  ConstSpiceChar *decls,
+        SpiceInt       *segno)
+    {
+        ekbseg_c(handle, tabnam, ncols, cnamln, cnames, declen, decls, segno);
+    }
+%}
 
 /***********************************************************************
 * -Procedure ekccnt_c ( EK, column count )
@@ -4990,8 +4996,8 @@ extern void ekgi_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *tabnam};
 %apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
                     {(SpiceInt ncols, SpiceInt cnamln, ConstSpiceChar *cnames)};
-%apply (SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
-                    {(SpiceInt declen, ConstSpiceChar *decls)};
+%apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
+                    {(SpiceInt ignore, SpiceInt declen, ConstSpiceChar *decls)};
 %apply (SpiceInt *OUTPUT) {SpiceInt *segno};
 %apply (SpiceInt *SIZE1, SpiceInt OUT_ARRAY1[ANY])
                     {(SpiceInt *nrows1, SpiceInt rcptrs[MAXROWS])};
@@ -5002,7 +5008,7 @@ extern void ekgi_c(
         ConstSpiceChar *tabnam,
         SpiceInt       nrows,
         SpiceInt       ncols, SpiceInt cnamln, ConstSpiceChar *cnames,
-        SpiceInt       declen, ConstSpiceChar *decls,
+        SpiceInt       ignore, SpiceInt declen, ConstSpiceChar *decls,
         SpiceInt       *segno,
         SpiceInt       *nrows1, SpiceInt rcptrs[MAXROWS])
     {
@@ -5172,14 +5178,12 @@ extern void ekntab_c(
 
 %rename (ekopn) ekopn_c;
 %apply (void RETURN_VOID) {void ekopn_c};
-%apply (SpiceInt DIM1, SpiceInt OUT_ARRAY1[ANY])
-                    {(SpiceInt ncomch, SpiceInt handle[1024])};
 
 extern void ekopn_c(
         ConstSpiceChar *CONST_STRING,
         ConstSpiceChar *CONST_STRING,
         SpiceInt       ncomch,
-        SpiceInt       *OUTPUT
+        SpiceInt       *handle
 );
 
 /***********************************************************************
@@ -5308,11 +5312,11 @@ extern void ekopw_c(
 %apply (void RETURN_VOID) {void my_ekpsel_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *query};
 %apply (SpiceInt *SIZE1, SpiceInt OUT_ARRAY1[ANY]) {(SpiceInt *n,  SpiceInt xbegs[CLAUSES])};
-%apply (SpiceInt OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt xends[CLAUSES],  int *n1)};
-%apply (SpiceInt OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt xtypes[CLAUSES], int *n2)};
-%apply (SpiceInt OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt xclass[CLAUSES], int *n3)};
-%apply (char OUT_STRINGS[ANY][ANY], int *NSTRINGS) {(char tabs[CLAUSES][NAMELEN], int *n4)};
-%apply (char OUT_STRINGS[ANY][ANY], int *NSTRINGS) {(char cols[CLAUSES][NAMELEN], int *n5)};
+%apply (SpiceInt OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt xends[CLAUSES],  SpiceInt *n1)};
+%apply (SpiceInt OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt xtypes[CLAUSES], SpiceInt *n2)};
+%apply (SpiceInt OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt xclass[CLAUSES], SpiceInt *n3)};
+%apply (SpiceChar OUT_STRINGS[ANY][ANY], SpiceInt *NSTRINGS) {(SpiceChar tabs[CLAUSES][NAMELEN], SpiceInt *n4)};
+%apply (SpiceChar OUT_STRINGS[ANY][ANY], SpiceInt *NSTRINGS) {(SpiceChar cols[CLAUSES][NAMELEN], SpiceInt *n5)};
 %apply (SpiceBoolean *OUTPUT) {SpiceBoolean *error};
 %apply (SpiceChar OUT_STRING[ANY]) {SpiceChar errmsg[MESSAGELEN]};
 
@@ -5321,11 +5325,11 @@ extern void ekopw_c(
         ConstSpiceChar *query,
         SpiceInt       *n,
         SpiceInt       xbegs[CLAUSES],
-        SpiceInt       xends[CLAUSES],  int *n1,
-        SpiceInt       xtypes[CLAUSES], int *n2,
-        SpiceInt       xclass[CLAUSES], int *n3,
-        char           tabs[CLAUSES][NAMELEN], int *n4,
-        char           cols[CLAUSES][NAMELEN], int *n5,
+        SpiceInt       xends[CLAUSES],  SpiceInt *n1,
+        SpiceInt       xtypes[CLAUSES], SpiceInt *n2,
+        SpiceInt       xclass[CLAUSES], SpiceInt *n3,
+        SpiceChar      tabs[CLAUSES][NAMELEN], SpiceInt *n4,
+        SpiceChar      cols[CLAUSES][NAMELEN], SpiceInt *n5,
         SpiceBoolean   *error,
         SpiceChar      errmsg[MESSAGELEN])
     {
@@ -5391,15 +5395,16 @@ extern void ekopw_c(
 %rename (ekrcec) ekrcec_c;
 %apply (void RETURN_VOID) {void ekrcec_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *column};
-%apply (SpiceInt DIM2, SpiceInt *SIZE1, char OUT_STRINGS[ANY][ANY])
-            {(SpiceInt cvalen, SpiceInt *nvals, char cvals[MAXVALS][COLLEN])};
+%apply (SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
+            {(SpiceInt cvalen, SpiceInt *nvals, SpiceChar cvals[MAXVALS][COLLEN])};
+
 
 extern void ekrcec_c(
         SpiceInt       handle,
         SpiceInt       segno,
         SpiceInt       recno,
         ConstSpiceChar *CONST_STRING,
-        SpiceInt       cvalen, SpiceInt *nvals, char cvals[MAXVALS][COLLEN],
+        SpiceInt       cvalen, SpiceInt *nvals, SpiceChar cvals[MAXVALS][COLLEN],
         SpiceBoolean   *OUTPUT
 );
 
@@ -5523,29 +5528,29 @@ extern void ekrcei_c(
 
 %rename (ekssum) my_ekssum_c;
 %apply (void RETURN_VOID) {void my_ekssum_c};
-%apply (SpiceChar    OUT_STRING[ANY], int *SIZE1) {(SpiceChar tabnam[NAMELEN], int *nrows)};
+%apply (SpiceChar    OUT_STRING[ANY], SpiceInt *SIZE1) {(SpiceChar tabnam[NAMELEN], SpiceInt *nrows)};
 %apply (SpiceInt     *OUTPUT)                     {(SpiceInt  *ncols)};
-%apply (SpiceChar    OUT_STRINGS[ANY][ANY], int *NSTRINGS) {(SpiceChar cnames[SPICE_EK_MXCLSG][NAMELEN], int *n1)};
-%apply (SpiceInt     OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt     cclass[SPICE_EK_MXCLSG], int *n2)};
-%apply (SpiceInt     OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt      dtype[SPICE_EK_MXCLSG], int *n3)};
-%apply (SpiceInt     OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt      strln[SPICE_EK_MXCLSG], int *n4)};
-%apply (SpiceInt     OUT_ARRAY1[ANY], int *SIZE1) {(SpiceInt       size[SPICE_EK_MXCLSG], int *n5)};
-%apply (SpiceBoolean OUT_ARRAY1[ANY], int *SIZE1) {(SpiceBoolean indexd[SPICE_EK_MXCLSG], int *n6)};
-%apply (SpiceBoolean OUT_ARRAY1[ANY], int *SIZE1) {(SpiceBoolean nullok[SPICE_EK_MXCLSG], int *n7)};
+%apply (SpiceChar    OUT_STRINGS[ANY][ANY], SpiceInt *NSTRINGS) {(SpiceChar cnames[SPICE_EK_MXCLSG][NAMELEN], SpiceInt *n1)};
+%apply (SpiceInt     OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt     cclass[SPICE_EK_MXCLSG], SpiceInt *n2)};
+%apply (SpiceInt     OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt      dtype[SPICE_EK_MXCLSG], SpiceInt *n3)};
+%apply (SpiceInt     OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt      strln[SPICE_EK_MXCLSG], SpiceInt *n4)};
+%apply (SpiceInt     OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt       size[SPICE_EK_MXCLSG], SpiceInt *n5)};
+%apply (SpiceBoolean OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceBoolean indexd[SPICE_EK_MXCLSG], SpiceInt *n6)};
+%apply (SpiceBoolean OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceBoolean nullok[SPICE_EK_MXCLSG], SpiceInt *n7)};
 
 %inline %{
     void my_ekssum_c(
         SpiceInt     handle,
         SpiceInt     segno,
-        SpiceChar    tabnam[NAMELEN], int *nrows,
+        SpiceChar    tabnam[NAMELEN], SpiceInt *nrows,
         SpiceInt     *ncols,
-        SpiceChar    cnames[SPICE_EK_MXCLSG][NAMELEN], int *n1,
-        SpiceInt     cclass[SPICE_EK_MXCLSG], int *n2,
-        SpiceInt      dtype[SPICE_EK_MXCLSG], int *n3,
-        SpiceInt      strln[SPICE_EK_MXCLSG], int *n4,
-        SpiceInt       size[SPICE_EK_MXCLSG], int *n5,
-        SpiceBoolean indexd[SPICE_EK_MXCLSG], int *n6,
-        SpiceBoolean nullok[SPICE_EK_MXCLSG], int *n7)
+        SpiceChar    cnames[SPICE_EK_MXCLSG][NAMELEN], SpiceInt *n1,
+        SpiceInt     cclass[SPICE_EK_MXCLSG], SpiceInt *n2,
+        SpiceInt      dtype[SPICE_EK_MXCLSG], SpiceInt *n3,
+        SpiceInt      strln[SPICE_EK_MXCLSG], SpiceInt *n4,
+        SpiceInt       size[SPICE_EK_MXCLSG], SpiceInt *n5,
+        SpiceBoolean indexd[SPICE_EK_MXCLSG], SpiceInt *n6,
+        SpiceBoolean nullok[SPICE_EK_MXCLSG], SpiceInt *n7)
     {
         SpiceEKSegSum segsum;
 
@@ -6036,8 +6041,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *relate};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfdist_c(
@@ -6050,7 +6055,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble    step,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6150,20 +6155,20 @@ extern SpiceInt esrchc_c(
 %rename (gfevnt) my_gfevnt_c;
 %apply (void RETURN_VOID) {void my_gfevnt_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *gquant};
-%apply (SpiceInt DIM1, ConstSpiceChar *IN_STRINGS)
-                {(SpiceInt qnpars, ConstSpiceChar *qpnams)};
+%apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
+                {(SpiceInt qnpars, SpiceInt ignore, ConstSpiceChar *qpnams)};
 %apply (ConstSpiceChar *IN_STRINGS) {ConstSpiceChar *qcpars};
 %apply (ConstSpiceDouble  *IN_ARRAY1) {ConstSpiceDouble  *qdpars};
 %apply (ConstSpiceInt     *IN_ARRAY1) {ConstSpiceInt     *qipars};
 %apply (ConstSpiceBoolean *IN_ARRAY1) {ConstSpiceBoolean *qlpars};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfevnt_c(
         SpiceDouble  step,
         ConstSpiceChar    *gquant,
-        SpiceInt          qnpars, ConstSpiceChar *qpnams,
+        SpiceInt          qnpars, SpiceInt ignore, ConstSpiceChar *qpnams,
         ConstSpiceChar    *qcpars,
         ConstSpiceDouble  *qdpars,
         ConstSpiceInt     *qipars,
@@ -6175,7 +6180,7 @@ extern SpiceInt esrchc_c(
         SpiceBoolean      rpt,
         SpiceDouble       et0,
         SpiceDouble       et1,
-        SpiceDouble       windows[WINDOWS][2], int *intervals)
+        SpiceDouble       windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6268,8 +6273,8 @@ extern SpiceInt esrchc_c(
 %rename (gffove) my_gffove_c;
 %apply (void RETURN_VOID) {void my_gffove_c};
 %apply (ConstSpiceDouble IN_ARRAY1[ANY]) {ConstSpiceDouble raydir[3]};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gffove_c(
@@ -6285,7 +6290,7 @@ extern SpiceInt esrchc_c(
         SpiceBoolean     rpt,
         SpiceDouble      et0,
         SpiceDouble      et1,
-        SpiceDouble      windows[WINDOWS][2], int *intervals)
+        SpiceDouble      windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6374,8 +6379,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
 %apply (ConstSpiceDouble IN_ARRAY1[ANY]) {ConstSpiceDouble spoint[3]};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *relate};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfilum_c(
@@ -6393,7 +6398,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble      step,
         SpiceDouble      et0,
         SpiceDouble      et1,
-        SpiceDouble      windows[WINDOWS][2], int *intervals)
+        SpiceDouble      windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6487,8 +6492,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *bshape};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfocce_c(
@@ -6506,7 +6511,7 @@ extern SpiceInt esrchc_c(
         SpiceBoolean   rpt,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6589,8 +6594,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *bframe};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfoclt_c(
@@ -6606,7 +6611,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble    step,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6678,8 +6683,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *relate};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfpa_c(
@@ -6693,7 +6698,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble    step,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6773,8 +6778,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *crdsys};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *coord};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *relate};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfposc_c(
@@ -6790,7 +6795,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble    step,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6862,8 +6867,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *rframe};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfrfov_c(
@@ -6875,7 +6880,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble      step,
         SpiceDouble      et0,
         SpiceDouble      et1,
-        SpiceDouble      windows[WINDOWS][2], int *intervals)
+        SpiceDouble      windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -6943,8 +6948,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *relate};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfrr_c(
@@ -6957,7 +6962,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble    step,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -7046,8 +7051,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *relate};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfsep_c(
@@ -7065,7 +7070,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble    step,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -7155,8 +7160,8 @@ extern SpiceInt esrchc_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *crdsys};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *coord};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *relate};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfsntc_c(
@@ -7175,7 +7180,7 @@ extern SpiceInt esrchc_c(
         SpiceDouble      step,
         SpiceDouble      et0,
         SpiceDouble      et1,
-        SpiceDouble      windows[WINDOWS][2], int *intervals)
+        SpiceDouble      windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -7283,8 +7288,8 @@ extern void gfstol_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *crdsys};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *coord};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *relate};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gfsubc_c(
@@ -7301,7 +7306,7 @@ extern void gfstol_c(
         SpiceDouble    step,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -7377,8 +7382,8 @@ extern void gfstol_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *tframe};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *abcorr};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *obsrvr};
-%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], int *SIZE1)
-                {(SpiceDouble windows[WINDOWS][2], int *intervals)};
+%apply (SpiceDouble OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
+                {(SpiceDouble windows[WINDOWS][2], SpiceInt *intervals)};
 
 %inline %{
     void my_gftfov_c(
@@ -7391,7 +7396,7 @@ extern void gfstol_c(
         SpiceDouble    step,
         SpiceDouble    et0,
         SpiceDouble    et1,
-        SpiceDouble    windows[WINDOWS][2], int *intervals)
+        SpiceDouble    windows[WINDOWS][2], SpiceInt *intervals)
     {
         SPICEDOUBLE_CELL(cnfine, 2);
         wnvald_c(2, 0, &cnfine);
@@ -8228,13 +8233,13 @@ VECTORIZE_di_di_d__RETURN_d(lgrint, my_lgrint_c)
 %apply (void RETURN_VOID) {void lparse_c};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *list};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *delim};
-%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, char OUT_STRINGS[ANY][ANY])
-        {(SpiceInt nmax, SpiceInt itemln, SpiceInt *n, char items[MAXVALS][NAMELEN])};
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
+        {(SpiceInt nmax, SpiceInt itemln, SpiceInt *n, SpiceChar items[MAXVALS][NAMELEN])};
 
 extern void lparse_c(
         ConstSpiceChar *CONST_STRING,
         ConstSpiceChar *CONST_STRING,
-        SpiceInt       nmax, SpiceInt itemln, SpiceInt *n, char items[MAXVALS][NAMELEN]
+        SpiceInt       nmax, SpiceInt itemln, SpiceInt *n, SpiceChar items[MAXVALS][NAMELEN]
 );
 
 /***********************************************************************
@@ -8269,12 +8274,12 @@ extern void lparse_c(
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *list};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *delims};
 %apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
-        {(SpiceInt nmax, SpiceInt itemln, SpiceInt *n, char items[MAXVALS][COLLEN])};
+        {(SpiceInt nmax, SpiceInt itemln, SpiceInt *n, SpiceChar items[MAXVALS][COLLEN])};
 
 extern void lparsm_c(
         ConstSpiceChar *CONST_STRING,
         ConstSpiceChar *CONST_STRING,
-        SpiceInt       nmax, SpiceInt itemln, SpiceInt *n, char items[MAXVALS][COLLEN]
+        SpiceInt       nmax, SpiceInt itemln, SpiceInt *n, SpiceChar items[MAXVALS][COLLEN]
 );
 
 /***********************************************************************
@@ -8895,7 +8900,7 @@ extern void nthwd_c(
 %apply (void RETURN_VOID) {void my_orderc_c};
 %apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
                 {(SpiceInt ndim, SpiceInt arrlen, ConstSpiceChar *array)};
-%apply (int *DIM1, SpiceInt **OUT_ARRAY1) {(SpiceInt *n, SpiceInt **iorder)};
+%apply (SpiceInt *SIZE1, SpiceInt **OUT_ARRAY1) {(SpiceInt *n, SpiceInt **iorder)};
 
 %inline %{
     void my_orderc_c(
@@ -8937,7 +8942,7 @@ extern void nthwd_c(
 %apply (void RETURN_VOID) {void my_orderd_c};
 %apply (ConstSpiceDouble *IN_ARRAY1, SpiceInt DIM1)
                 {(ConstSpiceDouble *array, SpiceInt ndim)};
-%apply (int *DIM1, SpiceInt **OUT_ARRAY1)
+%apply (SpiceInt *SIZE1, SpiceInt **OUT_ARRAY1)
                 {(SpiceInt *n, SpiceInt **iorder)};
 
 %inline %{
@@ -8981,7 +8986,7 @@ extern void nthwd_c(
 %apply (void RETURN_VOID) {void my_orderi_c};
 %apply (ConstSpiceInt *IN_ARRAY1, SpiceInt DIM1)
                 {(ConstSpiceInt *array, SpiceInt ndim)};
-%apply (int *DIM1, SpiceInt **OUT_ARRAY1) {(SpiceInt *n, SpiceInt **iorder)};
+%apply (SpiceInt *SIZE1, SpiceInt **OUT_ARRAY1) {(SpiceInt *n, SpiceInt **iorder)};
 
 %inline %{
     void my_orderi_c(
@@ -9240,12 +9245,12 @@ VECTORIZE_dX_dX_dX__dN(pltnrm, pltnrm_c, 3)
                 {(SpiceInt *nderiv_plus_1, SpiceDouble p[10])};
 
 // Copied from vectorize.i
-%apply (ConstSpiceDouble *IN_ARRAY12, int DIM1, int DIM2)
-                {(ConstSpiceDouble *in21, int in21_dim1, int in21_dim2)};
-%apply (ConstSpiceDouble *IN_ARRAY01, int DIM1)
-                {(ConstSpiceDouble *in12, int in12_dim1)};
-%apply (SpiceDouble **OUT_ARRAY12, int *SIZE1, int *SIZE2)
-                {(SpiceDouble **out21, int *out21_dim1, int *out21_dim2)};
+%apply (ConstSpiceDouble *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2)
+                {(ConstSpiceDouble *in21, SpiceInt in21_dim1, SpiceInt in21_dim2)};
+%apply (ConstSpiceDouble *IN_ARRAY01, SpiceInt DIM1)
+                {(ConstSpiceDouble *in12, SpiceInt in12_dim1)};
+%apply (SpiceDouble **OUT_ARRAY12, SpiceInt *SIZE1, SpiceInt *SIZE2)
+                {(SpiceDouble **out21, SpiceInt *out21_dim1, SpiceInt *out21_dim2)};
 
 %inline %{
     void my_polyds_c(
@@ -9262,10 +9267,10 @@ VECTORIZE_dX_dX_dX__dN(pltnrm, pltnrm_c, 3)
     // the rightmost dimension of the returned axis is variable.
 
     void polyds_vector(
-        ConstSpiceDouble *in21, int in21_dim1, int in21_dim2,
+        ConstSpiceDouble *in21, SpiceInt in21_dim1, SpiceInt in21_dim2,
         SpiceInt nderiv,
-        ConstSpiceDouble *in12, int in12_dim1,
-        SpiceDouble **out21, int *out21_dim1, int *out21_dim2)
+        ConstSpiceDouble *in12, SpiceInt in12_dim1,
+        SpiceDouble **out21, SpiceInt *out21_dim1, SpiceInt *out21_dim2)
     {
         char *my_name = "polyds_vector";
 
@@ -9492,9 +9497,12 @@ extern void prsint_c(
 
 %rename (qderiv) my_qderiv_c;
 %apply (void RETURN_VOID) {void my_qderiv_c};
-%apply (SpiceInt DIM1, ConstSpiceDouble *IN_ARRAY1) {(SpiceInt ndim, ConstSpiceDouble *f0)};
-%apply (SpiceInt DIM1, ConstSpiceDouble *IN_ARRAY1) {(SpiceInt ndim1, ConstSpiceDouble *f2)};
-%apply (SpiceInt *DIM1, SpiceDouble **OUT_ARRAY1) {(SpiceInt *ndim2, SpiceDouble **dfdt)};
+%apply (SpiceInt DIM1, ConstSpiceDouble *IN_ARRAY1)
+            {(SpiceInt ndim, ConstSpiceDouble *f0)};
+%apply (SpiceInt DIM1, ConstSpiceDouble *IN_ARRAY1)
+            {(SpiceInt ndim1, ConstSpiceDouble *f2)};
+%apply (SpiceInt *SIZE1, SpiceDouble **OUT_ARRAY1)
+            {(SpiceInt *ndim2, SpiceDouble **dfdt)};
 
 %inline %{
     void my_qderiv_c(
@@ -9598,12 +9606,12 @@ VECTORIZE_dX_2d__3d(recazl, recazl_c)
 %rename (reordc) reordc_c;
 %apply (void RETURN_VOID) {void reordc_c};
 %apply (ConstSpiceInt *IN_ARRAY1) {ConstSpiceInt *iorder};
-%apply (SpiceInt DIM1, SpiceInt DIM2, char *INOUT_STRINGS)
-                {(SpiceInt ndim, SpiceInt arrlen, char *array)};
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceChar *INOUT_STRINGS)
+                {(SpiceInt ndim, SpiceInt arrlen, SpiceChar *array)};
 
 extern void reordc_c(
         ConstSpiceInt *iorder,
-        SpiceInt      ndim, SpiceInt arrlen, char *array
+        SpiceInt      ndim, SpiceInt arrlen, SpiceChar *array
 );
 
 /***********************************************************************
@@ -9792,11 +9800,11 @@ extern SpiceBoolean return_c(void);
 
 %rename (shellc) shellc_c;
 %apply (void RETURN_VOID) {void shellc_c};
-%apply (SpiceInt DIM1, SpiceInt DIM2, char *INOUT_STRINGS)
-                {(SpiceInt ndim, SpiceInt arrlen, char *array)};
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceChar *INOUT_STRINGS)
+                {(SpiceInt ndim, SpiceInt arrlen, SpiceChar *array)};
 
 extern void shellc_c(
-        SpiceInt ndim, SpiceInt arrlen, char *array
+        SpiceInt ndim, SpiceInt arrlen, SpiceChar *array
 );
 
 /***********************************************************************
@@ -10441,7 +10449,8 @@ extern void spkpvn_c(
 %apply (void RETURN_VOID) {void my_spksfs_c};
 %apply (SpiceInt *OUTPUT) {SpiceInt *handle};
 %apply (SpiceDouble OUT_ARRAY1[ANY]) {SpiceDouble descr[5]};
-%apply (SpiceInt DIM1, SpiceChar OUT_STRING[ANY]) {(SpiceInt idlen, SpiceChar ident[SIDLEN])};
+%apply (SpiceInt DIM1, SpiceChar OUT_STRING[ANY])
+      {(SpiceInt idlen, SpiceChar ident[SIDLEN])};
 %apply (SpiceInt *OUTPUT) {SpiceBoolean *found};
 
 %inline %{
@@ -10450,7 +10459,7 @@ extern void spkpvn_c(
         SpiceDouble  et,
         SpiceInt     *handle,
         SpiceDouble  descr[5],
-        SpiceInt     idlen, SpiceChar *ident,
+        SpiceInt     idlen, SpiceChar ident[SIDLEN],
         SpiceBoolean *found)
     {
         spksfs_c(body, et, idlen, handle, descr, ident, found);
@@ -11397,7 +11406,7 @@ extern SpiceInt sumai_c(
 
 %rename (swpool) swpool_c;
 %apply (void RETURN_VOID) {void swpool_c};
-%apply (int DIM1, int DIM2, ConstSpiceChar *IN_STRINGS)
+%apply (SpiceInt DIM1, SpiceInt DIM2, ConstSpiceChar *IN_STRINGS)
                 {(SpiceInt nnames, SpiceInt namlen, ConstSpiceChar *names)};
 
 extern void swpool_c(
@@ -11781,17 +11790,17 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wncomd) my_wncomd_c;
 %apply (void RETURN_VOID) {void my_wncomd_c};
-%apply (int DIM1, SpiceDouble IN_ARRAY2[][ANY])
-                {(int n, SpiceDouble window[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
-                {(int *n1, SpiceDouble result[WINDOWS][2])};
+%apply (SpiceInt DIM1, SpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, SpiceDouble window[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
+                {(SpiceInt *n1, SpiceDouble result[WINDOWS][2])};
 
 %inline %{
     void my_wncomd_c(
         SpiceDouble left,
         SpiceDouble right,
-        int         n,   SpiceDouble window[][2],
-        int         *n1, SpiceDouble result[WINDOWS][2])
+        SpiceInt    n,   SpiceDouble window[][2],
+        SpiceInt    *n1, SpiceDouble result[WINDOWS][2])
     {
         int nx2 = 2 * n;
         SPICEDOUBLE_CELL(cells1, 2 * WINDOWS);
@@ -11834,17 +11843,17 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wncond) my_wncond_c;
 %apply (void RETURN_VOID) {void my_wncond_c};
-%apply (int DIM1, SpiceDouble IN_ARRAY2[][ANY])
-                {(int n, SpiceDouble window[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
-                {(int *size, SpiceDouble result[WINDOWS][2])};
+%apply (SpiceInt DIM1, SpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, SpiceDouble window[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
+                {(SpiceInt *size, SpiceDouble result[WINDOWS][2])};
 
 %inline %{
     void my_wncond_c(
         SpiceDouble left,
         SpiceDouble right,
-        int n, SpiceDouble window[][2],
-        int *size, SpiceDouble result[WINDOWS][2])
+        SpiceInt n, SpiceDouble window[][2],
+        SpiceInt *size, SpiceDouble result[WINDOWS][2])
     {
         int nx2 = 2 * n;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -11883,15 +11892,15 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wndifd) my_wndifd_c;
 %apply (void RETURN_VOID) {void my_wndifd_c};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int na, ConstSpiceDouble a[][2])};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int nb, ConstSpiceDouble b[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY]) {(int *nc, SpiceDouble c[WINDOWS][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt na, ConstSpiceDouble a[][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt nb, ConstSpiceDouble b[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY]) {(SpiceInt *nc, SpiceDouble c[WINDOWS][2])};
 
 %inline %{
     void my_wndifd_c(
-        int na,  ConstSpiceDouble a[][2],
-        int nb,  ConstSpiceDouble b[][2],
-        int *nc, SpiceDouble c[WINDOWS][2])
+        SpiceInt na,  ConstSpiceDouble a[][2],
+        SpiceInt nb,  ConstSpiceDouble b[][2],
+        SpiceInt *nc, SpiceDouble c[WINDOWS][2])
     {
         int nx2 = 2 * na;
         SPICEDOUBLE_CELL(cells_a, 2 * WINDOWS);
@@ -11938,13 +11947,13 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnelmd) my_wnelmd_c;
 %apply (SpiceBoolean RETURN_BOOLEAN) {SpiceBoolean my_wnelmd_c};
-%apply (int DIM1, SpiceDouble IN_ARRAY2[][ANY])
-                {(int n, SpiceDouble window[][2])};
+%apply (SpiceInt DIM1, SpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, SpiceDouble window[][2])};
 
 %inline %{
     SpiceBoolean my_wnelmd_c(
         SpiceDouble point,
-        int n, SpiceDouble window[][2])
+        SpiceInt n, SpiceDouble window[][2])
     {
         int nx2 = 2 * n;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -11980,17 +11989,17 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnexpd) my_wnexpd_c;
 %apply (void RETURN_VOID) {void my_wnexpd_c};
-%apply (int DIM1, SpiceDouble IN_ARRAY2[][ANY])
-                {(int n, SpiceDouble window[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
-                {(int *size, SpiceDouble result[WINDOWS][2])};
+%apply (SpiceInt DIM1, SpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, SpiceDouble window[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
+                {(SpiceInt *size, SpiceDouble result[WINDOWS][2])};
 
 %inline %{
     void my_wnexpd_c(
         SpiceDouble left,
         SpiceDouble right,
-        int n, SpiceDouble window[][2],
-        int *size, SpiceDouble result[WINDOWS][2])
+        SpiceInt n, SpiceDouble window[][2],
+        SpiceInt *size, SpiceDouble result[WINDOWS][2])
     {
         int nx2 = 2 * n;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -12030,16 +12039,16 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 %rename (wnextd) my_wnextd_c;
 %apply (void RETURN_VOID) {void my_wnextd_c};
 %apply (SpiceChar IN_STRING) {SpiceChar side};
-%apply (int DIM1, SpiceDouble IN_ARRAY2[][ANY])
-                {(int n, SpiceDouble window[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
-                {(int *size, SpiceDouble result[WINDOWS][2])};
+%apply (SpiceInt DIM1, SpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, SpiceDouble window[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
+                {(SpiceInt *size, SpiceDouble result[WINDOWS][2])};
 
 %inline %{
     void my_wnextd_c(
         SpiceChar side,
-        int n, SpiceDouble window[][2],
-        int *size, SpiceDouble result[WINDOWS][2])
+        SpiceInt n, SpiceDouble window[][2],
+        SpiceInt *size, SpiceDouble result[WINDOWS][2])
     {
         int nx2 = 2 * n;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -12076,16 +12085,16 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnfild) my_wnfild_c;
 %apply (void RETURN_VOID) {void my_wnfild_c};
-%apply (int DIM1, SpiceDouble IN_ARRAY2[][ANY])
-                {(int n, SpiceDouble window[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
-                {(int *n1, SpiceDouble result[WINDOWS][2])};
+%apply (SpiceInt DIM1, SpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, SpiceDouble window[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
+                {(SpiceInt *n1, SpiceDouble result[WINDOWS][2])};
 
 %inline %{
     void my_wnfild_c(
         SpiceDouble smlgap,
-        int n, SpiceDouble window[][2],
-        int *n1, SpiceDouble result[WINDOWS][2])
+        SpiceInt n, SpiceDouble window[][2],
+        SpiceInt *n1, SpiceDouble result[WINDOWS][2])
     {
         int nx2 = 2 * n;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -12122,16 +12131,16 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnfltd) my_wnfltd_c;
 %apply (void RETURN_VOID) {void my_wnfltd_c};
-%apply (int DIM1, SpiceDouble IN_ARRAY2[][ANY])
-                {(int n, ConstSpiceDouble window[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
-                {(int *n1, SpiceDouble result[WINDOWS][2])};
+%apply (SpiceInt DIM1, SpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, ConstSpiceDouble window[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
+                {(SpiceInt *n1, SpiceDouble result[WINDOWS][2])};
 
 %inline %{
     void my_wnfltd_c(
         SpiceDouble smlint,
-        int n,   ConstSpiceDouble window[][2],
-        int *n1, SpiceDouble result[WINDOWS][2])
+        SpiceInt n,   ConstSpiceDouble window[][2],
+        SpiceInt *n1, SpiceDouble result[WINDOWS][2])
     {
         int nx2 = 2 * n;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -12171,14 +12180,14 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnincd) my_wnincd_c;
 %apply (SpiceBoolean RETURN_BOOLEAN) {SpiceBoolean my_wnincd_c};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY])
-                {(int n, ConstSpiceDouble window[][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, ConstSpiceDouble window[][2])};
 
 %inline %{
     SpiceBoolean my_wnincd_c(
         SpiceDouble left,
         SpiceDouble right,
-        int n, ConstSpiceDouble window[][2])
+        SpiceInt n, ConstSpiceDouble window[][2])
     {
         int nx2 = 2 * n;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -12213,17 +12222,17 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wninsd) my_wninsd_c;
 %apply (void RETURN_VOID) {void my_wninsd_c};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY])
-                {(int n, ConstSpiceDouble window[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
-                {(int *n1, SpiceDouble result[WINDOWS][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY])
+                {(SpiceInt n, ConstSpiceDouble window[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY])
+                {(SpiceInt *n1, SpiceDouble result[WINDOWS][2])};
 
 %inline %{
     void my_wninsd_c(
         SpiceDouble left,
         SpiceDouble right,
-        int n, ConstSpiceDouble window[][2],
-        int *n1, SpiceDouble result[WINDOWS][2])
+        SpiceInt n, ConstSpiceDouble window[][2],
+        SpiceInt *n1, SpiceDouble result[WINDOWS][2])
     {
         int nx2 = n * 2;
         SPICEDOUBLE_CELL(cells, 2 * WINDOWS);
@@ -12262,15 +12271,15 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnintd) my_wnintd_c;
 %apply (void RETURN_VOID) {void my_wnintd_c};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int na, ConstSpiceDouble a[][2])};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int nb, ConstSpiceDouble b[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY]) {(int *nc, SpiceDouble c[WINDOWS][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt na, ConstSpiceDouble a[][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt nb, ConstSpiceDouble b[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY]) {(SpiceInt *nc, SpiceDouble c[WINDOWS][2])};
 
 %inline %{
     void my_wnintd_c(
-        int na,  ConstSpiceDouble a[][2],
-        int nb,  ConstSpiceDouble b[][2],
-        int *nc, SpiceDouble c[WINDOWS][2])
+        SpiceInt na,  ConstSpiceDouble a[][2],
+        SpiceInt nb,  ConstSpiceDouble b[][2],
+        SpiceInt *nc, SpiceDouble c[WINDOWS][2])
     {
         int nx2 = 2 * na;
         SPICEDOUBLE_CELL(cells_a, 2 * WINDOWS);
@@ -12323,15 +12332,15 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnreld) my_wnreld_c;
 %apply (SpiceBoolean RETURN_BOOLEAN) {SpiceBoolean my_wnreld_c};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int na, ConstSpiceDouble a[][2])};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int nb, ConstSpiceDouble b[][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt na, ConstSpiceDouble a[][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt nb, ConstSpiceDouble b[][2])};
 %apply (ConstSpiceChar *CONST_STRING) {ConstSpiceChar *op};
 
 %inline %{
     SpiceBoolean my_wnreld_c(
-        int na, ConstSpiceDouble a[][2],
+        SpiceInt na, ConstSpiceDouble a[][2],
         ConstSpiceChar *op,
-        int nb, ConstSpiceDouble b[][2])
+        SpiceInt nb, ConstSpiceDouble b[][2])
     {
         int nx2 = 2 * na;
         SPICEDOUBLE_CELL(cells_a, 2 * WINDOWS);
@@ -12376,7 +12385,7 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnsumd) my_wnsumd_c;
 %apply (void RETURN_VOID) {void my_wnsumd_c};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int n, ConstSpiceDouble window[][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt n, ConstSpiceDouble window[][2])};
 %apply (SpiceDouble *OUTPUT) {SpiceDouble *meas};
 %apply (SpiceDouble *OUTPUT) {SpiceDouble *avg};
 %apply (SpiceDouble *OUTPUT) {SpiceDouble *stddev};
@@ -12385,7 +12394,7 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %inline %{
     void my_wnsumd_c(
-        int n, ConstSpiceDouble window[][2],
+        SpiceInt n, ConstSpiceDouble window[][2],
         SpiceDouble *meas,
         SpiceDouble *avg,
         SpiceDouble *stddev,
@@ -12425,15 +12434,15 @@ VECTORIZE_di_di__di(vprojg, my_vprojg_nomalloc)
 
 %rename (wnunid) my_wnunid_c;
 %apply (void RETURN_VOID) {void my_wnunid_c};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int na, ConstSpiceDouble a[][2])};
-%apply (int DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(int nb, ConstSpiceDouble b[][2])};
-%apply (int *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY]) {(int *nc, SpiceDouble c[WINDOWS][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt na, ConstSpiceDouble a[][2])};
+%apply (SpiceInt DIM1, ConstSpiceDouble IN_ARRAY2[][ANY]) {(SpiceInt nb, ConstSpiceDouble b[][2])};
+%apply (SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY]) {(SpiceInt *nc, SpiceDouble c[WINDOWS][2])};
 
 %inline %{
     void my_wnunid_c(
-        int na,  ConstSpiceDouble a[][2],
-        int nb,  ConstSpiceDouble b[][2],
-        int *nc, SpiceDouble c[WINDOWS][2])
+        SpiceInt na,  ConstSpiceDouble a[][2],
+        SpiceInt nb,  ConstSpiceDouble b[][2],
+        SpiceInt *nc, SpiceDouble c[WINDOWS][2])
     {
         int nx2 = 2 * na;
         SPICEDOUBLE_CELL(cells_a, 2 * WINDOWS);
diff --git a/swig/cspyce_typemaps.i b/swig/cspyce_typemaps.i
index 747683d4..79266e69 100644
--- a/swig/cspyce_typemaps.i
+++ b/swig/cspyce_typemaps.i
@@ -840,21 +840,21 @@ PyArrayObject* create_array_with_owned_data(int nd, npy_intp const *dims, int ty
 *
 * If the size of the array is fixed and can be specified in the SWIG interface:
 *       (type IN_ARRAY1[ANY])
-*       (type IN_ARRAY1[ANY], int DIM1)
-*       (int DIM1, type IN_ARRAY1[ANY])
+*       (type IN_ARRAY1[ANY], SpiceInt DIM1)
+*       (SpiceInt DIM1, type IN_ARRAY1[ANY])
 * In these cases, an error condition will be raised if the dimension of the
 * structure passed from Python does not match that specified in braces within
 * the C function call.
 *
 * If the size of the array is defined by the Python structure:
-*       (type *IN_ARRAY1, int DIM1)
-*       (int DIM1, type *IN_ARRAY1)
+*       (type *IN_ARRAY1, SpiceInt DIM1)
+*       (SpiceInt DIM1, type *IN_ARRAY1)
 * In these cases, there is no limit on the number of elements that can be passed
 * to the C function. Internal memory is allocated as needed based on the size of
 * the array passed from Python.
 *
 * If a scalar should be shaped into an array of shape (1,):
-*       (type *IN_ARRAY01, int DIM1)
+*       (type *IN_ARRAY01, SpiceInt DIM1)
 * If a scalar is given, then DIM1 = 0.
 *******************************************************************************/
 
@@ -869,88 +869,86 @@ PyArrayObject* create_array_with_owned_data(int nd, npy_intp const *dims, int ty
     (Type IN_ARRAY1[ANY])                                       // PATTERN
             (PyArrayObject* pyarr=NULL)
 {
+//      $1_type $1_name
 //      (Type IN_ARRAY1[ANY])
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 1, 1, pyarr)
     TEST_INVALID_ARRAY_SHAPE_1D(pyarr, $1_dim0);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
 }
 
 /*******************************************************
-* (Type IN_ARRAY1[ANY], int DIM1)
+* (Type IN_ARRAY1[ANY], SpiceInt DIM1)
 *******************************************************/
 
 %typemap(in)
-    (Type IN_ARRAY1[ANY], int DIM1)                             // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (Type IN_ARRAY1[ANY], SpiceInt DIM1)                        // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type IN_ARRAY1[ANY], int DIM1)
-//  NOT CURRENTLY USED BY CSPICE
+//       $1_type $1_name, $2_type $2_name
+//       (Type IN_ARRAY1[ANY], SpiceInt DIM1)
+//       NOT CURRENTLY USED BY CSPICE
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 1, 1, pyarr)
     TEST_INVALID_ARRAY_SHAPE_1D(pyarr, $1_dim0);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
 }
 
 /*******************************************************
-* (int DIM1, Type IN_ARRAY1[ANY])
+* (SpiceInt DIM1, Type IN_ARRAY1[ANY])
 *******************************************************/
 
 %typemap(in)
-    (int DIM1, Type IN_ARRAY1[ANY])                             // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (SpiceInt DIM1, Type IN_ARRAY1[ANY])                        // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (int DIM1, Type IN_ARRAY1[ANY])
-//  NOT CURRENTLY USED BY CSPICE
+//       $1_type $1_name, $2_type $2_name
+//       (SpiceInt DIM1, Type IN_ARRAY1[ANY])
+//       NOT CURRENTLY USED BY CSPICE
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 1, 1, pyarr)
     TEST_INVALID_ARRAY_SHAPE_1D(pyarr, $2_dim0);
 
     $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
 }
 
 /*******************************************************
-* (Type *IN_ARRAY1, int DIM1)
+* (Type *IN_ARRAY1, SpiceInt DIM1)
 *******************************************************/
 
 %typemap(in)
-    (Type *IN_ARRAY1, int DIM1)                                 // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (Type *IN_ARRAY1, SpiceInt DIM1)                            // PATTERN
+        (PyArrayObject* pyarr=NULL),
+    (Type IN_ARRAY1[], SpiceInt DIM1)                           // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type *IN_ARRAY1, int DIM1)
+//       $1_type $1_name, $2_type $2_name
+//      (Type *IN_ARRAY1, SpiceInt DIM1)
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 1, 1, pyarr)
-
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
 }
 
 /*******************************************************
-* (int DIM1, Type *IN_ARRAY1)
+* (SpiceInt DIM1, Type *IN_ARRAY1)
 *******************************************************/
 
 %typemap(in)
-    (int DIM1, Type *IN_ARRAY1)                                 // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (SpiceInt DIM1, Type *IN_ARRAY1)                            // PATTERN
+        (PyArrayObject* pyarr=NULL),
+    (SpiceInt DIM1, Type IN_ARRAY1[])                           // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (int DIM1, Type *IN_ARRAY1)
+//       $1_type $1_name, $2_type $2_name
+//      (SpiceInt DIM1, Type *IN_ARRAY1)
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 1, 1, pyarr)
-
     $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
 }
 
 /*******************************************************
@@ -963,34 +961,30 @@ PyArrayObject* create_array_with_owned_data(int nd, npy_intp const *dims, int ty
     (Type IN_ARRAY1[])                                          // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type *IN_ARRAY1)
-//      (Type IN_ARRAY1[]
+//       $1_type $1_name
+//       (Type *IN_ARRAY1), (Type IN_ARRAY1[]
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 1, 1, pyarr)
-
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
 }
 
 /*******************************************************
-* (Type *IN_ARRAY01, int DIM1)
+* (Type *IN_ARRAY01, SpiceInt DIM1)
 *******************************************************/
 
 %typemap(in)
-    (Type *IN_ARRAY01, int DIM1)                                // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (Type *IN_ARRAY01, SpiceInt DIM1)                           // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type *IN_ARRAY01, int DIM1)
-
+//       $1_type $1_name, $2_type $2_name
+//      (Type *IN_ARRAY01, SpiceInt DIM1)
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 0, 1, pyarr)
-
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
     if (PyArray_NDIM(pyarr) == 0) {
         $2 = 0;                                                 // DIM1
     } else {
-        $2 = (int) PyArray_DIM(pyarr, 0);                       // DIM1
+        $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                  // DIM1
     }
 }
 
@@ -1001,38 +995,31 @@ PyArrayObject* create_array_with_owned_data(int nd, npy_intp const *dims, int ty
 
 %typemap(argout)
     (Type IN_ARRAY1[ANY]),
-    (Type IN_ARRAY1[ANY], int DIM1),
     (Type IN_ARRAY1[ANY], SpiceInt DIM1),
-    (int DIM1, Type IN_ARRAY1[ANY]),
     (SpiceInt DIM1, Type IN_ARRAY1[ANY]),
-    (Type *IN_ARRAY1, int DIM1),
     (Type *IN_ARRAY1, SpiceInt DIM1),
-    (int DIM1, Type *IN_ARRAY1),
+    (Type IN_ARRAY1[], SpiceInt DIM1),
     (SpiceInt DIM1, Type *IN_ARRAY1),
+    (SpiceInt DIM1, Type IN_ARRAY1[]),
     (Type *IN_ARRAY1),
     (Type IN_ARRAY1[]),
-    (Type *IN_ARRAY01, int DIM1),
     (Type *IN_ARRAY01, SpiceInt DIM1)
  ""
 
 %typemap(freearg)
     (Type IN_ARRAY1[ANY]),
-    (Type IN_ARRAY1[ANY], int DIM1),
     (Type IN_ARRAY1[ANY], SpiceInt DIM1),
-    (int DIM1, Type IN_ARRAY1[ANY]),
     (SpiceInt DIM1, Type IN_ARRAY1[ANY]),
-    (Type *IN_ARRAY1, int DIM1),
     (Type *IN_ARRAY1, SpiceInt DIM1),
-    (int DIM1, Type *IN_ARRAY1),
+    (Type IN_ARRAY1[], SpiceInt DIM1),
     (SpiceInt DIM1, Type *IN_ARRAY1),
+    (SpiceInt DIM1, Type IN_ARRAY1[]),
     (Type *IN_ARRAY1),
     (Type IN_ARRAY1[]),
-    (Type *IN_ARRAY01, int DIM1),
     (Type *IN_ARRAY01, SpiceInt DIM1)
-{
-//      (Type ...IN_ARRAY1[ANY]...)
+%{
     Py_XDECREF(pyarr$argnum);
-}
+%}
 
 /*******************************************************
 * Now apply to all data types
@@ -1042,13 +1029,10 @@ PyArrayObject* create_array_with_owned_data(int nd, npy_intp const *dims, int ty
 
 // Define concrete examples of the TYPEMAP_IN1 macros
 TYPEMAP_IN(ConstSpiceChar,   NPY_STRING )
-TYPEMAP_IN(int,              NPY_INT   )
 TYPEMAP_IN(SpiceInt,         NPY_INT   )
 TYPEMAP_IN(ConstSpiceInt,    NPY_INT   )
 TYPEMAP_IN(SpiceBoolean,     NPY_INT   )
 TYPEMAP_IN(ConstSpiceBoolean,NPY_INT   )
-TYPEMAP_IN(long,             NPY_LONG  )
-TYPEMAP_IN(double,           NPY_DOUBLE)
 TYPEMAP_IN(SpiceDouble,      NPY_DOUBLE)
 TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 
@@ -1062,15 +1046,15 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 *
 * If the size of the array is fixed and can be specified in the SWIG interface:
 *       (type IN_ARRAY2[ANY][ANY])
-*       (type IN_ARRAY2[ANY][ANY], int DIM1, int DIM2)
-*       (int DIM1, int DIM2, type IN_ARRAY2[ANY][ANY])
+*       (type IN_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2)
+*       (SpiceInt DIM1, SpiceInt DIM2, type IN_ARRAY2[ANY][ANY])
 * In these cases, an error condition will be raised if the dimensions of the
 * structure passed from Python do not match what was specified in braces within
 * the C function call.
 *
 * If the size of the array is defined by the Python structure:
-*       (type *IN_ARRAY2, int DIM1, int DIM2)
-*       (int DIM1, int DIM2, type *IN_ARRAY2)
+*       (type *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2)
+*       (SpiceInt DIM1, SpiceInt DIM2, type *IN_ARRAY2)
 * In these cases, there is no limit on the number of elements that can be passed
 * to the C function. Internal memory is allocated as needed based on the size of
 * the array passed from Python.
@@ -1079,15 +1063,15 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 *
 * If the size of the last array axis is fixed and can be specified in the
 * SWIG interface:
-*       (type IN_ARRAY2[ANY][ANY], int DIM1)
-*       (int DIM1, type IN_ARRAY2[ANY][ANY])
+*       (type IN_ARRAY2[ANY][ANY], SpiceInt DIM1)
+*       (SpiceInt DIM1, type IN_ARRAY2[ANY][ANY])
 * In these cases, an error condition will be raised if the second dimension of
 * the structure passed from Python does not match what was specified in braces
 * within the C function call. The value of the first dimension is ignored and
 * can be set to one.
 *
 * If the first dimension can be missing:
-*       (type *IN_ARRAY12, int DIM1, int DIM2)
+*       (type *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2)
 * If it is missing, DIM1 = 0.
 *******************************************************************************/
 
@@ -1101,137 +1085,132 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     (Type IN_ARRAY2[ANY][ANY])                                  // PATTERN
             (PyArrayObject* pyarr=NULL)
 {
+//       $1_type $1_name
 //      (Type IN_ARRAY2[ANY][ANY])
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
     TEST_INVALID_ARRAY_SHAPE_2D(pyarr, $1_dim0, $1_dim1);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $3 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
 }
 
 /*******************************************************
-* (Type IN_ARRAY2[ANY][ANY], int DIM1, int DIM2)
+* (Type IN_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2)
 *******************************************************/
 
 %typemap(in)
-    (Type IN_ARRAY2[ANY][ANY], int DIM1, int DIM2)              // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (Type IN_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2)    // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type IN_ARRAY2[ANY][ANY], int DIM1, int DIM2)
-//  NOT CURRENTLY USED BY CSPICE
+//       $1_type $1_name, $2_type $2_name, $3_type $3_name
+//       (Type IN_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2)
+//       NOT CURRENTLY USED BY CSPICE
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
     TEST_INVALID_ARRAY_SHAPE_2D(pyarr, $1_dim0, $1_dim1);
 
+
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $3 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
+    $3 = (SpiceInt) PyArray_DIM(pyarr, 1);                      // DIM2
 }
 
 /*******************************************************
-* (int DIM1, int DIM2, Type IN_ARRAY2[ANY][ANY])
+* (SpiceInt DIM1, SpiceInt DIM2, Type IN_ARRAY2[ANY][ANY])
 *******************************************************/
 
 %typemap(in)
-    (int DIM1, int DIM2, Type IN_ARRAY2[ANY][ANY])              // PATTERN
-            (PyArrayObject* pyarr=NULL),
     (SpiceInt DIM1, SpiceInt DIM2, Type IN_ARRAY2[ANY][ANY])    // PATTERN
             (PyArrayObject* pyarr=NULL)
 {
-//      (int DIM1, int DIM2, Type IN_ARRAY2[ANY][ANY])
-//   NOT CURRENTLY USED
+//       $1_type $1_name, $2_type $2_name, $3_type $3_name
+//       (SpiceInt DIM1, SpiceInt DIM2, Type IN_ARRAY2[ANY][ANY])
+//       NOT CURRENTLY USED
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
     TEST_INVALID_ARRAY_SHAPE_2D(pyarr, $3_dim0, $3_dim1);
 
-    $3 = ($3_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $2 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $3 = ($3_ltype) PyArray_DATA(pyarr);		      // ARRAY
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);		      // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 1);		      // DIM2
 }
 
 /*******************************************************
-* (Type *IN_ARRAY2, int DIM1, int DIM2)
+* (Type *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2)
 *******************************************************/
 
 %typemap(in)
-    (Type *IN_ARRAY2, int DIM1, int DIM2)                       // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (Type *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2)             // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type *IN_ARRAY2, int DIM1, int DIM2)
+//       $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2)
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
 
-    $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $3 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $1 = ($1_ltype) PyArray_DATA(pyarr);		      // ARRAY
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);		      // DIM1
+    $3 = (SpiceInt) PyArray_DIM(pyarr, 1);		      // DIM2
 }
 
 /*******************************************************
-* (int DIM1, int DIM2, Type *IN_ARRAY2)
+* (SpiceInt DIM1, SpiceInt DIM2, Type *IN_ARRAY2)
 *******************************************************/
 
 %typemap(in)
-    (int DIM1, int DIM2, Type *IN_ARRAY2)                       // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (SpiceInt DIM1, SpiceInt DIM2, Type *IN_ARRAY2)             // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (int DIM1, int DIM2, Type *IN_ARRAY2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt DIM1, SpiceInt DIM2, Type *IN_ARRAY2)
 //  NOT CURRENTLY USED BY CSPICE
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
 
-    $3 = ($3_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $2 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $3 = ($3_ltype) PyArray_DATA(pyarr);		         // ARRAY
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);		         // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 1);		         // DIM2
 }
 
 /*******************************************************
-* (int DIM1, Type IN_ARRAY2[][ANY])
+* (SpiceInt DIM1, Type IN_ARRAY2[][ANY])
 * (SpiceInt DIM1, Type IN_ARRAY2[ANY])
 *******************************************************/
 
 %typemap(in)
-    (int DIM1, Type IN_ARRAY2[][ANY])                           // PATTERN
-        (PyArrayObject* pyarr=NULL),
-    (SpiceInt DIM1, Type IN_ARRAY2[][ANY])                      // PATTERN
+    (SpiceInt DIM1, Type IN_ARRAY2[][ANY])                       // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (int DIM1, Type IN_ARRAY2[][ANY])
 //      (SpiceInt DIM1, Type IN_ARRAY2[][ANY])
 
+//      $1_type $1_name, $2_type $2_name
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
     TEST_INVALID_ARRAY_SHAPE_x2D(pyarr, $2_dim1);
 
-    $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $2 = ($2_ltype) PyArray_DATA(pyarr);		         // ARRAY
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);		         // DIM1
 }
 
 /*******************************************************
-* (int DIM1, Type IN_ARRAY2[][ANY])
+* (SpiceInt DIM1, Type IN_ARRAY2[][ANY])
 * (SpiceInt DIM1, Type IN_ARRAY2[ANY])
 *******************************************************/
 
 %typemap(in)
-    (Type IN_ARRAY2[][ANY], int DIM1)                           // PATTERN
+    (Type IN_ARRAY2[][ANY], SpiceInt DIM1)		        // PATTERN
         (PyArrayObject* pyarr=NULL),
     (Type IN_ARRAY2[][ANY], SpiceInt DIM1)                      // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type IN_ARRAY2[][ANY], int DIM1)
+//      $1_type $1_name, $2_type $2_name
+//      (Type IN_ARRAY2[][ANY], SpiceInt DIM1)
 //      (Type IN_ARRAY2[][ANY], SpiceInt DIM1)
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
     TEST_INVALID_ARRAY_SHAPE_x2D(pyarr, $1_dim1);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
 }
 
 /*******************************************************
@@ -1242,14 +1221,13 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     (Type IN_ARRAY2[][ANY])                                     // PATTERN
             (PyArrayObject* pyarr=NULL)
 {
+//      $1_type $1_name
 //      (Type IN_ARRAY2[][ANY])
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
     TEST_INVALID_ARRAY_SHAPE_x2D(pyarr, $1_dim1);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $3 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
 }
 
 
@@ -1264,63 +1242,61 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     (Type IN_ARRAY2[])          // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (int DIM1, int DIM2, Type *IN_ARRAY2)
+//      $1_type $1_name
+//      (SpiceInt DIM1, SpiceInt DIM2, Type *IN_ARRAY2)
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 2, pyarr)
-
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
 }
 
 
 /*******************************************************
-* (Type *IN_ARRAY12, int DIM1, int DIM2)
+* (Type *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2)
 *******************************************************/
 
 %typemap(in)
-    (Type *IN_ARRAY12, int DIM1, int DIM2)                      // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (Type *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2)            // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type *IN_ARRAY12, int DIM1, int DIM2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2)
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 1, 2, pyarr)
 
     if (PyArray_NDIM(pyarr) == 1) {
         $1 = ($1_ltype) PyArray_DATA(pyarr);                    // ARRAY
         $2 = 0;                                                 // DIM1
-        $3 = (int) PyArray_DIM(pyarr, 0);                       // DIM2
+        $3 = (SpiceInt) PyArray_DIM(pyarr, 0);                  // DIM2
     } else {
         $1 = ($1_ltype) PyArray_DATA(pyarr);                    // ARRAY
-        $2 = (int) PyArray_DIM(pyarr, 0);                       // DIM1
-        $3 = (int) PyArray_DIM(pyarr, 1);                       // DIM2
+        $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                  // DIM1
+        $3 = (SpiceInt) PyArray_DIM(pyarr, 1);                  // DIM2
     }
 }
 
 /*******************************************************
-* (Type *IN_ARRAY23, int DIM1, int DIM2, int DIM3)
+* (Type *IN_ARRAY23, SpiceInt DIM1, SpiceInt DIM2, SpiceInt DIM3)
 *******************************************************/
 
 %typemap(in)
-    (Type *IN_ARRAY23, int DIM1, int DIM2, int DIM3)            // PATTERN
-        (PyArrayObject* pyarr=NULL),
     (Type *IN_ARRAY23, SpiceInt DIM1, SpiceInt DIM2, SpiceInt DIM3) // PATTERN
         (PyArrayObject* pyarr=NULL)
 {
-//      (Type *IN_ARRAY23, int DIM1, int DIM2, int DIM3)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name, $4_type $4_name
+//      (Type *IN_ARRAY23, SpiceInt DIM1, SpiceInt DIM2, SpiceInt DIM3)
 
     CONVERT_TO_CONTIGUOUS_ARRAY(Typecode, $input, 2, 3, pyarr)
 
     if (PyArray_NDIM(pyarr) == 2) {
         $1 = ($1_ltype) PyArray_DATA(pyarr);                    // ARRAY
         $2 = 0;                                                 // DIM1
-        $3 = (int) PyArray_DIM(pyarr, 0);                       // DIM2
-        $4 = (int) PyArray_DIM(pyarr, 1);                       // DIM3
+        $3 = (SpiceInt) PyArray_DIM(pyarr, 0);                  // DIM2
+        $4 = (SpiceInt) PyArray_DIM(pyarr, 1);                  // DIM3
     } else {
         $1 = ($1_ltype) PyArray_DATA(pyarr);                    // ARRAY
-        $2 = (int) PyArray_DIM(pyarr, 0);                       // DIM1
-        $3 = (int) PyArray_DIM(pyarr, 1);                       // DIM2
-        $4 = (int) PyArray_DIM(pyarr, 2);                       // DIM3
+        $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                  // DIM1
+        $3 = (SpiceInt) PyArray_DIM(pyarr, 1);                  // DIM2
+        $4 = (SpiceInt) PyArray_DIM(pyarr, 2);                  // DIM3
     }
 }
 
@@ -1332,51 +1308,34 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 
 %typemap(argout)
     (Type IN_ARRAY2[ANY][ANY]),
-    (Type IN_ARRAY2[ANY][ANY], int DIM1, int DIM2),
     (Type IN_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, Type IN_ARRAY2[ANY][ANY]),
     (SpiceInt DIM1, SpiceInt DIM2, Type IN_ARRAY2[ANY][ANY]),
-    (Type *IN_ARRAY2, int DIM1, int DIM2),
     (Type *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, Type *IN_ARRAY2),
     (SpiceInt DIM1, SpiceInt DIM2, Type *IN_ARRAY2),
-    (int DIM1, Type IN_ARRAY2[][ANY]),
     (SpiceInt DIM1, Type IN_ARRAY2[][ANY]),
-    (Type IN_ARRAY2[][ANY], int DIM1),
     (Type IN_ARRAY2[][ANY], SpiceInt DIM1),
     (Type IN_ARRAY2[][ANY]),
     (Type IN_ARRAY2[]),
     (Type *IN_ARRAY2),
-    (Type *IN_ARRAY12, int DIM1, int DIM2),
     (Type *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2),
-    (Type *IN_ARRAY23, int DIM1, int DIM2, INT DIM3),
     (Type *IN_ARRAY23, SpiceInt DIM1, SpiceInt DIM2, SpiceInt DIM3)
 ""
 
 %typemap(freearg)
     (Type IN_ARRAY2[ANY][ANY]),
-    (Type IN_ARRAY2[ANY][ANY], int DIM1, int DIM2),
     (Type IN_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, Type IN_ARRAY2[ANY][ANY]),
     (SpiceInt DIM1, SpiceInt DIM2, Type IN_ARRAY2[ANY][ANY]),
-    (Type *IN_ARRAY2, int DIM1, int DIM2),
     (Type *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, Type *IN_ARRAY2),
     (SpiceInt DIM1, SpiceInt DIM2, Type *IN_ARRAY2),
-    (int DIM1, Type IN_ARRAY2[][ANY]),
     (SpiceInt DIM1, Type IN_ARRAY2[][ANY]),
-    (Type IN_ARRAY2[][ANY], int DIM1),
     (Type IN_ARRAY2[][ANY], SpiceInt DIM1),
     (Type IN_ARRAY2[][ANY]),
     (Type IN_ARRAY2[]),
     (Type *IN_ARRAY2),
-    (Type *IN_ARRAY12, int DIM1, int DIM2),
     (Type *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2),
-    (Type *IN_ARRAY23, int DIM1, int DIM2, INT DIM3),
     (Type *IN_ARRAY23, SpiceInt DIM1, SpiceInt DIM2, SpiceInt DIM3)
 
 {
-//      (Type ...IN_ARRAY2...)
     Py_XDECREF(pyarr$argnum);
 }
 
@@ -1387,13 +1346,10 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 %enddef
 
 // Define concrete examples of the TYPEMAP_IN1 macros
-TYPEMAP_IN(int,              NPY_INT   )
 TYPEMAP_IN(SpiceInt,         NPY_INT   )
 TYPEMAP_IN(ConstSpiceInt,    NPY_INT   )
 TYPEMAP_IN(SpiceBoolean,     NPY_INT   )
 TYPEMAP_IN(ConstSpiceBoolean,NPY_INT   )
-TYPEMAP_IN(long,             NPY_LONG  )
-TYPEMAP_IN(double,           NPY_DOUBLE)
 TYPEMAP_IN(SpiceDouble,      NPY_DOUBLE)
 TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 
@@ -1410,24 +1366,24 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 *
 * If the size of the array can be specified in the SWIG interface:
 *       (type OUT_ARRAY1[ANY])
-*       (type OUT_ARRAY1[ANY], int DIM1)
-*       (int DIM1, type OUT_ARRAY1[ANY])
+*       (type OUT_ARRAY1[ANY], SpiceInt DIM1)
+*       (SpiceInt DIM1, type OUT_ARRAY1[ANY])
 *
 * If the upper limit on the size of the array can be specified in the SWIG
 * interface, but the size returned by C is variable:
-*       (type OUT_ARRAY1[ANY], int DIM1, int *SIZE1)
-*       (type OUT_ARRAY1[ANY], int *SIZE1, int DIM1)
-*       (int DIM1, int *SIZE1, type OUT_ARRAY1[ANY])
-*       (int *SIZE1, int DIM1, type OUT_ARRAY1[ANY])
+*       (type OUT_ARRAY1[ANY], SpiceInt DIM1, SpiceInt *SIZE1)
+*       (type OUT_ARRAY1[ANY], SpiceInt *SIZE1, SpiceInt DIM1)
+*       (SpiceInt DIM1, SpiceInt *SIZE1, type OUT_ARRAY1[ANY])
+*       (SpiceInt *SIZE1, SpiceInt DIM1, type OUT_ARRAY1[ANY])
 *
 * If the total size of a temporary memory buffer can be specified in advance,
 * and the shape of the array then returned afterward.
-*       (type OUT_ARRAY1[ANY], int *SIZE1)
-*       (int *SIZE1, type OUT_ARRAY1[ANY])
+*       (type OUT_ARRAY1[ANY], SpiceInt *SIZE1)
+*       (SpiceInt *SIZE1, type OUT_ARRAY1[ANY])
 *
 * If the C function will allocate the memory it needs and will return the size:
-*       (type **OUT_ARRAY1, int *DIM1)
-*       (int *DIM1, type **OUT_ARRAY1)
+*       (type **OUT_ARRAY1, SpiceInt *DIM1)
+*       (SpiceInt *DIM1, type **OUT_ARRAY1)
 *******************************************************************************/
 
 %define TYPEMAP_ARGOUT(Type, Typecode) // Use to fill in numeric types below!
@@ -1440,6 +1396,7 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     (Type OUT_ARRAY1[ANY])                                      // PATTERN
         (PyArrayObject* pyarr = NULL)
 {
+//      $1_type $1_name
 //      (Type OUT_ARRAY1[ANY])
 
     npy_intp dims[1] = {$1_dim0};                               // DIMENSIONS
@@ -1447,21 +1404,18 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $3 = &size[0];                                              // SIZE1
 }
 
 /*******************************************************
-* (Type OUT_ARRAY1[ANY], int DIM1)
+* (Type OUT_ARRAY1[ANY], SpiceInt DIM1)
 *******************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY1[ANY], int DIM1)                            // PATTERN
-        (PyArrayObject* pyarr = NULL),
     (Type OUT_ARRAY1[ANY], SpiceInt DIM1)                       // PATTERN
         (PyArrayObject* pyarr = NULL)
 {
-//      (Type OUT_ARRAY1[ANY], int DIM1)
+//      $1_type $1_name, $2_type $2_name
+//      (Type OUT_ARRAY1[ANY], SpiceInt DIM1)
 //  NOT CURRENTLY USED BY CSPICE
 
     npy_intp dims[1] = {$1_dim0};                               // ARRAY
@@ -1469,21 +1423,19 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $3 = &size[0];                                              // SIZE1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
 }
 
 /*******************************************************
-* (int DIM1, Type OUT_ARRAY1[ANY])
+* (SpiceInt DIM1, Type OUT_ARRAY1[ANY])
 *******************************************************/
 
 %typemap(in, numinputs=0)
-    (int DIM1, Type OUT_ARRAY1[ANY])                            // PATTERN
-        (PyArrayObject* pyarr = NULL),
     (SpiceInt DIM1, Type OUT_ARRAY1[ANY])                       // PATTERN
         (PyArrayObject* pyarr = NULL)
 {
-//      (int DIM1, Type OUT_ARRAY1[ANY])
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceInt DIM1, Type OUT_ARRAY1[ANY])
 //  NOT CURRENTLY USED BY CSPICE
 
     npy_intp dims[1] = {$2_dim0};                               // ARRAY
@@ -1491,21 +1443,20 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
 //  $3 = &size[0];                                              // SIZE1
 }
 
 /*******************************************************
-* (Type OUT_ARRAY1[ANY], int DIM1, int *SIZE1)
+* (Type OUT_ARRAY1[ANY], SpiceInt DIM1, SpiceInt *SIZE1)
 *******************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY1[ANY], int DIM1, int *SIZE1)                // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1]),
     (Type OUT_ARRAY1[ANY], SpiceInt DIM1, SpiceInt *SIZE1)      // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1])
+        (PyArrayObject* pyarr = NULL, SpiceInt size[1])
 {
-//      (Type OUT_ARRAY1[ANY], int DIM1, int *SIZE1)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type OUT_ARRAY1[ANY], SpiceInt DIM1, SpiceInt *SIZE1)
 //  NOT CURRENTLY USED BY CSPICE
 
     size[0] = 0;
@@ -1514,21 +1465,20 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
     $3 = &size[0];                                              // SIZE1
 }
 
 /*******************************************************
-* (Type OUT_ARRAY1[ANY], int *SIZE1, int DIM1)
+* (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1, SpiceInt DIM1)
 *******************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY1[ANY], int *SIZE1, int DIM1)                // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1]),
     (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1, SpiceInt DIM1)      // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1])
+        (PyArrayObject* pyarr = NULL, SpiceInt size[1])
 {
-//      (Type OUT_ARRAY1[ANY], int *SIZE1, int DIM1)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1, SpiceInt DIM1)
 //  NOT CURRENTLY USED BY CSPICE
 
     size[0] = 0;
@@ -1537,21 +1487,20 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $3 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $3 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
     $2 = &size[0];                                              // SIZE1
 }
 
 /*******************************************************
-* (int DIM1, int *SIZE1, Type OUT_ARRAY1[ANY])
+* (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY1[ANY])
 *******************************************************/
 
 %typemap(in, numinputs=0)
-    (int DIM1, int *SIZE1, Type OUT_ARRAY1[ANY])                // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1]),
     (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY1[ANY])      // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1])
+        (PyArrayObject* pyarr = NULL, SpiceInt size[1])
 {
-//      (int DIM1, int *SIZE1, Type OUT_ARRAY1[ANY])
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY1[ANY])
 
     size[0] = 0;
     npy_intp dims[1] = {$3_dim0};                               // ARRAY
@@ -1559,21 +1508,20 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $3 = ($3_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
     $2 = &size[0];                                              // SIZE1
 }
 
 /*******************************************************
-* (int *SIZE1, int DIM1, Type OUT_ARRAY1[ANY])
+* (SpiceInt *SIZE1, SpiceInt DIM1, Type OUT_ARRAY1[ANY])
 *******************************************************/
 
 %typemap(in, numinputs=0)
-    (int *SIZE1, int DIM1, Type OUT_ARRAY1[ANY])                // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1]),
     (SpiceInt *SIZE1, SpiceInt DIM1, Type OUT_ARRAY1[ANY])      // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1])
+        (PyArrayObject* pyarr = NULL, SpiceInt size[1])
 {
-//      (int *SIZE1, int DIM1, Type OUT_ARRAY1[ANY])
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt *SIZE1, SpiceInt DIM1, Type OUT_ARRAY1[ANY])
 //  NOT CURRENTLY USED BY CSPICE
 
     size[0] = 0;
@@ -1582,21 +1530,20 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $3 = ($3_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                           // DIM1
     $1 = &size[0];                                              // SIZE1
 }
 
 /*******************************************************
-* (Type OUT_ARRAY1[ANY], int *SIZE1)
+* (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1)
 *******************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY1[ANY], int *SIZE1)                          // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1]),
     (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1)                     // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1])
+        (PyArrayObject* pyarr = NULL, SpiceInt size[1])
 {
-//      (Type OUT_ARRAY1[ANY], int *SIZE1)
+//      $1_type $1_name, $2_type $2_name
+//      (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1)
 
     size[0] = 0;
     npy_intp dims[1] = {$1_dim0};                               // ARRAY
@@ -1604,21 +1551,19 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $3 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
     $2 = &size[0];                                              // SIZE1
 }
 
 /*******************************************************
-* (int *SIZE1, Type OUT_ARRAY1[ANY])
+* (SpiceInt *SIZE1, Type OUT_ARRAY1[ANY])
 *******************************************************/
 
 %typemap(in, numinputs=0)
-    (int *SIZE1, Type OUT_ARRAY1[ANY])                          // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1]),
     (SpiceInt *SIZE1, Type OUT_ARRAY1[ANY])                     // PATTERN
-        (PyArrayObject* pyarr = NULL, int size[1])
+        (PyArrayObject* pyarr = NULL, SpiceInt size[1])
 {
-//      (int *SIZE1, Type OUT_ARRAY1[ANY])
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceInt *SIZE1, Type OUT_ARRAY1[ANY])
 
     size[0] = 0;
     npy_intp dims[1] = {$2_dim0};                               // ARRAY
@@ -1626,7 +1571,6 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 
     $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $3 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
     $1 = &size[0];                                              // SIZE1
 }
 
@@ -1637,10 +1581,8 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 
 %typemap(argout)
     (Type OUT_ARRAY1[ANY]),
-    (Type OUT_ARRAY1[ANY], int DIM1),
-    (Type OUT_ARRAY1[ANY], Spiceint DIM1),
-    (int DIM1, Type OUT_ARRAY1[ANY]),
-    (Spiceint DIM1, Type OUT_ARRAY1[ANY])
+    (Type OUT_ARRAY1[ANY], SpiceInt DIM1),
+    (SpiceInt DIM1, Type OUT_ARRAY1[ANY])
 {
     $result = SWIG_Python_AppendOutput($result, (PyObject *) pyarr$argnum);
     // AppendOutput steals the reference to the argument.
@@ -1648,17 +1590,11 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 }
 
 %typemap(argout)
-    (Type OUT_ARRAY1[ANY], int DIM1, int *SIZE1),
     (Type OUT_ARRAY1[ANY], SpiceInt DIM1, SpiceInt *SIZE1),
-    (Type OUT_ARRAY1[ANY], int  *SIZE1, int DIM1),
     (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1, SpiceInt DIM1),
-    (int DIM1, int *SIZE1, Type OUT_ARRAY1[ANY]),
     (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY1[ANY]),
-    (int *SIZE1, int DIM1, Type OUT_ARRAY1[ANY]),
     (SpiceInt *SIZE1, SpiceInt DIM1, Type OUT_ARRAY1[ANY]),
-    (Type OUT_ARRAY1[ANY], int *SIZE1),
     (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1),
-    (int *SIZE1, Type OUT_ARRAY1[ANY]),
     (SpiceInt *SIZE1, Type OUT_ARRAY1[ANY])
 {
     // Reshape to indicate the number of elements we actually created
@@ -1674,55 +1610,46 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 
 %typemap(freearg)
     (Type OUT_ARRAY1[ANY]),
-    (Type OUT_ARRAY1[ANY], int DIM1),
     (Type OUT_ARRAY1[ANY], SpiceInt DIM1),
-    (int DIM1, Type OUT_ARRAY1[ANY]),
     (SpiceInt DIM1, Type OUT_ARRAY1[ANY]),
-    (Type OUT_ARRAY1[ANY], int DIM1, int  *SIZE1),
     (Type OUT_ARRAY1[ANY], SpiceInt DIM1, SpiceInt *SIZE1),
-    (Type OUT_ARRAY1[ANY], int  *SIZE1, int DIM1),
     (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1, SpiceInt DIM1),
-    (int DIM1, int *SIZE1, Type OUT_ARRAY1[ANY]),
     (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY1[ANY]),
-    (int *SIZE1, int DIM1, Type OUT_ARRAY1[ANY]),
     (SpiceInt *SIZE1, SpiceInt DIM1, Type OUT_ARRAY1[ANY]),
-    (Type OUT_ARRAY1[ANY], int  *SIZE1),
     (Type OUT_ARRAY1[ANY], SpiceInt *SIZE1),
-    (int *SIZE1, Type OUT_ARRAY1[ANY]),
     (SpiceInt *SIZE1, Type OUT_ARRAY1[ANY])
 {
     Py_XDECREF(pyarr$argnum);
 }
 
 /***************************************************************
-* (Type **OUT_ARRAY1, int *SIZE1)
+* (Type **OUT_ARRAY1, SpiceInt *SIZE1)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type **OUT_ARRAY1, int *SIZE1)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[1]),
     (Type **OUT_ARRAY1, SpiceInt *SIZE1)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[1])
+        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, SpiceInt dimsize[1])
 {
-//      (Type **OUT_ARRAY1, int *SIZE1)
+//      $1_type $1_name, $2_type $2_name
+//      (Type **OUT_ARRAY1, SpiceInt *SIZE1)
 
+    dimsize[0] = 0;
     $1 = &buffer;                                               // ARRAY
     $2 = &dimsize[0];                                           // SIZE1
 }
 
 /***************************************************************
-* (int *SIZE1, Type **OUT_ARRAY1)
+* (SpiceInt *SIZE1, Type **OUT_ARRAY1)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (int *SIZE1, Type **OUT_ARRAY1)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[1]),
     (SpiceInt *SIZE1, Type **OUT_ARRAY1)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[1])
+        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, SpiceInt dimsize[1])
 {
-//      (int *SIZE1, Type **OUT_ARRAY1)
-//  NOT CURRENTLY USED BY CSPICE
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceInt *SIZE1, Type **OUT_ARRAY1)
 
+    dimsize[0] = 0;
     $2 = &buffer;                                               // ARRAY
     $1 = &dimsize[0];                                           // SIZE1
 }
@@ -1733,13 +1660,11 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 *******************************************************/
 
 %typemap(argout)
-    (Type **OUT_ARRAY1, int *SIZE1),
     (Type **OUT_ARRAY1, SpiceInt *SIZE1),
-    (int *SIZE1, Type **OUT_ARRAY1),
     (SpiceInt *SIZE1, Type **OUT_ARRAY1)
 {
-//      (Type **OUT_ARRAY1, int *SIZE1)
-//      (int *SIZE1, Type **OUT_ARRAY1)
+//      (Type **OUT_ARRAY1, SpiceInt *SIZE1)
+//      (SpiceInt *SIZE1, Type **OUT_ARRAY1)
 
     TEST_MALLOC_FAILURE(buffer$argnum);
     npy_intp dims[1] = {dimsize$argnum[0]};
@@ -1752,9 +1677,7 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 }
 
 %typemap(freearg)
-    (Type **OUT_ARRAY1, int *SIZE1),
     (Type **OUT_ARRAY1, SpiceInt *SIZE1),
-    (int *SIZE1, Type **OUT_ARRAY1),
     (SpiceInt *SIZE1, Type **OUT_ARRAY1)
 {
     Py_XDECREF(pyarr$argnum);
@@ -1767,35 +1690,29 @@ TYPEMAP_IN(ConstSpiceDouble, NPY_DOUBLE)
 
 %enddef
 
-TYPEMAP_ARGOUT(int,           NPY_INT   )
 TYPEMAP_ARGOUT(SpiceInt,      NPY_INT   )
 TYPEMAP_ARGOUT(SpiceBoolean,  NPY_INT   )
-TYPEMAP_ARGOUT(long,          NPY_LONG  )
-TYPEMAP_ARGOUT(double,        NPY_DOUBLE)
 TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 
 #undef TYPEMAP_ARGOUT
 
 /*******************************************************************************
 * If the function should return a Python scalar on size = 0:
-*       (type **OUT_ARRAY01, int *DIM1)
+*       (type **OUT_ARRAY01, SpiceInt *DIM1)
 *******************************************************************************/
 
 %define TYPEMAP_ARGOUT(Type, Typecode) // To fill in types below!
 
 /***************************************************************
-* (Type **OUT_ARRAY01, int *SIZE1)
+* (Type **OUT_ARRAY01, SpiceInt *SIZE1)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type **OUT_ARRAY01, int *SIZE1)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL,
-                                                           int dimsize[1]),
     (Type **OUT_ARRAY01, SpiceInt *SIZE1)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL,
-                                                           int dimsize[1])
+        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, SpiceInt dimsize[1])
 {
-//      (Type **OUT_ARRAY01, int *SIZE1)
+//      $1_type $1_name, $2_type $2_name
+//      (Type **OUT_ARRAY01, SpiceInt *SIZE1)
 
     $1 = &buffer;                                               // ARRAY
     $2 = &dimsize[0];                                           // SIZE1
@@ -1807,10 +1724,9 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 *******************************************************/
 
 %typemap(argout)
-    (Type **OUT_ARRAY01, int *SIZE1),
     (Type **OUT_ARRAY01, SpiceInt *SIZE1)
 {
-//      (Type **OUT_ARRAY01, int *SIZE1)
+//      (Type **OUT_ARRAY01, SpiceInt *SIZE1)
 
     TEST_MALLOC_FAILURE(buffer$argnum);
     npy_intp dim = max(dimsize$argnum[0], 1);
@@ -1831,7 +1747,6 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 }
 
 %typemap(freearg)
-    (Type **OUT_ARRAY01, int *SIZE1),
     (Type **OUT_ARRAY01, SpiceInt *SIZE1)
 {
     Py_XDECREF(pyarr$argnum);
@@ -1844,7 +1759,7 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 * Now define these typemaps for every numeric type
 *******************************************************/
 
-TYPEMAP_ARGOUT(int,           NPY_INT)
+TYPEMAP_ARGOUT(SpiceInt,           NPY_INT)
 TYPEMAP_ARGOUT(SpiceInt,      NPY_INT)
 TYPEMAP_ARGOUT(SpiceBoolean,  NPY_INT)
 TYPEMAP_ARGOUT(long,          NPY_LONG)
@@ -1856,13 +1771,23 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 
 
 /*******************************************************************************
-* 1-D numeric typemaps for output
+* This family of typemaps converts an integer input into a typed array of that size,
+* which is given to the C function as an argnument, and then returned to the user
+* as a result.  These typemaps are useful in which the size of the array can be calculated
+* from the other arguments passed by the user.
+*
+* We hope, at some point, to replace many of the malloc's() in the code with sized type
+* arrays.  All the allocing and freeing is handled by SWIG code rather than by
+* bespoke code for each function.
+*
+* Optionally, there may also be a DIM1 argument, indicating that the C function needs
+* to know the integer argument that was passed by an argument.  A SIZE1 argument is
+* an out-argument passed to the C function so that C can ask for the array to be shortened.
 *
-* FY WRITE ME
 *******************************************************************************/
 
 %define CREATE_SIZED_INOUT_ARRAY(Typecode)
-    int size = 0;
+    SpiceInt size = 0;
     int error = SWIG_AsVal_int($input, &size);
     RAISE_BAD_TYPE_ON_ERROR(error, "Integer");
 
@@ -1871,15 +1796,20 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     TEST_MALLOC_FAILURE(pyarr);
 %enddef
 
-
 %define TYPEMAP_SIZED_ARGOUT(Type, Typecode) // Use to fill in numeric types below!
 
+/*******************************************************
+*  (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1, SpiceInt *SIZE1)
+*  (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1, SpiceInt *SIZE1)
+*******************************************************/
+
 %typemap(in)
     (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1, SpiceInt *SIZE1)
         (PyArrayObject* pyarr=NULL, SpiceInt dimsize[1]),
     (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1, SpiceInt *SIZE1)
         (PyArrayObject* pyarr=NULL, SpiceInt dimsize[1])
 {
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
 //     (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1, SpiceInt *SIZE1)
 
     CREATE_SIZED_INOUT_ARRAY(Typecode)
@@ -1890,12 +1820,18 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     $3 = dimsize;
 }
 
+/*******************************************************
+* (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1, SpiceInt *SIZE1)
+* (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1, SpiceInt *SIZE1)
+*******************************************************/
+
 %typemap(in)
     (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1, SpiceInt *SIZE1)
         (PyArrayObject* pyarr=NULL, SpiceInt dimsize[1]),
     (SpiceInt DIM1, Type SIZED_INOUT_ARRAY1[], SpiceInt *SIZE1)
         (PyArrayObject* pyarr=NULL, SpiceInt dimsize[1])
 {
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
 //    (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1, SpiceInt *SIZE1)
 
     CREATE_SIZED_INOUT_ARRAY(Typecode)
@@ -1906,12 +1842,18 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     $3 = dimsize;
 }
 
+/*******************************************************
+ *  (SpiceInt DIM1, SpiceInt *SIZE1, Type *SIZED_INOUT_ARRAY1)
+ *  (SpiceInt DIM1, SpiceInt *SIZE1, Type *SIZED_INOUT_ARRAY1)
+*******************************************************/
+
 %typemap(in)
     (SpiceInt DIM1, SpiceInt *SIZE1, Type *SIZED_INOUT_ARRAY1)
         (PyArrayObject* pyarr=NULL, SpiceInt dimsize[1]),
     (SpiceInt DIM1, SpiceInt *SIZE1, Type SIZED_INOUT_ARRAY1[])
         (PyArrayObject* pyarr=NULL, SpiceInt dimsize[1])
 {
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
 //     (SpiceInt DIM1, SpiceInt *SIZE1, Type *SIZED_INOUT_ARRAY1)
 
     CREATE_SIZED_INOUT_ARRAY(Typecode)
@@ -1921,6 +1863,10 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     $2 = dimsize;
     $3 = PyArray_DATA(pyarr);
 }
+/*******************************************************
+ *  (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1)
+ *  (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1)
+*******************************************************/
 
 %typemap(in)
     (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1)
@@ -1928,6 +1874,7 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1)
             (PyArrayObject* pyarr=NULL)
 {
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
 //     (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1)
 
     CREATE_SIZED_INOUT_ARRAY(Typecode)
@@ -1936,30 +1883,45 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     $2 = PyArray_DIM(pyarr, 0);
 }
 
+/*******************************************************
+ *  (SpiceInt DIM1, Type *SIZED_INOUT_ARRAY1)
+ *  (SpiceInt DIM1, Type SIZED_INOUT_ARRAY1[])
+*******************************************************/
+
 %typemap(in)
     (SpiceInt DIM1, Type *SIZED_INOUT_ARRAY1)
             (PyArrayObject* pyarr=NULL),
     (SpiceInt DIM1, Type SIZED_INOUT_ARRAY1[])
             (PyArrayObject* pyarr=NULL)
 {
+//      $1_type $1_name, $2_type $2_name
+//     (SpiceInt DIM1, Type *SIZED_INOUT_ARRAY1)
+
     CREATE_SIZED_INOUT_ARRAY(Typecode)
 
     $1 = PyArray_DIM(pyarr, 0);
     $2 = PyArray_DATA(pyarr);
 }
 
+/*******************************************************
+ *  (Type *SIZED_INOUT_ARRAY1)
+ *  (Type SIZED_INOUT_ARRAY1[])
+*******************************************************/
+
 %typemap(in)
     (Type *SIZED_INOUT_ARRAY1)
             (PyArrayObject* pyarr=NULL),
     (Type SIZED_INOUT_ARRAY1[])
             (PyArrayObject* pyarr=NULL)
 {
+//      $1_type $1_name
 //     (Type *SIZED_INOUT_ARRAY1)
 
     CREATE_SIZED_INOUT_ARRAY(Typecode)
     $1 = PyArray_DATA(pyarr);
 }
 
+// These are the typemaps that resize the output
 %typemap(argout)
     (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1, SpiceInt *SIZE1),
     (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1, SpiceInt *SIZE1),
@@ -1979,6 +1941,7 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     pyarr$argnum = NULL;
 }
 
+// These are the typemaps that don't resize the output.
 %typemap(argout)
     (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1),
     (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1),
@@ -1986,13 +1949,11 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     (SpiceInt DIM1, Type SIZED_INOUT_ARRAY1[]),
     (Type *SIZED_INOUT_ARRAY1),
     (Type SIZED_INOUT_ARRAY1[])
-
 {
     $result = SWIG_Python_AppendOutput($result, (PyObject *)pyarr$argnum);
     pyarr$argnum = NULL;
 }
 
-
 %typemap(free)
     (Type *SIZED_INOUT_ARRAY1, SpiceInt DIM1, SpiceInt *SIZE1),
     (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1, SpiceInt *SIZE1),
@@ -2004,22 +1965,19 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     (Type SIZED_INOUT_ARRAY1[], SpiceInt DIM1),
     (SpiceInt DIM1, Type *SIZED_INOUT_ARRAY1),
     (SpiceInt DIM1, Type SIZED_INOUT_ARRAY1[]),
-    (Type *SIZED_INOUT_ARRAY1)
+    (Type *SIZED_INOUT_ARRAY1),
+    (SpiceInt DIM1, Type *SIZED_INOUT_ARRAY2[ANY]),
+    (SpiceInt DIM1, Type SIZED_INOUT_ARRAY2[][ANY])
+
 {
     Py_XDECREF(pyarr$argnum);
 }
 
 
-
-
 %enddef
 
-TYPEMAP_SIZED_ARGOUT(int,           NPY_INT   )
 TYPEMAP_SIZED_ARGOUT(SpiceInt,      NPY_INT   )
 TYPEMAP_SIZED_ARGOUT(SpiceBoolean,  NPY_INT   )
-TYPEMAP_SIZED_ARGOUT(long,          NPY_LONG  )
-TYPEMAP_SIZED_ARGOUT(float,         NPY_FLOAT )
-TYPEMAP_SIZED_ARGOUT(double,        NPY_DOUBLE)
 TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 
 /*******************************************************************************
@@ -2030,34 +1988,34 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 *
 * If the size of the array can be specified in the SWIG interface:
 *       (type OUT_ARRAY2[ANY][ANY])
-*       (type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2)
-*       (int DIM1, int DIM2, type OUT_ARRAY2[ANY][ANY])
+*       (type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2)
+*       (SpiceInt DIM1, SpiceInt DIM2, type OUT_ARRAY2[ANY][ANY])
 *
 * If the upper limit on the size of the array's first axis can be specified in
 * the SWIG interface, but the size of the first axis returned by C is variable:
-*       (type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2, int *SIZE1)
-*       (type OUT_ARRAY2[ANY][ANY], int *SIZE1, int DIM1, int DIM2)
-*       (int DIM1, int DIM2, int *SIZE1, type OUT_ARRAY2[ANY][ANY])
-*       (int *SIZE1, int DIM1, int DIM2, type OUT_ARRAY2[ANY][ANY])
+*       (type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1)
+*       (type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2)
+*       (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1, type OUT_ARRAY2[ANY][ANY])
+*       (SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2, type OUT_ARRAY2[ANY][ANY])
 * Also...
-*       (int DIM1, int *SIZE1, type OUT_ARRAY2[ANY][ANY])
-*       (int *SIZE1, type OUT_ARRAY2[ANY][ANY])
+*       (SpiceInt DIM1, SpiceInt *SIZE1, type OUT_ARRAY2[ANY][ANY])
+*       (SpiceInt *SIZE1, type OUT_ARRAY2[ANY][ANY])
 *
 * If an upper limit on the total size of a temporary memory buffer can be
 * specified in advance, and the shape of the array then returned afterward.
 * Upon return, the large buffer is freed and only the required amount of memory
 * is retained.
-*       (type OUT_ARRAY2[ANY][ANY], int *SIZE1, int *SIZE2)
-*       (int *SIZE1, int *SIZE2, type OUT_ARRAY2[ANY][ANY])
+*       (type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt *SIZE2)
+*       (SpiceInt *SIZE1, SpiceInt *SIZE2, type OUT_ARRAY2[ANY][ANY])
 *
 * If the C function will allocate the memory it needs and will return the
 * dimensions:
-*       (type **OUT_ARRAY2, int *DIM1, int *DIM2)
-*       (int *DIM1, int *DIM2, type **OUT_ARRAY2)
+*       (type **OUT_ARRAY2, SpiceInt *DIM1, SpiceInt *DIM2)
+*       (SpiceInt *DIM1, SpiceInt *DIM2, type **OUT_ARRAY2)
 *
 * This version will return a 1-D array if the first dimension is 0; otherwise
 * a 2-D array:
-*       (type **OUT_ARRAY12, int *DIM1, int *DIM2)
+*       (type **OUT_ARRAY12, SpiceInt *DIM1, SpiceInt *DIM2)
 *******************************************************************************/
 
 %define TYPEMAP_ARGOUT(Type, Typecode) // Use to fill in numeric types below!
@@ -2070,87 +2028,70 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     (Type OUT_ARRAY2[ANY][ANY])                                 // PATTERN
         (PyArrayObject* pyarr = NULL)
 {
+//      $1_type $1_name
 //      (Type OUT_ARRAY2[ANY][ANY])
 
     npy_intp dims[2] = {$1_dim0, $1_dim1};               // ARRAY
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-//  dimsize[0] = (int) dims[0];
-//  dimsize[1] = (int) dims[1];
-
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $3 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
-//  $4 = &dimsize[0];                                           // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
 }
 
 /***************************************************************
-* (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2)
+* (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2)             // PATTERN
-        (PyArrayObject* pyarr = NULL),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2)   // PATTERN
         (PyArrayObject* pyarr = NULL)
 {
-//      (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2)
 //  NOT CURRENTLY USED BY CSPICE
 
     npy_intp dims[2] = {$1_dim0, $1_dim1};                      // ARRAY
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-//  dimsize[0] = (int) dims[0];
-//  dimsize[1] = (int) dims[1];
-
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $3 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
-//  $4 = &dimsize[0];                                           // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
+    $3 = (SpiceInt) PyArray_DIM(pyarr, 1);                      // DIM2
 }
 
 /***************************************************************
-* (int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY])
+* (SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY])
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY])             // PATTERN
+    (SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY])   // PATTERN
         (PyArrayObject* pyarr = NULL),
     (SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY])   // PATTERN
         (PyArrayObject* pyarr = NULL)
 {
-//      (int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY])
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY])
 //  NOT CURRENTLY USED BY CSPICE
 
     npy_intp dims[2] = {$3_dim0, $3_dim1};                      // ARRAY
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-//  dimsize[0] = (int) dims[0];
-//  dimsize[1] = (int) dims[1];
-
     $3 = ($3_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $2 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
-//  $4 = &dimsize[0];                                           // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 1);                      // DIM2
 }
 
 /***************************************************************
-* (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2, int *SIZE1)
+* (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2, int *SIZE1)
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1)
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize)
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize)
 {
-//      (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2, int *SIZE1)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name, $4_type $4_name
+//      (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1)
 //  NOT CURRENTLY USED BY CSPICE
 
     outsize = 0;
@@ -2158,28 +2099,25 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) dim$argnums[1];
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) dim$argnums[1];
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $3 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
+    $3 = (SpiceInt) PyArray_DIM(pyarr, 1);                      // DIM2
     $4 = &outsize;                                              // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
-
 }
 
 /***************************************************************
-* (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int DIM1, int DIM2)
+* (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int DIM1, int DIM2)
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2)
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize)
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize)
 {
-//      (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int DIM1, int DIM2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2)
 //  NOT CURRENTLY USED BY CSPICE
 
     outsize = 0;
@@ -2187,27 +2125,25 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) dims[1];
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) dims[1];
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $3 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $4 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $3 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
+    $4 = (SpiceInt) PyArray_DIM(pyarr, 1);                       // DIM2
     $2 = &outsize;                                              // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
 }
 
 /***************************************************************
-* (int DIM1, int DIM2, int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
+* (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (int DIM1, int DIM2, int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize),
     (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize)
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize)
 {
-//      (int DIM1, int DIM2, int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name, $4_type $4_name
+//      (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
 //  NOT CURRENTLY USED BY CSPICE
 
     outsize = 0;
@@ -2215,25 +2151,25 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) dims[1];
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) dims[1];
 
     $4 = ($4_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $2 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);                           // DIM1
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 1);                           // DIM2
     $3 = &outsize;                                              // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
 }
 
 /***************************************************************
-* (int DIM1, int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
+* (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (int DIM1, int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize)
+    (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize)
 {
-//      (int DIM1, int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
 //  NOT CURRENTLY USED BY CSPICE
 
     outsize = 0;
@@ -2241,27 +2177,24 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) $3_dim1;
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) $3_dim1;
 
     $3 = ($3_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $4 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);                           // DIM1
     $2 = &outsize;                                              // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
 }
 
 /***************************************************************
-* (int *SIZE1, int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY])
+* (SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY])
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (int *SIZE1, int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY]),
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize),
     (SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY])
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize)
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize)
 {
-//      (int *SIZE1, int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY])
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name, $4_name $4_type
+//      (SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY])
 //  NOT CURRENTLY USED BY CSPICE
 
     outsize = 0;
@@ -2269,81 +2202,71 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) dims[1];
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) dims[1];
 
     $4 = ($4_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $2 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $3 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
+    $2 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
+    $3 = (SpiceInt) PyArray_DIM(pyarr, 1);                      // DIM2
     $1 = &outsize;                                              // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
 }
 
 /***************************************************************
-* (Type OUT_ARRAY2[ANY][ANY], int *SIZE1)
+* (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1)
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize)
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize)
 {
-//      (Type OUT_ARRAY2[ANY][ANY], int *SIZE1)
+//      $1_type $1_name, $2_type $2_name
+//      (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1)
 
     outsize = 0;
     npy_intp dims[2] = {$1_dim0, $1_dim1};                      // ARRAY
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) dims[1];
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) dims[1];
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $3 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $4 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
     $2 = &outsize;                                              // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
 }
 
 /***************************************************************
-* (int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
+* (SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize),
     (SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize)
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize)
 {
-//      (int *SIZE1, Type OUT_ARRAY2[ANY][ANY])
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
 
     outsize = 0;
     npy_intp dims[2] = {$2_dim0, $2_dim1};                      // ARRAY
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) dims[1];
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) dims[1];
 
     $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $3 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $4 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
     $1 = &outsize;                                              // SIZE1
-//  $5 = &dimsize[1];                                           // SIZE2
 }
 
 /***************************************************************
-* (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int *SIZE2)
+* (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt *SIZE2)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int *SIZE2)
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt *SIZE2)
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize)
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize)
 {
-//      (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int *SIZE2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt *SIZE2)
 //  NOT CURRENTLY USED BY CSPICE
 
     outsize = 0;
@@ -2351,27 +2274,23 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) dims[1];
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) dims[1];
 
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $4 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $5 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
     $2 = &outsize;                                              // SIZE1
-//  $3 = &dimsize[1];                                           // SIZE2
 }
 
 /***************************************************************
-* (int *SIZE1, int *SIZE2, Type OUT_ARRAY2[ANY][ANY])
+* (SpiceInt *SIZE1, SpiceInt *SIZE2, Type OUT_ARRAY2[ANY][ANY])
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (int *SIZE1, int *SIZE2, Type OUT_ARRAY2[ANY][ANY])
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize[2]),
     (SpiceInt *SIZE1, SpiceInt *SIZE2, Type OUT_ARRAY2[ANY][ANY])
-        (PyArrayObject* pyarr = NULL, int dimsize[2], int outsize[2])
+        (PyArrayObject* pyarr = NULL, SpiceInt dimsize[2], SpiceInt outsize[2])
 {
-//      (int *SIZE1, int *SIZE2, Type OUT_ARRAY2[ANY][ANY])
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt *SIZE1, SpiceInt *SIZE2, Type OUT_ARRAY2[ANY][ANY])
 
     outsize[0] = 0;
     outsize[1] = 0;
@@ -2379,12 +2298,10 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
     pyarr = (PyArrayObject *) PyArray_SimpleNew(2, dims, Typecode);
     TEST_MALLOC_FAILURE(pyarr);
 
-    dimsize[0] = (int) dims[0];
-    dimsize[1] = (int) dims[1];
+    dimsize[0] = (SpiceInt) dims[0];
+    dimsize[1] = (SpiceInt) dims[1];
 
     $3 = ($3_ltype) PyArray_DATA(pyarr);                        // ARRAY
-//  $4 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-//  $5 = (int) PyArray_DIM(pyarr, 1);                           // DIM2
     $1 = &outsize[0];                                           // SIZE1
     $2 = &outsize[1];                                           // SIZE2
 }
@@ -2396,9 +2313,7 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 
 %typemap(argout)
     (Type OUT_ARRAY2[ANY][ANY]),
-    (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY])
 {
     $result = SWIG_Python_AppendOutput($result, (PyObject *) pyarr$argnum);
@@ -2407,18 +2322,12 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 }
 
 %typemap(argout)
-    (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2, int *SIZE1),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1),
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int DIM1, int DIM2),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, int *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
-    (int DIM1, int *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
-    (int *SIZE1, int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY]),
+    (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY]),
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1),
-    (int *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY])
 {
     npy_intp dims[2] = {outsize$argnum, dimsize$argnum[1]};
@@ -2432,9 +2341,7 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 }
 
 %typemap(argout)
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int *SIZE2),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt *SIZE2),
-    (int *SIZE1, int *SIZE2, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt *SIZE1, SpiceInt *SIZE2, Type OUT_ARRAY2[ANY][ANY])
 {
     npy_intp dims[2] = {outsize$argnum[0], outsize$argnum[1]};
@@ -2449,48 +2356,35 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 
 %typemap(freearg)
     (Type OUT_ARRAY2[ANY][ANY]),
-    (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY]),
 
-    (Type OUT_ARRAY2[ANY][ANY], int DIM1, int DIM2, int *SIZE1),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1),
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int DIM1, int DIM2),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, int *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
-    (int DIM1, int *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
-    (int *SIZE1, int DIM1, int DIM2, Type OUT_ARRAY2[ANY][ANY]),
+    (SpiceInt DIM1, SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt *SIZE1, SpiceInt DIM1, SpiceInt DIM2, Type OUT_ARRAY2[ANY][ANY]),
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1),
-    (int *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt *SIZE1, Type OUT_ARRAY2[ANY][ANY]),
 
-    (Type OUT_ARRAY2[ANY][ANY], int *SIZE1, int *SIZE2),
     (Type OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1, SpiceInt *SIZE2),
-    (int *SIZE1, int *SIZE2, Type OUT_ARRAY2[ANY][ANY]),
     (SpiceInt *SIZE1, SpiceInt *SIZE2, Type OUT_ARRAY2[ANY][ANY])
 {
     Py_XDECREF(pyarr$argnum);
 }
 
 /***************************************************************
-* (Type **OUT_ARRAY2, int *SIZE1, int *SIZE2)
+* (Type **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[2]),
     (Type **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[2]),
-    (Type **OUT_ARRAY12, int *SIZE1, int *SIZE2)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[2]),
+        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, SpiceInt dimsize[2]),
     (Type **OUT_ARRAY12, SpiceInt *SIZE1, SpiceInt *SIZE2)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[2])
+        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, SpiceInt dimsize[2])
 {
-//      (Type **OUT_ARRAY2, int *SIZE1, int *SIZE2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
 
     $1 = &buffer;                                               // ARRAY
     $2 = &dimsize[0];                                           // SIZE1
@@ -2498,16 +2392,15 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 }
 
 /***************************************************************
-* (int *SIZE1, int *SIZE2, Type **OUT_ARRAY2)
+* (SpiceInt *SIZE1, SpiceInt *SIZE2, Type **OUT_ARRAY2)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (int *SIZE1, int *SIZE2, Type **OUT_ARRAY2)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[2]),
     (SpiceInt *SIZE1, SpiceInt *SIZE2, Type **OUT_ARRAY2)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[2])
+        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, SpiceInt dimsize[2])
 {
-//      (int *SIZE1, int *SIZE2, Type **OUT_ARRAY2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt *SIZE1, SpiceInt *SIZE2, Type **OUT_ARRAY2)
 //  NOT CURRENTLY USED BY CSPICE
 
     $3 = &buffer;                                               // ARRAY
@@ -2521,13 +2414,12 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 *******************************************************/
 
 %typemap(argout)
-    (Type **OUT_ARRAY2, int *SIZE1, int *SIZE2),
     (Type **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2),
-    (int *SIZE1, int *SIZE2, Type **OUT_ARRAY2),
     (SpiceInt *SIZE1, SpiceInt *SIZE2, Type **OUT_ARRAY2)
 {
-//      (Type **OUT_ARRAY2, int *SIZE1, int *SIZE2)
-//      (int *SIZE1, int *SIZE2, Type **OUT_ARRAY2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2)
+//      (SpiceInt *SIZE1, SpiceInt *SIZE2, Type **OUT_ARRAY2)
 
     TEST_MALLOC_FAILURE(buffer$argnum);
     npy_intp dims[2] = {dimsize$argnum[0], dimsize$argnum[1]};
@@ -2540,14 +2432,13 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 }
 
 %typemap(argout)
-    (Type **OUT_ARRAY12, int *SIZE1, int *SIZE2),
     (Type **OUT_ARRAY12, SpiceInt *SIZE1, SpiceInt *SIZE2)
 {
-//      (Type **OUT_ARRAY12, int *SIZE1, int *SIZE2)
+//      (Type **OUT_ARRAY12, SpiceInt *SIZE1, SpiceInt *SIZE2)
 
     TEST_MALLOC_FAILURE(buffer$argnum);
     npy_intp dims[2] = {dimsize$argnum[0], dimsize$argnum[1]};
-    int nd = dims[0] == 0 ? 1 : 2;
+    int nd = (dims[0] == 0) ? 1 : 2;
     pyarr$argnum = create_array_with_owned_data(nd, &dims[2 - nd], Typecode, &buffer$argnum);
     TEST_MALLOC_FAILURE(pyarr$argnum);
 
@@ -2557,11 +2448,8 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 }
 
 %typemap(freearg)
-        (Type **OUT_ARRAY2, int *SIZE1, int *SIZE2),
         (Type **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2),
-        (Type **OUT_ARRAY12, int *SIZE1, int *SIZE2),
         (Type **OUT_ARRAY12, SpiceInt *SIZE1, SpiceInt *SIZE2),
-        (int *SIZE1, int *SIZE2, Type **OUT_ARRAY2),
         (SpiceInt *SIZE1, SpiceInt *SIZE2, Type **OUT_ARRAY2)
 {
     Py_XDECREF(pyarr$argnum);
@@ -2574,34 +2462,32 @@ TYPEMAP_SIZED_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 
 %enddef
 
-TYPEMAP_ARGOUT(int,           NPY_INT   )
 TYPEMAP_ARGOUT(SpiceInt,      NPY_INT   )
 TYPEMAP_ARGOUT(SpiceBoolean,  NPY_INT   )
-TYPEMAP_ARGOUT(long,          NPY_LONG  )
-TYPEMAP_ARGOUT(double,        NPY_DOUBLE)
 TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 
 #undef TYPEMAP_ARGOUT
 
 /*******************************************************************************
 * Basic 3-D numeric typemaps for output
-*       (type **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3)
+*       (type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3)
 * We only have a few left over from vectors.
 *******************************************************************************/
 
 %define TYPEMAP_ARGOUT(Type, Typecode) // Use to fill in numeric types below!
 
 /***************************************************************
-* (Type **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3)
+* (Type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3)
 ***************************************************************/
 
 %typemap(in, numinputs=0)
-    (Type **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[3]),
     (Type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3)
-        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, int dimsize[3])
+        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, SpiceInt dimsize[3]),
+    (Type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3)
+        (PyArrayObject* pyarr=NULL, Type *buffer=NULL, SpiceInt dimsize[3])
 {
-//      (Type **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name, $4_type $4_name
+//      (Type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3)
 
     $1 = &buffer;                                               // ARRAY
     $2 = &dimsize[0];                                           // SIZE1
@@ -2615,10 +2501,9 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 *******************************************************/
 
 %typemap(argout)
-    (Type **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3),
     (Type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3)
 {
-//      (Type **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3)
+//      (Type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3)
 
     TEST_MALLOC_FAILURE(buffer$argnum);
     npy_intp dims[3] = {dimsize$argnum[0], dimsize$argnum[1], dimsize$argnum[2]};
@@ -2632,7 +2517,7 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 }
 
 %typemap(freearg)
-    (Type **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3),
+    (Type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3),
     (Type **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3)
 {
     Py_XDECREF(pyarr$argnum);
@@ -2645,15 +2530,14 @@ TYPEMAP_ARGOUT(SpiceDouble,   NPY_DOUBLE)
 
 %enddef
 
-TYPEMAP_ARGOUT(double,      NPY_DOUBLE)
 TYPEMAP_ARGOUT(SpiceDouble, NPY_DOUBLE)
 
 #undef TYPEMAP_ARGOUT
 
 /*******************************************************************************
 * Basic INOUT typemaps for 1- and 2-dimensional arrays:
-*    (int DIM1, Type *INOUT_ARRAY1)
-*    (int DIM1, Type INOUT_ARRAY2[][ANY])
+*    (SpiceInt DIM1, Type *INOUT_ARRAY1)
+*    (SpiceInt DIM1, Type INOUT_ARRAY2[][ANY])
 *
 * We make a new Numpy array out of the contents passed to us (which may or may not
 * be a Numpy array) and pass it to the function.  The new array is returned to the user.
@@ -2668,57 +2552,32 @@ TYPEMAP_ARGOUT(SpiceDouble, NPY_DOUBLE)
     (Type *INOUT_ARRAY1)
         (PyArrayObject* pyarr=NULL)
 {
+//      $1_type $1_name
 //      (Type *INOUT_ARRAY1)
     CONVERT_TO_CONTIGUOUS_ARRAY_WRITEABLE_COPY(Typecode, $input, 1, 1, pyarr)
     $1 = ($1_ltype) PyArray_DATA(pyarr);                        // ARRAY
 }
 
 %typemap(in)
-    (int DIM1, Type *INOUT_ARRAY1)
+    (SpiceInt DIM1, Type *INOUT_ARRAY1)
         (PyArrayObject* pyarr=NULL),
-    (int DIM1, Type INOUT_ARRAY1[])
+    (SpiceInt DIM1, Type INOUT_ARRAY1[])
         (PyArrayObject* pyarr=NULL)
 {
-//      (int DIM1, Type *INOUT_ARRAY1)
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceInt DIM1, Type *INOUT_ARRAY1)
 //  NOT CURRENTLY USED BY CSPICE
 
     CONVERT_TO_CONTIGUOUS_ARRAY_WRITEABLE_COPY(Typecode, $input, 1, 1, pyarr)
     $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-}
-
-%typemap(in)
-    (int DIM1, Type INOUT_ARRAY2[][ANY])
-        (PyArrayObject* pyarr=NULL)
-{
-//      (int DIM1, type INOUT_ARRAY2[][ANY])
-//  NOT CURRENTLY USED BY CSPICE
-
-    // NOT CURRENTLY USED
-    CONVERT_TO_CONTIGUOUS_ARRAY_WRITABLE_COPY(Typecode, $input, 2, 2, pyarr)
-    TEST_INVALID_ARRAY_SHAPE_x2D(pyarr, $2_dim1)
-    $1 = (int) PyArray_DIM(pyarr, 0);                           // DIM1
-    $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
-}
-
-%typemap(in)
-    (int DIM2, Type *INOUT_ARRAY2)
-        (PyArrayObject* pyarr=NULL)
-{
-//      (int DIM1, type INOUT_ARRAY2)
-//  NOT CURRENTLY USED BY CSPICE
-
-    CONVERT_TO_CONTIGUOUS_ARRAY_WRITABLE_COPY(Typecode, $input, 2, 2, pyarr)
-    $1 = (int) PyArray_DIM(pyarr, 1);                           // DIM1
-    $2 = ($2_ltype) PyArray_DATA(pyarr);                        // ARRAY
+    $1 = (SpiceInt) PyArray_DIM(pyarr, 0);                      // DIM1
 }
 
 %typemap(argout)
     (Type *INOUT_ARRAY1),
-    (int DIM1, Type *INOUT_ARRAY1),
-    (int DIM1, Type INOUT_ARRAY1[]),
-    (int DIM1, Type INOUT_ARRAY2[][ANY]),
-    (int DIM2, Type *INOUT_ARRAY2)
+    (SpiceInt DIM1, Type *INOUT_ARRAY1),
+    (SpiceInt DIM1, Type INOUT_ARRAY1[])
+    (SpiceInt DIM1, Type INOUT_ARRAY2[][ANY])
 {
     $result = SWIG_Python_AppendOutput($result, (PyObject *)pyarr$argnum);
     pyarr$argnum = NULL;
@@ -2726,10 +2585,8 @@ TYPEMAP_ARGOUT(SpiceDouble, NPY_DOUBLE)
 
 %typemap(freearg)
     (Type *INOUT_ARRAY1),
-    (int DIM1, Type *INOUT_ARRAY1),
-    (int DIM1, Type INOUT_ARRAY1[]),
-    (int DIM1, Type INOUT_ARRAY2[][ANY]),
-    (int DIM2, Type *INOUT_ARRAY2)
+    (SpiceInt DIM1, Type *INOUT_ARRAY1),
+    (SpiceInt DIM1, Type INOUT_ARRAY1[])
 {
     Py_XDECREF(pyarr$argnum);
 }
@@ -2737,12 +2594,9 @@ TYPEMAP_ARGOUT(SpiceDouble, NPY_DOUBLE)
 %enddef
 
 // Define concrete examples of the TYPEMAP_INOUT macros
-TYPEMAP_INOUT(char,          NPY_STRING)
-TYPEMAP_INOUT(int,           NPY_INT   )
+TYPEMAP_INOUT(SpiceChar,     NPY_STRING)
 TYPEMAP_INOUT(SpiceInt,      NPY_INT   )
 TYPEMAP_INOUT(SpiceBoolean,  NPY_INT   )
-TYPEMAP_INOUT(long,          NPY_LONG  )
-TYPEMAP_INOUT(double,        NPY_DOUBLE)
 TYPEMAP_INOUT(SpiceDouble,   NPY_DOUBLE)
 
 #undef TYPEMAP_INOUT
@@ -2753,19 +2607,19 @@ TYPEMAP_INOUT(SpiceDouble,   NPY_DOUBLE)
 *
 * These typemaps handle string input.
 *
-*       (char *IN_STRING)
-*       (char *CONST_STRING)
-*       (char IN_STRING)
+*       (SpiceChar *IN_STRING)
+*       (SpiceChar *CONST_STRING)
+*       (SpiceChar IN_STRING)
 *
 * The differences between the options are:
 *
-*       (char *IN_STRING): The string is taken as input. It is copied to ensure
+*       (SpiceChar *IN_STRING): The string is taken as input. It is copied to ensure
 *               that the Python string remains immutable.
 *
-*       (char *CONST_STRING): The string is taken as input. It is not copied so
+*       (SpiceChar *CONST_STRING): The string is taken as input. It is not copied so
 *               one must ensure that it does not get changed by the C function.
 *
-*       (char IN_STRING): If the C function accepts a single character, not a
+*       (SpiceChar IN_STRING): If the C function accepts a single SpiceCharacter, not a
 *               pointer to a string, any you wish to provide the Python input
 *               as a string.
 *******************************************************************************/
@@ -2773,10 +2627,11 @@ TYPEMAP_INOUT(SpiceDouble,   NPY_DOUBLE)
 %define TYPEMAP_IN(Type) // Use to fill in types below
 
 /***********************************************
-* (char *CONST_STRING)
+* (SpiceChar *CONST_STRING)
 ***********************************************/
 
 %typemap(in) (Type *CONST_STRING) (PyObject* byte_string = NULL) {
+//      $1_type $1_name
 //      (Type *CONST_STRING)
 
     TEST_IS_STRING($input);
@@ -2793,19 +2648,24 @@ TYPEMAP_INOUT(SpiceDouble,   NPY_DOUBLE)
 }
 
 /***********************************************
-* (char IN_STRING)
+* (SpiceChar IN_STRING)
 ***********************************************/
 
 %typemap(in) (Type IN_STRING) {
+//      $1_type $1_name
 //      (Type IN_STRING)
     TEST_IS_STRING($input);
-    int error  = SWIG_AsVal_char($input, &$1);
+    SpiceInt error  = SWIG_AsVal_char($input, &$1);
     RAISE_BAD_TYPE_ON_ERROR(error, "String");
  }
 
-%typemap(argout) (Type IN_STRING) ""
+%typemap(argout)
+    (Type *CONST_STRING),
+    (Type IN_STRING) ""
 
-%typemap(freearg) (Type IN_STRING) ""
+%typemap(freearg)
+    (Type *CONST_STRING),
+    (Type IN_STRING) ""
 
 /*******************************************************
 * Now apply to all data types
@@ -2815,7 +2675,6 @@ TYPEMAP_INOUT(SpiceDouble,   NPY_DOUBLE)
 
 // Define concrete examples of the TYPEMAP_IN macros
 
-TYPEMAP_IN(char)
 TYPEMAP_IN(SpiceChar)
 TYPEMAP_IN(ConstSpiceChar)
 
@@ -2827,21 +2686,21 @@ TYPEMAP_IN(ConstSpiceChar)
 * These typemaps allow C-format strings to be passed to the C function and for
 * a string value to be returned.
 *
-*       (char INOUT_STRING[ANY])
-*       (char *INOUT_STRING)
+*       (SpiceChar INOUT_STRING[ANY])
+*       (SpiceChar *INOUT_STRING)
 *
-*       (int DIM1, char INOUT_STRING[ANY])
-*       (int DIM1, char *INOUT_STRING)
+*       (SpiceInt DIM1, SpiceChar INOUT_STRING[ANY])
+*       (SpiceInt DIM1, SpiceChar *INOUT_STRING)
 *
-*       (char INOUT_STRING[ANY], int DIM1)
-*       (char *INOUT_STRING, int DIM1)
+*       (SpiceChar INOUT_STRING[ANY], SpiceInt DIM1)
+*       (SpiceChar *INOUT_STRING, SpiceInt DIM1)
 *
 * The differences between the options are:
 *
-*       (char *INOUT_STRING): The string is taken as input. A buffer of the
+*       (SpiceChar *INOUT_STRING): The string is taken as input. A buffer of the
 *               size is used to construct the returned string.
 *
-*       (char INOUT_STRING[ANY]): The string is taken as input. A buffer of the
+*       (SpiceChar INOUT_STRING[ANY]): The string is taken as input. A buffer of the
 *               size specified in braces is used to construct the output.
 *
 * The integer DIM1 parameter carries the dimensioned length of the string.
@@ -2854,24 +2713,24 @@ TYPEMAP_IN(ConstSpiceChar)
 * Python string values. They are part of the Python return value and do not
 * appear as arguments when the function is called from Python.
 *
-*       (char OUT_STRING[ANY])
-*       (char OUT_STRING[ANY], int DIM1)
-*       (int DIM1, char OUT_STRING[ANY])
+*       (SpiceChar OUT_STRING[ANY])
+*       (SpiceChar OUT_STRING[ANY], SpiceInt DIM1)
+*       (SpiceInt DIM1, SpiceChar OUT_STRING[ANY])
 *
 * In each case, the dimensioned length of the string is defined in the SWIG
 * interface by a number inside the brackets. The differences between the three
 * options are:
 *
-*       (char OUT_STRING[ANY]): one argument to the C function of type char*
+*       (SpiceChar OUT_STRING[ANY]): one argument to the C function of type SpiceChar*
 *               is consumed; no information about the string's dimensioned
 *               length is passed to the function.
 *
-*       ((char OUT_STRING[ANY], int DIM1): two arguments to the C function are
-*               consumed; the dimensioned length of the the character string
+*       ((SpiceChar OUT_STRING[ANY], SpiceInt DIM1): two arguments to the C function are
+*               consumed; the dimensioned length of the the SpiceCharacter string
 *               (which is one greater than the maximum allowed string length)
-*               is passed as the next argument after the char* pointer.
+*               is passed as the next argument after the SpiceChar* pointer.
 *
-*       ((int DIM1, char OUT_STRING[ANY]): two arguments to the C function are
+*       ((SpiceInt DIM1, SpiceChar OUT_STRING[ANY]): two arguments to the C function are
 *               consumed; the dimensioned length of the the character string is
 *               passed as the argument before the char* pointer.
 *
@@ -2879,7 +2738,7 @@ TYPEMAP_IN(ConstSpiceChar)
 *
 * The C source code:
 *
-*       void yesno(int status, char *str, int lstr) {
+*       void yesno(SpiceInt status, SpiceChar *str, SpiceInt lstr) {
 *           if (status) {
 *               strncpy(str, "yes", lstr);
 *           } else {
@@ -2889,8 +2748,8 @@ TYPEMAP_IN(ConstSpiceChar)
 *
 * In the interface file:
 *
-*       %apply (char OUT_STRING[ANY], int LEN) {(char str[4], int lstr)};
-*       extern void yesno(int status, char str[4], int lstr);
+*       %apply (SpiceChar OUT_STRING[ANY], SpiceInt LEN) {(SpiceChar str[4], SpiceInt lstr)};
+*       extern void yesno(SpiceInt status, SpiceChar str[4], SpiceInt lstr);
 *
 * In Python:
 *
@@ -2921,14 +2780,15 @@ char *byte_string_to_buffer_minimum_size(
 %define TYPEMAP_INOUT_OUT(Type) // Use to fill in types below
 
 /***********************************************
-* (char INOUT_STRING[ANY])
+* (SpiceChar INOUT_STRING[ANY])
 ***********************************************/
 
 %typemap(in)
     (Type INOUT_STRING[ANY])                                    // PATTERN
         (char *buffer = NULL, size_t dim1 = 0, PyObject *byte_string = NULL)
 {
-//      (char INOUT_STRING[ANY])
+//      $1_type $1_name
+//      (Type INOUT_STRING[ANY])
 //  NOT CURRENTLY USED BY CSPICE
 
     TEST_IS_STRING($input);
@@ -2942,16 +2802,15 @@ char *byte_string_to_buffer_minimum_size(
 }
 
 /***********************************************
-* (char INOUT_STRING[ANY], int DIM1)
+* (SpiceChar INOUT_STRING[ANY], SpiceInt DIM1)
 ***********************************************/
 
 %typemap(in)
-    (Type INOUT_STRING[ANY], int DIM1)                          // PATTERN
-        (char *buffer = NULL, size_t dim1 = 0, PyObject *byte_string = NULL),
     (Type INOUT_STRING[ANY], SpiceInt DIM1)                     // PATTERN
         (char *buffer = NULL, size_t dim1 = 0, PyObject *byte_string = NULL)
 {
-//      (char INOUT_STRING[ANY], int DIM1)
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceChar INOUT_STRING[ANY], SpiceInt DIM1)
 //  NOT CURRENTLY USED BY CSPICE
 
     TEST_IS_STRING($input);
@@ -2966,16 +2825,15 @@ char *byte_string_to_buffer_minimum_size(
 }
 
 /***********************************************
-* (int DIM1, char INOUT_STRING[ANY])
+* (SpiceInt DIM1, SpiceChar INOUT_STRING[ANY])
 ***********************************************/
 
 %typemap(in)
-    (int DIM1, Type INOUT_STRING[ANY])                          // PATTERN
-        (char *buffer = NULL, size_t dim1 = 0, PyObject *byte_string = NULL),
     (SpiceInt DIM1, Type INOUT_STRING[ANY])                     // PATTERN
         (char *buffer = NULL, size_t dim1 = 0, PyObject *byte_string = NULL)
 {
-//      (int DIM1, char INOUT_STRING[ANY])
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceInt DIM1, SpiceChar INOUT_STRING[ANY])
 
     TEST_IS_STRING($input);
     byte_string = PyUnicode_AsUTF8String($input);
@@ -2989,16 +2847,15 @@ char *byte_string_to_buffer_minimum_size(
 }
 
 /***********************************************
-* (int DIM1, char *INOUT_STRING)
+* (SpiceInt DIM1, SpiceChar *INOUT_STRING)
 ***********************************************/
 
 %typemap(in)
-    (int DIM1, Type *INOUT_STRING)                              // PATTERN
-        (char *buffer = NULL, size_t dim1 = 0, PyObject *byte_string = NULL),
     (SpiceInt DIM1, Type *INOUT_STRING)                         // PATTERN
         (char *buffer = NULL, size_t dim1 = 0, PyObject *byte_string = NULL)
 {
-//      (int DIM1, char *INOUT_STRING)
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceInt DIM1, SpiceChar *INOUT_STRING)
 
     TEST_IS_STRING($input);
     byte_string = PyUnicode_AsUTF8String($input);
@@ -3011,57 +2868,65 @@ char *byte_string_to_buffer_minimum_size(
     $1 = ($1_type) dim1;                                        // DIM1
 }
 
-/***********************************************
-* (char OUT_STRING[ANY])
-***********************************************/
+/*******************************************************
+* %typemap(argout)
+* %typemap(freearg)
+*******************************************************/
 
-%typemap(in, numinputs=0)
-    (Type OUT_STRING[ANY])                                      // PATTERN
-        (Type *buffer = NULL, size_t dim1 = 0)
+%typemap(argout)
+    (Type INOUT_STRING[ANY]),
+    (Type INOUT_STRING[ANY], SpiceInt DIM1),
+    (SpiceInt DIM1, Type INOUT_STRING[ANY]),
+    (Type *INOUT_STRING),
+    (Type *INOUT_STRING, SpiceInt DIM1),
+    (SpiceInt DIM1, Type *INOUT_STRING)
 {
-//      (char OUT_STRING[ANY])
-
-    dim1 = max(1, $1_dim0);
-    buffer = (char *) PyMem_Malloc((dim1 + 1) * sizeof(Type));
-    TEST_MALLOC_FAILURE(buffer);
+    buffer$argnum[dim1$argnum-1] = '\0';  // Make sure string is terminated
+    PyObject *obj = PyUnicode_FromString((Type *) buffer$argnum);
+    $result = SWIG_Python_AppendOutput($result, obj);
+}
 
-    buffer[0] = '\0';   // String begins empty
-    $1 = buffer;                                                // STRING
+%typemap(freearg)
+    (Type INOUT_STRING[ANY]),
+    (Type INOUT_STRING[ANY], SpiceInt DIM1),
+    (SpiceInt DIM1, Type INOUT_STRING[ANY]),
+    (Type *INOUT_STRING),
+    (Type *INOUT_STRING, SpiceInt DIM1),
+    (SpiceInt DIM1, Type *INOUT_STRING)
+{
+    PyMem_Free(buffer$argnum);
+    Py_XDECREF(byte_string$argnum);
 }
 
 /***********************************************
-* (char OUT_STRING[ANY], int DIM1)
+* (SpiceChar OUT_STRING[ANY])
 ***********************************************/
 
 %typemap(in, numinputs=0)
-    (Type OUT_STRING[ANY], int DIM1)                            // PATTERN
-        (Type *buffer = NULL, size_t dim1 = 0),
-    (Type OUT_STRING[ANY], SpiceInt DIM1)                       // PATTERN
-        (Type *buffer = NULL, size_t dim1 = 0)
+    (Type OUT_STRING[ANY])                                      // PATTERN
+        (Type *buffer = NULL, size_t dim1)
 {
-//      (char OUT_STRING[ANY], int DIM1)
-//  NOT CURRENTLY USED BY CSPICE
+//      $1_type $1_name
+//      (SpiceChar OUT_STRING[ANY])
 
-    dim1 = max(1, $2_dim0);
-    buffer = ($1_ltype) PyMem_Malloc((dim1 + 1) * sizeof(Type));
+    dim1 = max(1, $1_dim0);
+    buffer = (char *) PyMem_Malloc((dim1 + 1) * sizeof(Type));
     TEST_MALLOC_FAILURE(buffer);
 
     buffer[0] = '\0';   // String begins empty
     $1 = buffer;                                                // STRING
-    $2 = ($2type)dim1;                                         // DIM1
 }
 
 /***********************************************
-* (int DIM1, char OUT_STRING[ANY])
+* (SpiceInt DIM1, SpiceChar OUT_STRING[ANY])
 ***********************************************/
 
 %typemap(in, numinputs=0)
-    (int DIM1, Type OUT_STRING[ANY])                            // PATTERN
-        (Type *buffer = NULL, size_t dim1),
     (SpiceInt DIM1, Type OUT_STRING[ANY])                       // PATTERN
         (Type *buffer = NULL, size_t dim1)
 {
-//      (int DIM1, char OUT_STRING[ANY])
+//      $1_type $1_name, $2_type $2_name
+//      (SpiceInt DIM1, SpiceChar OUT_STRING[ANY])
 
     dim1 = max(1, $2_dim0);
     buffer = (Type *) PyMem_Malloc((dim1 + 1) * sizeof(Type));
@@ -3072,6 +2937,23 @@ char *byte_string_to_buffer_minimum_size(
     $1 = ($1_type)dim1;                                         // DIM1
 }
 
+%typemap(in, numinputs=0)
+    (Type OUT_STRING[ANY], SpiceInt *SIZE1)                      // PATTERN
+        (Type *buffer = NULL, size_t size1),
+    (Type OUT_STRING[ANY], SpiceInt *SIZE1)                      // PATTERN
+        (Type *buffer = NULL, size_t size1)
+{
+//      $1_type $1_name, $2_type $2_name
+//    (Type OUT_STRING[ANY], SpiceInt *SIZE1)                    // PATTERN
+
+    size_t dim1 = max(1, $1_dim0);
+    buffer = ($1_ltype) PyMem_Malloc((dim1 + 1) * sizeof(Type));
+    TEST_MALLOC_FAILURE(buffer);
+
+    buffer[0] = '\0';   // String begins empty
+    $1 = buffer;                                                // STRING
+    $2 = &size1;                                                 // DIM1
+}
 
 /*******************************************************
 * %typemap(argout)
@@ -3079,53 +2961,27 @@ char *byte_string_to_buffer_minimum_size(
 *******************************************************/
 
 %typemap(argout)
-    (Type INOUT_STRING[ANY]),
-    (Type INOUT_STRING[ANY], int DIM1),
-    (Type INOUT_STRING[ANY], SpiceInt DIM1),
-    (int DIM1, Type INOUT_STRING[ANY]),
-    (SpiceInt DIM1, Type INOUT_STRING[ANY]),
-    (Type *INOUT_STRING),
-    (Type *INOUT_STRING, int DIM1),
-    (Type *INOUT_STRING, SpiceInt DIM1),
-    (int DIM1, Type *INOUT_STRING),
-    (SpiceInt DIM1, Type *INOUT_STRING),
     (Type OUT_STRING[ANY]),
-    (Type OUT_STRING[ANY], int DIM1),
     (Type OUT_STRING[ANY], SpiceInt DIM1),
-    (int DIM1, Type OUT_STRING[ANY]),
     (SpiceInt DIM1, Type OUT_STRING[ANY])
 {
-//      (... Type INOUT_STRING[ANY] ...)
-//      (... Type *INOUT_STRING ...)
-//      (... Type OUT_STRING[ANY] ...)
-
     buffer$argnum[dim1$argnum-1] = '\0';  // Make sure string is terminated
     PyObject *obj = PyUnicode_FromString((Type *) buffer$argnum);
     $result = SWIG_Python_AppendOutput($result, obj);
 }
 
-%typemap(freearg)
-    (Type INOUT_STRING[ANY]),
-    (Type INOUT_STRING[ANY], int DIM1),
-    (Type INOUT_STRING[ANY], SpiceInt DIM1),
-    (int DIM1, Type INOUT_STRING[ANY]),
-    (SpiceInt DIM1, Type INOUT_STRING[ANY]),
-    (Type *INOUT_STRING),
-    (Type *INOUT_STRING, int DIM1),
-    (Type *INOUT_STRING, SpiceInt DIM1),
-    (int DIM1, Type *INOUT_STRING),
-    (SpiceInt DIM1, Type *INOUT_STRING)
+%typemap(argout)
+    (Type OUT_STRING[ANY], SpiceInt *SIZE1)
 {
-    PyMem_Free(buffer$argnum);
-    Py_XDECREF(byte_string$argnum);
+    PyObject *obj = PyUnicode_FromStringAndSize((Type *) buffer$argnum, size1$argnum);
+    $result = SWIG_Python_AppendOutput($result, obj);
 }
 
 %typemap(freearg)
     (Type OUT_STRING[ANY]),
-    (Type OUT_STRING[ANY], int DIM1),
     (Type OUT_STRING[ANY], SpiceInt DIM1),
-    (INT DIM1, Type OUT_STRING[ANY]),
-    (SpiceInt DIM1, Type OUT_STRING[ANY])
+    (SpiceInt DIM1, Type OUT_STRING[ANY]),
+    (Type OUT_STRING[ANY], SpiceInt *SIZE1)
 {
     PyMem_Free(buffer$argnum);
 }
@@ -3139,7 +2995,6 @@ char *byte_string_to_buffer_minimum_size(
 %enddef
 
 // Define concrete examples of the  MAP_IN macros
-TYPEMAP_INOUT_OUT(char)
 TYPEMAP_INOUT_OUT(SpiceChar)
 
 #undef TYPEMAP_INOUT_OUT
@@ -3149,9 +3004,9 @@ TYPEMAP_INOUT_OUT(SpiceChar)
 *
 * These typemaps allow C-format string arrays to be passed into the C function.
 *
-*       (char *IN_STRINGS, int DIM1, int DIM2)
-*       (int DIM1, int DIM2, char *IN_STRINGS)
-*       (int DIM1, int DIM2, Type *INOUT_STRINGS)
+*       (SpiceChar *IN_STRINGS, SpiceInt DIM1, SpiceInt DIM2)
+*       (SpiceInt DIM1, SpiceInt DIM2, SpiceChar *IN_STRINGS)
+*       (SpiceInt DIM1, SpiceInt DIM2, Type *INOUT_STRINGS)
 *
 * In all cases, the Strings are copied to an n x m array where n is the number
 * of strings and m is longer than the longest string.
@@ -3163,35 +3018,31 @@ TYPEMAP_INOUT_OUT(SpiceChar)
 %define TYPEMAP_IN(Type) // Use to fill in types below
 
 /***********************************************************************
-* (Type *IN_STRINGS, int DIM1, int DIM2)
+* (Type *IN_STRINGS, SpiceInt DIM1, SpiceInt DIM2)
 ***********************************************************************/
 
 %typemap(in)
-    (Type *IN_STRINGS, int DIM1, int DIM2)
-        (PyObject *list = NULL, char *buffer = NULL),
     (Type *IN_STRINGS, SpiceInt DIM1, SpiceInt DIM2)
         (PyObject *list = NULL, char *buffer = NULL)
 {
-//      (Type *IN_STRINGS, int DIM1, int DIM2)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (Type *IN_STRINGS, SpiceInt DIM1, SpiceInt DIM2)
 
     HANDLE_TYPEMAP_IN_STRINGS($1, $*1_type, $2, $3, buffer, list)
 }
 
 /***********************************************************************
-* (int DIM1, int DIM2, Type *IN_STRINGS)
+* (SpiceInt DIM1, SpiceInt DIM2, Type *IN_STRINGS)
 ***********************************************************************/
 
 %typemap(in)
-    (int DIM1, int DIM2, Type *IN_STRINGS)
-        (PyObject *list = NULL, char *buffer = NULL),
     (SpiceInt DIM1, SpiceInt DIM2, Type *IN_STRINGS)
         (PyObject *list = NULL, char *buffer = NULL),
-    (int DIM1, int DIM2, Type *INOUT_STRINGS)
-        (PyObject *list = NULL, char *buffer = NULL),
     (SpiceInt DIM1, SpiceInt DIM2, Type *INOUT_STRINGS)
         (PyObject *list = NULL, char *buffer = NULL)
 {
-//      (int DIM1, int DIM2, Type *IN[OUT]_STRINGS)
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt DIM1, SpiceInt DIM2, Type *IN[OUT]_STRINGS)
 
     HANDLE_TYPEMAP_IN_STRINGS($3, $*3_type, $1, $2, buffer, list)
 }
@@ -3201,18 +3052,15 @@ TYPEMAP_INOUT_OUT(SpiceChar)
 * %typemap(freearg)
 ***********************************************************************/
 %typemap(argout)
-    (Type *IN_STRINGS, int DIM1, int DIM2),
     (Type *IN_STRINGS, SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, Type *IN_STRINGS),
     (SpiceInt DIM1, SpiceInt DIM2, Type *IN_STRINGS)
 ""
 
 %typemap(argout)
-    (int DIM1, int DIM2, Type *INOUT_STRINGS),
     (SpiceInt DIM1, SpiceInt DIM2, Type *INOUT_STRINGS)
 {
-//      (int DIM1, int DIM2, Type *INOUT_STRINGS)
-    // We can reuse list$argnum, but first we need to free whatever is already there.
+//      (SpiceInt DIM1, SpiceInt DIM2, Type *INOUT_STRINGS)
+    // We can reuse list$argnum, but first we need to free whatever is there.
     Py_XDECREF(list$argnum);
     list$argnum = NULL;
     CONVERT_BUFFER_TO_ARRAY_OF_STRINGS(buffer$argnum, $1, $2, list$argnum);
@@ -3221,11 +3069,8 @@ TYPEMAP_INOUT_OUT(SpiceChar)
 }
 
 %typemap(freearg)
-    (Type *IN_STRINGS, int DIM1, int DIM2),
     (Type *IN_STRINGS, SpiceInt DIM1, SpiceInt DIM2),
-    (int DIM1, int DIM2, Type *IN_STRINGS),
     (SpiceInt DIM1, SpiceInt DIM2, Type *IN_STRINGS),
-    (int DIM1, int DIM2, Type *INOUT_STRINGS),
     (SpiceInt DIM1, SpiceInt DIM2, Type *INOUT_STRINGS)
 {
     Py_XDECREF(list$argnum);
@@ -3239,7 +3084,6 @@ TYPEMAP_INOUT_OUT(SpiceChar)
 %enddef
 
 // Define concrete examples of the TYPEMAP_IN macros
-TYPEMAP_IN(char)
 TYPEMAP_IN(SpiceChar)
 TYPEMAP_IN(ConstSpiceChar)
 
@@ -3252,101 +3096,92 @@ TYPEMAP_IN(ConstSpiceChar)
 * a list of Python string values. They are part of the return value and do not
 * appear as arguments to the Python function.
 *
-*       (char OUT_STRINGS[ANY][ANY], int DIM1, int DIM1, int *NSTRINGS)
-*       (int DIM1, int DIM2, int *NSTRINGS, char OUT_STRINGS[ANY][ANY])
+*       (SpiceChar OUT_STRINGS[ANY][ANY], SpiceInt DIM1, SpiceInt DIM1, SpiceInt *NSTRINGS)
+*       (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
 *
 * As above, the maximum size and number of strings must be defined in the SWIG
 * interface file (to ensure adequate memory is allocated). The typemaps could
 * easily be written for alternative orderings of the arguments or for cases
 * where one or more arguments are missing.
+*
+* There are so many possibilities here that we are just going to create them on
+* demand as needed.
 *******************************************************************************/
 
-%define TYPEMAP_OUT(Type) // Use to fill in types below
-
-/***********************************************************************
-* (char OUT_STRINGS[ANY][ANY], int DIM1, int DIM2, int *NSTRINGS)
-***********************************************************************/
-
-%typemap(in,numinputs=0)
-    (Type OUT_STRINGS[ANY][ANY], int DIM1, int DIM2, int *NSTRINGS)
-        (Type *buffer, int dimsize[2], int nstrings),
-    (Type OUT_STRINGS[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS)
-        (Type *buffer, int dimsize[2], int nstrings)
-{
-//      (char OUT_STRINGS[ANY][ANY], int DIM1, int DIM2, int *NSTRINGS)
-//  NOT CURRENTLY USED BY CSPICE
-
+%define HANDLE_OUT_STRINGS_ANY_ANY(Type, dim0, dim1)
     nstrings = 0;
-    dimsize[0] = $1_dim0;                                       // ARRAY_dim0
-    dimsize[1] = $1_dim1;                                       // ARRAY_dim1
+    dimsize[0] = dim0;                                       // ARRAY_dim0
+    dimsize[1] = dim1;                                       // ARRAY_dim1
     if (dimsize[1] < 2) {
         dimsize[1] = 2;
     }
-
     buffer = (Type *) PyMem_Malloc(dimsize[0] * dimsize[1] * sizeof(Type));
     TEST_MALLOC_FAILURE(buffer);
+%enddef
 
-    $1 = buffer;                                                // ARRAY
-    $2 = dimsize[0];                                            // DIM1
-    $3 = dimsize[1];                                            // DIM2
-    $4 = &nstrings;                                             // NSTRINGS
-}
+%define TYPEMAP_OUT(Type) // Use to fill in types below
 
 /***********************************************************************
-* (int DIM1, int DIM2, int *NSTRINGS, char OUT_STRINGS[ANY][ANY])
+* (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY])
 ***********************************************************************/
 
 %typemap(in,numinputs=0)
-    (int DIM1, int DIM2, int *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
-        (Type *buffer, int dimsize[2], int nstrings, PyObject* list = NULL),
-    (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
-        (Type *buffer, int dimsize[2], int nstrings, PyObject* list = NULL)
+    (Type OUT_STRINGS[ANY][ANY], SpiceInt *NSTRINGS)
+        (Type *buffer = NULL, SpiceInt dimsize[2], SpiceInt nstrings, PyObject* list = NULL)
 {
-//      (int DIM1, int DIM2, int *NSTRINGS, char OUT_STRINGS[ANY][ANY])
+//      $1_type $1_name, $2_type $2_name
 
-    nstrings = 0;
-    dimsize[0] = $4_dim0;                                       // ARRAY_dim0
-    dimsize[1] = $4_dim1;                                       // NARRAY_dim1
-    if (dimsize[1] < 2) {
-        dimsize[1] = 2;
-    }
+    HANDLE_OUT_STRINGS_ANY_ANY(Type, $1_dim0, $1_dim1)
+    $1 = buffer;                                                // ARRAY
+    $2 = &nstrings;                                             // NSTRINGS
+}
 
-    buffer = (Type *) PyMem_Malloc(dimsize[0] * dimsize[1] * sizeof(Type));
-    TEST_MALLOC_FAILURE(buffer);
+%typemap(in,numinputs=0)
+    (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
+        (Type *buffer = NULL, SpiceInt dimsize[2], SpiceInt nstrings, PyObject* list = NULL)
+{
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name, $4_type $4_name
+//      (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
 
+    HANDLE_OUT_STRINGS_ANY_ANY(Type, $4_dim0, $4_dim1)
+    // foobar1
     $4 = buffer;                                                // ARRAY
     $1 = dimsize[0];                                            // DIM1
     $2 = dimsize[1];                                            // DIM2
     $3 = &nstrings;                                             // NSTRINGS
 }
 
-/***********************************************************************
-* %typemap(argout)
-* %typemap(freearg)
-***********************************************************************/
+%typemap(in,numinputs=0)
+    (SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
+        (Type *buffer = NULL, SpiceInt dimsize[2], SpiceInt nstrings, PyObject* list = NULL)
+{
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
+//      (SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
+
+    HANDLE_OUT_STRINGS_ANY_ANY(Type, $3_dim0, $3_dim1)
+
+    $3 = buffer;                                                // ARRAY
+    $1 = dimsize[1];                                            // DIM2
+    $2 = &nstrings;                                             // NSTRINGS
+}
 
 %typemap(argout)
-    (Type OUT_STRINGS[ANY][ANY], int DIM1, int DIM2, int *NSTRINGS),
-    (Type OUT_STRINGS[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS),
-    (int DIM1, int DIM2, int *NSTRINGS, Type OUT_STRINGS[ANY][ANY]),
-    (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
+    (Type OUT_STRINGS[ANY][ANY], SpiceInt *NSTRINGS),
+    (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY]),
+    (SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
 {
-//      (char OUT_STRINGS[ANY][ANY], int DIM1, int DIM2, int *NSTRINGS)
-
     CONVERT_BUFFER_TO_ARRAY_OF_STRINGS(buffer$argnum, nstrings$argnum, dimsize$argnum[1], list$argnum)
     $result = SWIG_Python_AppendOutput($result, list$argnum);
-    list$argnum = NULL;
+    list$argnum = NULL; // foobar2
 }
 
 %typemap(freearg)
-    (Type OUT_STRINGS[ANY][ANY], int DIM1, int DIM2, int *NSTRINGS),
-    (Type OUT_STRINGS[ANY][ANY], SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS),
-    (int DIM1, int DIM2, int *NSTRINGS, Type OUT_STRINGS[ANY][ANY]),
-    (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
+    (Type OUT_STRINGS[ANY][ANY], SpiceInt *NSTRINGS),
+    (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY]),
+    (SpiceInt DIM2, SpiceInt *NSTRINGS, Type OUT_STRINGS[ANY][ANY])
 {
-//      (char OUT_STRINGS[ANY][ANY], int DIM1, int DIM2, int *NSTRINGS)
     PyMem_Free((void *) buffer$argnum);
-    Py_XDECREF(list$argnum);
+    Py_XDECREF(list$argnum); // foobar3
 }
 
 /*******************************************************
@@ -3356,7 +3191,6 @@ TYPEMAP_IN(ConstSpiceChar)
 %enddef
 
 // Define concrete examples of the TYPEMAP_IN macros
-TYPEMAP_OUT(char)
 TYPEMAP_OUT(SpiceChar)
 
 #undef TYPEMAP_OUT
@@ -3377,6 +3211,7 @@ TYPEMAP_OUT(SpiceChar)
     (Type *OUTPUT)
         (Type value)
 {
+//      $1_type $1_name
 //      (Type *OUTPUT)
     $1 = &value;
 }
@@ -3384,6 +3219,7 @@ TYPEMAP_OUT(SpiceChar)
 %typemap(argout)
     (Type *OUTPUT)
 {
+//      $1_type $1_name
 //      (Type *OUTPUT)
 
     $result = SWIG_Python_AppendOutput($result, converter);
@@ -3403,10 +3239,10 @@ TYPEMAP_ARGOUT(PyObject*, (value$argnum))
 * runtime exception if necessary.
 *
 *       (void   RETURN_VOID   )
-*       (int    RETURN_BOOLEAN)
-*       (int    RETURN_INT    )
+*       (SpiceInt    RETURN_BOOLEAN)
+*       (SpiceInt    RETURN_INT    )
 *       (double RETURN_DOUBLE )
-*       (char  *RETURN_STRING )
+*       (SpiceChar  *RETURN_STRING )
 *******************************************************************************/
 
 %typemap(out) (void RETURN_VOID) {
@@ -3425,7 +3261,7 @@ TYPEMAP_ARGOUT(PyObject*, (value$argnum))
 
 
 %typemap(out)
-    (int RETURN_BOOLEAN),
+    (SpiceInt RETURN_BOOLEAN),
     (SpiceBoolean RETURN_BOOLEAN) {
 
     TEST_FOR_EXCEPTION;
@@ -3433,7 +3269,6 @@ TYPEMAP_ARGOUT(PyObject*, (value$argnum))
 }
 
 %typemap(out)
-    (int RETURN_INT),
     (SpiceInt RETURN_INT) {
 
     TEST_FOR_EXCEPTION;
@@ -3470,6 +3305,7 @@ TYPEMAP_ARGOUT(PyObject*, (value$argnum))
 %typemap(in, numinputs=0)
     (SWIGTYPE*)
 {
+//      $1_type $1_name, $2_type $2_name, $3_type $3_name
      ERROR The argument "$1_type $1_name" in "$symname" didnt match any template!!
 }
 #endif
diff --git a/swig/make_cspyce0_info.py b/swig/make_cspyce0_info.py
index 5cfa7211..89aff5a1 100644
--- a/swig/make_cspyce0_info.py
+++ b/swig/make_cspyce0_info.py
@@ -356,7 +356,8 @@ def handle_one_function(out, records):
                                                 # declaration
                         assert inouts[name] == inout
                         if argtype2:
-                            assert types[name] == argtype2
+                            if types[name] != argtype2:
+                                raise ValueError(f"In {func}, expected {argtype2} but got {types[name]}")
                     else:
                         if name in types:
                             validate_type_change(argtype, types[name],
diff --git a/swig/make_vectorize.py b/swig/make_vectorize.py
index a9b32dee..484e61f4 100644
--- a/swig/make_vectorize.py
+++ b/swig/make_vectorize.py
@@ -91,7 +91,7 @@ def get_declaration(self):
         else:
             my_type = "ConstSpiceDouble *" if self.key[0] == 'd' else "SpiceDouble *"
             main_declaration = f'{my_type}{self.name}'
-            dim_declarations = [f'int {dim}' for dim in self.dim_names]
+            dim_declarations = [f'SpiceInt {dim}' for dim in self.dim_names]
             return ', '.join((main_declaration, *dim_declarations))
 
     def get_call(self, sizer_count):
@@ -148,7 +148,7 @@ def expand_key(self, counter, ijkdict, fullname):
     def get_declaration(self):
         my_type = dict(i='SpiceInt', b='SpiceBoolean').get(self.key, 'SpiceDouble')
         main_declaration = f'{my_type} **{self.name}'
-        dims_declarations = [f'int *{name}' for name in self.dim_names]
+        dims_declarations = [f'SpiceInt *{name}' for name in self.dim_names]
         return ', '.join((main_declaration, *dims_declarations))
 
     def get_malloc(self):
@@ -341,18 +341,18 @@ def __get_out_letters(self):
 
 
 APPLY_TEMPLATE_LINES = [
-    "%apply (ConstSpiceDouble *IN_ARRAY01, int DIM1) {(ConstSpiceDouble *in1@, int in1@_dim1)};",
-    "%apply (ConstSpiceDouble *IN_ARRAY12, int DIM1, int DIM2) {(ConstSpiceDouble *in2@, int in2@_dim1, int in2@_dim2)};",
-    "%apply (ConstSpiceDouble *IN_ARRAY23, int DIM1, int DIM2, int DIM3) {(ConstSpiceDouble *in3@, int in3@_dim1, int in3@_dim2, int in3@_dim3)};",
-    "%apply (SpiceDouble *IN_ARRAY01, int DIM1) {(SpiceDouble *in1@, int in1@_dim1)};",
-    "%apply (SpiceDouble *IN_ARRAY12, int DIM1, int DIM2) {(SpiceDouble *in2@, int in2@_dim1, int in2@_dim2)};",
-    "%apply (SpiceDouble *IN_ARRAY23, int DIM1, int DIM2, int DIM3) {(SpiceDouble *in3@, int in3@_dim1, int in3@_dim2, int in3@_dim3)};",
+    "%apply (ConstSpiceDouble *IN_ARRAY01, SpiceInt DIM1) {(ConstSpiceDouble *in1@, SpiceInt in1@_dim1)};",
+    "%apply (ConstSpiceDouble *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2) {(ConstSpiceDouble *in2@, SpiceInt in2@_dim1, SpiceInt in2@_dim2)};",
+    "%apply (ConstSpiceDouble *IN_ARRAY23, SpiceInt DIM1, SpiceInt DIM2, SpiceInt DIM3) {(ConstSpiceDouble *in3@, SpiceInt in3@_dim1, SpiceInt in3@_dim2, SpiceInt in3@_dim3)};",
+    "%apply (SpiceDouble *IN_ARRAY01, SpiceInt DIM1) {(SpiceDouble *in1@, SpiceInt in1@_dim1)};",
+    "%apply (SpiceDouble *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2) {(SpiceDouble *in2@, SpiceInt in2@_dim1, SpiceInt in2@_dim2)};",
+    "%apply (SpiceDouble *IN_ARRAY23, SpiceInt DIM1, SpiceInt DIM2, SpiceInt DIM3) {(SpiceDouble *in3@, SpiceInt in3@_dim1, SpiceInt in3@_dim2, SpiceInt in3@_dim3)};",
     "%apply (ConstSpiceChar *CONST_STRING) {(ConstSpiceChar *str@)};",
-    "%apply (SpiceDouble **OUT_ARRAY01, int *SIZE1) {(SpiceDouble **out1@, int *out1@_dim1)};",
-    "%apply (SpiceDouble **OUT_ARRAY12, int *SIZE1, int *SIZE2) {(SpiceDouble **out2@, int *out2@_dim1, int *out2@_dim2)};",
-    "%apply (SpiceDouble **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3) {(SpiceDouble **out3@, int *out3@_dim1, int *out3@_dim2, int *out3@_dim3)};",
-    "%apply (SpiceInt **OUT_ARRAY01, int *SIZE1) {(SpiceInt **int@, int *int@_dim1)};",
-    "%apply (SpiceBoolean **OUT_ARRAY01, int *SIZE1) {(SpiceBoolean **bool@, int *bool@_dim1)};",
+    "%apply (SpiceDouble **OUT_ARRAY01, SpiceInt *SIZE1) {(SpiceDouble **out1@, SpiceInt *out1@_dim1)};",
+    "%apply (SpiceDouble **OUT_ARRAY12, SpiceInt *SIZE1, SpiceInt *SIZE2) {(SpiceDouble **out2@, SpiceInt *out2@_dim1, SpiceInt *out2@_dim2)};",
+    "%apply (SpiceDouble **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3) {(SpiceDouble **out3@, SpiceInt *out3@_dim1, SpiceInt *out3@_dim2, SpiceInt *out3@_dim3)};",
+    "%apply (SpiceInt **OUT_ARRAY01, SpiceInt *SIZE1) {(SpiceInt **int@, SpiceInt *int@_dim1)};",
+    "%apply (SpiceBoolean **OUT_ARRAY01, SpiceInt *SIZE1) {(SpiceBoolean **bool@, SpiceInt *bool@_dim1)};",
 ]
 
 
diff --git a/swig/typemap_samples.i b/swig/typemap_samples.i
index 76744684..f09795aa 100644
--- a/swig/typemap_samples.i
+++ b/swig/typemap_samples.i
@@ -29,17 +29,17 @@
 }
 
 %{
-    PyObject* int_array_to_tuple(int *buffer, int count) {
+    PyObject* int_array_to_tuple(SpiceInt *buffer, SpiceInt count) {
         PyObject* result = PyTuple_New(count);
-        for (int i = 0; i < count;i++) {
+        for (SpiceInt i = 0; i < count;i++) {
             PyTuple_SetItem(result, i, Py_BuildValue("i", buffer[i]));
         }
         return result;
     }
 
-    PyObject* double_array_to_tuple(double *buffer, int count) {
+    PyObject* double_array_to_tuple(SpiceDouble *buffer, SpiceInt count) {
         PyObject *result = PyTuple_New(count);
-        for (int i = 0; i < count;i++) {
+        for (SpiceInt i = 0; i < count;i++) {
             PyTuple_SetItem(result, i, Py_BuildValue("d", buffer[i]));
         }
         return result;
@@ -48,19 +48,19 @@
 
 
 %{
-    PyObject* in_array1_1(int arg[3]) {
+    PyObject* in_array1_1(SpiceInt arg[3]) {
         return int_array_to_tuple(arg, 3);
     }
 
-    PyObject* in_array1_2(int *arg, int dim) {
+    PyObject* in_array1_2(SpiceInt *arg, SpiceInt dim) {
         return int_array_to_tuple(arg, dim);
     }
 
-    PyObject* in_array1_3(int *arg, int dim) {
+    PyObject* in_array1_3(SpiceInt *arg, SpiceInt dim) {
         return int_array_to_tuple(arg, dim);
     }
 
-    PyObject* in_array01_1(int *arg, int dim) {
+    PyObject* in_array01_1(SpiceInt *arg, SpiceInt dim) {
         if (dim == 0) {
             return Py_BuildValue("i", arg[0]);
         }
@@ -68,87 +68,87 @@
     }
 %}
 
-%apply (int IN_ARRAY1[ANY]) {int arg[3]};
-PyObject* in_array1_1(int arg[3]);
+%apply (SpiceInt IN_ARRAY1[ANY]) {SpiceInt arg[3]};
+PyObject* in_array1_1(SpiceInt arg[3]);
 
-%apply (int* IN_ARRAY1, int DIM1) {(int* arg, int dim)};
-PyObject* in_array1_2(int *arg, int dim);
+%apply (SpiceInt* IN_ARRAY1, SpiceInt DIM1) {(SpiceInt* arg, SpiceInt dim)};
+PyObject* in_array1_2(SpiceInt *arg, SpiceInt dim);
 
-%apply (int* IN_ARRAY1) {(int arg[])};
-PyObject* in_array1_3(int arg[], int dim);
+%apply (SpiceInt* IN_ARRAY1) {(SpiceInt arg[])};
+PyObject* in_array1_3(SpiceInt arg[], SpiceInt dim);
 
-%apply (int *IN_ARRAY01, int DIM1) {(int *arg, int dim)};
-PyObject* in_array01_1(int *arg, int dim);
+%apply (SpiceInt *IN_ARRAY01, SpiceInt DIM1) {(SpiceInt *arg, SpiceInt dim)};
+PyObject* in_array01_1(SpiceInt *arg, SpiceInt dim);
 
 %{
-   PyObject* in_array2_1(int arg[3][5]) {
+   PyObject* in_array2_1(SpiceInt arg[3][5]) {
        PyObject* info = int_array_to_tuple(arg, 15);
        return Py_BuildValue("Nii", info, 3, 5);
    }
 
-   PyObject *in_array2_2(int *arg, int dim1, int dim2) {
+   PyObject *in_array2_2(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2) {
        PyObject* info = int_array_to_tuple(arg, dim1 * dim2);
        return Py_BuildValue("Nii", info, dim1, dim2);
    }
 
-   PyObject *in_array2_3(int arg[][5], int dim1) {
+   PyObject *in_array2_3(SpiceInt arg[][5], SpiceInt dim1) {
        PyObject* info = int_array_to_tuple(arg, dim1 * 5);
        return Py_BuildValue("Nii", info, dim1, 5);
    }
 
-   PyObject *in_array2_4(int arg[][5]) {
+   PyObject *in_array2_4(SpiceInt arg[][5]) {
        /* Nothing we can return, since array might be size 0 */
        Py_RETURN_TRUE;
    }
 
-   PyObject *in_array12(int *arg, int dim1, int dim2) {
+   PyObject *in_array12(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2) {
        PyObject* info = int_array_to_tuple(arg, max(dim1, 1) * dim2);
        return Py_BuildValue("Nii", info, dim1, dim2);
    }
 
-   PyObject *in_array23(int *arg, int dim1, int dim2, int dim3) {
+   PyObject *in_array23(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2, SpiceInt dim3) {
        PyObject* info = int_array_to_tuple(arg, max(dim1, 1) * dim2 * dim3);
        return Py_BuildValue("Niii", info, dim1, dim2, dim3);
    }
 %}
 
-%apply (int IN_ARRAY2[ANY][ANY]) {int arg[3][5]};
-PyObject* in_array2_1(int arg[3][5]);
+%apply (SpiceInt IN_ARRAY2[ANY][ANY]) {SpiceInt arg[3][5]};
+PyObject* in_array2_1(SpiceInt arg[3][5]);
 
-%apply (int *IN_ARRAY2, int DIM1, int DIM2) {(int *arg, int dim1, int dim2)};
-PyObject *in_array2_2(int *arg, int dim1, int dim2);
+%apply (SpiceInt *IN_ARRAY2, SpiceInt DIM1, SpiceInt DIM2) {(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2)};
+PyObject *in_array2_2(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2);
 
-%apply (int IN_ARRAY2[][ANY], int DIM1) {(int arg[][5], int dim1)};
-PyObject *in_array2_3(int arg[][5], int dim1);
+%apply (SpiceInt IN_ARRAY2[][ANY], SpiceInt DIM1) {(SpiceInt arg[][5], SpiceInt dim1)};
+PyObject *in_array2_3(SpiceInt arg[][5], SpiceInt dim1);
 
-%apply (int IN_ARRAY2[][ANY]) {int arg[][5]};
-PyObject *in_array2_4(int arg[][5]);
+%apply (SpiceInt IN_ARRAY2[][ANY]) {SpiceInt arg[][5]};
+PyObject *in_array2_4(SpiceInt arg[][5]);
 
-%apply (int *IN_ARRAY12, int DIM1, int DIM2)  {(int *arg, int dim1, int dim2)};
-PyObject *in_array12(int *arg, int dim1, int dim2);
+%apply (SpiceInt *IN_ARRAY12, SpiceInt DIM1, SpiceInt DIM2)  {(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2)};
+PyObject *in_array12(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2);
 
-%apply (int *IN_ARRAY23, int DIM1, int DIM2, int DIM3)  {(int *arg, int dim1, int dim2, int dim3)};
-PyObject *in_array23(int *arg, int dim1, int dim2, int dim3);
+%apply (SpiceInt *IN_ARRAY23, SpiceInt DIM1, SpiceInt DIM2, SpiceInt DIM3)  {(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2, SpiceInt dim3)};
+PyObject *in_array23(SpiceInt *arg, SpiceInt dim1, SpiceInt dim2, SpiceInt dim3);
 
 %{
-    void out_array1_1(int start, int array[100]) {
-        for (int i = 0; i < 100; i++) {
+    void out_array1_1(SpiceInt start, SpiceInt array[100]) {
+        for (SpiceInt i = 0; i < 100; i++) {
             array[i] = start + i;
         }
     }
 
-    void out_array1_2(int start, int length, int array[100], int *size) {
-        for (int i = 0; i < length; i++) {
+    void out_array1_2(SpiceInt start, SpiceInt length, SpiceInt array[100], SpiceInt *size) {
+        for (SpiceInt i = 0; i < length; i++) {
             array[i] = start + i;
         }
         *size = length;
     }
 
-    void out_array1_malloc(int start, int length, int **arrayP, int *size) {
+    void out_array1_malloc(SpiceInt start, SpiceInt length, SpiceInt **arrayP, SpiceInt *size) {
         if (start >= 0) {
-            *arrayP = PyMem_Malloc(length * sizeof(int));
-            int *array = *arrayP;
-            for (int i = 0; i < length; i++) {
+            *arrayP = PyMem_Malloc(length * sizeof(SpiceInt));
+            SpiceInt *array = *arrayP;
+            for (SpiceInt i = 0; i < length; i++) {
                 array[i] = start + i;
             }
         } else {
@@ -157,13 +157,13 @@ PyObject *in_array23(int *arg, int dim1, int dim2, int dim3);
         *size = length;
     }
 
-    void out_array01_malloc(double start, int length, double **arrayP, int *size) {
-        int real_length = max(length, 1);
+    void out_array01_malloc(SpiceDouble start, SpiceInt length, SpiceDouble **arrayP, SpiceInt *size) {
+        SpiceInt real_length = max(length, 1);
         *size = length;
         if (start >= 0) {
-            *arrayP = PyMem_Malloc(real_length * sizeof(double));
-            double *array = *arrayP;
-            for (int i = 0; i < real_length; i++) {
+            *arrayP = PyMem_Malloc(real_length * sizeof(SpiceDouble));
+            SpiceDouble *array = *arrayP;
+            for (SpiceInt i = 0; i < real_length; i++) {
                 array[i] = start + i;
             }
         } else {
@@ -172,40 +172,40 @@ PyObject *in_array23(int *arg, int dim1, int dim2, int dim3);
     }
 %}
 
-%apply (int OUT_ARRAY1[ANY]) {(int array[100])};
-void out_array1_1(int start, int array[100]);
+%apply (SpiceInt OUT_ARRAY1[ANY]) {(SpiceInt array[100])};
+void out_array1_1(SpiceInt start, SpiceInt array[100]);
 
-%apply (int OUT_ARRAY1[ANY], int *SIZE1) {(int array[100], int *size)};
-void out_array1_2(int start, int length, int array[100], int *size);
+%apply (SpiceInt OUT_ARRAY1[ANY], SpiceInt *SIZE1) {(SpiceInt array[100], SpiceInt *size)};
+void out_array1_2(SpiceInt start, SpiceInt length, SpiceInt array[100], SpiceInt *size);
 
-%apply (int **OUT_ARRAY1, int *SIZE1) {(int **arrayP, int *size)};
-void out_array1_malloc(int start, int length, int **arrayP, int *size);
+%apply (SpiceInt **OUT_ARRAY1, SpiceInt *SIZE1) {(SpiceInt **arrayP, SpiceInt *size)};
+void out_array1_malloc(SpiceInt start, SpiceInt length, SpiceInt **arrayP, SpiceInt *size);
 
-%apply (double **OUT_ARRAY01, int *SIZE1) {(double **arrayP, int *size)};
-void out_array01_malloc(double start, int length, double **arrayP, int *size);
+%apply (SpiceDouble **OUT_ARRAY01, SpiceInt *SIZE1) {(SpiceDouble **arrayP, SpiceInt *size)};
+void out_array01_malloc(SpiceDouble start, SpiceInt length, SpiceDouble **arrayP, SpiceInt *size);
 
 
 %{
-    void out_array2_1(int start, int array[2][3]) {
-        int* ptr = array;
-        for (int i = 0; i < 6; i++) {
+    void out_array2_1(SpiceInt start, SpiceInt array[2][3]) {
+        SpiceInt* ptr = array;
+        for (SpiceInt i = 0; i < 6; i++) {
            ptr[i] = start + i;
         }
     }
 
-    void out_array2_2(int start, int length, int array[1000][2], int *size) {
-        int *ptr = array;
-        for (int i = 0; i < 2000; i++) {
+    void out_array2_2(SpiceInt start, SpiceInt length, SpiceInt array[1000][2], SpiceInt *size) {
+        SpiceInt *ptr = array;
+        for (SpiceInt i = 0; i < 2000; i++) {
            ptr[i] = start + i;
         }
         *size = length;
     }
 
-    void out_array2_3(int start, int length1, int length2, int **result, int *size1, int *size2) {
-        int *ptr = NULL;
+    void out_array2_3(SpiceInt start, SpiceInt length1, SpiceInt length2, SpiceInt **result, SpiceInt *size1, SpiceInt *size2) {
+        SpiceInt *ptr = NULL;
         if (start >= 0) {
-            ptr = PyMem_Malloc(length1 * length2 * sizeof(int));
-            for (int i = 0; i < length1 * length2; i++) {
+            ptr = PyMem_Malloc(length1 * length2 * sizeof(SpiceInt));
+            for (SpiceInt i = 0; i < length1 * length2; i++) {
                 ptr[i] = start + i;
             }
         }
@@ -214,30 +214,30 @@ void out_array01_malloc(double start, int length, double **arrayP, int *size);
         *size2 = length2;
     }
 
-    int out_array2_4(int start, int length, int dim1, int *size1, double result[4][5]) {
-        double *ptr = result;
-        for (int i = 0; i < 20; i++) {
+    SpiceInt out_array2_4(SpiceInt start, SpiceInt length, SpiceInt dim1, SpiceInt *size1, SpiceDouble result[4][5]) {
+        SpiceDouble *ptr = result;
+        for (SpiceInt i = 0; i < 20; i++) {
             ptr[i] = start + i;
         }
         *size1 = length;
         return dim1;
     }
 
-    void out_array2_5(int length, int *size1, SpiceBoolean result[4][5]) {
+    void out_array2_5(SpiceInt length, SpiceInt *size1, SpiceBoolean result[4][5]) {
         *size1 = length;
         SpiceBoolean *ptr = result;
-        for (int i = 0; i < 20; i++) {
+        for (SpiceInt i = 0; i < 20; i++) {
             ptr[i] = (i % 3) == 0;
         }
     }
 
 
-    void out_array12_1(int start, int length1, int length2, int **result, int *size1, int *size2) {
-        int *ptr = NULL;
+    void out_array12_1(SpiceInt start, SpiceInt length1, SpiceInt length2, SpiceInt **result, SpiceInt *size1, SpiceInt *size2) {
+        SpiceInt *ptr = NULL;
         if (start >= 0) {
-            int xlength1 = max(length1, 1);
-            ptr = PyMem_Malloc(xlength1 * length2 * sizeof(int));
-            for (int i = 0; i < xlength1 * length2; i++) {
+            SpiceInt xlength1 = max(length1, 1);
+            ptr = PyMem_Malloc(xlength1 * length2 * sizeof(SpiceInt));
+            for (SpiceInt i = 0; i < xlength1 * length2; i++) {
                 ptr[i] = start + i;
             }
         }
@@ -246,13 +246,13 @@ void out_array01_malloc(double start, int length, double **arrayP, int *size);
         *size2 = length2;
     }
 
-    void out_array23_1(int start, int length1, int length2, int length3,
-                       double **result, int *size1, int *size2, int *size3) {
-        double *ptr = NULL;
+    void out_array23_1(SpiceInt start, SpiceInt length1, SpiceInt length2, SpiceInt length3,
+                       SpiceDouble **result, SpiceInt *size1, SpiceInt *size2, SpiceInt *size3) {
+        SpiceDouble *ptr = NULL;
         if (start >= 0) {
-            int xlength1 = max(length1, 1);
-            ptr = PyMem_Malloc(xlength1 * length2 * length3 * sizeof(double));
-            for (int i = 0; i < xlength1 * length2; i++) {
+            SpiceInt xlength1 = max(length1, 1);
+            ptr = PyMem_Malloc(xlength1 * length2 * length3 * sizeof(SpiceDouble));
+            for (SpiceInt i = 0; i < xlength1 * length2; i++) {
                 ptr[i] = start + i;
             }
         }
@@ -263,79 +263,79 @@ void out_array01_malloc(double start, int length, double **arrayP, int *size);
     }
 %}
 
-%apply (int OUT_ARRAY2[ANY][ANY]) {(int array[2][3])};
-void out_array2_1(int start, int array[2][3]);
+%apply (SpiceInt OUT_ARRAY2[ANY][ANY]) {(SpiceInt array[2][3])};
+void out_array2_1(SpiceInt start, SpiceInt array[2][3]);
 
-%apply (int OUT_ARRAY2[ANY][ANY], int *SIZE1) {(int array[1000][2], int *size)};
-void out_array2_2(int start, int length, int array[1000][2], int *size);
+%apply (SpiceInt OUT_ARRAY2[ANY][ANY], SpiceInt *SIZE1) {(SpiceInt array[1000][2], SpiceInt *size)};
+void out_array2_2(SpiceInt start, SpiceInt length, SpiceInt array[1000][2], SpiceInt *size);
 
-%apply (int **OUT_ARRAY2, int *SIZE1, int *SIZE2) {(int **result, int *size1, int *size2)};
-void out_array2_3(int start, int length1, int length2, int **result, int *size1, int *size2);
+%apply (SpiceInt **OUT_ARRAY2, SpiceInt *SIZE1, SpiceInt *SIZE2) {(SpiceInt **result, SpiceInt *size1, SpiceInt *size2)};
+void out_array2_3(SpiceInt start, SpiceInt length1, SpiceInt length2, SpiceInt **result, SpiceInt *size1, SpiceInt *size2);
 
-%apply (int DIM1, int *SIZE1, double OUT_ARRAY2[ANY][ANY]) {(int dim1, int *size1, double result[4][5])};
-int out_array2_4(int start, int length, int dim1, int *size1, double result[4][5]);
+%apply (SpiceInt DIM1, SpiceInt *SIZE1, SpiceDouble OUT_ARRAY2[ANY][ANY]) {(SpiceInt dim1, SpiceInt *size1, SpiceDouble result[4][5])};
+SpiceInt out_array2_4(SpiceInt start, SpiceInt length, SpiceInt dim1, SpiceInt *size1, SpiceDouble result[4][5]);
 
-%apply (int *SIZE1, SpiceBoolean OUT_ARRAY2[ANY][ANY]) {(int *size1, SpiceBoolean result[4][5])}
-void out_array2_5(int length, int *size1, SpiceBoolean result[4][5]);
+%apply (SpiceInt *SIZE1, SpiceBoolean OUT_ARRAY2[ANY][ANY]) {(SpiceInt *size1, SpiceBoolean result[4][5])}
+void out_array2_5(SpiceInt length, SpiceInt *size1, SpiceBoolean result[4][5]);
 
-%apply (int **OUT_ARRAY12, int *SIZE1, int *SIZE2) {(int **result, int *size1, int *size2)};
-void out_array12_1(int start, int length1, int length2, int **result, int *size1, int *size2);
+%apply (SpiceInt **OUT_ARRAY12, SpiceInt *SIZE1, SpiceInt *SIZE2) {(SpiceInt **result, SpiceInt *size1, SpiceInt *size2)};
+void out_array12_1(SpiceInt start, SpiceInt length1, SpiceInt length2, SpiceInt **result, SpiceInt *size1, SpiceInt *size2);
 
-%apply (double **OUT_ARRAY23, int *SIZE1, int *SIZE2, int *SIZE3) {(double **result, int *size1, int *size2, int *size3)};
-void out_array23_1(int start, int length1, int length2, int length3, double **result, int *size1, int *size2, int *size3);
+%apply (SpiceDouble **OUT_ARRAY23, SpiceInt *SIZE1, SpiceInt *SIZE2, SpiceInt *SIZE3) {(SpiceDouble **result, SpiceInt *size1, SpiceInt *size2, SpiceInt *size3)};
+void out_array23_1(SpiceInt start, SpiceInt length1, SpiceInt length2, SpiceInt length3, SpiceDouble **result, SpiceInt *size1, SpiceInt *size2, SpiceInt *size3);
 
 
 
 %{
-    int const_string_0(const char *string) {
-        return (int) strlen(string);
+    SpiceInt const_string_0(const SpiceChar *string) {
+        return (SpiceInt) strlen(string);
     }
 
-    int const_char_0(char value) {
-        return (int)value;
+    SpiceInt const_char_0(SpiceChar value) {
+        return (SpiceInt)value;
     }
 
-    void inout_string_10(int dim, char* result) {
+    void inout_string_10(SpiceInt dim, SpiceChar* result) {
         sprintf(result, "%d", dim);
     }
 
-    void inout_string_ptr(int dim, char* result) {
+    void inout_string_ptr(SpiceInt dim, SpiceChar* result) {
         sprintf(result, "%d", dim);
     }
 
-    void out_string(int value, char* result) {
+    void out_string(SpiceInt value, SpiceChar* result) {
         sprintf(result, "%d", value);
     }
 %}
 
-%apply (char *CONST_STRING) {(const char *string)};
-int const_string_0(const char *string);
+%apply (SpiceChar *CONST_STRING) {(const SpiceChar *string)};
+SpiceInt const_string_0(const SpiceChar *string);
 
-%apply (char IN_STRING) {(char value)};
-int const_char_0(char value);
+%apply (SpiceChar IN_STRING) {(SpiceChar value)};
+SpiceInt const_char_0(SpiceChar value);
 
-%apply (int DIM1, char INOUT_STRING[ANY]) {(int dim, char result[10])};
-void inout_string_10(int dim, char result[10]);
+%apply (SpiceInt DIM1, SpiceChar INOUT_STRING[ANY]) {(SpiceInt dim, SpiceChar result[10])};
+void inout_string_10(SpiceInt dim, SpiceChar result[10]);
 
-%apply (int DIM1, char *INOUT_STRING) {(int dim, char* result)};
-void inout_string_ptr(int dim, char *result);
+%apply (SpiceInt DIM1, SpiceChar *INOUT_STRING) {(SpiceInt dim, SpiceChar* result)};
+void inout_string_ptr(SpiceInt dim, SpiceChar *result);
 
-%apply (char OUT_STRING[ANY]) {(char result[10])};
-void out_string(int value, char result[10]);
+%apply (SpiceChar OUT_STRING[ANY]) {(SpiceChar result[10])};
+void out_string(SpiceInt value, SpiceChar result[10]);
 
 %{
-    PyObject* in_strings(const char *strings, int dim1, int dim2) {
+    PyObject* in_strings(const SpiceChar *strings, SpiceInt dim1, SpiceInt dim2) {
         PyObject* result = PyTuple_New(dim1 + 1);
-        for (int i = 0; i < dim1; i++) {
+        for (SpiceInt i = 0; i < dim1; i++) {
             PyTuple_SetItem(result, i, Py_BuildValue("s", strings + i * dim2));
         }
         PyTuple_SetItem(result, dim1, Py_BuildValue("ii", dim1, dim2));
         return result;
     }
 
-    PyObject* out_strings(int length, int dim1, int dim2, int *size, char* buffer) {
-        for (int i = 0; i < length; i++) {
-            char* ptr = buffer + i * dim2;
+    PyObject* out_strings(SpiceInt length, SpiceInt dim1, SpiceInt dim2, SpiceInt *size, SpiceChar* buffer) {
+        for (SpiceInt i = 0; i < length; i++) {
+            SpiceChar* ptr = buffer + i * dim2;
             memset(ptr, 0, dim1);
             memset(ptr, 'a' + i, i + 1);
         }
@@ -344,39 +344,39 @@ void out_string(int value, char result[10]);
     }
 %}
 
-%apply (char *IN_STRINGS, int DIM1, int DIM2) {(const char *strings, int dim1, int dim2)};
-PyObject* in_strings(const char *strings, int dim1, int dim2);
+%apply (SpiceChar *IN_STRINGS, SpiceInt DIM1, SpiceInt DIM2) {(const SpiceChar *strings, SpiceInt dim1, SpiceInt dim2)};
+PyObject* in_strings(const SpiceChar *strings, SpiceInt dim1, SpiceInt dim2);
 
-%apply (int DIM1, int DIM2, int *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY]) {(int dim1, int dim2, int *size, char buffer[50][256])};
-PyObject* out_strings(int length, int dim1, int dim2, int *size, char buffer[50][256]);
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceInt *NSTRINGS, SpiceChar OUT_STRINGS[ANY][ANY]) {(SpiceInt dim1, SpiceInt dim2, SpiceInt *size, SpiceChar buffer[50][256])};
+PyObject* out_strings(SpiceInt length, SpiceInt dim1, SpiceInt dim2, SpiceInt *size, SpiceChar buffer[50][256]);
 
 %{
-    void double_in_out_array(int dim1, int *array) {
-        for (int i = 0; i < dim1; i++) {
+    void double_in_out_array(SpiceInt dim1, SpiceInt *array) {
+        for (SpiceInt i = 0; i < dim1; i++) {
             array[i] *= 2;
         }
     }
 
 %}
 
-%apply (int DIM1, int *INOUT_ARRAY1) {(int dim1, int *array)}
-void double_in_out_array(int dim1, int *array);
+%apply (SpiceInt DIM1, SpiceInt *INOUT_ARRAY1) {(SpiceInt dim1, SpiceInt *array)}
+void double_in_out_array(SpiceInt dim1, SpiceInt *array);
 
 %{
-    void sort_strings(int rows, int columns, char* array) {
+    void sort_strings(SpiceInt rows, SpiceInt columns, SpiceChar* array) {
         qsort(array, rows, columns, strcmp);
     }
 %}
 
-%apply (int DIM1, int DIM2, char *INOUT_STRINGS) {(int rows, int columns, char* array)};
-void sort_strings(int rows, int columns, char* array);
+%apply (SpiceInt DIM1, SpiceInt DIM2, SpiceChar *INOUT_STRINGS) {(SpiceInt rows, SpiceInt columns, SpiceChar* array)};
+void sort_strings(SpiceInt rows, SpiceInt columns, SpiceChar* array);
 
 %{
-    const char* return_string(void) {
+    const SpiceChar* return_string(void) {
        return "hello";
     }
 
-    int return_boolean(int value) {
+    SpiceInt return_boolean(SpiceInt value) {
         return value;
     }
 
@@ -385,35 +385,35 @@ void sort_strings(int rows, int columns, char* array);
 
 %}
 
-%apply (char *RETURN_STRING) {const char* return_string};
-const char* return_string();
+%apply (SpiceChar *RETURN_STRING) {const SpiceChar* return_string};
+const SpiceChar* return_string();
 
-%apply (int RETURN_BOOLEAN) {int return_boolean};
-int return_boolean(int value);
+%apply (SpiceInt RETURN_BOOLEAN) {SpiceInt return_boolean};
+SpiceInt return_boolean(SpiceInt value);
 
 %apply (void RETURN_VOID_SIGERR) {void return_sigerr};
 void return_sigerr(void);
 
 %{
-    void outvar_set_from_var_int(int in, SpiceInt* out) { *out = in; }
+    void outvar_set_from_var_int(SpiceInt in, SpiceInt* out) { *out = in; }
     void outvar_set_from_var_float(float in, SpiceFloat* out) { *out = in; }
-    void outvar_set_from_var_double(double in, SpiceDouble* out) { *out = in; }
-    void outvar_set_from_var_char(char in, SpiceChar *out) { *out = in; }
-    void outvar_set_from_var_bool(int in, SpiceBoolean *out) { *out = in; }
+    void outvar_set_from_var_double(SpiceDouble in, SpiceDouble* out) { *out = in; }
+    void outvar_set_from_var_char(SpiceChar in, SpiceChar *out) { *out = in; }
+    void outvar_set_from_var_bool(SpiceInt in, SpiceBoolean *out) { *out = in; }
 %}
 
-void outvar_set_from_var_int(int INPUT, SpiceInt* OUTPUT);
+void outvar_set_from_var_int(SpiceInt INPUT, SpiceInt* OUTPUT);
 void outvar_set_from_var_float(float INPUT, SpiceFloat* OUTPUT);
-void outvar_set_from_var_double(double INPUT, SpiceDouble* OUTPUT);
-void outvar_set_from_var_char(char INPUT, SpiceChar *OUTPUT);
-void outvar_set_from_var_bool(int INPUT, SpiceBoolean *OUTPUT);
+void outvar_set_from_var_double(SpiceDouble INPUT, SpiceDouble* OUTPUT);
+void outvar_set_from_var_char(SpiceChar INPUT, SpiceChar *OUTPUT);
+void outvar_set_from_var_bool(SpiceInt INPUT, SpiceBoolean *OUTPUT);
 
 %{
     void sized_array_plain(SpiceInt *array) {}
 
-    int sized_array_no_resize(SpiceDouble *array, SpiceInt in_size) { return in_size; }
+    SpiceInt sized_array_no_resize(SpiceDouble *array, SpiceInt in_size) { return in_size; }
 
-    int sized_array_with_resize(SpiceInt *array, SpiceInt in_size, SpiceInt *out_size, SpiceInt new_size) {
+    SpiceInt sized_array_with_resize(SpiceInt *array, SpiceInt in_size, SpiceInt *out_size, SpiceInt new_size) {
         *out_size = new_size > in_size ? in_size : new_size;
         return in_size;
     }
@@ -423,8 +423,8 @@ void outvar_set_from_var_bool(int INPUT, SpiceBoolean *OUTPUT);
 void sized_array_plain(SpiceInt SIZED_INOUT_ARRAY1[]);
 
 %apply (SpiceInt SIZED_INOUT_ARRAY1[], SpiceInt DIM1) {(SpiceInt *array, SpiceInt in_size)};
-int sized_array_no_resize(SpiceInt SIZED_INOUT_ARRAY1[], SpiceInt DIM1);
+SpiceInt sized_array_no_resize(SpiceInt SIZED_INOUT_ARRAY1[], SpiceInt DIM1);
 
 %apply (SpiceInt SIZED_INOUT_ARRAY1[], SpiceInt DIM1, SpiceInt *SIZE1) {(SpiceInt *array, SpiceInt in_size, SpiceInt *out_size)};
-int sized_array_with_resize(SpiceInt *array, SpiceInt in_size, SpiceInt *out_size, SpiceInt new_size);
+SpiceInt sized_array_with_resize(SpiceInt *array, SpiceInt in_size, SpiceInt *out_size, SpiceInt new_size);
 


Test patch:
diff --git a/unittests/test_build_sanity.py b/unittests/test_build_sanity.py
new file mode 100644
index 00000000..02a5f139
--- /dev/null
+++ b/unittests/test_build_sanity.py
@@ -0,0 +1,50 @@
+import pytest
+import inspect
+
+import cspyce.cspyce1 as cspyce1
+
+"""
+This file contains tests of the build process
+"""
+
+def test_sane_argnames_and_signatures():
+    """
+    For every function in cspyce1, it has the ARGNAMES attribute iff it has the SIGNATURE
+    attribute.  The ARGNAMES attribute, the SIGNATURE attribute, and the actual length
+    of the function's parameters must be identical.
+    """
+
+    # This function finds as many errors as it can, rather than reporting them one by one.
+    errors = []
+    for name, func in vars(cspyce1).items():
+        if callable(func):
+            argnames = getattr(func, 'ARGNAMES', None)
+            signature = getattr(func, 'SIGNATURE', None)
+
+            if argnames is None and signature is None:
+                # We're not interested
+                continue
+
+            if argnames is None or signature is None:
+                if argnames is None:
+                    errors.append(f"cs1.{name}.ARGNAMES is missing")
+                else:
+                    errors.append(f"cs1.{name}.SIGNATURE is missing")
+                continue
+
+            # Both argnames and signature are non-NULL
+            parameters = inspect.signature(func).parameters
+
+            if len(argnames) != len(parameters):
+                error = f"cs1.{name}.ARGNAMES has length {len(argnames)} but " \
+                        f"actually takes {len(parameters)} arguments."
+                errors.append(error)
+
+            if len(argnames) != len(signature):
+                errors.append(f'cs1.{name}.ARGNAMES has length {len(argnames)}; '
+                              f'cs1.{name}.SIGNATURE has length {len(signature)}.')
+
+    if errors:
+        error_message = "These functions may have bad Typemaps:\n" + "\n".join(errors)
+        pytest.fail(error_message)
+