# HG changeset patch # User Matti Hamalainen # Date 1455527301 -7200 # Node ID 55d99dc7c35c52e58b760010bd06cc72a36e9c3d # Parent c7ecf56d23e7bb524040cfdf299ce88c72310f07 Prepare for some possible future enhancements by specifying a type for each data field. diff -r c7ecf56d23e7 -r 55d99dc7c35c sidinfo.c --- a/sidinfo.c Mon Feb 15 10:36:26 2016 +0200 +++ b/sidinfo.c Mon Feb 15 11:08:21 2016 +0200 @@ -12,6 +12,13 @@ // Some constants #define SET_SLDB_FILENAME "Songlengths.txt" +enum +{ + OTYPE_OTHER = 0, + OTYPE_STR = 1, + OTYPE_INT = 2, +}; + typedef struct { @@ -33,32 +40,34 @@ { char *name; char *lname; + int type; } PSFOption; static const PSFOption optPSOptions[] = { - { "Filename" , NULL }, - { "Type" , NULL }, - { "Version" , NULL }, - { "PlayerType" , "Player type" }, - { "PlayerCompat" , "Player compatibility" }, - { "VideoClock" , "Video clock speed" }, - { "SIDModel" , "SID model" }, + { "Filename" , NULL , OTYPE_STR }, + { "Type" , NULL , OTYPE_STR }, + { "Version" , NULL , OTYPE_STR }, + { "PlayerType" , "Player type" , OTYPE_STR }, + { "PlayerCompat" , "Player compatibility" , OTYPE_STR }, + { "VideoClock" , "Video clock speed" , OTYPE_STR }, + { "SIDModel" , "SID model" , OTYPE_STR }, - { "DataOffs" , "Data offset" }, - { "DataSize" , "Data size" }, - { "LoadAddr" , "Load address" }, - { "InitAddr" , "Init address" }, - { "PlayAddr" , "Play address" }, - { "Songs" , "Songs" }, - { "StartSong" , "Start song" }, - { "Name" , NULL }, - { "Author" , NULL }, - { "Copyright" , NULL }, - { "Hash" , NULL }, + { "DataOffs" , "Data offset" , OTYPE_INT }, + { "DataSize" , "Data size" , OTYPE_INT }, + { "LoadAddr" , "Load address" , OTYPE_INT }, + { "InitAddr" , "Init address" , OTYPE_INT }, + { "PlayAddr" , "Play address" , OTYPE_INT }, + { "Songs" , "Songs" , OTYPE_INT }, + { "StartSong" , "Start song" , OTYPE_INT }, - { "Songlengths" , "Song lengths" }, + { "Name" , NULL , OTYPE_STR }, + { "Author" , NULL , OTYPE_STR }, + { "Copyright" , NULL , OTYPE_STR }, + { "Hash" , NULL , OTYPE_OTHER }, + + { "Songlengths" , "Song lengths" , OTYPE_OTHER }, }; static const int noptPSOptions = sizeof(optPSOptions) / sizeof(optPSOptions[0]);