File: part_info.h

package info (click to toggle)
noflushd 2.7.5-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 792 kB
  • ctags: 302
  • sloc: ansic: 2,537; sh: 1,142; makefile: 85
file content (58 lines) | stat: -rw-r--r-- 1,983 bytes parent folder | download | duplicates (5)
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
/*
 * <part_info.h>
 * 
 * (C) 2001 Daniel Kobras <kobras@linux.de>
 * 
 * $Id: part_info.h,v 1.1 2001/07/23 21:35:23 nold Exp $
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */             

#ifndef _NFD_PART_INFO_H
#define _NFD_PART_INFO_H

/* The part_info set is used to query information on all disks and
 * partitions currently available in the system.
 */
typedef struct part_info_s *part_info_t;

/* Initialize and destroy resource infrastructure. */
part_info_t part_info_init(void);
void part_info_release(part_info_t);

/* Reset resources to begin new query. */
void part_info_reset(part_info_t);

/* Advance to next disk and next partition in current disk respectively.
 * Returns zero if no more disks/partitions are available, non-zero
 * otherwise.
 */
int part_info_disk_next(part_info_t);
int part_info_part_next(part_info_t);

/* Query name and device major/minor of current disk/partition entry. These
 * values change with each call to the *next() and *reset() methods.
 */
char *part_info_get_name(part_info_t);
int part_info_get_major(part_info_t);
int part_info_get_minor(part_info_t);

/* Returns true if device names in /proc/partitions follow the devfs
 * naming scheme. May only be used after part_info_init has been called
 * at least once.
 */
int part_info_is_devfs(void);

#endif