forked from cory/tildefriends
Compare commits
10 Commits
392206c19e
...
v0.0.17
Author | SHA1 | Date | |
---|---|---|---|
3c0b680b8e | |||
895356897b | |||
9164be2f37 | |||
5385264f94 | |||
610e756c07 | |||
15c9f8f458 | |||
fb704a5b83 | |||
fdda628be8 | |||
2b45d8aa05 | |||
0e2fc65301 |
48
GNUmakefile
48
GNUmakefile
@ -4,7 +4,7 @@ MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
VERSION_CODE := 17
|
||||
VERSION_NUMBER := 0.0.17-wip
|
||||
VERSION_NUMBER := 0.0.17
|
||||
VERSION_NAME := Please enjoy responsibly.
|
||||
|
||||
SQLITE_URL := https://www.sqlite.org/2024/sqlite-amalgamation-3450200.zip
|
||||
@ -17,18 +17,6 @@ UNAME_M := $(shell uname -m)
|
||||
|
||||
ANDROID_SDK ?= ~/Android/Sdk
|
||||
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
ifneq ($(UNAME_S),Haiku)
|
||||
debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
||||
debug: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME_M),aarch64)
|
||||
debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
||||
debug: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
BUILD_TYPES := macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease
|
||||
else ifeq ($(UNAME_S),Linux)
|
||||
@ -222,6 +210,18 @@ $(IOS_TARGETS): LDFLAGS += -Ldeps/openssl/ios/ios64-xcrun/usr/local/lib
|
||||
$(IOSSIM_TARGETS): CFLAGS += -Ideps/openssl/ios/iossimulator-xcrun/usr/local/include
|
||||
$(IOSSIM_TARGETS): LDFLAGS += -Ldeps/openssl/ios/iossimulator-xcrun/usr/local/lib
|
||||
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
ifneq ($(UNAME_S),Haiku)
|
||||
out/debug/tildefriends: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
||||
out/debug/tildefriends: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME_M),aarch64)
|
||||
out/debug/tildefriends: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
||||
out/debug/tildefriends: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
||||
endif
|
||||
|
||||
get_objs = \
|
||||
$(foreach build_type,$(BUILD_TYPES),$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)))))) \
|
||||
$(foreach build_type,debug release,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \
|
||||
@ -578,7 +578,7 @@ $(MINIUNZIP_OBJS): CFLAGS += \
|
||||
LDFLAGS += \
|
||||
-pthread \
|
||||
-lm
|
||||
debug release $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
|
||||
$(LINUX_TARGETS) $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
|
||||
-lssl \
|
||||
-lcrypto
|
||||
ifneq ($(UNAME_S),Haiku)
|
||||
@ -728,7 +728,7 @@ out/apk/TildeFriends-arm-%.unsigned.apk:
|
||||
@cp out/apk/res.apk $@.zip
|
||||
@cp out/apk/classes.dex out/apk-arm-$(BUILD_TYPE)/
|
||||
@cd out/apk-arm-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
|
||||
@zip -u $@.zip -q $(RAW_FILES)
|
||||
@zip -u $@.zip -q -9 $(RAW_FILES)
|
||||
@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
|
||||
|
||||
out/apk/TildeFriends-x86-%.unsigned.apk:
|
||||
@ -741,7 +741,7 @@ out/apk/TildeFriends-x86-%.unsigned.apk:
|
||||
@cp out/apk/res.apk $@.zip
|
||||
@cp out/apk/classes.dex out/apk-x86-$(BUILD_TYPE)/
|
||||
@cd out/apk-x86-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
|
||||
@zip -u $@.zip -q $(RAW_FILES)
|
||||
@zip -u $@.zip -q -9 $(RAW_FILES)
|
||||
@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
|
||||
|
||||
out/%.apk: out/apk/%.unsigned.apk
|
||||
@ -769,10 +769,10 @@ out/%.app/tildefriends.png: src/ios/tildefriends.png
|
||||
@mkdir -p $(dir $@)
|
||||
@cp -v $< $@
|
||||
|
||||
out/%/data.zip: $(RAW_FILES)
|
||||
out/data.zip: $(RAW_FILES)
|
||||
@zip -u $@ -q -9 $(RAW_FILES)
|
||||
|
||||
out/tildefriends-%.app/tildefriends: out/%/tildefriends out/tildefriends-%.app/Info.plist out/tildefriends-%.app/tildefriends.png out/tildefriends-%.app/data.zip
|
||||
out/tildefriends-%.app/tildefriends: out/%/tildefriends out/tildefriends-%.app/Info.plist out/tildefriends-%.app/tildefriends.png out/data.zip
|
||||
@mkdir -p $(dir $@)
|
||||
@cp -v $< $@
|
||||
ifeq ($(HAVE_LINUX_IOS),1)
|
||||
@ -787,6 +787,12 @@ out/tildefriends-%.ipa: out/tildefriends-ios%.app/tildefriends
|
||||
@cd $@.tmp/ && zip -u ../../$@ -q -9 -r ./
|
||||
@rm -rf $@.tmp/
|
||||
|
||||
|
||||
out/%/tildefriends.standalone: out/%/tildefriends out/data.zip
|
||||
@echo "[standalone] $@"
|
||||
@cat $< out/data.zip > $@
|
||||
@chmod +x $@
|
||||
|
||||
iossimdebug-app: out/tildefriends-iossimdebug.app/tildefriends
|
||||
iossimrelease-app: out/tildefriends-iossimrelease.app/tildefriends
|
||||
iosdebug-app: out/tildefriends-iosdebug.app/tildefriends
|
||||
@ -851,7 +857,7 @@ dist: release-apk iosrelease-ipa
|
||||
@echo [archive] dist/tildefriends-$(VERSION_NUMBER).tar.xz
|
||||
@rm -rf out/tildefriends-$(VERSION_NUMBER)
|
||||
@mkdir -p dist/ out/tildefriends-$(VERSION_NUMBER)
|
||||
@git archive main | tar -x -C out/tildefriends-$(VERSION_NUMBER)
|
||||
@git archive HEAD | tar -x -C out/tildefriends-$(VERSION_NUMBER)
|
||||
@tar \
|
||||
--exclude=apps/welcome* \
|
||||
--exclude=deps/libbacktrace/Isaac.Newton-Opticks.txt \
|
||||
@ -867,7 +873,9 @@ dist: release-apk iosrelease-ipa
|
||||
--exclude=deps/sqlite/shell.c \
|
||||
--exclude=deps/zlib/contrib/vstudio \
|
||||
--exclude=deps/zlib/doc \
|
||||
-caf dist/tildefriends-$(VERSION_NUMBER).tar.xz out/tildefriends-$(VERSION_NUMBER)
|
||||
-caf dist/tildefriends-$(VERSION_NUMBER).tar.xz \
|
||||
-C out/ \
|
||||
tildefriends-$(VERSION_NUMBER)
|
||||
@echo "[cp] TildeFriends-x86-$(VERSION_NUMBER).apk"
|
||||
@cp out/TildeFriends-x86-release.zopfli.apk dist/TildeFriends-x86-$(VERSION_NUMBER).apk
|
||||
@echo "[cp] TildeFriends-arm-$(VERSION_NUMBER).apk"
|
||||
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "⚙️"
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
async function main() {
|
||||
// Get body.html
|
||||
const body = utf8Decode(await getFile("body.html"));
|
||||
|
||||
// Build the document
|
||||
const document = `
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="tildefriends.css"/>
|
||||
<link rel="stylesheet" href="style.css"/>
|
||||
<script src="script.js" type="module"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
${body}
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
// Send it to the browser
|
||||
app.setDocument(document);
|
||||
}
|
||||
|
||||
main();
|
@ -1,130 +0,0 @@
|
||||
<h1>h1</h1>
|
||||
<h2>h2</h2>
|
||||
<h3>hxc3</h3>
|
||||
|
||||
Notice: this example app fetches an image and an audio file from a third-party website.
|
||||
Those will not work offline. <a href="/">This is a link.</a>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<button class="red" onclick="hello()">button.red</button>
|
||||
<button class="green">button.green</button>
|
||||
<button class="blue">button.blue</button>
|
||||
<button class="yellow">button.yellow</button>
|
||||
<button>button</button>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<code>
|
||||
x = 5;
|
||||
y = 6;
|
||||
z = x + y;
|
||||
</code>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<audio controls>
|
||||
<source src="https://www.audiocheck.net/Audio/audiocheck.net_brownnoise.ogg" type="audio/ogg">
|
||||
Your browser does not support the audio element.
|
||||
</audio>
|
||||
|
||||
<br />
|
||||
|
||||
<img src="https://picsum.photos/id/37/500/250" alt="Italian Trulli">
|
||||
|
||||
|
||||
<div class="box flex">
|
||||
Hello
|
||||
<div class="box flex">
|
||||
Hello
|
||||
<div class="box flex">
|
||||
Hello
|
||||
<div class="box flex">
|
||||
Hello
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dignissim leo a urna gravida, vel pulvinar magna blandit. Cras eleifend, elit ac faucibus gravida, justo mauris ornare nisi, eget ultrices lorem tortor vitae purus. Quisque et dui arcu. Nam semper, mauris id molestie imperdiet, risus nunc dignissim dolor, nec cursus elit mi sit amet dui. Nulla aliquam id mauris sed posuere. Nam mollis velit luctus accumsan aliquam. In tempor, felis id finibus tincidunt, erat nulla vehicula orci, a venenatis mauris nunc et diam. Aliquam lorem sem, iaculis ut mollis in, feugiat a mauris. Nam laoreet vestibulum leo a aliquet. Nam sit amet neque erat.</p>
|
||||
|
||||
<p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Pellentesque porttitor, sem ac pretium accumsan, dui sapien placerat ligula, ut maximus lacus eros sed tortor. Vivamus finibus facilisis felis, quis dictum felis vestibulum nec. Mauris eu facilisis est, nec tempor sem. Quisque ac ultricies tortor. Morbi et ante at dolor accumsan molestie. Curabitur facilisis condimentum lorem a luctus. Quisque lectus risus, vestibulum non malesuada quis, porta sed urna. Sed elementum magna in velit sagittis, vel fringilla ipsum pulvinar. Morbi nec lectus egestas, laoreet erat fringilla, tristique quam.</p>
|
||||
|
||||
<p>Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur eu mattis ante. Donec venenatis pretium ornare. Nulla vel purus cursus, molestie velit a, vehicula mi. Phasellus ac eleifend sapien, in euismod mauris. Donec quis nisi sodales, accumsan mi sed, malesuada purus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent venenatis enim et nisi interdum, nec sodales diam suscipit. Etiam nisl neque, dapibus id felis eget, laoreet posuere eros. Donec arcu neque, aliquam vel fringilla ut, laoreet in velit. Ut tincidunt rutrum eros vel fringilla. Sed at eleifend sem. Pellentesque ut leo in ligula accumsan dignissim quis at justo. Donec luctus felis sed lacus pharetra aliquam. Nam volutpat quis tellus eget lobortis. Proin ultrices ante vitae quam efficitur accumsan.</p>
|
||||
|
||||
<p>Here is a quote from WWF's website:</p>
|
||||
|
||||
<blockquote cite="http://www.worldwildlife.org/who/index.html">
|
||||
For 60 years, WWF has worked to help people and nature thrive. As the world's leading conservation organization, WWF works in nearly 100 countries. At every level, we collaborate with people around the world to develop and deliver innovative solutions that protect communities, wildlife, and the places in which they live.
|
||||
</blockquote>
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Company</th>
|
||||
<th>Contact</th>
|
||||
<th>Country</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alfreds Futterkiste</td>
|
||||
<td>Maria Anders</td>
|
||||
<td>Germany</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Centro comercial Moctezuma</td>
|
||||
<td>Francisco Chang</td>
|
||||
<td>Mexico</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ernst Handel</td>
|
||||
<td>Roland Mendel</td>
|
||||
<td>Austria</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Island Trading</td>
|
||||
<td>Helen Bennett</td>
|
||||
<td>UK</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Laughing Bacchus Winecellars</td>
|
||||
<td>Yoshi Tannamuri</td>
|
||||
<td>Canada</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Magazzini Alimentari Riuniti</td>
|
||||
<td>Giovanni Rovelli</td>
|
||||
<td>Italy</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2>An Unordered HTML List</h2>
|
||||
|
||||
<ul>
|
||||
<li>Coffee</li>
|
||||
<li>Tea</li>
|
||||
<li>Milk</li>
|
||||
</ul>
|
||||
|
||||
<h2>An Ordered HTML List</h2>
|
||||
|
||||
<ol>
|
||||
<li>Coffee</li>
|
||||
<li>Tea</li>
|
||||
<li>Milk</li>
|
||||
</ol>
|
||||
|
||||
<form">
|
||||
<textarea rows="5" cols="32">This is a textarea.</textarea>
|
||||
<br />
|
||||
<div class="flex-column" style="align-items: start;">
|
||||
<input type ="radio" />
|
||||
<input type ="radio" />
|
||||
<input type ="checkbox" />
|
||||
<input type ="checkbox" />
|
||||
</div>
|
||||
<br />
|
||||
<input class="green" type="submit" value="Button">
|
||||
</form>
|
@ -1,3 +0,0 @@
|
||||
function hello() {
|
||||
alert("Hello !");
|
||||
}
|
@ -1 +0,0 @@
|
||||
/* */
|
@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Tilde Friends core stylesheet
|
||||
* This is a prototype; things may change based on feedback.
|
||||
*
|
||||
* This Software is an external library that is part of
|
||||
* Tilde Friends and is shared under the MIT license.
|
||||
*
|
||||
* Inject this file in your app at tildefriends.css
|
||||
* and use this tag to import it:
|
||||
* <link rel="stylesheet" href="tildefriends.css"/>
|
||||
*
|
||||
* Revision 0 / 2024 M02 19
|
||||
*/
|
||||
|
||||
body {
|
||||
color: white;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
button,
|
||||
.button,
|
||||
input[type=button],
|
||||
input[type=submit],
|
||||
input[type=dropdown] {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
padding: 8px 12px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
margin: 4px;
|
||||
|
||||
&.red {
|
||||
background-color: #bd1e24;
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.green {
|
||||
background-color: #18922d;
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.blue {
|
||||
background-color: #0067a7;
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.yellow {
|
||||
background-color: #ee9600;
|
||||
color: black;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
filter: brightness(0.75);
|
||||
}
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: #268bd2;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #6c71c4;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #859900;
|
||||
}
|
||||
|
||||
a:active {
|
||||
color: #2aa198;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
td, th {
|
||||
border: 1px solid #ffffff40;
|
||||
text-align: left;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
tr:nth-child(even) {
|
||||
background-color: #ffffff20;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.flex-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.inline-flex-row {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.box {
|
||||
background-color: #00000020;
|
||||
border: 1px solid grey;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
margin: 4px;
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.unprompted.tildefriends"
|
||||
android:versionCode="17"
|
||||
android:versionName="0.0.17-wip">
|
||||
android:versionName="0.0.17">
|
||||
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="34"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<application
|
||||
|
@ -316,7 +316,9 @@ static void _file_read_file_zip_after_work(uv_work_t* work, int status)
|
||||
tf_trace_begin(trace, "file_read_zip_after_work");
|
||||
if (data->result >= 0)
|
||||
{
|
||||
tf_task_resolve_promise(data->task, data->promise, tf_util_new_uint8_array(data->context, data->buffer, data->result));
|
||||
JSValue array = tf_util_new_uint8_array(data->context, data->buffer, data->result);
|
||||
tf_task_resolve_promise(data->task, data->promise, array);
|
||||
JS_FreeValue(data->context, array);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
34
src/http.c
34
src/http.c
@ -161,10 +161,11 @@ static void _http_request_destroy(tf_http_request_t* request)
|
||||
tf_http_close_callback* on_close = request->on_close;
|
||||
if (on_close)
|
||||
{
|
||||
tf_trace_t* trace = request->http->trace;
|
||||
request->on_close = NULL;
|
||||
tf_trace_begin(request->http->trace, request->connection && request->connection->trace_name ? request->connection->trace_name : "websocket");
|
||||
tf_trace_begin(trace, request->connection && request->connection->trace_name ? request->connection->trace_name : "websocket");
|
||||
on_close(request);
|
||||
tf_trace_end(request->http->trace);
|
||||
tf_trace_end(trace);
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,12 +175,9 @@ static void _http_connection_destroy(tf_http_connection_t* connection, const cha
|
||||
|
||||
if (connection->request)
|
||||
{
|
||||
_http_request_destroy(connection->request);
|
||||
if (connection->request && connection->request->ref_count == 0)
|
||||
{
|
||||
tf_free(connection->request);
|
||||
}
|
||||
tf_http_request_t* request = connection->request;
|
||||
connection->request = NULL;
|
||||
_http_request_destroy(request);
|
||||
}
|
||||
|
||||
if (connection->tcp.data && !uv_is_closing((uv_handle_t*)&connection->tcp))
|
||||
@ -383,11 +381,19 @@ static void _http_add_body_bytes(tf_http_connection_t* connection, const void* d
|
||||
};
|
||||
connection->request = request;
|
||||
|
||||
tf_http_request_ref(request);
|
||||
tf_trace_begin(connection->http->trace, connection->trace_name ? connection->trace_name : "http");
|
||||
connection->callback(request);
|
||||
tf_trace_end(connection->http->trace);
|
||||
tf_http_request_unref(request);
|
||||
if (!connection->http->is_shutting_down)
|
||||
{
|
||||
tf_http_request_ref(request);
|
||||
tf_trace_begin(connection->http->trace, connection->trace_name ? connection->trace_name : "http");
|
||||
connection->callback(request);
|
||||
tf_trace_end(connection->http->trace);
|
||||
tf_http_request_unref(request);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* k_payload = tf_http_status_text(503);
|
||||
tf_http_respond(request, 503, NULL, 0, k_payload, strlen(k_payload));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -786,6 +792,8 @@ const char* tf_http_status_text(int status)
|
||||
return "File not found";
|
||||
case 500:
|
||||
return "Internal server error";
|
||||
case 503:
|
||||
return "Service Unavailable";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
@ -965,11 +973,11 @@ void tf_http_request_unref(tf_http_request_t* request)
|
||||
tf_http_connection_t* connection = request->connection;
|
||||
if (--request->ref_count == 0)
|
||||
{
|
||||
_http_request_destroy(request);
|
||||
if (connection)
|
||||
{
|
||||
connection->request = NULL;
|
||||
}
|
||||
_http_request_destroy(request);
|
||||
tf_free(request);
|
||||
}
|
||||
|
||||
|
32
src/main.c
32
src/main.c
@ -11,6 +11,7 @@
|
||||
|
||||
#include "backtrace.h"
|
||||
#include "sqlite3.h"
|
||||
#include "unzip.h"
|
||||
|
||||
#include <getopt.h>
|
||||
#include <stdlib.h>
|
||||
@ -416,6 +417,14 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
|
||||
};
|
||||
bool show_usage = false;
|
||||
|
||||
/* Check if the executable has data attached. */
|
||||
unzFile zip = unzOpen(file);
|
||||
if (zip)
|
||||
{
|
||||
args.zip = file;
|
||||
unzClose(zip);
|
||||
}
|
||||
|
||||
while (!show_usage)
|
||||
{
|
||||
static const struct option k_options[] = {
|
||||
@ -485,17 +494,18 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
|
||||
{
|
||||
tf_printf("\n%s run [options]\n\n", file);
|
||||
tf_printf("options\n");
|
||||
tf_printf(" -s, --script script Script to run (default: core/core.js).\n");
|
||||
tf_printf(" -b, --ssb-port port Port on which to run SSB (default: 8008, 0 disables).\n");
|
||||
tf_printf(" -p, --http-port port Port on which to run Tilde Friends web server (default: 12345).\n");
|
||||
tf_printf(" -q, --https-port port Port on which to run secure Tilde Friends web server (default: 12346).\n");
|
||||
tf_printf(" -d, --db-path path SQLite database path (default: %s).\n", k_db_path_default);
|
||||
tf_printf(" -n, --count count Number of instances to run.\n");
|
||||
tf_printf(" -a, --args args Arguments of the format key=value,foo=bar,verbose=true.\n");
|
||||
tf_printf(" -o, --one-proc Run everything in one process (unsafely!).\n");
|
||||
tf_printf(" -z, --zip path Zip archive from which to load files.\n");
|
||||
tf_printf(" -v, --verbose Log raw messages.\n");
|
||||
tf_printf(" -h, --help Show this usage information.\n");
|
||||
tf_printf(" -s, --script script Script to run (default: core/core.js).\n");
|
||||
tf_printf(" -b, --ssb-port port Port on which to run SSB (default: 8008, 0 disables).\n");
|
||||
tf_printf(" -p, --http-port port Port on which to run Tilde Friends web server (default: 12345).\n");
|
||||
tf_printf(" -q, --https-port port Port on which to run secure Tilde Friends web server (default: 12346).\n");
|
||||
tf_printf(" -d, --db-path path SQLite database path (default: %s).\n", k_db_path_default);
|
||||
tf_printf(" -k, --ssb-network-key key SSB network key to use.\n");
|
||||
tf_printf(" -n, --count count Number of instances to run.\n");
|
||||
tf_printf(" -a, --args args Arguments of the format key=value,foo=bar,verbose=true.\n");
|
||||
tf_printf(" -o, --one-proc Run everything in one process (unsafely!).\n");
|
||||
tf_printf(" -z, --zip path Zip archive from which to load files.\n");
|
||||
tf_printf(" -v, --verbose Log raw messages.\n");
|
||||
tf_printf(" -h, --help Show this usage information.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -1939,6 +1939,11 @@ void tf_task_destroy(tf_task_t* task)
|
||||
tf_free(task->_promise_stacks);
|
||||
tf_free((void*)task->_path);
|
||||
bool was_trusted = task->_trusted;
|
||||
if (task->_zip)
|
||||
{
|
||||
unzClose(task->_zip);
|
||||
task->_zip = NULL;
|
||||
}
|
||||
tf_free(task);
|
||||
if (was_trusted)
|
||||
{
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define VERSION_NUMBER "0.0.17-wip"
|
||||
#define VERSION_NUMBER "0.0.17"
|
||||
#define VERSION_NAME "Please enjoy responsibly."
|
||||
|
Reference in New Issue
Block a user