Hi Steven,
the patch is very simple. It allows application to convert priority and
facilities back and forward from id to string and viceversa.
It is useful to have for some applications that only knows about id and
needs to set info with names.
Please apply.
Thanks
Fabio
--
I'm going to make him an offer he can't refuse.
Index: trunk/exec/logsys.c
===================================================================
--- trunk/exec/logsys.c (revision 1525)
+++ trunk/exec/logsys.c (working copy)
@@ -140,6 +140,18 @@
return (-1);
}
+char *logsys_facility_name_get (unsigned int facility)
+{
+ unsigned int i;
+
+ for (i = 0; facilitynames[i].c_name != NULL; i++) {
+ if (facility == facilitynames[i].c_val) {
+ return (facilitynames[i].c_name);
+ }
+ }
+ return (NULL);
+}
+
int logsys_priority_id_get (const char *name)
{
unsigned int i;
@@ -152,7 +164,7 @@
return (-1);
}
-static inline char *logsys_priority_name_get (unsigned int priority)
+char *logsys_priority_name_get (unsigned int priority)
{
unsigned int i;
Index: trunk/exec/logsys.h
===================================================================
--- trunk/exec/logsys.h (revision 1525)
+++ trunk/exec/logsys.h (working copy)
@@ -121,9 +121,15 @@
extern int logsys_facility_id_get (
const char *name);
+extern char *logsys_facility_name_get (
+ unsigned int facility);
+
extern int logsys_priority_id_get (
const char *name);
+extern char *logsys_priority_name_get (
+ unsigned int priority);
+
extern void logsys_flush (void);
extern void logsys_atsegv (void);
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais