Пример #1
0
void platform_init_OT() {

    buffers_init(); //buffers init must be first in order to do core dumps
    vl_init();      //Veelite init must be second

    radio_init();   //radio init third

    sys_init();     //system init last
}
Пример #2
0
/*!
  @brief   Return list of \c stat(2) information on a file.
  @ingroup system_io

  @param   file Filename to stat.
  If \c NULL, stat information from the most recent \c stat(2) call is
  used.

  @return  List of stat info (pointer to internal buffer).
  @retval  NULL if the file doesn't exist.

  The list contains the following entries:
      -# device number of filesystem
      -# inode number
      -# file mode (type and permissions)
      -# number of (hard) links to the file
      -# numeric user ID of file's owner
      -# numer group ID of file's owner
      -# the device identifier (special files only)
      -# total size of file, in bytes
      -# last access time since the epoch
      -# last modify time since the epoch
      -# inode change time (NOT creation time!) since the epoch
      -# preferred blocksize for file system I/O
      -# actual number of blocks allocated
*/
vlist *
v_stat(char *file)
{
    static vlist *l = NULL;

    /* Get stat info */
    STAT_FILE(file);
    if (!statok)
        return NULL;

    /* Initialise */
    vl_init(l);

    /* Store info */
    vl_istore(l,  0, (int) statbuf.st_dev);
    vl_istore(l,  1, statbuf.st_ino);
    vl_istore(l,  2, statbuf.st_mode);
    vl_istore(l,  3, statbuf.st_nlink);
    vl_istore(l,  4, statbuf.st_uid);
    vl_istore(l,  5, statbuf.st_gid);

#ifdef HAVE_STRUCT_STAT_ST_RDEV
    vl_istore(l,  6, (int) statbuf.st_rdev);
#endif

    vl_istore(l,  7, statbuf.st_size);
    vl_istore(l,  8, statbuf.st_atime);
    vl_istore(l,  9, statbuf.st_mtime);
    vl_istore(l, 10, statbuf.st_ctime);

#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
    vl_istore(l, 11, statbuf.st_blksize);
#endif

#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
    vl_istore(l, 12, statbuf.st_blocks);
#endif

    return l;
}