Compare commits
4 commits
85e398844c
...
9b877b222a
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b877b222a | |||
| 8a0923f28a | |||
| c0ca81418b | |||
| 6848796fb3 |
5 changed files with 47 additions and 0 deletions
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild",
|
||||
"C_Cpp.default.compileCommands": "/home/thek0tyara/Documents/projects/c/builddir/compile_commands.json"
|
||||
}
|
||||
BIN
bin/main
Executable file
BIN
bin/main
Executable file
Binary file not shown.
6
build.sh
Executable file
6
build.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
c_files=$(find src -name '*.c')
|
||||
|
||||
mkdir -p bin
|
||||
clang ${c_files} -o bin/main
|
||||
21
src/main.c
Normal file
21
src/main.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include "main.h"
|
||||
//
|
||||
char *scanned_path;
|
||||
//
|
||||
void check_args(int argc, char *argv[]) {
|
||||
char* _scanned_path;
|
||||
if(argc > 1) {
|
||||
_scanned_path=argv[1];
|
||||
}else{
|
||||
_scanned_path=".";
|
||||
}
|
||||
scanned_path=realpath(_scanned_path, NULL);
|
||||
}
|
||||
int main(int argc, char *argv[]) {
|
||||
check_args(argc, argv);
|
||||
printf("scanned path: %s\n",scanned_path);
|
||||
//
|
||||
path_node *parent_node=alloc;
|
||||
//
|
||||
return 0;
|
||||
}
|
||||
16
src/main.h
Normal file
16
src/main.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef __main_h__
|
||||
#define __main_h__
|
||||
//
|
||||
#include <pthread.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
//
|
||||
struct path_node {
|
||||
char *path;
|
||||
uint size;
|
||||
struct path_node *next;
|
||||
};
|
||||
//
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue