Commit efbf807 1 parent ae63e78 commit efbf807 Copy full SHA for efbf807
File tree 4 files changed +5
-19
lines changed
4 files changed +5
-19
lines changed Original file line number Diff line number Diff line change 28
28
29
29
30
30
int main (int argc , char * * argv ) {
31
- TJS_SetupArgs (argc , argv );
31
+ TJS_Initialize (argc , argv );
32
32
33
33
TJSRuntime * qrt = TJS_NewRuntime ();
34
34
CHECK_NOT_NULL (qrt );
Original file line number Diff line number Diff line change 31
31
"txiki.js/" STRINGIFY(TJS_VERSION_MAJOR) "." STRINGIFY(TJS_VERSION_MINOR) "." STRINGIFY(TJS_VERSION_PATCH) \
32
32
TJS_VERSION_SUFFIX
33
33
34
- static uv_once_t curl__init_once = UV_ONCE_INIT ;
35
-
36
- static void tjs__curl_init_once (void ) {
37
- curl_global_init (CURL_GLOBAL_ALL );
38
- }
39
-
40
- static void tjs__curl_init (void ) {
41
- uv_once (& curl__init_once , tjs__curl_init_once );
42
- }
43
-
44
34
CURL * tjs__curl_easy_init (CURL * curl_h ) {
45
- tjs__curl_init ();
46
-
47
35
if (curl_h == NULL )
48
36
curl_h = curl_easy_init ();
49
37
@@ -261,8 +249,6 @@ CURLM *tjs__get_curlm(JSContext *ctx) {
261
249
CHECK_NOT_NULL (qrt );
262
250
263
251
if (!qrt -> curl_ctx .curlm_h ) {
264
- tjs__curl_init ();
265
-
266
252
CURLM * curlm_h = curl_multi_init ();
267
253
curl_multi_setopt (curlm_h , CURLMOPT_SOCKETFUNCTION , curl__handle_socket );
268
254
curl_multi_setopt (curlm_h , CURLMOPT_SOCKETDATA , qrt );
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ void TJS_DefaultOptions(TJSRunOptions *options);
42
42
TJSRuntime * TJS_NewRuntime (void );
43
43
TJSRuntime * TJS_NewRuntimeOptions (TJSRunOptions * options );
44
44
void TJS_FreeRuntime (TJSRuntime * qrt );
45
- void TJS_SetupArgs (int argc , char * * argv );
45
+ void TJS_Initialize (int argc , char * * argv );
46
46
JSContext * TJS_GetJSContext (TJSRuntime * qrt );
47
47
TJSRuntime * TJS_GetRuntime (JSContext * ctx );
48
48
int TJS_Run (TJSRuntime * qrt );
Original file line number Diff line number Diff line change @@ -282,11 +282,11 @@ void TJS_FreeRuntime(TJSRuntime *qrt) {
282
282
free (qrt );
283
283
}
284
284
285
- void TJS_SetupArgs (int argc , char * * argv ) {
285
+ void TJS_Initialize (int argc , char * * argv ) {
286
+ curl_global_init (CURL_GLOBAL_ALL );
287
+
286
288
tjs__argc = argc ;
287
289
tjs__argv = uv_setup_args (argc , argv );
288
- if (!tjs__argv )
289
- tjs__argv = argv ;
290
290
}
291
291
292
292
JSContext * TJS_GetJSContext (TJSRuntime * qrt ) {
You can’t perform that action at this time.
0 commit comments