1 | /********************************************************************* |
2 | * |
3 | * This is based on code created by Peter Harvey, |
4 | * (pharvey@codebydesign.com). |
5 | * |
6 | * Modified and extended by Nick Gorham |
7 | * (nick@lurcher.org). |
8 | * |
9 | * Any bugs or problems should be considered the fault of Nick and not |
10 | * Peter. |
11 | * |
12 | * copyright (c) 1999 Nick Gorham |
13 | * |
14 | * This library is free software; you can redistribute it and/or |
15 | * modify it under the terms of the GNU Lesser General Public |
16 | * License as published by the Free Software Foundation; either |
17 | * version 2 of the License, or (at your option) any later version. |
18 | * |
19 | * This library is distributed in the hope that it will be useful, |
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
22 | * Lesser General Public License for more details. |
23 | * |
24 | * You should have received a copy of the GNU Lesser General Public |
25 | * License along with this library; if not, write to the Free Software |
26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
27 | * |
28 | ********************************************************************** |
29 | * |
30 | * $Id: __stats.h,v 1.2 2005/02/01 10:24:24 lurcher Exp $ |
31 | * |
32 | * $Log: __stats.h,v $ |
33 | * Revision 1.2 2005/02/01 10:24:24 lurcher |
34 | * Cope if SHLIBEXT is not set |
35 | * |
36 | * Revision 1.1.1.1 2001/10/17 16:40:09 lurcher |
37 | * |
38 | * First upload to SourceForge |
39 | * |
40 | * Revision 1.1 2000/12/18 11:53:51 martin |
41 | * |
42 | * handle statistic API. |
43 | * |
44 | * |
45 | **********************************************************************/ |
46 | |
47 | #ifndef UNIXODBC__STATS_H |
48 | #define UNIXODBC__STATS_H 1 |
49 | |
50 | #include <stdio.h> |
51 | #include <sys/types.h> |
52 | #ifdef HAVE_SYS_STAT_H |
53 | #include <sys/stat.h> |
54 | #endif |
55 | |
56 | typedef struct uodbc_stats_proc |
57 | { |
58 | pid_t pid; /* process ID */ |
59 | long n_env; /* # of henvs */ |
60 | long n_dbc; /* # of hdbcs */ |
61 | long n_stmt; /* # of hstmts */ |
62 | long n_desc; /* # of hdescs */ |
63 | } uodbc_stats_proc_t; |
64 | |
65 | typedef struct uodbc_stats |
66 | { |
67 | int n_pid; /* # of PIDs attached */ |
68 | uodbc_stats_proc_t perpid[20]; |
69 | } uodbc_stats_t; |
70 | |
71 | typedef struct uodbc_stats_handle |
72 | { |
73 | char id[5]; /* identifier */ |
74 | # define UODBC_STATS_ID "UODBC" |
75 | int sem_id; /* sempahore ID */ |
76 | int shm_id; /* shared memory ID */ |
77 | uodbc_stats_t *stats; /* ptr to stats in shared mem */ |
78 | pid_t pid; |
79 | } uodbc_stats_handle_t; |
80 | |
81 | int uodbc_update_stats(void *rh, |
82 | unsigned int type, |
83 | void *value); |
84 | #define UODBC_STATS_TYPE_TYPE_MASK 0xffff |
85 | #define UODBC_STATS_TYPE_HENV 1 |
86 | #define UODBC_STATS_TYPE_HDBC 2 |
87 | #define UODBC_STATS_TYPE_HSTMT 3 |
88 | #define UODBC_STATS_TYPE_HDESC 4 |
89 | #endif /* UNIXODBC__STATS_H */ |
90 | |