- char *dir; /* "/sys" or "/" */
- char *spec_device; /* "LABEL=/" or "none" or "proc" or "/dev/hda1" */
- char *device; /* "none" or "proc" or "/dev/hda1" */
- char *type; /* "sysfs" or "ext3" */
- char *options; /* "rw,noatime,commit=600,quota,grpquota" */
- cu_mount_t *next;
+ char *dir; /* "/sys" or "/" */
+ char *spec_device; /* "LABEL=/" or "none" or "proc" or "/dev/hda1" */
+ char *device; /* "none" or "proc" or "/dev/hda1" */
+ char *type; /* "sysfs" or "ext3" */
+ char *options; /* "rw,noatime,commit=600,quota,grpquota" */
+ cu_mount_t *next;
- If *list is NULL, a new list is created and *list is
- set to point to the first entry.
+ If *list is NULL, a new list is created and *list is
+ set to point to the first entry.
- If *list is not NULL, the list of mountpoints is appended
- and *list is not changed.
+ If *list is not NULL, the list of mountpoints is appended
+ and *list is not changed.
- The cu_mount_getlist() function returns a pointer to
- the last entry of the list, or NULL if an error has
- occured.
+ The cu_mount_getlist() function returns a pointer to
+ the last entry of the list, or NULL if an error has
+ occured.
- The cu_mount_checkoption() function is a replacement of
- char *hasmntopt(const struct mntent *mnt, const char *opt).
- In fact hasmntopt() just looks for the first occurrence of the
- characters at opt in mnt->mnt_opts. cu_mount_checkoption()
- checks for the *option* keyword in line, starting at the
- first character of line or after a ','.
+ The cu_mount_checkoption() function is a replacement of
+ char *hasmntopt(const struct mntent *mnt, const char *opt).
+ In fact hasmntopt() just looks for the first occurrence of the
+ characters at opt in mnt->mnt_opts. cu_mount_checkoption()
+ checks for the *option* keyword in line, starting at the
+ first character of line or after a ','.
- If full is not 0 then also the end of keyword has to match
- either the end of line or a ',' after keyword.
+ If full is not 0 then also the end of keyword has to match
+ either the end of line or a ',' after keyword.
- The cu_mount_checkoption() function returns a pointer into
- string line if a match of keyword is found. If no match is
- found cu_mount_checkoption() returns NULL.
+ The cu_mount_checkoption() function returns a pointer into
+ string line if a match of keyword is found. If no match is
+ found cu_mount_checkoption() returns NULL.
- full should be set to 0 when matching options like: rw, quota,
- noatime. Set full to 1 when matching options like: loop=,
- gid=, commit=.
+ full should be set to 0 when matching options like: rw, quota,
+ noatime. Set full to 1 when matching options like: loop=,
+ gid=, commit=.
- If line is "rw,usrquota,grpquota", keyword is "quota", NULL
- will be returned (independend of full).
+ If line is "rw,usrquota,grpquota", keyword is "quota", NULL
+ will be returned (independend of full).
- If line is "rw,usrquota,grpquota", keyword is "usrquota",
- a pointer to "usrquota,grpquota" is returned (independend
- of full).
+ If line is "rw,usrquota,grpquota", keyword is "usrquota",
+ a pointer to "usrquota,grpquota" is returned (independend
+ of full).
- If line is "rw,loop=/dev/loop1,quota", keyword is "loop="
- and full is 0, then a pointer to "loop=/dev/loop1,quota"
- is returned. If full is not 0 then NULL is returned. But
- maybe you might want to try cu_mount_getoptionvalue()...
+ If line is "rw,loop=/dev/loop1,quota", keyword is "loop="
+ and full is 0, then a pointer to "loop=/dev/loop1,quota"
+ is returned. If full is not 0 then NULL is returned. But
+ maybe you might want to try cu_mount_getoptionvalue()...
- The cu_mount_getoptionvalue() function can be used to grab
- a VALUE out of a mount option (line) like:
- loop=VALUE
- whereas "loop=" is the keyword.
+ The cu_mount_getoptionvalue() function can be used to grab
+ a VALUE out of a mount option (line) like:
+ loop=VALUE
+ whereas "loop=" is the keyword.
- If the cu_mount_getoptionvalue() function can find the option
- keyword in line, then memory is allocated for the value of
- that option and a pointer to that value is returned.
+ If the cu_mount_getoptionvalue() function can find the option
+ keyword in line, then memory is allocated for the value of
+ that option and a pointer to that value is returned.
- Internally it calls cu_mount_checkoption(), then it
- allocates memory for VALUE and returns a pointer to that
- string. So *do not forget* to free() the memory returned
- after use!!!
+ Internally it calls cu_mount_checkoption(), then it
+ allocates memory for VALUE and returns a pointer to that
+ string. So *do not forget* to free() the memory returned
+ after use!!!