make HTTP example 'compileable'

git-svn-id: svn://kolibrios.org@4160 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-11-04 16:12:47 +00:00
parent e3e38a93a0
commit f11c912eea

View File

@ -31,12 +31,12 @@ use32
dd params ; I_PARAM dd params ; I_PARAM
dd 0x0 ; I_Path dd 0x0 ; I_Path
include '../../macros.inc' include '../../../../macros.inc'
include '../../proc32.inc' include '../../../../proc32.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../../../dll.inc'
include '../../dll.inc' include '../../../../debug-fdo.inc'
include '../../debug-fdo.inc' include '../../box_lib/trunk/box_lib.mac'
include '../../develop/libraries/http/http.inc' include '../../http/http.inc'
virtual at 0 virtual at 0
http_msg http_msg http_msg http_msg
@ -55,6 +55,8 @@ START:
cmp byte[params], 0 ; no parameters ? cmp byte[params], 0 ; no parameters ?
je reset_events ; load the GUI je reset_events ; load the GUI
inc [silently]
download: download:
DEBUGF 1, "Starting download\n" DEBUGF 1, "Starting download\n"
@ -69,6 +71,9 @@ download:
test eax, eax test eax, eax
jnz .loop jnz .loop
test [silently], 0xff
jnz save
reset_events: reset_events:
DEBUGF 1, "resetting events\n" DEBUGF 1, "resetting events\n"
@ -143,15 +148,14 @@ save:
mov [final_buffer], ebx mov [final_buffer], ebx
mcall 70, fileinfo mcall 70, fileinfo
.done: test [silently], 0xff
jnz exit
; TODO: if called from command line, then exit
mov ecx, [sc.work_text] mov ecx, [sc.work_text]
or ecx, 0x80000000 or ecx, 0x80000000
mcall 4, <10, 93>, , download_complete mcall 4, <10, 93>, , download_complete
ret jmp still
; ********************************************* ; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ******** ; ******* WINDOW DEFINITIONS AND DRAW ********
@ -204,7 +208,6 @@ library lib_http, 'http.obj', \
import lib_http, \ import lib_http, \
HTTP_get , 'get' , \ HTTP_get , 'get' , \
find_header_field , 'find_header_field' , \
HTTP_process , 'process' HTTP_process , 'process'
import box_lib, \ import box_lib, \
@ -231,9 +234,10 @@ include_debug_strings
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
type_pls db 'URL:', 0 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 download_complete db 'File saved as /rd/1/.download', 0
title db 'HTTP Downloader', 0 title db 'HTTP Downloader', 0
silently db 0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
document_user db 'http://' document_user db 'http://'