better gcc and types.h
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
build
|
||||
*.o
|
||||
.vscode
|
||||
*.bmp
|
||||
@@ -3,7 +3,5 @@ clean:
|
||||
rm -rf build
|
||||
|
||||
build:
|
||||
mkdir -p build && \
|
||||
cd build && \
|
||||
gcc -Wall -c ../src/*.c && \
|
||||
gcc -Wall -o mg *.o
|
||||
mkdir -p build
|
||||
gcc -Wall src/*.c src/*.h -o build/mg
|
||||
+1
-12
@@ -1,21 +1,10 @@
|
||||
#include "types.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef 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);
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "types.h"
|
||||
|
||||
#ifndef BMP_H
|
||||
#define BMP_H
|
||||
|
||||
typedef void line_fn(unsigned long y, char *data_buffer);
|
||||
|
||||
void bmp_generate(unsigned long width, unsigned long height,
|
||||
unsigned int color_depth, char *file_path,
|
||||
line_fn generate_line);
|
||||
|
||||
+18
@@ -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
|
||||
Reference in New Issue
Block a user