4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 %#pragma ident "%Z%%M% %I% %E% SMI"
32 %#ifndef _DB_LOG_ENTRY_H
33 %#define _DB_LOG_ENTRY_H
36 %/* A log entry that describes an action to be performed and its parameters. */
40 #if RPC_HDR || RPC_XDR
42 %#include "db_vers_c.h"
43 %#include "db_query_c.h"
44 %#include "db_entry_c.h"
47 %#include "db_query.h"
48 %#include "db_entry.h"
52 #if RPC_HDR || RPC_XDR
55 vers aversion; /* version of log entry */
56 db_action action; /* action to be invoked */
57 db_query *query; /* query supplied with action (if any) */
58 entry_object *object; /* object involved in action (if any) */
59 struct db_log_entry *next; /* Used in constructing list */
60 vers bversion; /* sanity check */
62 typedef struct db_log_entry* db_log_entry_p;
69 % vers aversion; /* version of log entry */
70 % db_action action; /* action to be invoked */
71 % db_query *query; /* query supplied with action (if any) */
72 % entry_object *object; /* object involved in action (if any) */
73 % db_log_entry *next; /* Used in constructing list */
74 % vers bversion; /* sanity check */
77 %/*Constructor: Create an empty log entry, with no query and not object */
78 % db_log_entry() { query = NULL, object = NULL; next = NULL; }
80 %/*Constructor: Create a log entry using the given parameters. Note that
81 % pointers to db_query and entry_object are simply assigned, not copied. */
82 % db_log_entry( db_action, vers *, db_query *, entry_object*);
86 %/* Print to stdout this log entry */
89 %/* Accessor: return version of log entry */
90 % vers *get_version() { return( &aversion ); }
92 %/* Accessor: return pointer to action of log entry */
93 % db_action get_action() { return( action ); }
95 %/* Accessor: return pointer to query part of log entry */
96 % db_query *get_query() { return( query ); }
98 %/* Predicate: return whether log entry is complete and not truncated */
99 % bool_t sane() { return( aversion.equal( &bversion ) ); }
101 %/* Accessor: return pointer to copy of object in log entry */
102 % entry_object *get_object() { return( object ); }
104 %/* Accessor: return pointer to copy of object in log entry */
105 % db_log_entry * getnextptr() { return( next ); }
107 %/* Accessor: return pointer to copy of object in log entry */
108 % void setnextptr( db_log_entry *p ) { next = p; }
111 %extern "C" bool_t xdr_db_log_entry(XDR*, db_log_entry*);
113 %extern bool_t xdr_db_log_entry(XDR*, db_log_entry*);
115 %typedef class db_log_entry * db_log_entry_p;
120 db_log_entry_p list<>;
124 %#endif /* _DB_LOG_ENTRY_H */