2 # Copyright (c) 2023 by the citadel.org team
3 # This program is open source software. Use, duplication, or disclosure
4 # is subject to the terms of the GNU General Public License, version 3.
6 # Source our data structures from the real live working code
7 SERVER_H=server/server.h
10 tail +1 ${SERVER_H} > /dev/null 2>&1
15 # Generate the "32-bit" versions of these structures.
16 # Note that this is specifically for converting "32-bit to 64-bit" -- NOT "any-to-any"
18 start_line=$(cat ${SERVER_H} | egrep -n "^struct $1 {" | cut -d: -f1)
19 tail ${tail_opt} +${start_line} ${SERVER_H} | sed '/};/q' \
20 | sed s/"^struct $1 {"/"struct ${1}_32 {"/g \
21 | sed s/"long "/"int32_t "/g \
22 | sed s/"time_t "/"int32_t "/g \
23 | sed s/"size_t "/"int32_t "/g \
24 | sed s/"struct ExpirePolicy "/"struct ExpirePolicy_32 "/g
29 # Here we go. Let's make this thing happen.
32 echo '// This file was automatically generated by ctdl3264_prep.sh'
33 echo '// Attempting to modify it would be an exercise in futility.'
36 convert_struct "ctdluser"
37 convert_struct "ExpirePolicy"
38 convert_struct "ctdlroom"
39 convert_struct "floor"
40 convert_struct "visit"
41 convert_struct "visit_index"
42 convert_struct "MetaData"
43 convert_struct "CtdlCompressHeader"
44 convert_struct "UseTable"
46 ) >utils/ctdl3264_structs.h