Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d0230904
Commit
d0230904
authored
Sep 05, 2007
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
32
git-svn-id:
file:///svn/tokudb@261
c7de825b-a66e-492c-adef-691d508d4ae1
parent
1d54aef5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
10 deletions
+18
-10
buildheader/make_db_h.c
buildheader/make_db_h.c
+12
-4
buildheader/sample_offsets.c
buildheader/sample_offsets.c
+1
-1
buildheader/sample_offsets_32.h
buildheader/sample_offsets_32.h
+5
-5
No files found.
buildheader/make_db_h.c
View file @
d0230904
...
...
@@ -34,10 +34,9 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo *
// int total32 = fields32[N-1].size;
// int total64 = fields32[N-1].size;
printf
(
"struct __toku_%s {
\n
"
,
structname
);
for
(
i
=
0
;
i
<
N
-
1
;
i
++
)
{
for
(
i
=
0
;
i
<
N
;
i
++
)
{
unsigned
int
this_32
=
fields32
[
i
].
off
;
unsigned
int
this_64
=
fields64
[
i
].
off
;
assert
(
strcmp
(
fields32
[
i
].
decl
,
fields64
[
i
].
decl
)
==
0
);
//fprintf(stderr, "this32=%d current32=%d this64=%d current64=%d\n", this_32, current_32, this_64, current_64);
if
(
this_32
>
current_32
||
this_64
>
current_64
)
{
unsigned
int
diff32
=
this_32
-
current_32
;
...
...
@@ -64,9 +63,15 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo *
current_64
=
this_64
;
}
if
(
this_32
<
current_32
||
this_64
<
current_64
)
{
printf
(
"Whoops
\n
"
);
printf
(
"Whoops
this_32=%d this_64=%d
\n
"
,
this_32
,
this_64
);
}
if
(
i
+
1
<
N
)
{
assert
(
strcmp
(
fields32
[
i
].
decl
,
fields64
[
i
].
decl
)
==
0
);
printf
(
" %s; /* 32-bit offset=%d size=%d, 64=bit offset=%d size=%d */
\n
"
,
fields32
[
i
].
decl
,
fields32
[
i
].
off
,
fields32
[
i
].
size
,
fields64
[
i
].
off
,
fields64
[
i
].
size
);
}
else
{
assert
(
fields32
[
i
].
decl
==
0
);
assert
(
fields64
[
i
].
decl
==
0
);
}
current_32
+=
fields32
[
i
].
size
;
current_64
+=
fields64
[
i
].
size
;
}
...
...
@@ -94,6 +99,9 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
assert
(
sizeof
(
dbc_fields32
)
==
sizeof
(
dbc_fields64
));
print_struct
(
"dbc"
,
1
,
dbc_fields32
,
dbc_fields64
,
sizeof
(
dbc_fields32
)
/
sizeof
(
dbc_fields32
[
0
]));
assert
(
sizeof
(
db_env_fields32
)
==
sizeof
(
db_env_fields64
));
print_struct
(
"db_env"
,
1
,
db_env_fields32
,
db_env_fields64
,
sizeof
(
db_env_fields32
)
/
sizeof
(
db_env_fields32
[
0
]));
printf
(
"#if defined(__cplusplus)
\n
}
\n
#endif
\n
"
);
printf
(
"#endif
\n
"
);
return
0
;
...
...
buildheader/sample_offsets.c
View file @
d0230904
...
...
@@ -46,7 +46,7 @@ void sort_and_dump_fields (const char *structname, unsigned int sizeofstruct) {
for
(
i
=
0
;
i
<
field_counter
;
i
++
)
{
fprintf
(
outf
,
" {
\"
%s
\"
, %d, %d},
\n
"
,
fields
[
i
].
decl
,
fields
[
i
].
off
,
fields
[
i
].
size
);
}
fprintf
(
outf
,
" {0,
0, %d} /* size of whole struct */
\n
"
,
sizeofstruct
);
fprintf
(
outf
,
" {0,
%d, %d} /* size of whole struct */
\n
"
,
sizeofstruct
,
sizeofstruct
);
fprintf
(
outf
,
"};
\n
"
);
}
...
...
buildheader/sample_offsets_32.h
View file @
d0230904
...
...
@@ -13,7 +13,7 @@ struct fieldinfo db_fields32[] = {
{
"int (*set_flags) (DB *, u_int32_t)"
,
380
,
4
},
{
"int (*stat) (DB *, void *, u_int32_t)"
,
396
,
4
},
{
"int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))"
,
412
,
4
},
{
0
,
0
,
484
}
/* size of whole struct */
{
0
,
484
,
484
}
/* size of whole struct */
};
struct
fieldinfo
dbt_fields32
[]
=
{
{
"void*data"
,
0
,
4
},
...
...
@@ -21,18 +21,18 @@ struct fieldinfo dbt_fields32[] = {
{
"u_int32_t ulen"
,
8
,
4
},
{
"void*app_private"
,
20
,
4
},
{
"u_int32_t flags"
,
24
,
4
},
{
0
,
0
,
28
}
/* size of whole struct */
{
0
,
28
,
28
}
/* size of whole struct */
};
struct
fieldinfo
db_txn_fields32
[]
=
{
{
"int (*commit) (DB_TXN*, u_int32_t)"
,
80
,
4
},
{
"u_int32_t (*id) (DB_TXN *)"
,
88
,
4
},
{
0
,
0
,
104
}
/* size of whole struct */
{
0
,
104
,
104
}
/* size of whole struct */
};
struct
fieldinfo
dbc_fields32
[]
=
{
{
"int (*c_close) (DBC *)"
,
204
,
4
},
{
"int (*c_del) (DBC *, u_int32_t)"
,
212
,
4
},
{
"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)"
,
220
,
4
},
{
0
,
0
,
268
}
/* size of whole struct */
{
0
,
268
,
268
}
/* size of whole struct */
};
struct
fieldinfo
db_env_fields32
[]
=
{
{
"int (*close) (DB_ENV *, u_int32_t)"
,
248
,
4
},
...
...
@@ -55,5 +55,5 @@ struct fieldinfo db_env_fields32[] = {
{
"int (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int)"
,
460
,
4
},
{
"int (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)"
,
552
,
4
},
{
"int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t)"
,
564
,
4
},
{
0
,
0
,
584
}
/* size of whole struct */
{
0
,
584
,
584
}
/* size of whole struct */
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment