From f11c912eeaab2332e1ed776c513abccfed94000b Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 4 Nov 2013 16:12:47 +0000 Subject: [PATCH] make HTTP example 'compileable' git-svn-id: svn://kolibrios.org@4160 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../libraries/http/examples/downloader.asm | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/programs/develop/libraries/http/examples/downloader.asm b/programs/develop/libraries/http/examples/downloader.asm index 6fe3502752..2610d4ad61 100644 --- a/programs/develop/libraries/http/examples/downloader.asm +++ b/programs/develop/libraries/http/examples/downloader.asm @@ -31,12 +31,12 @@ use32 dd params ; I_PARAM dd 0x0 ; I_Path -include '../../macros.inc' -include '../../proc32.inc' -include '../../develop/libraries/box_lib/trunk/box_lib.mac' -include '../../dll.inc' -include '../../debug-fdo.inc' -include '../../develop/libraries/http/http.inc' +include '../../../../macros.inc' +include '../../../../proc32.inc' +include '../../../../dll.inc' +include '../../../../debug-fdo.inc' +include '../../box_lib/trunk/box_lib.mac' +include '../../http/http.inc' virtual at 0 http_msg http_msg @@ -55,6 +55,8 @@ START: cmp byte[params], 0 ; no parameters ? je reset_events ; load the GUI + inc [silently] + download: DEBUGF 1, "Starting download\n" @@ -69,6 +71,9 @@ download: test eax, eax jnz .loop + test [silently], 0xff + jnz save + reset_events: DEBUGF 1, "resetting events\n" @@ -143,15 +148,14 @@ save: mov [final_buffer], ebx mcall 70, fileinfo - .done: - -; TODO: if called from command line, then exit + test [silently], 0xff + jnz exit mov ecx, [sc.work_text] or ecx, 0x80000000 mcall 4, <10, 93>, , download_complete - ret + jmp still ; ********************************************* ; ******* WINDOW DEFINITIONS AND DRAW ******** @@ -204,7 +208,6 @@ library lib_http, 'http.obj', \ import lib_http, \ HTTP_get , 'get' , \ - find_header_field , 'find_header_field' , \ HTTP_process , 'process' import box_lib, \ @@ -231,9 +234,10 @@ include_debug_strings ;--------------------------------------------------------------------- type_pls db 'URL:', 0 -button_text db 'DOWNLOAD STOP RESAVE', 0 +button_text db 'DOWNLOAD STOP SAVE', 0 download_complete db 'File saved as /rd/1/.download', 0 title db 'HTTP Downloader', 0 +silently db 0 ;--------------------------------------------------------------------- document_user db 'http://'