112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
$handle go
load $tmpfile myPkg
puts [ext_add 1 42]
file delete $tmpfile
}
# More involved test
set handle [tcc4tcl::new]
$handle ccode {
#include <stdint.h>
#include <curl/curl.h>
}
$handle cwrap curl_version {} vstring
$handle cproc curl_fetch {char* url} ok {
void *handle;
handle = curl_easy_init();
if (!handle) {
return(TCL_ERROR);
}
curl_easy_setopt(handle, CURLOPT_URL, url);
curl_easy_perform(handle);
return(TCL_OK);
}
$handle add_include_path /usr/include
$handle add_library_path /usr/lib64
$handle add_library_path /usr/lib
$handle add_library_path /usr/lib32
$handle add_library curl
$handle go
curl_fetch http://rkeene.org/
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
$handle go
load $tmpfile myPkg
puts [ext_add 1 42]
file delete $tmpfile
}
# More involved test
if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} {
set handle [tcc4tcl::new]
$handle ccode {
#include <stdint.h>
#include <curl/curl.h>
}
$handle cwrap curl_version {} vstring
$handle cproc curl_fetch {char* url} ok {
void *handle;
handle = curl_easy_init();
if (!handle) {
return(TCL_ERROR);
}
curl_easy_setopt(handle, CURLOPT_URL, url);
curl_easy_perform(handle);
return(TCL_OK);
}
$handle add_include_path /usr/include
$handle add_library_path /usr/lib64
$handle add_library_path /usr/lib
$handle add_library_path /usr/lib32
$handle add_library curl
$handle go
curl_fetch http://rkeene.org/
}
|