lookup.h

00001 /*
00002  * Copyright (c) 2005, Ian Paul Larsen 
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining 
00005  * a copy of this software and associated documentation files (the "Software"), 
00006  * to deal in the Software without restriction, including without limitation 
00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
00008  * and/or sell copies of the Software, and to permit persons to whom the 
00009  * Software is furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included 
00012  * in all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
00017  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
00018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
00019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
00020  * OTHER DEALINGS IN THE SOFTWARE. 
00021  */
00022 
00023 
00024 
00025 #ifndef __LOOKUP_H
00026 #define __LOOKUP_H
00027 
00028 #include "ntw.h"
00029 
00030 struct ntw_callback_data {
00031   int32 data_length;
00032   void *data;
00033 };
00034 
00035 struct ntw_event_table{
00036   func_ptr *event_handler;
00037   int32 *user_data;
00038 };
00039 
00040 struct ntw_widget_table{
00041   int32 id;
00042   int32 type;
00043   void *address;
00044   struct ntw_event_table *ev_table;
00045 };
00046 
00047 int32
00048 ntw_get_next_id();
00049 
00050 void
00051 ntw_bump_next_id(int32 a);
00052 
00053 int
00054 ntw_init_ntw_read_id_table();
00055 
00056 struct ntw_widget_table *
00057 ntw_read_id_table();
00058 
00059 
00060 int
00061 ntw_add_to_id_table(int32 id, int32 type, void *address, struct ntw_event_table *ev_table);
00062 
00063 int 
00064 ntw_remove_from_id_table(int32 id);
00065 
00066 int
00067 ntw_remove_widget_recursive(int32 id);
00068 
00069 struct ntw_widget_table *
00070 ntw_lookup_widget_by_id(int32 id);
00071 
00072 struct ntw_widget_table *
00073 ntw_lookup_widget_by_address(void *address);
00074 
00075 ntwWidget *
00076 ntw_get_widget_by_id(int32 id);
00077 
00078 int
00079 ntw_widget_set_ref_id(ntwWidget *widget, int32 ref_id);
00080 
00081 int32
00082 ntw_widget_get_ref_id(ntwWidget *widget);
00083 
00084 ntwWidget *
00085 ntw_get_widget_by_ref_id(int32 refid);
00086 
00087 int
00088 ntw_save_ref_id_table(FILE *statefile);
00089 
00090 int
00091 ntw_init_callback(char *name, void *address);
00092 
00093 void *
00094 ntw_lookup_callback_address(char *name);
00095 
00096 char *
00097 ntw_lookup_callback_name(void *address);
00098 
00099 
00100 #endif

Generated on Wed Jun 28 17:00:07 2006 for NTW Server C Library by  doxygen 1.4.6