more organization

This commit is contained in:
'mr software' 2023-10-08 21:37:55 -07:00
parent 1f7a101e6c
commit 690978a294
10 changed files with 10 additions and 26 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
a.out a.out
mp3
huffcv.awk huffcv.awk
old old

View File

@ -3,11 +3,12 @@
### (it is true) ### (it is true)
# files # files
- dat.h: miscellaneous tables and constants needed by the library
- huffman.h: generated huffman table
- main.c: test application for the library - main.c: test application for the library
- mp3.c: library code - mp3.c: library code
- mp3.h: library header, include this in client code - inc: includes
+ dat.h: miscellaneous tables and constants needed by the library
+ huffman.h: generated huffman table
+ mp3.h: library header, include this in client code
- scr: scripts unneeded to use the library, provided for reference purposes - scr: scripts unneeded to use the library, provided for reference purposes
+ huff: wrapper for huffcvt, generating huffman tables copied to the clipboard from the mp3 specification + huff: wrapper for huffcvt, generating huffman tables copied to the clipboard from the mp3 specification
+ scr/huffcvt.c: changes huffman string format to c array + scr/huffcvt.c: changes huffman string format to c array

1
build Executable file
View File

@ -0,0 +1 @@
cc -Iinc -O3 main.c mp3.c -o mp3

3
huff
View File

@ -1,3 +0,0 @@
echo -e ", {\t\t\t\t\t\t\t// $1"
eval `wl-paste|sed 's/^/\.\/huffcvt /g;s/$/;/g'`
echo -ne '\t}'

View File

@ -1,16 +0,0 @@
#include <string.h>
#include <stdio.h>
unsigned long btoi(char* s) {
unsigned long r = 0;
int l = strlen(s) - 1;
for(int i = l; i >= 0; i--) {
r <<= 1;
r |= (s[l-i]-'0');
}
return r;
}
int main(int argc, char** argv) {
printf("\t\t{%s,%s,%s,%i},\n", argv[1], argv[2], argv[3], btoi(argv[4]));
}

View File

View File

2
main.c
View File

@ -1,4 +1,4 @@
#include "mp3.h" #include <mp3.h>
int main(int argc, char** argv) { int main(int argc, char** argv) {

6
mp3.c
View File

@ -1,7 +1,7 @@
#include "mp3.h" #include <mp3.h>
#include "huffman.h" #include <huffman.h>
#include "dat.h" #include <dat.h>
// TODO autodetect endianness here // TODO autodetect endianness here
#define fromle(x) (x) #define fromle(x) (x)