-
Notifications
You must be signed in to change notification settings - Fork 1
/
fstab.h
66 lines (53 loc) · 2.24 KB
/
fstab.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/***************************************************************************
fstab.c - Access the /etc/fstab file
-------------------
begin : Mon Dec 26 2004
copyright : (C) 2004 by Markus Raab
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the BSD License (revised). *
* *
***************************************************************************/
/***************************************************************************
* *
* This is a backend that takes /etc/fstab file as its backend storage. *
* The kdbGet() method will parse /etc/fstab and generate a *
* valid key tree. The kdbSet() method will take a KeySet with valid *
* filesystem keys and print an equivalent regular fstab in stdout. *
* *
***************************************************************************/
#ifndef FSTAB_H
#define FSTAB_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef GETMNTENT_GLIBC
#include <mntent.h>
#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <kdbbackend.h>
#define BACKENDNAME "fstab"
#define BACKENDVERSION "0.0.1"
#define BACKENDDESCR "Parses files in a syntax like /etc/fstab"
#define FSTAB_PATH "/etc/fstab"
int kdbbWriteLock (FILE *f);
int kdbbReadLock (FILE *f);
int kdbbUnlock (FILE *f);
int kdbOpen_fstab(KDB *handle);
int kdbClose_fstab(KDB *handle);
ssize_t kdbGet_fstab(KDB *handle, KeySet *ks, const Key *parentKey);
ssize_t kdbSet_fstab(KDB *handle, KeySet *ks, const Key *parentKey);
KDBEXPORT(fstab);
#endif