All FreeBASIC Code
All FreeBASIC Code
I'm thinking of starting a new version of the ABC, but for FB code. I'd appriciate any opinions etc. I've got a prototype done which i'll post up later when ive fished some of the worst spaghetti out.
-
- Posts: 142
- Joined: May 27, 2005 6:13
ive been playing around and have a file format sorted but am wondering how to go about getting snippits to make a release. Should i just trawl the forums, or ask for submissions? obviously it would be easier to take submissions, and it would give authors the chance to give it a final check, but trawling would yield more.
Anyway heres my file format as it stands. any suggestions would be good. At the moment it compresses .bas files but leaves others untouched as trying to recompress zips (which i guess would be the other main format) is pointless. Also i am i two minds about how to deal with category. using a string would give future proof i guess to add more categorys.
ID 5 Bytes "AFBC" (Null terminated)
NumSnippets 2 Bytes unsigned number of snippets in packet
[ (offset table for snippits)
Offset NumSnippets * 4 Bytes unsigned offset to snippit info
]
At each offset
[
ID 1 Byte "@" used for checking valid
FileNameLen 2 Bytes unsigned len of FileSize
FileName 1 * FileNameLen Bytes Filename (not null terminated)
SubjectLen 2 Bytes unsigned len of Subject
Subject 1 * SubjectLen Bytes Subject (not null terminated)
AuthorLen 2 Bytes unsigned len of Author
Author 1 * AuthorLen Bytes Author (not null terminated)
CategoryLen 2 Bytes unsigned len of Category
Category 1 * CategoryLen Bytes Category (not null terminated)
CRC32 4 Bytes unsigned CRC32 of file
NormalSize 4 Bytes unsigned size of file
CompressedSize 4 Bytes unsigned size actually used (if same as normal size then data is uncompressed)
]
Data 1 * CompressedSize Bytes Files Data (can be compressed or plain, check if compressedsize = normalsize)
Anyway heres my file format as it stands. any suggestions would be good. At the moment it compresses .bas files but leaves others untouched as trying to recompress zips (which i guess would be the other main format) is pointless. Also i am i two minds about how to deal with category. using a string would give future proof i guess to add more categorys.
ID 5 Bytes "AFBC" (Null terminated)
NumSnippets 2 Bytes unsigned number of snippets in packet
[ (offset table for snippits)
Offset NumSnippets * 4 Bytes unsigned offset to snippit info
]
At each offset
[
ID 1 Byte "@" used for checking valid
FileNameLen 2 Bytes unsigned len of FileSize
FileName 1 * FileNameLen Bytes Filename (not null terminated)
SubjectLen 2 Bytes unsigned len of Subject
Subject 1 * SubjectLen Bytes Subject (not null terminated)
AuthorLen 2 Bytes unsigned len of Author
Author 1 * AuthorLen Bytes Author (not null terminated)
CategoryLen 2 Bytes unsigned len of Category
Category 1 * CategoryLen Bytes Category (not null terminated)
CRC32 4 Bytes unsigned CRC32 of file
NormalSize 4 Bytes unsigned size of file
CompressedSize 4 Bytes unsigned size actually used (if same as normal size then data is uncompressed)
]
Data 1 * CompressedSize Bytes Files Data (can be compressed or plain, check if compressedsize = normalsize)