Magellan Linux

Annotation of /trunk/mkinitrd-magellan/klibc/usr/kinit/kinit.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 1484 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 niro 532 /*
2     * kinit/kinit.h
3     */
4    
5     #ifndef KINIT_H
6     #define KINIT_H
7    
8     #include <stddef.h>
9     #include <stdio.h>
10     #include <sys/types.h>
11    
12     int do_mounts(int argc, char *argv[]);
13     int mount_nfs_root(int argc, char *argv[], int flags);
14     int ramdisk_load(int argc, char *argv[], dev_t root_dev);
15     void md_run(int argc, char *argv[]);
16     const char *bdevname(dev_t dev);
17    
18     extern int mnt_procfs;
19     extern int mnt_sysfs;
20    
21     extern int init_argc;
22     extern char **init_argv;
23     extern const char *progname;
24    
25     char *get_arg(int argc, char *argv[], const char *name);
26     int get_flag(int argc, char *argv[], const char *name);
27    
28     int getintfile(const char *path, long *val);
29    
30     ssize_t readfile(const char *path, char **pptr);
31     ssize_t freadfile(FILE *f, char **pptr);
32    
33     /*
34     * min()/max() macros that also do
35     * strict type-checking.. See the
36     * "unnecessary" pointer comparison.
37     * From the Linux kernel.
38     */
39     #define min(x,y) ({ \
40     typeof(x) _x = (x); \
41     typeof(y) _y = (y); \
42     (void) (&_x == &_y); \
43     _x < _y ? _x : _y; })
44    
45     #define max(x,y) ({ \
46     typeof(x) _x = (x); \
47     typeof(y) _y = (y); \
48     (void) (&_x == &_y); \
49     _x > _y ? _x : _y; })
50    
51     #define INI_DEBUG
52    
53     #undef DEBUG
54     #ifdef INI_DEBUG
55     #define DEBUG(x) printf x
56     #else
57     #define DEBUG(x) do { } while (0)
58     #endif
59    
60     #ifdef INI_DEBUG
61     void dump_args(int argc, char *argv[]);
62     #else
63     static inline void dump_args(int argc, char *argv[])
64     {
65     (void)argc;
66     (void)argv;
67     }
68     #endif
69    
70     #endif /* KINIT_H */