Hello, All:

      What references exist on how to link to C?


I'm familiar with sections 5.2 and 5.6 of the "Writing R Extension" manual plus chapter 6 of Venables and Ripley (2000) S Programming (Springer). From these, I get the following:


R storage mode   C type
logical          int *
integer          int *
double           double *
complex          Rcomplex *
character        char **
raw              unsigned char *
list             SEXP *
R object         SEXP


"integer" and "int" are 32 bits. If I understand correctly, "short" has only 16 bits = 2 bytes.


Should I define any "short" vector in C as a matrix with 2 rows of type either "raw" or "char"?


      Thanks,
      Spencer


p.s. I need this to link to lossless JPEG code obtained from "ftp.cs.cornell.edu/pub/multimed/ljpg.tar.Z"


--
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567
web:  www.structuremonitoring.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to