~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/serialise/imrect.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #include <stdio.h>
  2 #include <stdlib.h>
  3 #include <tina/sys.h>
  4 #include <tina/sysfuncs.h>
  5 
  6 void    narray_ts_print(Varptrptr d, int m1, int n1, int m2, int n2, Vartype type);
  7 List   *narray_ts_serialise(List * lg, Varptrptr d,
  8                         int m1, int n1, int m2, int n2, Vartype type);
  9 List   *narray_ts_deserialise(List * lg, Varptrptr * d,
 10                         int m1, int n1, int m2, int n2, Vartype type);
 11 
 12 void    Imrect_ts_print(Imrect * im)
 13 {
 14     Varptrptr vp;
 15 
 16     ts_print(im);
 17     vp.char_v = (char **) im->data;
 18     mprintf(" _extra_ {");
 19     narray_ts_print(vp,
 20                     im->region->ly, im->region->lx,
 21                     im->region->uy, im->region->ux,
 22                     im->vtype);
 23     mprintf("}Imrect;");
 24 }
 25 
 26 List   *Imrect_ts_serialise(List * lg, Imrect * im)
 27 {
 28     Varptrptr vp;
 29 
 30     vp.char_v = (char **) im->data;
 31     if (serialise_tagged_item(&lg, im, sizeof(Imrect)) == 1)
 32         if (im->data)           /* any image data? */
 33             lg = narray_ts_serialise(lg, vp,
 34                                      im->region->ly, im->region->lx,
 35                                      im->region->uy, im->region->ux,
 36                                      im->vtype);
 37     return lg;
 38 }
 39 
 40 List   *Imrect_ts_deserialise(List * lg, Imrect ** im)
 41 {
 42     if (deserialise_tagged_item(&lg, (void **) im) == 1)
 43     {
 44         Imrect *i = *im;
 45 
 46         if (i->data)            /* was there any data? */
 47         {
 48             Varptrptr *vpp;
 49 
 50             vpp = (Varptrptr *) & (i->data);
 51             lg = narray_ts_deserialise(lg, vpp,
 52                                        i->region->ly, i->region->lx,
 53                                        i->region->uy, i->region->ux,
 54                                        i->vtype);
 55         }
 56     }
 57     return lg;
 58 }
 59 
 60 void    Imrect_ts_free(Imrect * im)
 61 {
 62   ts_free_gen(im->props);
 63   narray_free(im->data,
 64               im->region->ly, im->region->lx,
 65               im->region->uy, im->region->ux,
 66               var_size(im->vtype));
 67   ts_free_gen(im->region);
 68   rfree(im);
 69 }
 70 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.