すくすくゴートうちゃん Android 版(黒歴史)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

http.mod.hsp 631 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __HTTP__
  2. #define __HTTP__
  3. #module \
  4. Http
  5. #enum STATUS_SUCCESS = 1
  6. #enum STATUS_ERROR
  7. #deffunc local \
  8. Fetch \
  9. str p_url,\
  10. local l_res,\
  11. local l_size
  12. HTTPLoad p_url
  13. If stat = 0 {
  14. Repeat
  15. HTTPInfo l_res, HTTPINFO_MODE
  16. Switch l_res
  17. Case HTTPMODE_READY
  18. Case HTTPMODE_NONE
  19. Case HTTPMODE_ERROR
  20. Break
  21. SwEnd
  22. Wait 5
  23. Loop
  24. If l_res = HTTPMODE_READY {
  25. HTTPInfo l_size, HTTPINFO_SIZE
  26. SDim data, l_size
  27. HTTPInfo data, HTTPINFO_DATA
  28. status = STATUS_SUCCESS
  29. Return
  30. }
  31. }
  32. HTTPInfo errMsg, HTTPINFO_ERROR
  33. status = STATUS_ERROR
  34. Return
  35. #global
  36. #endif ; not __HTTP__