Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

andhandler.h

Go to the documentation of this file.
00001 
00002 /*
00003 ** Copyright (C) 2004 Russell Leighton
00004 **
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
00009 **
00010 ** This program is distributed in the hope that it will be useful,
00011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ** GNU General Public License for more details.
00014 **
00015 ** You should have received a copy of the GNU General Public License
00016 ** along with this program; if not, write to the Free Software
00017 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 
00021  
00022 #ifndef __AWHANDLER_AND__
00023 #define __AWHANDLER_AND__
00024 
00025 #include <stdio.h>
00026 
00027 #include "monitor.h"
00028 
00029 #include "wire.h"
00030 
00032 /*\@{*/
00033 
00087 /* 
00088 Changes:
00089 
00090 */
00091 
00095 typedef struct {
00096 
00097   aw_event_sig_t
00098    complete,                 /* completed successfully */
00099    time;                     /* completed successfully and this is how long it took */
00100 
00101 } aw_andhandler_cevents_t;
00102 
00106 typedef struct {
00107 
00108   aw_timestamp_t
00109    starttime;
00110 
00111 } aw_andhandler_state_t ;
00112 
00116 typedef struct {
00117 
00118   aw_address_t
00119    id;
00120 
00121   u_int32_t
00122    val;
00123 
00124 }  aw_andhandler_reg_t;
00125 
00126 
00130 typedef struct {
00131 
00132   aw_handler_t
00133    handler_header;
00134 
00135   aw_andhandler_cevents_t
00136    cevents;
00137 
00138   byte_t 
00139    *desc;
00140 
00141   aw_andhandler_state_t 
00142    state;
00143 
00144   /* used in wrapper that traps regevent calls */
00145   int32_t (*orig_regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index);
00146 
00147   /* table that keeps track of events */
00148   u_int32_t
00149    nregistered;
00150   aw_andhandler_reg_t
00151    *registered;
00152 
00153 } aw_andhandler_t;
00154 
00164 aw_andhandler_t *aw_create_andhandler(const aw_andhandler_cevents_t *cevents,
00165                                       const byte_t *desc,
00166                                       int32_t (*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00167                                       int32_t (*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00168                                       aw_logger_t *aware_logger);
00169 
00170 
00175 void aw_free_andhandler(aw_andhandler_t *h);
00176 
00177 
00181 aw_handler_t *aw_wire_andhandler(aw_wire_mkhandler_args_t *args);
00182 
00183 /*\@}*/
00184 #endif
00185 
00186 
00187 
00188 
00189 
00190 
00191 
00192 
00193 
00194 
00195 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)