On Tue, Dec 21, 2010 at 04:29:58PM +0000, Matthew D Fleming wrote:
> Author: mdf
> Date: Tue Dec 21 16:29:58 2010
> New Revision: 216616
> URL: http://svn.freebsd.org/changeset/base/216616
> 
> Log:
>   Move the fail_point_entry definition from fail.h to kern_fail.c, which
>   allows putting the enumeration constants of fail point types with the
>   text string that matches them.

[snip]

> +enum fail_point_t {
> +     FAIL_POINT_OFF,         /**< don't fail */
> +     FAIL_POINT_PANIC,       /**< panic */
> +     FAIL_POINT_RETURN,      /**< return an errorcode */
> +     FAIL_POINT_BREAK,       /**< break into the debugger */
> +     FAIL_POINT_PRINT,       /**< print a message */
> +     FAIL_POINT_SLEEP,       /**< sleep for some msecs */
> +     FAIL_POINT_INVALID,     /**< placeholder */
> +};
> +
> +static const char *fail_type_strings[] = {
> +     "off",
> +     "panic",
> +     "return",
> +     "break",
> +     "print",
> +     "sleep",
> +};

FWIW, you can also do this in C99:

static const char *fail_type_strings[] = {
        [FAIL_POINT_OFF] = "off",
};

Cheers,
Stefan
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to