Mercurial > dwindows
comparison ios/dw.m @ 2991:81f9399b11c8
Mac/iOS: Fix exported API function definitions reported by Xcode.
Added missing APIs on functions, not necessary on Mac and iOS technically
but for consistence they should be there and for future use.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 04 Apr 2023 12:05:14 +0000 |
parents | ae4d6856b983 |
children | 8311be624877 |
comparison
equal
deleted
inserted
replaced
2990:9220cbf90ed3 | 2991:81f9399b11c8 |
---|---|
4317 /* | 4317 /* |
4318 * Returns a pointer to a static buffer which containes the | 4318 * Returns a pointer to a static buffer which containes the |
4319 * current user directory. Or the root directory (C:\ on | 4319 * current user directory. Or the root directory (C:\ on |
4320 * OS/2 and Windows). | 4320 * OS/2 and Windows). |
4321 */ | 4321 */ |
4322 char *dw_user_dir(void) | 4322 char * API dw_user_dir(void) |
4323 { | 4323 { |
4324 static char _user_dir[PATH_MAX+1] = { 0 }; | 4324 static char _user_dir[PATH_MAX+1] = { 0 }; |
4325 | 4325 |
4326 if(!_user_dir[0]) | 4326 if(!_user_dir[0]) |
4327 { | 4327 { |
4505 * None. | 4505 * None. |
4506 * Returns: | 4506 * Returns: |
4507 * Pointer to an allocated string of text or NULL if clipboard empty or contents could not | 4507 * Pointer to an allocated string of text or NULL if clipboard empty or contents could not |
4508 * be converted to text. | 4508 * be converted to text. |
4509 */ | 4509 */ |
4510 char *dw_clipboard_get_text() | 4510 char * API dw_clipboard_get_text(void) |
4511 { | 4511 { |
4512 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; | 4512 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; |
4513 NSString *str = [pasteboard string]; | 4513 NSString *str = [pasteboard string]; |
4514 if(str != nil) | 4514 if(str != nil) |
4515 return strdup([str UTF8String]); | 4515 return strdup([str UTF8String]); |
4519 /* | 4519 /* |
4520 * Sets the contents of the default clipboard to the supplied text. | 4520 * Sets the contents of the default clipboard to the supplied text. |
4521 * Parameters: | 4521 * Parameters: |
4522 * Text. | 4522 * Text. |
4523 */ | 4523 */ |
4524 void dw_clipboard_set_text(const char *str, int len) | 4524 void API dw_clipboard_set_text(const char *str, int len) |
4525 { | 4525 { |
4526 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; | 4526 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; |
4527 | 4527 |
4528 [pasteboard setString:[NSString stringWithUTF8String:str]]; | 4528 [pasteboard setString:[NSString stringWithUTF8String:str]]; |
4529 } | 4529 } |
8036 /* | 8036 /* |
8037 * Optimizes the column widths so that all data is visible. | 8037 * Optimizes the column widths so that all data is visible. |
8038 * Parameters: | 8038 * Parameters: |
8039 * handle: Handle to the window (widget) to be optimized. | 8039 * handle: Handle to the window (widget) to be optimized. |
8040 */ | 8040 */ |
8041 void dw_container_optimize(HWND handle) | 8041 void API dw_container_optimize(HWND handle) |
8042 { | 8042 { |
8043 /* TODO: Not sure if we need to implement this on iOS */ | 8043 /* TODO: Not sure if we need to implement this on iOS */ |
8044 } | 8044 } |
8045 | 8045 |
8046 /* | 8046 /* |
10471 * or NULL if it fails or notifications are not supported by the system. | 10471 * or NULL if it fails or notifications are not supported by the system. |
10472 * Remarks: | 10472 * Remarks: |
10473 * This will create a system notification that will show in the notifaction panel | 10473 * This will create a system notification that will show in the notifaction panel |
10474 * on supported systems, which may be clicked to perform another task. | 10474 * on supported systems, which may be clicked to perform another task. |
10475 */ | 10475 */ |
10476 HWND dw_notification_new(const char *title, const char *imagepath, const char *description, ...) | 10476 HWND API dw_notification_new(const char *title, const char *imagepath, const char *description, ...) |
10477 { | 10477 { |
10478 char outbuf[1025] = {0}; | 10478 char outbuf[1025] = {0}; |
10479 HWND retval = NULL; | 10479 HWND retval = NULL; |
10480 | 10480 |
10481 if(description) | 10481 if(description) |
10522 * Parameters: | 10522 * Parameters: |
10523 * notification: The handle to the notification returned by dw_notification_new(). | 10523 * notification: The handle to the notification returned by dw_notification_new(). |
10524 * Returns: | 10524 * Returns: |
10525 * DW_ERROR_NONE on success, DW_ERROR_UNKNOWN on error or not supported. | 10525 * DW_ERROR_NONE on success, DW_ERROR_UNKNOWN on error or not supported. |
10526 */ | 10526 */ |
10527 int dw_notification_send(HWND notification) | 10527 int API dw_notification_send(HWND notification) |
10528 { | 10528 { |
10529 if(notification) | 10529 if(notification) |
10530 { | 10530 { |
10531 NSString *notid = [NSString stringWithFormat:@"dw-notification-%llu", DW_POINTER_TO_ULONGLONG(notification)]; | 10531 NSString *notid = [NSString stringWithFormat:@"dw-notification-%llu", DW_POINTER_TO_ULONGLONG(notification)]; |
10532 | 10532 |
10551 /* | 10551 /* |
10552 * Returns some information about the current operating environment. | 10552 * Returns some information about the current operating environment. |
10553 * Parameters: | 10553 * Parameters: |
10554 * env: Pointer to a DWEnv struct. | 10554 * env: Pointer to a DWEnv struct. |
10555 */ | 10555 */ |
10556 void dw_environment_query(DWEnv *env) | 10556 void API dw_environment_query(DWEnv *env) |
10557 { | 10557 { |
10558 memset(env, '\0', sizeof(DWEnv)); | 10558 memset(env, '\0', sizeof(DWEnv)); |
10559 strcpy(env->osName, "iOS"); | 10559 strcpy(env->osName, "iOS"); |
10560 | 10560 |
10561 strncpy(env->buildDate, __DATE__, sizeof(env->buildDate)-1); | 10561 strncpy(env->buildDate, __DATE__, sizeof(env->buildDate)-1); |
11080 * Parameters: | 11080 * Parameters: |
11081 * name: Base name of the shared library. | 11081 * name: Base name of the shared library. |
11082 * handle: Pointer to a module handle, | 11082 * handle: Pointer to a module handle, |
11083 * will be filled in with the handle. | 11083 * will be filled in with the handle. |
11084 */ | 11084 */ |
11085 int dw_module_load(const char *name, HMOD *handle) | 11085 int API dw_module_load(const char *name, HMOD *handle) |
11086 { | 11086 { |
11087 int len; | 11087 int len; |
11088 char *newname; | 11088 char *newname; |
11089 char errorbuf[1025]; | 11089 char errorbuf[1025]; |
11090 | 11090 |
11123 * handle: Module handle returned by dw_module_load() | 11123 * handle: Module handle returned by dw_module_load() |
11124 * name: Name of the symbol you want the address of. | 11124 * name: Name of the symbol you want the address of. |
11125 * func: A pointer to a function pointer, to obtain | 11125 * func: A pointer to a function pointer, to obtain |
11126 * the address. | 11126 * the address. |
11127 */ | 11127 */ |
11128 int dw_module_symbol(HMOD handle, const char *name, void**func) | 11128 int API dw_module_symbol(HMOD handle, const char *name, void**func) |
11129 { | 11129 { |
11130 if(!func || !name) | 11130 if(!func || !name) |
11131 return -1; | 11131 return -1; |
11132 | 11132 |
11133 if(strlen(name) == 0) | 11133 if(strlen(name) == 0) |
11139 | 11139 |
11140 /* Frees the shared library previously opened. | 11140 /* Frees the shared library previously opened. |
11141 * Parameters: | 11141 * Parameters: |
11142 * handle: Module handle returned by dw_module_load() | 11142 * handle: Module handle returned by dw_module_load() |
11143 */ | 11143 */ |
11144 int dw_module_close(HMOD handle) | 11144 int API dw_module_close(HMOD handle) |
11145 { | 11145 { |
11146 if(handle) | 11146 if(handle) |
11147 return dlclose(handle); | 11147 return dlclose(handle); |
11148 return 0; | 11148 return 0; |
11149 } | 11149 } |
11150 | 11150 |
11151 /* | 11151 /* |
11152 * Returns the handle to an unnamed mutex semaphore. | 11152 * Returns the handle to an unnamed mutex semaphore. |
11153 */ | 11153 */ |
11154 HMTX dw_mutex_new(void) | 11154 HMTX API dw_mutex_new(void) |
11155 { | 11155 { |
11156 HMTX mutex = malloc(sizeof(pthread_mutex_t)); | 11156 HMTX mutex = malloc(sizeof(pthread_mutex_t)); |
11157 | 11157 |
11158 pthread_mutex_init(mutex, NULL); | 11158 pthread_mutex_init(mutex, NULL); |
11159 return mutex; | 11159 return mutex; |
11162 /* | 11162 /* |
11163 * Closes a semaphore created by dw_mutex_new(). | 11163 * Closes a semaphore created by dw_mutex_new(). |
11164 * Parameters: | 11164 * Parameters: |
11165 * mutex: The handle to the mutex returned by dw_mutex_new(). | 11165 * mutex: The handle to the mutex returned by dw_mutex_new(). |
11166 */ | 11166 */ |
11167 void dw_mutex_close(HMTX mutex) | 11167 void API dw_mutex_close(HMTX mutex) |
11168 { | 11168 { |
11169 if(mutex) | 11169 if(mutex) |
11170 { | 11170 { |
11171 pthread_mutex_destroy(mutex); | 11171 pthread_mutex_destroy(mutex); |
11172 free(mutex); | 11172 free(mutex); |
11176 /* | 11176 /* |
11177 * Tries to gain access to the semaphore, if it can't it blocks. | 11177 * Tries to gain access to the semaphore, if it can't it blocks. |
11178 * Parameters: | 11178 * Parameters: |
11179 * mutex: The handle to the mutex returned by dw_mutex_new(). | 11179 * mutex: The handle to the mutex returned by dw_mutex_new(). |
11180 */ | 11180 */ |
11181 void dw_mutex_lock(HMTX mutex) | 11181 void API dw_mutex_lock(HMTX mutex) |
11182 { | 11182 { |
11183 /* We need to handle locks from the main thread differently... | 11183 /* We need to handle locks from the main thread differently... |
11184 * since we can't stop message processing... otherwise we | 11184 * since we can't stop message processing... otherwise we |
11185 * will deadlock... so try to acquire the lock and continue | 11185 * will deadlock... so try to acquire the lock and continue |
11186 * processing messages in between tries. | 11186 * processing messages in between tries. |
11216 /* | 11216 /* |
11217 * Reliquishes the access to the semaphore. | 11217 * Reliquishes the access to the semaphore. |
11218 * Parameters: | 11218 * Parameters: |
11219 * mutex: The handle to the mutex returned by dw_mutex_new(). | 11219 * mutex: The handle to the mutex returned by dw_mutex_new(). |
11220 */ | 11220 */ |
11221 void dw_mutex_unlock(HMTX mutex) | 11221 void API dw_mutex_unlock(HMTX mutex) |
11222 { | 11222 { |
11223 pthread_mutex_unlock(mutex); | 11223 pthread_mutex_unlock(mutex); |
11224 } | 11224 } |
11225 | 11225 |
11226 /* | 11226 /* |
11227 * Returns the handle to an unnamed event semaphore. | 11227 * Returns the handle to an unnamed event semaphore. |
11228 */ | 11228 */ |
11229 HEV dw_event_new(void) | 11229 HEV API dw_event_new(void) |
11230 { | 11230 { |
11231 HEV eve = (HEV)malloc(sizeof(struct _dw_unix_event)); | 11231 HEV eve = (HEV)malloc(sizeof(struct _dw_unix_event)); |
11232 | 11232 |
11233 if(!eve) | 11233 if(!eve) |
11234 return NULL; | 11234 return NULL; |
11251 /* | 11251 /* |
11252 * Resets a semaphore created by dw_event_new(). | 11252 * Resets a semaphore created by dw_event_new(). |
11253 * Parameters: | 11253 * Parameters: |
11254 * eve: The handle to the event returned by dw_event_new(). | 11254 * eve: The handle to the event returned by dw_event_new(). |
11255 */ | 11255 */ |
11256 int dw_event_reset (HEV eve) | 11256 int API dw_event_reset(HEV eve) |
11257 { | 11257 { |
11258 if(!eve) | 11258 if(!eve) |
11259 return DW_ERROR_NON_INIT; | 11259 return DW_ERROR_NON_INIT; |
11260 | 11260 |
11261 pthread_mutex_lock (&(eve->mutex)); | 11261 pthread_mutex_lock (&(eve->mutex)); |
11270 * Posts a semaphore created by dw_event_new(). Causing all threads | 11270 * Posts a semaphore created by dw_event_new(). Causing all threads |
11271 * waiting on this event in dw_event_wait to continue. | 11271 * waiting on this event in dw_event_wait to continue. |
11272 * Parameters: | 11272 * Parameters: |
11273 * eve: The handle to the event returned by dw_event_new(). | 11273 * eve: The handle to the event returned by dw_event_new(). |
11274 */ | 11274 */ |
11275 int dw_event_post (HEV eve) | 11275 int API dw_event_post(HEV eve) |
11276 { | 11276 { |
11277 if(!eve) | 11277 if(!eve) |
11278 return FALSE; | 11278 return FALSE; |
11279 | 11279 |
11280 pthread_mutex_lock (&(eve->mutex)); | 11280 pthread_mutex_lock (&(eve->mutex)); |
11288 * Waits on a semaphore created by dw_event_new(), until the | 11288 * Waits on a semaphore created by dw_event_new(), until the |
11289 * event gets posted or until the timeout expires. | 11289 * event gets posted or until the timeout expires. |
11290 * Parameters: | 11290 * Parameters: |
11291 * eve: The handle to the event returned by dw_event_new(). | 11291 * eve: The handle to the event returned by dw_event_new(). |
11292 */ | 11292 */ |
11293 int dw_event_wait(HEV eve, unsigned long timeout) | 11293 int API dw_event_wait(HEV eve, unsigned long timeout) |
11294 { | 11294 { |
11295 int rc; | 11295 int rc; |
11296 | 11296 |
11297 if(!eve) | 11297 if(!eve) |
11298 return DW_ERROR_NON_INIT; | 11298 return DW_ERROR_NON_INIT; |
11328 /* | 11328 /* |
11329 * Closes a semaphore created by dw_event_new(). | 11329 * Closes a semaphore created by dw_event_new(). |
11330 * Parameters: | 11330 * Parameters: |
11331 * eve: The handle to the event returned by dw_event_new(). | 11331 * eve: The handle to the event returned by dw_event_new(). |
11332 */ | 11332 */ |
11333 int dw_event_close(HEV *eve) | 11333 int API dw_event_close(HEV *eve) |
11334 { | 11334 { |
11335 if(!eve || !(*eve)) | 11335 if(!eve || !(*eve)) |
11336 return DW_ERROR_NON_INIT; | 11336 return DW_ERROR_NON_INIT; |
11337 | 11337 |
11338 pthread_mutex_lock (&((*eve)->mutex)); | 11338 pthread_mutex_lock (&((*eve)->mutex)); |
11507 * Parameters: | 11507 * Parameters: |
11508 * eve: Pointer to an event handle to receive handle. | 11508 * eve: Pointer to an event handle to receive handle. |
11509 * name: Name given to semaphore which can be opened | 11509 * name: Name given to semaphore which can be opened |
11510 * by other processes. | 11510 * by other processes. |
11511 */ | 11511 */ |
11512 HEV dw_named_event_new(const char *name) | 11512 HEV API dw_named_event_new(const char *name) |
11513 { | 11513 { |
11514 struct sockaddr_un un; | 11514 struct sockaddr_un un; |
11515 int ev, *tmpsock = (int *)malloc(sizeof(int)*2); | 11515 int ev, *tmpsock = (int *)malloc(sizeof(int)*2); |
11516 HEV eve; | 11516 HEV eve; |
11517 DWTID dwthread; | 11517 DWTID dwthread; |
11568 * Parameters: | 11568 * Parameters: |
11569 * eve: Pointer to an event handle to receive handle. | 11569 * eve: Pointer to an event handle to receive handle. |
11570 * name: Name given to semaphore which can be opened | 11570 * name: Name given to semaphore which can be opened |
11571 * by other processes. | 11571 * by other processes. |
11572 */ | 11572 */ |
11573 HEV dw_named_event_get(const char *name) | 11573 HEV API dw_named_event_get(const char *name) |
11574 { | 11574 { |
11575 struct sockaddr_un un; | 11575 struct sockaddr_un un; |
11576 HEV eve; | 11576 HEV eve; |
11577 int ev = socket(AF_UNIX, SOCK_STREAM, 0); | 11577 int ev = socket(AF_UNIX, SOCK_STREAM, 0); |
11578 if(ev < 0) | 11578 if(ev < 0) |
11599 * on this semaphore will block. | 11599 * on this semaphore will block. |
11600 * Parameters: | 11600 * Parameters: |
11601 * eve: Handle to the semaphore obtained by | 11601 * eve: Handle to the semaphore obtained by |
11602 * an open or create call. | 11602 * an open or create call. |
11603 */ | 11603 */ |
11604 int dw_named_event_reset(HEV eve) | 11604 int API dw_named_event_reset(HEV eve) |
11605 { | 11605 { |
11606 /* signal reset */ | 11606 /* signal reset */ |
11607 char tmp = (char)0; | 11607 char tmp = (char)0; |
11608 | 11608 |
11609 if(!eve || eve->alive < 0) | 11609 if(!eve || eve->alive < 0) |
11618 * waiting on the semaphore will no longer block. | 11618 * waiting on the semaphore will no longer block. |
11619 * Parameters: | 11619 * Parameters: |
11620 * eve: Handle to the semaphore obtained by | 11620 * eve: Handle to the semaphore obtained by |
11621 * an open or create call. | 11621 * an open or create call. |
11622 */ | 11622 */ |
11623 int dw_named_event_post(HEV eve) | 11623 int API dw_named_event_post(HEV eve) |
11624 { | 11624 { |
11625 | 11625 |
11626 /* signal post */ | 11626 /* signal post */ |
11627 char tmp = (char)1; | 11627 char tmp = (char)1; |
11628 | 11628 |
11640 * eve: Handle to the semaphore obtained by | 11640 * eve: Handle to the semaphore obtained by |
11641 * an open or create call. | 11641 * an open or create call. |
11642 * timeout: Number of milliseconds before timing out | 11642 * timeout: Number of milliseconds before timing out |
11643 * or -1 if indefinite. | 11643 * or -1 if indefinite. |
11644 */ | 11644 */ |
11645 int dw_named_event_wait(HEV eve, unsigned long timeout) | 11645 int API dw_named_event_wait(HEV eve, unsigned long timeout) |
11646 { | 11646 { |
11647 fd_set rd; | 11647 fd_set rd; |
11648 struct timeval tv, *useme = NULL; | 11648 struct timeval tv, *useme = NULL; |
11649 int retval = 0; | 11649 int retval = 0; |
11650 char tmp; | 11650 char tmp; |
11690 * handles on this semaphore the semaphore will be destroyed. | 11690 * handles on this semaphore the semaphore will be destroyed. |
11691 * Parameters: | 11691 * Parameters: |
11692 * eve: Handle to the semaphore obtained by | 11692 * eve: Handle to the semaphore obtained by |
11693 * an open or create call. | 11693 * an open or create call. |
11694 */ | 11694 */ |
11695 int dw_named_event_close(HEV eve) | 11695 int API dw_named_event_close(HEV eve) |
11696 { | 11696 { |
11697 /* Finally close the domain socket, | 11697 /* Finally close the domain socket, |
11698 * cleanup will continue in _dw_handle_sem. | 11698 * cleanup will continue in _dw_handle_sem. |
11699 */ | 11699 */ |
11700 if(eve) | 11700 if(eve) |
11952 * handle: A pointer to receive a SHM identifier. | 11952 * handle: A pointer to receive a SHM identifier. |
11953 * dest: A pointer to a pointer to receive the memory address. | 11953 * dest: A pointer to a pointer to receive the memory address. |
11954 * size: Size in bytes of the shared memory region to allocate. | 11954 * size: Size in bytes of the shared memory region to allocate. |
11955 * name: A string pointer to a unique memory name. | 11955 * name: A string pointer to a unique memory name. |
11956 */ | 11956 */ |
11957 HSHM dw_named_memory_new(void **dest, int size, const char *name) | 11957 HSHM API dw_named_memory_new(void **dest, int size, const char *name) |
11958 { | 11958 { |
11959 char namebuf[1025] = {0}; | 11959 char namebuf[1025] = {0}; |
11960 struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); | 11960 struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); |
11961 | 11961 |
11962 mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); | 11962 mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); |
11993 * Parameters: | 11993 * Parameters: |
11994 * dest: A pointer to a pointer to receive the memory address. | 11994 * dest: A pointer to a pointer to receive the memory address. |
11995 * size: Size in bytes of the shared memory region to requested. | 11995 * size: Size in bytes of the shared memory region to requested. |
11996 * name: A string pointer to a unique memory name. | 11996 * name: A string pointer to a unique memory name. |
11997 */ | 11997 */ |
11998 HSHM dw_named_memory_get(void **dest, int size, const char *name) | 11998 HSHM API dw_named_memory_get(void **dest, int size, const char *name) |
11999 { | 11999 { |
12000 char namebuf[1025]; | 12000 char namebuf[1025]; |
12001 struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); | 12001 struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); |
12002 | 12002 |
12003 mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); | 12003 mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); |
12031 * Frees a shared memory region previously allocated. | 12031 * Frees a shared memory region previously allocated. |
12032 * Parameters: | 12032 * Parameters: |
12033 * handle: Handle obtained from DB_named_memory_allocate. | 12033 * handle: Handle obtained from DB_named_memory_allocate. |
12034 * ptr: The memory address aquired with DB_named_memory_allocate. | 12034 * ptr: The memory address aquired with DB_named_memory_allocate. |
12035 */ | 12035 */ |
12036 int dw_named_memory_free(HSHM handle, void *ptr) | 12036 int API dw_named_memory_free(HSHM handle, void *ptr) |
12037 { | 12037 { |
12038 struct _dw_unix_shm *h = handle; | 12038 struct _dw_unix_shm *h = handle; |
12039 int rc = munmap(ptr, h->size); | 12039 int rc = munmap(ptr, h->size); |
12040 | 12040 |
12041 close(h->fd); | 12041 close(h->fd); |
12056 * Parameters: | 12056 * Parameters: |
12057 * func: Function which will be run in the new thread. | 12057 * func: Function which will be run in the new thread. |
12058 * data: Parameter(s) passed to the function. | 12058 * data: Parameter(s) passed to the function. |
12059 * stack: Stack size of new thread (OS/2 and Windows only). | 12059 * stack: Stack size of new thread (OS/2 and Windows only). |
12060 */ | 12060 */ |
12061 DWTID dw_thread_new(void *func, void *data, int stack) | 12061 DWTID API dw_thread_new(void *func, void *data, int stack) |
12062 { | 12062 { |
12063 DWTID thread; | 12063 DWTID thread; |
12064 void **tmp = malloc(sizeof(void *) * 2); | 12064 void **tmp = malloc(sizeof(void *) * 2); |
12065 int rc; | 12065 int rc; |
12066 | 12066 |
12074 } | 12074 } |
12075 | 12075 |
12076 /* | 12076 /* |
12077 * Ends execution of current thread immediately. | 12077 * Ends execution of current thread immediately. |
12078 */ | 12078 */ |
12079 void dw_thread_end(void) | 12079 void API dw_thread_end(void) |
12080 { | 12080 { |
12081 pthread_exit(NULL); | 12081 pthread_exit(NULL); |
12082 } | 12082 } |
12083 | 12083 |
12084 /* | 12084 /* |
12085 * Returns the current thread's ID. | 12085 * Returns the current thread's ID. |
12086 */ | 12086 */ |
12087 DWTID dw_thread_id(void) | 12087 DWTID API dw_thread_id(void) |
12088 { | 12088 { |
12089 return (DWTID)pthread_self(); | 12089 return (DWTID)pthread_self(); |
12090 } | 12090 } |
12091 | 12091 |
12092 /* | 12092 /* |
12119 /* | 12119 /* |
12120 * Loads a web browser pointed at the given URL. | 12120 * Loads a web browser pointed at the given URL. |
12121 * Parameters: | 12121 * Parameters: |
12122 * url: Uniform resource locator. | 12122 * url: Uniform resource locator. |
12123 */ | 12123 */ |
12124 int dw_browse(const char *url) | 12124 int API dw_browse(const char *url) |
12125 { | 12125 { |
12126 NSURL *myurl = [NSURL URLWithString:[NSString stringWithUTF8String:url]]; | 12126 NSURL *myurl = [NSURL URLWithString:[NSString stringWithUTF8String:url]]; |
12127 [DWApp openURL:myurl options:@{} | 12127 [DWApp openURL:myurl options:@{} |
12128 completionHandler:^(BOOL success) {}]; | 12128 completionHandler:^(BOOL success) {}]; |
12129 return DW_ERROR_NONE; | 12129 return DW_ERROR_NONE; |