driver/*.c: Add response for get_arg("mmc-supported?")

example/*.c: remove compiler wranings.
This commit is contained in:
R. Bernstein
2010-01-17 05:54:02 -05:00
parent eeb59ad3d4
commit 0297656be1
6 changed files with 42 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
/*
$Id: aix.c,v 1.3 2008/04/22 15:29:11 karl Exp $
Copyright (C) 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2004, 2005, 2006, 2008, 2010 Rocky Bernstein <rocky@gnu.org>
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
@@ -679,6 +679,13 @@ _cdio_malloc_and_zero(size_t size) {
}
#endif
static bool
is_mmc_supported(void *user_data)
{
_img_private_t *env = user_data;
return (_AM_NONE == env->access_mode) ? false : true;
}
/*!
Return the value associated with the key "arg".
*/
@@ -696,6 +703,8 @@ get_arg_aix (void *p_user_data, const char key[])
case _AM_NONE:
return "no access method";
}
} else if (!strcmp (key, "mmc-supported?")) {
return is_mmc_supported(env) ? "true" : "false";
}
return NULL;
}

View File

@@ -1,7 +1,5 @@
/*
$Id: image_common.c,v 1.15 2008/04/22 15:29:12 karl Exp $
Copyright (C) 2004, 2005, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2004, 2005, 2008, 2010 Rocky Bernstein <rocky@gnu.org>
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
@@ -91,6 +89,8 @@ _get_arg_image (void *user_data, const char key[])
return p_env->psz_cue_name;
} else if (!strcmp(key, "access-mode")) {
return "image";
} else if (!strcmp (key, "mmc-supported?")) {
return "false";
}
return NULL;
}

View File

@@ -1,7 +1,5 @@
/*
$Id: netbsd.c,v 1.4 2008/04/22 15:29:12 karl Exp $
Copyright (C) 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2008, 2010 Rocky Bernstein <rocky@gnu.org>
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
@@ -372,6 +370,8 @@ get_arg_netbsd(void *user_data, const char key[])
return _obj->gen.source_name;
} else if (!strcmp(key, "access-mode")) {
return "READ_CD";
} else if (!strcmp (key, "mmc-supported?")) {
return "true" ;
}
return NULL;