Skip to content

Instantly share code, notes, and snippets.

@LinArcX
Created March 25, 2021 16:33
Show Gist options
  • Save LinArcX/a6a463d78dd8ea77566518e4ba99b596 to your computer and use it in GitHub Desktop.
Save LinArcX/a6a463d78dd8ea77566518e4ba99b596 to your computer and use it in GitHub Desktop.
/usr/bin/gcc -o aria2t -std=c11 -g -O2 -pedantic -Wall -Wextra -Wno-override-init -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -lncursesw aria2t.c program.c websocket.c b64.c jeezson/jeezson.c fourmat/fourmat.c
aria2t.c: In function 'notification_handler':
aria2t.c:618:4: error: 'K_notification_none' undeclared (first use in this function)
618 | [K_notification_none ] = D_UNKNOWN,
| ^~~~~~~~~~~~~~~~~~~
aria2t.c:618:4: note: each undeclared identifier is reported only once for each function it appears in
aria2t.c:618:4: error: array index in initializer not of integer type
aria2t.c:618:4: note: (near initialization for 'STATUS_MAP')
aria2t.c:619:4: error: 'K_notification_DownloadStart' undeclared (first use in this function)
619 | [K_notification_DownloadStart ] = D_ACTIVE,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:619:4: error: array index in initializer not of integer type
aria2t.c:619:4: note: (near initialization for 'STATUS_MAP')
aria2t.c:620:4: error: 'K_notification_DownloadPause' undeclared (first use in this function)
620 | [K_notification_DownloadPause ] = D_PAUSED,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:620:4: error: array index in initializer not of integer type
aria2t.c:620:4: note: (near initialization for 'STATUS_MAP')
aria2t.c:621:4: error: 'K_notification_DownloadStop' undeclared (first use in this function)
621 | [K_notification_DownloadStop ] = D_PAUSED,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:621:4: error: array index in initializer not of integer type
aria2t.c:621:4: note: (near initialization for 'STATUS_MAP')
aria2t.c:622:4: error: 'K_notification_DownloadComplete' undeclared (first use in this function)
622 | [K_notification_DownloadComplete ] = D_COMPLETE,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:622:4: error: array index in initializer not of integer type
aria2t.c:622:4: note: (near initialization for 'STATUS_MAP')
aria2t.c:623:4: error: 'K_notification_DownloadError' undeclared (first use in this function)
623 | [K_notification_DownloadError ] = D_ERROR,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:623:4: error: array index in initializer not of integer type
aria2t.c:623:4: note: (near initialization for 'STATUS_MAP')
aria2t.c:624:4: error: 'K_notification_BtDownloadComplete' undeclared (first use in this function)
624 | [K_notification_BtDownloadComplete] = D_ACTIVE
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:624:4: error: array index in initializer not of integer type
aria2t.c:624:4: note: (near initialization for 'STATUS_MAP')
aria2t.c:635:39: warning: implicit declaration of function 'K_notification_parse' [-Wimplicit-function-declaration]
635 | int8_t const new_status = STATUS_MAP[K_notification_parse(method + strlen("aria2.on"))];
| ^~~~~~~~~~~~~~~~~~~~
aria2t.c: In function 'parse_peer':
aria2t.c:1050:11: warning: implicit declaration of function 'K_peer_parse' [-Wimplicit-function-declaration]
1050 | switch (K_peer_parse(field->key)) {
| ^~~~~~~~~~~~
aria2t.c:1051:8: error: 'K_peer_none' undeclared (first use in this function)
1051 | case K_peer_none:
| ^~~~~~~~~~~
aria2t.c:1055:8: error: 'K_peer_peerId' undeclared (first use in this function)
1055 | case K_peer_peerId:
| ^~~~~~~~~~~~~
aria2t.c:1059:8: error: 'K_peer_ip' undeclared (first use in this function)
1059 | case K_peer_ip:
| ^~~~~~~~~
aria2t.c:1063:8: error: 'K_peer_port' undeclared (first use in this function)
1063 | case K_peer_port:
| ^~~~~~~~~~~
aria2t.c:1067:8: error: 'K_peer_bitfield' undeclared (first use in this function); did you mean 'parse_peer_bitfield'?
1067 | case K_peer_bitfield:
| ^~~~~~~~~~~~~~~
| parse_peer_bitfield
aria2t.c:1072:8: error: 'K_peer_amChoking' undeclared (first use in this function)
1072 | case K_peer_amChoking:
| ^~~~~~~~~~~~~~~~
aria2t.c:1076:8: error: 'K_peer_peerChoking' undeclared (first use in this function)
1076 | case K_peer_peerChoking:
| ^~~~~~~~~~~~~~~~~~
aria2t.c:1080:8: error: 'K_peer_downloadSpeed' undeclared (first use in this function)
1080 | case K_peer_downloadSpeed:
| ^~~~~~~~~~~~~~~~~~~~
aria2t.c:1084:8: error: 'K_peer_uploadSpeed' undeclared (first use in this function)
1084 | case K_peer_uploadSpeed:
| ^~~~~~~~~~~~~~~~~~
aria2t.c: In function 'parse_download_files':
aria2t.c:1277:12: warning: implicit declaration of function 'K_file_parse' [-Wimplicit-function-declaration]
1277 | switch (K_file_parse(field->key)) {
| ^~~~~~~~~~~~
aria2t.c:1278:9: error: 'K_file_none' undeclared (first use in this function)
1278 | case K_file_none:
| ^~~~~~~~~~~
aria2t.c:1282:9: error: 'K_file_index' undeclared (first use in this function)
1282 | case K_file_index:
| ^~~~~~~~~~~~
aria2t.c:1286:9: error: 'K_file_path' undeclared (first use in this function)
1286 | case K_file_path:
| ^~~~~~~~~~~
aria2t.c:1290:9: error: 'K_file_length' undeclared (first use in this function)
1290 | case K_file_length:
| ^~~~~~~~~~~~~
aria2t.c:1294:9: error: 'K_file_completedLength' undeclared (first use in this function)
1294 | case K_file_completedLength:
| ^~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1298:9: error: 'K_file_selected' undeclared (first use in this function)
1298 | case K_file_selected:
| ^~~~~~~~~~~~~~~
aria2t.c:1303:9: error: 'K_file_uris' undeclared (first use in this function); did you mean 'find_file_uri'?
1303 | case K_file_uris:
| ^~~~~~~~~~~
| find_file_uri
aria2t.c: In function 'parse_download':
aria2t.c:1418:11: warning: implicit declaration of function 'K_download_parse' [-Wimplicit-function-declaration]
1418 | switch (K_download_parse(field->key)) {
| ^~~~~~~~~~~~~~~~
aria2t.c:1419:8: error: 'K_download_gid' undeclared (first use in this function); did you mean 'get_download_by_gid'?
1419 | case K_download_gid:
| ^~~~~~~~~~~~~~
| get_download_by_gid
aria2t.c:1424:8: error: 'K_download_files' undeclared (first use in this function); did you mean 'parse_download_files'?
1424 | case K_download_files:
| ^~~~~~~~~~~~~~~~
| parse_download_files
aria2t.c:1428:8: error: 'K_download_numPieces' undeclared (first use in this function)
1428 | case K_download_numPieces:
| ^~~~~~~~~~~~~~~~~~~~
aria2t.c:1432:8: error: 'K_download_pieceLength' undeclared (first use in this function)
1432 | case K_download_pieceLength:
| ^~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1436:8: error: 'K_download_bitfield' undeclared (first use in this function)
1436 | case K_download_bitfield:
| ^~~~~~~~~~~~~~~~~~~
aria2t.c:1443:8: error: 'K_download_bittorrent' undeclared (first use in this function)
1443 | case K_download_bittorrent:
| ^~~~~~~~~~~~~~~~~~~~~
aria2t.c:1455:8: error: 'K_download_status' undeclared (first use in this function)
1455 | case K_download_status:
| ^~~~~~~~~~~~~~~~~
aria2t.c:1458:6: error: 'K_status_none' undeclared (first use in this function)
1458 | [K_status_none ] = D_UNKNOWN,
| ^~~~~~~~~~~~~
aria2t.c:1458:6: error: array index in initializer not of integer type
aria2t.c:1458:6: note: (near initialization for 'STATUS_MAP')
aria2t.c:1459:6: error: 'K_status_active' undeclared (first use in this function)
1459 | [K_status_active ] = D_ACTIVE,
| ^~~~~~~~~~~~~~~
aria2t.c:1459:6: error: array index in initializer not of integer type
aria2t.c:1459:6: note: (near initialization for 'STATUS_MAP')
aria2t.c:1460:6: error: 'K_status_waiting' undeclared (first use in this function)
1460 | [K_status_waiting ] = D_WAITING,
| ^~~~~~~~~~~~~~~~
aria2t.c:1460:6: error: array index in initializer not of integer type
aria2t.c:1460:6: note: (near initialization for 'STATUS_MAP')
aria2t.c:1461:6: error: 'K_status_paused' undeclared (first use in this function)
1461 | [K_status_paused ] = D_PAUSED,
| ^~~~~~~~~~~~~~~
aria2t.c:1461:6: error: array index in initializer not of integer type
aria2t.c:1461:6: note: (near initialization for 'STATUS_MAP')
aria2t.c:1462:6: error: 'K_status_error' undeclared (first use in this function)
1462 | [K_status_error ] = D_ERROR,
| ^~~~~~~~~~~~~~
aria2t.c:1462:6: error: array index in initializer not of integer type
aria2t.c:1462:6: note: (near initialization for 'STATUS_MAP')
aria2t.c:1463:6: error: 'K_status_complete' undeclared (first use in this function)
1463 | [K_status_complete] = D_COMPLETE,
| ^~~~~~~~~~~~~~~~~
aria2t.c:1463:6: error: array index in initializer not of integer type
aria2t.c:1463:6: note: (near initialization for 'STATUS_MAP')
aria2t.c:1464:6: error: 'K_status_removed' undeclared (first use in this function)
1464 | [K_status_removed ] = D_REMOVED
| ^~~~~~~~~~~~~~~~
aria2t.c:1464:6: error: array index in initializer not of integer type
aria2t.c:1464:6: note: (near initialization for 'STATUS_MAP')
aria2t.c:1467:41: warning: implicit declaration of function 'K_status_parse' [-Wimplicit-function-declaration]
1467 | int8_t const new_status = STATUS_MAP[K_status_parse(field->str)];
| ^~~~~~~~~~~~~~
aria2t.c:1480:8: error: 'K_download_completedLength' undeclared (first use in this function)
1480 | case K_download_completedLength:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1486:8: error: 'K_download_uploadLength' undeclared (first use in this function)
1486 | case K_download_uploadLength:
| ^~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1492:8: error: 'K_download_following' undeclared (first use in this function)
1492 | case K_download_following:
| ^~~~~~~~~~~~~~~~~~~~
aria2t.c:1497:8: error: 'K_download_belongsTo' undeclared (first use in this function)
1497 | case K_download_belongsTo:
| ^~~~~~~~~~~~~~~~~~~~
aria2t.c:1517:8: error: 'K_download_errorMessage' undeclared (first use in this function)
1517 | case K_download_errorMessage:
| ^~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1522:8: error: 'K_download_downloadSpeed' undeclared (first use in this function)
1522 | case K_download_downloadSpeed:
| ^~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1528:8: error: 'K_download_uploadSpeed' undeclared (first use in this function)
1528 | case K_download_uploadSpeed:
| ^~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1534:8: error: 'K_download_totalLength' undeclared (first use in this function)
1534 | case K_download_totalLength:
| ^~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1538:8: error: 'K_download_connections' undeclared (first use in this function)
1538 | case K_download_connections:
| ^~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1542:8: error: 'K_download_verifiedLength' undeclared (first use in this function)
1542 | case K_download_verifiedLength:
| ^~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1546:8: error: 'K_download_verifyIntegrityPending' undeclared (first use in this function)
1546 | case K_download_verifyIntegrityPending:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1550:8: error: 'K_download_none' undeclared (first use in this function)
1550 | case K_download_none:
| ^~~~~~~~~~~~~~~
aria2t.c: In function 'parse_option':
aria2t.c:1592:11: warning: implicit declaration of function 'K_option_parse' [-Wimplicit-function-declaration]
1592 | switch (K_option_parse(option)) {
| ^~~~~~~~~~~~~~
aria2t.c:1597:8: error: 'K_option_max__download__limit' undeclared (first use in this function)
1597 | case K_option_max__download__limit:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1603:8: error: 'K_option_max__upload__limit' undeclared (first use in this function)
1603 | case K_option_max__upload__limit:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1609:8: error: 'K_option_seed__ratio' undeclared (first use in this function)
1609 | case K_option_seed__ratio:
| ^~~~~~~~~~~~~~~~~~~~
aria2t.c:1617:8: error: 'K_option_dir' undeclared (first use in this function)
1617 | case K_option_dir:
| ^~~~~~~~~~~~
aria2t.c:1628:8: error: 'K_option_bt__external__ip' undeclared (first use in this function)
1628 | case K_option_bt__external__ip:
| ^~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1632:8: error: 'K_option_max__overall__download__limit' undeclared (first use in this function)
1632 | case K_option_max__overall__download__limit:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aria2t.c:1636:8: error: 'K_option_max__overall__upload__limit' undeclared (first use in this function)
1636 | case K_option_max__overall__upload__limit:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:37: aria2t] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment