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
9 # Generate the "32-bit" versions of these structures.
10 # Note that this is specifically converting "32-bit to 64-bit" -- NOT "any-to-any"
12 start_line=$(cat ${SERVER_H} | egrep -n "^struct $1 {" | cut -d: -f1)
13 tail +${start_line} ${SERVER_H} | sed '/};/q' \
14 | sed s/"^struct $1 {"/"struct ${1}_32 {"/g \
15 | sed s/"long "/"int32_t "/g \
16 | sed s/"time_t "/"int32_t "/g \
17 | sed s/"struct ExpirePolicy "/"struct ExpirePolicy_32 "/g
22 # Here we go. Let's make this thing happen.
25 echo '// This file was automatically generated by ctdl3264_prep.sh'
26 echo '// Attempting to modify it would be an exercise in futility.'
29 convert_struct "ctdluser"
30 convert_struct "ExpirePolicy"
31 convert_struct "ctdlroom"
32 convert_struct "floor"
33 convert_struct "visit"
35 ) >utils/ctdl3264_structs.h