socket: conexao TCP como TbStream (fluxo com classe read/write/close) e blocos para conectar, enviar, receber e resolver endereco. ssl: embrulha um TbStream TCP em TLS (OpenSSL), com SNI e certificado conferido pelo sistema e pelo nome do host. http: cliente HTTP/1.1 so sobre TbStream; https:// quando a ssl esta carregada; Content-Length, chunked e redirecionamentos; GET e POST de texto e download em segundo plano (.parte ate terminar) com progresso. archive: lista e extrai .tar e .tar.gz (zlib), nomes longos GNU/pax; recusa entradas com "../" ou caminho absoluto. As camadas se acham pelas tabelas no lib_userdata, sem linkar umas com as outras. test-http usa um servidor local (e a internet, se houver); test-archive cria os arquivos com tar e Python. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
767 B
Makefile
31 lines
767 B
Makefile
# Makefile da library archive (categoria "Arquivos compactados")
|
|
# Constroi build/libtinyblocks-archive.a e build/libtinyblocks-archive.so
|
|
CC := gcc
|
|
BUILD := build
|
|
|
|
CFLAGS := -std=c11 -O2 -Wall -Wextra -pedantic -fvisibility=hidden \
|
|
-D_POSIX_C_SOURCE=200809L -I../../include -Iinclude
|
|
|
|
SRCS := src/tb_archive.c
|
|
OBJS := $(BUILD)/tb_archive.o
|
|
LIB_A := $(BUILD)/libtinyblocks-archive.a
|
|
LIB_SO := $(BUILD)/libtinyblocks-archive.so
|
|
|
|
.PHONY: all static shared clean
|
|
all: static shared
|
|
static: $(LIB_A)
|
|
shared: $(LIB_SO)
|
|
|
|
$(BUILD)/%.o: src/%.c $(wildcard include/*.h) $(wildcard src/*.h)
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
|
|
$(LIB_A): $(OBJS)
|
|
ar rcs $@ $^
|
|
|
|
$(LIB_SO): $(OBJS)
|
|
$(CC) -shared -o $@ $^ -lz
|
|
|
|
clean:
|
|
$(RM) -r $(BUILD)
|