better gcc and types.h

This commit is contained in:
2025-06-03 22:40:07 +02:00
parent 19ade556b6
commit 5ca191d14f
5 changed files with 23 additions and 19 deletions
-1
View File
@@ -1,4 +1,3 @@
build build
*.o
.vscode .vscode
*.bmp *.bmp
+2 -4
View File
@@ -3,7 +3,5 @@ clean:
rm -rf build rm -rf build
build: build:
mkdir -p build && \ mkdir -p build
cd build && \ gcc -Wall src/*.c src/*.h -o build/mg
gcc -Wall -c ../src/*.c && \
gcc -Wall -o mg *.o
+1 -12
View File
@@ -1,21 +1,10 @@
#include "types.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifndef ARGS_H #ifndef ARGS_H
#define ARGS_H #define ARGS_H
struct Parameters {
unsigned long width;
unsigned long height;
char *file_path;
unsigned int size;
float slope;
float start[3];
float var[3];
};
typedef struct Parameters parameters;
parameters parse_args(int argc, char **argv); parameters parse_args(int argc, char **argv);
#endif #endif
+2 -2
View File
@@ -1,8 +1,8 @@
#include "types.h"
#ifndef BMP_H #ifndef BMP_H
#define BMP_H #define BMP_H
typedef void line_fn(unsigned long y, char *data_buffer);
void bmp_generate(unsigned long width, unsigned long height, void bmp_generate(unsigned long width, unsigned long height,
unsigned int color_depth, char *file_path, unsigned int color_depth, char *file_path,
line_fn generate_line); line_fn generate_line);
+18
View File
@@ -0,0 +1,18 @@
#ifndef TYPES_H
#define TYPES_H
struct Parameters {
unsigned long width;
unsigned long height;
char *file_path;
unsigned int size;
float slope;
float start[3];
float var[3];
};
typedef struct Parameters parameters;
typedef void line_fn(unsigned long y, char *data_buffer);
#endif