|
- #ifndef __SETTING__
- #define __SETTING__
-
- #module \
- Setting
-
- #define FILE_NAME ("setting.dat")
-
- ; ユーザ ID
- #const USER_ID_OFFSET 0
- #const USER_ID_SIZE 4
-
- ; ユーザのパスコード
- #const USER_PASSCODE_OFFSET (USER_ID_OFFSET + USER_ID_SIZE)
- #const USER_PASSCODE_SIZE 16
-
- ; ユーザの引継ぎコード
- #const USER_INHERITANCE_CODE_OFFSET (USER_PASSCODE_OFFSET + USER_PASSCODE_SIZE)
- #const USER_INHERITANCE_CODE_SIZE 16
-
- #deffunc local \
- Load
- id@User = 0
- SDim pass@User, USER_PASSCODE_SIZE
- SDim inheritanceCode@User, USER_INHERITANCE_CODE_SIZE
-
- Exist FILE_NAME
- If strSize < 0 {
- Save
-
- Return
- }
-
- BLoad FILE_NAME, id@User, USER_ID_SIZE, USER_ID_OFFSET
- BLoad FILE_NAME, pass@User, USER_PASSCODE_SIZE, USER_PASSCODE_OFFSET
- BLoad FILE_NAME, inheritanceCode@User, USER_INHERITANCE_CODE_SIZE, USER_INHERITANCE_CODE_OFFSET
-
- Return
-
- #deffunc local \
- Save \
- local l_dummy
- Exist FILE_NAME
- If strSize < 0 {
- l_dummy = ""
- BSave FILE_NAME, l_dummy, 0
- }
-
- BSave FILE_NAME, id@User, USER_ID_SIZE, USER_ID_OFFSET
- BSave FILE_NAME, pass@User, USER_PASSCODE_SIZE, USER_PASSCODE_OFFSET
- BSave FILE_NAME, inheritanceCode@User, USER_INHERITANCE_CODE_SIZE, USER_INHERITANCE_CODE_OFFSET
-
- Load
-
- Return
-
- #global
-
- #endif ; not __SETTING__
|