Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Use a typedef to define the prototype of the per-sensor call...



details:   https://anonhg.NetBSD.org/src/rev/0796141eb88e
branches:  trunk
changeset: 753811:0796141eb88e
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Apr 11 01:12:28 2010 +0000

description:
Use a typedef to define the prototype of the per-sensor callback.

Update manpage for the prototype, and fix a fubar'd Cross-reference.

diffstat:

 share/man/man9/sysmon_envsys.9 |  8 +++-----
 sys/dev/sysmon/sysmon_envsys.c |  9 ++++-----
 sys/dev/sysmon/sysmonvar.h     |  9 +++++----
 3 files changed, 12 insertions(+), 14 deletions(-)

diffs (82 lines):

diff -r e3d3825aaecd -r 0796141eb88e share/man/man9/sysmon_envsys.9
--- a/share/man/man9/sysmon_envsys.9    Sat Apr 10 22:53:59 2010 +0000
+++ b/share/man/man9/sysmon_envsys.9    Sun Apr 11 01:12:28 2010 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sysmon_envsys.9,v 1.39 2010/04/10 21:10:10 wiz Exp $
+.\"    $NetBSD: sysmon_envsys.9,v 1.40 2010/04/11 01:12:28 pgoyette Exp $
 .\"
 .\" Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -50,9 +50,7 @@
 .Ft void
 .Fn sysmon_envsys_sensor_event "struct sysmon_envsys *" "envsys_data_t *" "int"
 .Ft void
-.Fn sysmon_envsys_foreach_sensor \
-"bool (*)(const struct sysmon_envsys *" "const envsys_data_t *" "void *)" \
-"void *" "bool"
+.Fn sysmon_envsys_foreach_sensor "sysmon_envsys_callback_t" "void *" "bool"
 .Ft int
 .Fn sysmon_envsys_update_limits "struct sysmon_envsys *" "envsys_data_t *"
 .Sh DESCRIPTION
@@ -120,7 +118,7 @@
 function can be used by other parts of the kernel to iterate over all
 registered sensors.
 This capability is used by the
-.X3 i386/apm 4
+.Xr i386/apm 4
 driver to summarize the state of all battery sensors.
 .Pp
 Drivers can also call the
diff -r e3d3825aaecd -r 0796141eb88e sys/dev/sysmon/sysmon_envsys.c
--- a/sys/dev/sysmon/sysmon_envsys.c    Sat Apr 10 22:53:59 2010 +0000
+++ b/sys/dev/sysmon/sysmon_envsys.c    Sun Apr 11 01:12:28 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysmon_envsys.c,v 1.106 2010/04/10 19:01:00 pgoyette Exp $     */
+/*     $NetBSD: sysmon_envsys.c,v 1.107 2010/04/11 01:12:28 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.106 2010/04/10 19:01:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.107 2010/04/11 01:12:28 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -2039,9 +2039,8 @@
  *     device's sensors are skipped.
  */
 void   
-sysmon_envsys_foreach_sensor(bool(*func)(const struct sysmon_envsys *,
-                                        const envsys_data_t *, void*),
-                            void *arg, bool refresh)
+sysmon_envsys_foreach_sensor(sysmon_envsys_callback_t func, void *arg,
+                            bool refresh)
 {
        struct sysmon_envsys *sme;
        envsys_data_t *sensor;
diff -r e3d3825aaecd -r 0796141eb88e sys/dev/sysmon/sysmonvar.h
--- a/sys/dev/sysmon/sysmonvar.h        Sat Apr 10 22:53:59 2010 +0000
+++ b/sys/dev/sysmon/sysmonvar.h        Sun Apr 11 01:12:28 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysmonvar.h,v 1.38 2010/04/01 12:16:14 pgoyette Exp $  */
+/*     $NetBSD: sysmonvar.h,v 1.39 2010/04/11 01:12:28 pgoyette Exp $  */
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -208,9 +208,10 @@
 void   sysmon_envsys_sensor_event(struct sysmon_envsys *, envsys_data_t *,
                                   int);
 
-void   sysmon_envsys_foreach_sensor(bool(*)(const struct sysmon_envsys *,
-                                            const envsys_data_t *, void*),
-                                    void *, bool);
+typedef        bool (*sysmon_envsys_callback_t)(const struct sysmon_envsys *,
+                                        const envsys_data_t *, void*);
+
+void   sysmon_envsys_foreach_sensor(sysmon_envsys_callback_t, void *, bool);
 
 int    sysmon_envsys_update_limits(struct sysmon_envsys *, envsys_data_t *);
 



Home | Main Index | Thread Index | Old Index