@@ -0,0 +1,3 @@
|
|||||||
|
*.o
|
||||||
|
*.d
|
||||||
|
/blobchain
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2026, Chloe M.
|
||||||
|
# Provided under the BSD-3 clause
|
||||||
|
#
|
||||||
|
|
||||||
|
CFILES = $(shell find . -name "*.c")
|
||||||
|
DFILES = $(CFILES:.c=.d)
|
||||||
|
OFILES = $(CFILES:.c=.o)
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
CFLAGS = \
|
||||||
|
-Wall \
|
||||||
|
-pedantic \
|
||||||
|
-Iinc/ \
|
||||||
|
-MMD
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: blobchain
|
||||||
|
|
||||||
|
.PHONY: blobchain
|
||||||
|
blobchain: $(OFILES)
|
||||||
|
$(CC) $< -o $@
|
||||||
|
|
||||||
|
-include $(DFILES)
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) -c $< $(CFLAGS) -o $@
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Blobchain --
|
||||||
|
|
||||||
|
The blobchain format allows one to create a list of files and have a content-addressed snapshot of a directory
|
||||||
|
in the form of a blockchain for verification purposes.
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2026, Chloe M.
|
||||||
|
* Provided under the BSD-3 clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include "blobchain/common.h"
|
||||||
|
|
||||||
|
static void
|
||||||
|
help(void)
|
||||||
|
{
|
||||||
|
printf("usage: ./blobchain <flags>\n");
|
||||||
|
printf("... [-h] Display this help menu\n");
|
||||||
|
printf("... [-v] Display the version\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
version(void)
|
||||||
|
{
|
||||||
|
printf("Version v%s\n", BLOBCHAIN_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int opt;
|
||||||
|
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("fatal: too few arguments!\n");
|
||||||
|
help();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((opt = getopt(argc, argv, "hv")) != -1) {
|
||||||
|
switch (opt) {
|
||||||
|
case 'h':
|
||||||
|
help();
|
||||||
|
return -1;
|
||||||
|
case 'v':
|
||||||
|
version();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2026, Chloe M.
|
||||||
|
* Provided under the BSD-3 clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BLOBCHAIN_COMMON_H
|
||||||
|
#define BLOBCHAIN_COMMON_H 1
|
||||||
|
|
||||||
|
#define BLOBCHAIN_VERSION "0.0.1"
|
||||||
|
|
||||||
|
#endif /* !BLOBCHAIN_COMMON_H */
|
||||||
Reference in New Issue
Block a user