Skip to content

Commit

Permalink
Updated disk file ids as numbers.
Browse files Browse the repository at this point in the history
████ ███  To request new features or in case this commit breaks something for you,
████ ███  please, create a new github issue with all possible information for me,
▓███▀█▄   but never share your API Keys!
▒▓██ ███
░▒▓█ ███  Signed-off-by: Carles Tubio <ctubio@users.noreply.github.com>
 _________________________________________
/ Hello, WORLD!                           \
|                                         |
\ pssst.. 1.00000000 BTC = 47773.76 EUR.  /
 -----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
  • Loading branch information
ctubio committed Oct 10, 2021
1 parent cf2920f commit 0dc86b4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ K ?= K.sh
MAJOR = 0
MINOR = 6
PATCH = 6
BUILD = 4
BUILD = 5

OBLIGATORY = DISCLAIMER: This is strict non-violent software: \n$\
if you hurt other living creatures, please stop; \n$\
Expand Down
21 changes: 11 additions & 10 deletions src/bin/+portfolios/+portfolios.disk.S
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
//! \file
//! \brief Lazy disk file builder using global external linkage.
//! \note Line 10 can be removed; just exemplifies each column.
//! \note Line 11 can be removed; just exemplifies each column.
//! \note See src/lib/Krypto.ninja-disk.S for info about DISK()
//! \note Webserver 404 page is loaded using an empty url path.
//! \note Filesystem paths at www/* are included from lib/, at:
//! - /var/lib/K/assets/www/*
//! - ./src/lib/Krypto.ninja-client/www/*

#define DISK(file) \
/*file( example_var , www/filesystem/path/to/file , /webserver/url/path )*/\
file( html_index , www/index.html , / ) \
file( ico_favicon , www/favicon.ico , /favicon.ico ) \
file( js_client , www/js/client.min.js , /js/client.min.js ) \
file( css_base , www/css/bootstrap.min.css , /css/bootstrap.min.css ) \
file( css_dark , www/css/bootstrap-dark.min.css , /css/bootstrap-dark.min.css ) \
file( css_light , www/css/bootstrap-light.min.css , /css/bootstrap-light.min.css ) \
file( woff2_font , www/font/beacons.woff2 , /font/beacons.woff2 ) \
file( gzip_bomb , www/.bomb.gzip , )
/*file( ids , www/filesystem/path/to/files , /webserver/url/paths )*/\
file( 001 , www/index.html , / ) \
file( 002 , www/favicon.ico , /favicon.ico ) \
file( 003 , www/js/client.min.js , /js/client.min.js ) \
file( 004 , www/css/bootstrap.min.css , /css/bootstrap.min.css ) \
file( 005 , www/css/bootstrap-dark.min.css , /css/bootstrap-dark.min.css ) \
file( 006 , www/css/bootstrap-light.min.css , /css/bootstrap-light.min.css ) \
file( 007 , www/font/beacons.woff2 , /font/beacons.woff2 ) \
file( 000 , www/.bomb.gzip , )
25 changes: 13 additions & 12 deletions src/bin/trading-bot/trading-bot.disk.S
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
//! \file
//! \brief Lazy disk file builder using global external linkage.
//! \note Line 10 can be removed; just exemplifies each column.
//! \note Line 11 can be removed; just exemplifies each column.
//! \note See src/lib/Krypto.ninja-disk.S for info about DISK()
//! \note Webserver 404 page is loaded using an empty url path.
//! \note Filesystem paths at www/* are included from lib/, at:
//! - /var/lib/K/assets/www/*
//! - ./src/lib/Krypto.ninja-client/www/*

#define DISK(file) \
/*file( example_var , www/filesystem/path/to/file , /webserver/url/path )*/\
file( html_index , www/index.html , / ) \
file( ico_favicon , www/favicon.ico , /favicon.ico ) \
file( js_client , www/js/client.min.js , /js/client.min.js ) \
file( css_base , www/css/bootstrap.min.css , /css/bootstrap.min.css ) \
file( css_dark , www/css/bootstrap-dark.min.css , /css/bootstrap-dark.min.css ) \
file( css_light , www/css/bootstrap-light.min.css , /css/bootstrap-light.min.css ) \
file( woff2_font , www/font/beacons.woff2 , /font/beacons.woff2 ) \
file( mp3_audio_0 , www/audio/0.mp3 , /audio/0.mp3 ) \
file( mp3_audio_1 , www/audio/1.mp3 , /audio/1.mp3 ) \
file( gzip_bomb , www/.bomb.gzip , )
/*file( ids , www/filesystem/path/to/files , /webserver/url/paths )*/\
file( 001 , www/index.html , / ) \
file( 002 , www/favicon.ico , /favicon.ico ) \
file( 003 , www/js/client.min.js , /js/client.min.js ) \
file( 004 , www/css/bootstrap.min.css , /css/bootstrap.min.css ) \
file( 005 , www/css/bootstrap-dark.min.css , /css/bootstrap-dark.min.css ) \
file( 006 , www/css/bootstrap-light.min.css , /css/bootstrap-light.min.css ) \
file( 007 , www/font/beacons.woff2 , /font/beacons.woff2 ) \
file( 008 , www/audio/0.mp3 , /audio/0.mp3 ) \
file( 009 , www/audio/1.mp3 , /audio/1.mp3 ) \
file( 000 , www/.bomb.gzip , )
33 changes: 16 additions & 17 deletions src/lib/Krypto.ninja-disk.S
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
//! \brief Lazy declarations OR definitions of disk files.

//! \def
//! \brief Enforce underscore prefix for global external symbol names.
//! \brief Define variable names for any disk file.
#define DISK_VARNAME(a, b) a ## _disk_file_ ## b
#ifdef __APPLE__
#define _SYM(a) _ ## a
#define DISK_SYMBOL(a) DISK_VARNAME(_, a)
#else
#define _SYM(a) a
#define DISK_SYMBOL(a) DISK_VARNAME( , a)
#endif

//! \def
//! \brief Lazy (assembler OR c++) code for any disk file.
#ifdef __ASSEMBLER__
#define FILE(a, b, c) .disk_file _SYM(_disk_file_ ## a), b;
#define DISK_FILE(a, b, c) .disk_file DISK_SYMBOL(a), b;
#else
#define FILE(a, b, c) extern const char _disk_file_ ## a; \
extern const int _disk_file_ ## a ## _len;
#define DOCS(a, b, c) { #c, { \
&_disk_file_ ## a, \
_disk_file_ ## a ## _len \
} },
#define DISK_FILE(a, b, c) extern const char DISK_VARNAME(, a); \
extern const int DISK_VARNAME(, a ## _len);
#define DISK_DOCS(a, b, c) { #c, { &DISK_VARNAME(, a), \
DISK_VARNAME(, a ## _len)}},
#endif

//! \def
Expand All @@ -30,15 +29,15 @@

//! \def
//! \brief Use whatever code for any disk file (c++).
#define DISK_WWW \
DISK \
( DOCS )
#define DISK_WWW \
DISK \
( DISK_DOCS )

//! \def
//! \brief Use whatever code for any disk file (assembler OR c++).
#define DATA \
DISK \
( FILE )
#define DISK_DATA \
DISK \
( DISK_FILE )

//! \def
//! \brief Let any disk file be declared (c++) OR defined (assembler).
Expand All @@ -58,7 +57,7 @@
.endm
#endif

DATA
DISK_DATA

#ifdef __ASSEMBLER__
.end
Expand Down

0 comments on commit 0dc86b4

Please sign in to comment.