Skip to content

Commit

Permalink
v1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeduglas committed Jul 12, 2017
1 parent 705afd4 commit e34ef12
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ libcurl for Clarion

## Required C6.3 and newer.

v1.17
- FIX: in TCurlClass methods .SetUrl, .SetUserPwd, .SetCAInfo now accept unlimited string arguments.
- FIX: in TCurlDropboxClass size of some local string variables were increased.


v1.16
- FIX: TCurlClass.AddHttpHeader(STRING pHeader) now accepts unlimited HTTP header string (it was 255 characters).
Expand Down
12 changes: 6 additions & 6 deletions libsrc/libcurl.clw
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!** libcurl for Clarion v1.16
!** 28.06.2017
!** libcurl for Clarion v1.17
!** 12.07.2017
!** mikeduglas66@gmail.com


Expand Down Expand Up @@ -205,7 +205,7 @@ cs CSTRING(LEN(s) + LEN(prefix) + 1)

curl::GetFileContents PROCEDURE(STRING pFile)
OS_INVALID_HANDLE_VALUE EQUATE(-1)
szFile CSTRING(256)
szFile CSTRING(LEN(pFile) + 1)
sData &STRING
hFile HANDLE
dwFileSize LONG
Expand Down Expand Up @@ -704,7 +704,7 @@ TCurlClass.SetOpt PROCEDURE(CURLoption option, TCurlSList plist)
RETURN curl_easy_setopt(SELF.curl, option, plist.GetList())

TCurlClass.SetUrl PROCEDURE(STRING pUrl)
url CSTRING(256)
url CSTRING(LEN(pUrl) + 1)
CODE
url = CLIP(pUrl)
RETURN SELF.SetOpt(CURLOPT_URL, ADDRESS(url))
Expand All @@ -728,7 +728,7 @@ TCurlClass.StrError PROCEDURE(CURLcode errcode)
RETURN curl_easy_strerror(errcode)

TCurlClass.SetUserPwd PROCEDURE(STRING pUser, STRING pPwd)
userpwd CSTRING(256)
userpwd CSTRING(LEN(pUser) + LEN(pPwd) + 1 + 1)
CODE
IF pUser AND pPwd
userpwd = CLIP(pUser) &':'& CLIP(pPwd)
Expand Down Expand Up @@ -1117,7 +1117,7 @@ TCurlClass.SetSSLVerifyPeer PROCEDURE(BOOL pValue)
RETURN SELF.SetOpt(CURLOPT_SSL_VERIFYPEER, pValue)

TCurlClass.SetCAInfo PROCEDURE(STRING pCert)
szcert CSTRING(256)
szcert CSTRING(LEN(pCert) + 1)
CODE
szcert = CLIP(pCert)
RETURN SELF.SetOpt(CURLOPT_CAINFO, ADDRESS(szcert))
Expand Down
4 changes: 2 additions & 2 deletions libsrc/libcurl.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!** libcurl for Clarion v1.16
!** 29.06.2017
!** libcurl for Clarion v1.17
!** 12.07.2017
!** mikeduglas66@gmail.com

INCLUDE('DynStr.inc'), ONCE
Expand Down
24 changes: 12 additions & 12 deletions libsrc/libcurldropbox.clw
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!** libcurl for Clarion v1.14
!** 11.01.2017
!** libcurl for Clarion v1.17
!** 12.07.2017
!** mikeduglas66@gmail.com

MEMBER
Expand Down Expand Up @@ -55,7 +55,7 @@ TCurlDropboxClass.AccessToken PROCEDURE()

TCurlDropboxClass.Authorize PROCEDURE(STRING pAppKey)
szAction CSTRING('open')
szUrl CSTRING(256)
szUrl CSTRING(512)
CODE
szUrl = 'https://www.dropbox.com/oauth2/authorize?response_type=code&client_id='& CLIP(pAppKey)
winapi::ShellExecute(0, szAction, szUrl, , , SW_SHOWNORMAL)
Expand Down Expand Up @@ -202,7 +202,7 @@ rc CURLcode, AUTO

TCurlDropboxClass.Copy PROCEDURE(STRING pFromPath, STRING pToPath)
func STRING('copy')
args CSTRING(256)
args CSTRING(1024)
CODE
args = '{{"from_path": "'& CLIP(pFromPath) &'","to_path": "'& CLIP(pToPath) &'"}'
SELF._lastCurlCode = SELF.SetRPCEndpoint(args)
Expand All @@ -219,7 +219,7 @@ args CSTRING(256)

TCurlDropboxClass.Move PROCEDURE(STRING pFromPath, STRING pToPath)
func STRING('move')
args CSTRING(256)
args CSTRING(1024)
CODE
args = '{{"from_path": "'& CLIP(pFromPath) &'","to_path": "'& CLIP(pToPath) &'"}'
SELF._lastCurlCode = SELF.SetRPCEndpoint(args)
Expand All @@ -236,7 +236,7 @@ args CSTRING(256)

TCurlDropboxClass.CreateFolder PROCEDURE(STRING pPath)
func STRING('create_folder')
args CSTRING(256)
args CSTRING(512)
CODE
args = '{{"path": "'& CLIP(pPath) &'"}'
SELF._lastCurlCode = SELF.SetRPCEndpoint(args)
Expand All @@ -253,7 +253,7 @@ args CSTRING(256)

TCurlDropboxClass.Delete PROCEDURE(STRING pPath)
func STRING('delete')
args CSTRING(256)
args CSTRING(512)
CODE
args = '{{"path": "'& CLIP(pPath) &'"}'
SELF._lastCurlCode = SELF.SetRPCEndpoint(args)
Expand All @@ -270,7 +270,7 @@ args CSTRING(256)

TCurlDropboxClass.Download PROCEDURE(STRING pRemotePath, STRING pLocalPath)
func STRING('download')
args CSTRING(256)
args CSTRING(512)
fs TCurlFileStruct
dwBytes LONG, AUTO
CODE
Expand Down Expand Up @@ -337,7 +337,7 @@ fileContent &STRING

TCurlDropboxClass.ListFolder PROCEDURE(STRING pPath, BOOL pRecursive = FALSE)
func STRING('list_folder')
args CSTRING(256)
args CSTRING(512)
CODE
args = '{{"path": "'& CLIP(pPath) &'"'
IF pRecursive
Expand All @@ -359,7 +359,7 @@ args CSTRING(256)

TCurlDropboxClass.Get_Copy_Reference PROCEDURE(STRING pPath)
func STRING('copy_reference/get')
args CSTRING(256)
args CSTRING(512)
CODE
args = '{{"path": "'& CLIP(pPath) &'"}'
SELF._lastCurlCode = SELF.SetRPCEndpoint(args)
Expand Down Expand Up @@ -393,7 +393,7 @@ args CSTRING(512)

TCurlDropboxClass.Preview PROCEDURE(STRING pPath, *STRING pTmpFile)
func STRING('get_preview')
args CSTRING(256)
args CSTRING(512)
htmlDocTypeStr STRING('<<!DOCTYPE html>')
pdfDocTypeStr STRING('%PDF')
fs TCurlFileStruct
Expand Down Expand Up @@ -431,7 +431,7 @@ rc BOOL(FALSE)

TCurlDropboxClass.Thumbnail PROCEDURE(STRING pPath, TDbxThumbnailFormat pFormat, TDbxThumbnailSize pSize, *STRING pTmpFile)
func STRING('get_thumbnail')
args CSTRING(256)
args CSTRING(1024)
fs TCurlFileStruct
dwBytes LONG, AUTO
rc BOOL(FALSE)
Expand Down

0 comments on commit e34ef12

Please sign in to comment.