1 /*
2  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*
7  * This file was generated during make.
8  */
9 
10 #include <fm/libfmevent.h>
11 
12 static const char *_fmev_errstrs[] = {
13 	"Error details unknown " /* FMEVERR_UNKNOWN */,
14 	"Library ABI version incompatible with caller " /* FMEVERR_VERSION_MISMATCH */,
15 	"Library API usage violation " /* FMEVERR_API */,
16 	"Failed to allocate additional resources " /* FMEVERR_ALLOC */,
17 	"Event contents are inconsistent or corrupt " /* FMEVERR_MALFORMED_EVENT */,
18 	"Operation would overflow result type " /* FMEVERR_OVERFLOW */,
19 	"Internal library error " /* FMEVERR_INTERNAL */,
20 	"Insufficient permissions or privilege " /* FMEVERR_NOPRIV */,
21 	"Resource is busy " /* FMEVERR_BUSY */,
22 	"Duplicate request " /* FMEVERR_DUPLICATE */,
23 	"Bad event class or class pattern " /* FMEVERR_BADCLASS */,
24 	"No match to criteria provided " /* FMEVERR_NOMATCH */,
25 	"Exceeds maximum subscribers per handle " /* FMEVERR_MAX_SUBSCRIBERS */,
26 	"Argument is invalid " /* FMEVERR_INVALIDARG */,
27 	"String argument exceeds maximum length " /* FMEVERR_STRING2BIG */,
28 	"Varargs list bad or incorrectly terminated " /* FMEVERR_VARARGS_MALFORMED */,
29 	"Varargs list exceeds maximum length " /* FMEVERR_VARARGS_TOOLONG */,
30 	"Ruleset selected for publication is bad " /* FMEVERR_BADRULESET */,
31 	"Priority selected for publication is bad " /* FMEVERR_BADPRI */,
32 	"Error in underlying event transport implementation " /* FMEVERR_TRANSPORT */,
33 	"nvlist argument is not of type NV_UNIQUE_NAME " /* FMEVERR_NVLIST */,
34 };
35 
36 static const int _fmev_nerrs =
37     sizeof (_fmev_errstrs) / sizeof (_fmev_errstrs[0]);
38 
39 const char *
40 fmev_strerror(fmev_err_t err)
41 {
42 	const char *s;
43 
44 	if (err >= FMEVERR_UNKNOWN && (err - FMEVERR_UNKNOWN < _fmev_nerrs))
45 		s = _fmev_errstrs[err - FMEVERR_UNKNOWN];
46 	else
47 		s = _fmev_errstrs[0];
48 
49 	return (s);
50 }
51