3 * (C) Copyright 2007-2011 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
5 * This file is released under the GPLv2. See the COPYING file for more
11 static void copy_fn
(char *dst
, char *src
)
15 len
= strnlen
(src
, 8);
19 memset
(dst
+ len
, ' ', 8 - len
);
22 static void __logo
(int local
, u64 devtype
, char *fn
, char *ft
)
29 logo
= malloc
(sizeof
(struct logo
), ZONE_NORMAL
);
33 INIT_LIST_HEAD
(&logo
->list
);
34 INIT_LIST_HEAD
(&logo
->lines
);
36 /* save the <conn, devtype, fn, ft> pair */
39 logo
->conn
= LOGO_CONN_LOCAL
;
43 logo
->devtype
= devtype
;
45 copy_fn
(logo
->fn
, fn
);
46 copy_fn
(logo
->ft
, ft
);
48 list_add_tail
(&logo
->list
, &sysconf.logos
);
58 static void __rdev
(u64 devnum
, u64 devtype
)
60 assert
(devtype
<= 0xffff);
61 assert
(devnum
<= 0xffff);
63 FIXME
("save the <devnum,devtype> pair");
66 static void __oper_con
(u64 devnum
)
68 assert
(devnum
<= 0xffff);
70 sysconf.oper_con
= devnum
;
73 static void __oper_userid
(char *name
)
75 strncpy
(sysconf.oper_userid
, name
, 8);
76 sysconf.oper_userid
[8] = '\0';
79 static void __direct
(char *fn
, char *ft
)
81 copy_fn
(sysconf.direct_fn
, fn
);
82 copy_fn
(sysconf.direct_ft
, ft
);
94 %token OPERATOR RDEV LOGO CONSOLE USERID LOCAL DIRECTORY
103 stmt
: OPERATOR CONSOLE NUM NLINE
{ __oper_con
($3); }
104 | OPERATOR USERID WORD NLINE
{ __oper_userid
($3);
107 | OPERATOR USERID OPERATOR NLINE
{ __oper_userid
("OPERATOR"); }
108 | RDEV NUM NUM NLINE
{ __rdev
($2, $3); }
109 | LOGO LOCAL NUM WORD WORD NLINE
{ __logo
(1, $3, $4, $5);
113 | LOGO LOCAL NUM WORD LOGO NLINE
{ __logo
(1, $3, $4, "LOGO");
116 | DIRECTORY WORD WORD NLINE
{ __direct
($2, $3);