diff options
author | Michael Brown | 2013-07-22 17:13:25 +0200 |
---|---|---|
committer | Michael Brown | 2013-07-22 17:16:11 +0200 |
commit | b87020a0908669446796b83d57eaa2c093419621 (patch) | |
tree | 9c63e3ae5d0b5251811367d61b537516c96f7c2a /src/core/parseopt.c | |
parent | [settings] Remove now-unused store_named_setting() (diff) | |
download | ipxe-b87020a0908669446796b83d57eaa2c093419621.tar.gz ipxe-b87020a0908669446796b83d57eaa2c093419621.tar.xz ipxe-b87020a0908669446796b83d57eaa2c093419621.zip |
[parseopt] Allow parsed option to be modified
Parsing a setting name requires the ability to modify the text being
parsed.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/parseopt.c')
-rw-r--r-- | src/core/parseopt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/parseopt.c b/src/core/parseopt.c index 659d20ee..1ae5d9b2 100644 --- a/src/core/parseopt.c +++ b/src/core/parseopt.c @@ -59,7 +59,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); * @ret value String value * @ret rc Return status code */ -int parse_string ( const char *text, const char **value ) { +int parse_string ( char *text, char **value ) { /* Sanity check */ assert ( text != NULL ); @@ -77,7 +77,7 @@ int parse_string ( const char *text, const char **value ) { * @ret value Integer value * @ret rc Return status code */ -int parse_integer ( const char *text, unsigned int *value ) { +int parse_integer ( char *text, unsigned int *value ) { char *endp; /* Sanity check */ @@ -100,7 +100,7 @@ int parse_integer ( const char *text, unsigned int *value ) { * @ret netdev Network device * @ret rc Return status code */ -int parse_netdev ( const char *text, struct net_device **netdev ) { +int parse_netdev ( char *text, struct net_device **netdev ) { /* Sanity check */ assert ( text != NULL ); @@ -122,7 +122,7 @@ int parse_netdev ( const char *text, struct net_device **netdev ) { * @ret menu Menu * @ret rc Return status code */ -int parse_menu ( const char *text, struct menu **menu ) { +int parse_menu ( char *text, struct menu **menu ) { /* Find menu */ *menu = find_menu ( text ); @@ -145,7 +145,7 @@ int parse_menu ( const char *text, struct menu **menu ) { * @ret flag Flag to set * @ret rc Return status code */ -int parse_flag ( const char *text __unused, int *flag ) { +int parse_flag ( char *text __unused, int *flag ) { /* Set flag */ *flag = 1; @@ -160,7 +160,7 @@ int parse_flag ( const char *text __unused, int *flag ) { * @ret key Key * @ret rc Return status code */ -int parse_key ( const char *text, unsigned int *key ) { +int parse_key ( char *text, unsigned int *key ) { /* Interpret single characters as being a literal key character */ if ( text[0] && ! text[1] ) { @@ -198,7 +198,7 @@ int reparse_options ( int argc, char **argv, struct command_descriptor *cmd, char shortopts[ cmd->num_options * 3 /* possible "::" */ + 1 /* "h" */ + 1 /* NUL */ ]; unsigned int shortopt_idx = 0; - int ( * parse ) ( const char *text, void *value ); + int ( * parse ) ( char *text, void *value ); void *value; unsigned int i; unsigned int j; |