comp.lang.ada
 help / color / mirror / Atom feed
* Trying to import a C function
@ 2003-11-06 10:07 Preben Randhol
  2003-11-06 10:40 ` Lutz Donnerhacke
  2003-11-06 14:48 ` Steve
  0 siblings, 2 replies; 13+ messages in thread
From: Preben Randhol @ 2003-11-06 10:07 UTC (permalink / raw)


Hi

Firstly I didn't manage to get florist (posix binding) to compile so
that is why I'm trying to bind this myself.

I only want to use the C stat function to find the modification date and
access time of files.

   int stat(const char *file_name, struct stat *buf);

My question is about the struct the stat function returns.

     struct stat {
         dev_t         st_dev;      /* device */
         ino_t         st_ino;      /* inode */
         mode_t        st_mode;     /* protection */
         nlink_t       st_nlink;    /* number of hard links */
         uid_t         st_uid;      /* user ID of owner */
         gid_t         st_gid;      /* group ID of owner */
         dev_t         st_rdev;     /* device type (if inode device) */
         off_t         st_size;     /* total size, in bytes */
         blksize_t     st_blksize;  /* blocksize for filesystem I/O */
         blkcnt_t      st_blocks;   /* number of blocks allocated */
         time_t        st_atime;    /* time of last access */
         time_t        st_mtime;    /* time of last modification */
         time_t        st_ctime;    /* time of last status change */
     };

After much digging I found:

   /usr/include/sys/types.h:

      typedef __dev_t dev_t;

   /usr/include/bits/types.h:

      typedef __DEV_T_TYPE __dev_t; 

   /usr/include/bits/typesizes.h:

      #define __DEV_T_TYPE           __UQUAD_TYPE

   /usr/include/bits/types.h:

      #define    __UQUAD_TYPE            unsigned long long int


So in short

      typedef unsigned long long int dev_t;

right?

Now what is the equivalent of unsigned long long int in Ada?

I don't find the info from florist, becuase it looks like you have to
manage to compile it to generate the sources needed.

System: Debian GNU/Linux on i686

Thanks in advance.

Preben

--------------------------
Compile error from florist:

gcc -O2 -DVERSION="\"Florist-3.15p  (20020604)\"" -DLIBS="\"-lresolv -lnsl -lrt -lpthread \"" -o c-posix c-posix.c -lresolv -lnsl -lrt -lpthread
c-posix.c:6347:17: missing terminating " character
c-posix.c: In function `create_c':
c-posix.c:6348: error: syntax error before "POSIX_String"
c-posix.c:6348: error: stray '\' in program
c-posix.c:6348:32: missing terminating " character
c-posix.c:6349: error: `n' undeclared (first use in this function)
c-posix.c:6349: error: (Each undeclared identifier is reported only once
c-posix.c:6349: error: for each function it appears in.)
make: *** [c-posix] Error 1



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-11-11  8:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-06 10:07 Trying to import a C function Preben Randhol
2003-11-06 10:40 ` Lutz Donnerhacke
2003-11-06 16:05   ` Preben Randhol
2003-11-07 15:02     ` Adrian Knoth
2003-11-07 15:13       ` Preben Randhol
2003-11-10 14:39     ` Lutz Donnerhacke
2003-11-10 16:10       ` Preben Randhol
2003-11-10 16:45         ` Adrian Knoth
2003-11-06 14:48 ` Steve
2003-11-06 17:11   ` Warren W. Gay VE3WWG
2003-11-07  8:44     ` Preben Randhol
2003-11-10 17:39       ` Warren W. Gay VE3WWG
2003-11-11  8:26         ` Preben Randhol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox