Logo Search packages:      
Sourcecode: sbrsh version File versions  Download package

mount.h

/*
 * Copyright (c) 2003, 2004, 2005 Nokia
 * Author: Timo Savola <tsavola@movial.fi>
 *
 * This program is licensed under GPL (see COPYING for details)
 */

#ifndef MOUNT_H
#define MOUNT_H

#include "types.h"

#define MOUNTS_FILE "/proc/mounts"

typedef enum {
      /** mount info type: NFS */
      MTYPE_NFS  = 1,

      /** mount info type: path should be bound to a mount point */
      MTYPE_BIND = 2,

      /** mount info type: SSH */
      MTYPE_SSH  = 3,
} mtype_t;

struct mount_info_s;
struct mount_s;

/** Describes how stuff should be mounted. */
00030 typedef struct mount_info_s {
      /** Mount type. */
00032       mtype_t type;

      /** Mount point path. */
00035       char *point;

      /** Path to special file or whatever should be mounted... */
00038       char *device;

      /** Options for the mount command (-o). */
00041       char *opts;

      /** Device number of DEVICE (not applicable for MTYPE_BIND). */
00044       dev_t device_dev;
} mount_info_t;

/** An entry in a doubly linked list of mount points. */
00048 typedef struct mount_s {
      struct mount_s *prev;
      struct mount_s *next;

      /** How many processes are using this mount? */
00053       unsigned int usage;

      /** When will the mount expire? Relevant when usage is 0. */
00056       time_t expiration;

      /** Properties of the mount entry. */
00059       struct mount_info_s info;

      /** Device number of POINT (not applicable for MTYPE_BIND). */
00062       dev_t point_dev;
} mount_t;

mount_info_t *mntinfo_alloc(void);
void mntinfo_free(mount_info_t *);
int mntinfo_copy(mount_info_t *, mount_info_t *);
mount_info_t *mntinfo_parse(const char *);
int mntinfo_stat_device(mount_info_t *);
void mntinfo_sort_vec(mount_info_t **);

#endif

Generated by  Doxygen 1.6.0   Back to index