axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r580204 - in /webservices/axis2/trunk/c/util/src/platforms/windows: axutil_windows.c date_time_util_windows.c dir_windows.c getopt_windows.c thread_mutex_windows.c thread_windows.c uuid_gen_windows.c
Date Fri, 28 Sep 2007 03:16:59 GMT
Author: samisa
Date: Thu Sep 27 20:16:58 2007
New Revision: 580204

URL: http://svn.apache.org/viewvc?rev=580204&view=rev
Log:
Fixed indentation

Modified:
    webservices/axis2/trunk/c/util/src/platforms/windows/axutil_windows.c
    webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c
    webservices/axis2/trunk/c/util/src/platforms/windows/dir_windows.c
    webservices/axis2/trunk/c/util/src/platforms/windows/getopt_windows.c
    webservices/axis2/trunk/c/util/src/platforms/windows/thread_mutex_windows.c
    webservices/axis2/trunk/c/util/src/platforms/windows/thread_windows.c
    webservices/axis2/trunk/c/util/src/platforms/windows/uuid_gen_windows.c

Modified: webservices/axis2/trunk/c/util/src/platforms/windows/axutil_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/windows/axutil_windows.c?rev=580204&r1=580203&r2=580204&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/windows/axutil_windows.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/windows/axutil_windows.c Thu Sep 27 20:16:58
2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,12 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
-
+
 
 #include <windows/axutil_windows.h>
 #include <stdio.h>
-
+    
+
 /*
 
 std::string* getPlatformErrorMessage(long errorNumber)
@@ -41,18 +41,18 @@
 
     return returningString;
 }
-*/
-AXIS2_EXTERN HMODULE AXIS2_CALL
-callLoadLib(char* lib)
-{
-
-    SetErrorMode(SEM_FAILCRITICALERRORS); //Disable display of the critical-error-handler
message box
-    return LoadLibrary(lib);
-}
-
-AXIS2_EXTERN struct tm *AXIS2_CALL
-            axis2_win_gmtime(const time_t *timep, struct tm *result)
-{
-    return gmtime(timep);
-}
-
+*/ 
+    AXIS2_EXTERN HMODULE AXIS2_CALL 
 callLoadLib(char *lib) 
+{
+    

SetErrorMode(SEM_FAILCRITICALERRORS); //Disable display of the critical-error-handler
message box
+    return LoadLibrary(lib);
+
}
+

AXIS2_EXTERN struct tm *AXIS2_CALL 
+axis2_win_gmtime(
+    const time_t * timep,
+    struct tm *result) 
+{
+    
return gmtime(timep);
+
}
+
+

Modified: webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c?rev=580204&r1=580203&r2=580204&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c Thu Sep
27 20:16:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -17,15 +18,17 @@
 
 #include <platforms/windows/axutil_date_time_util_windows.h>
 
-AXIS2_EXTERN int AXIS2_CALL axis2_platform_get_milliseconds() 
+AXIS2_EXTERN int AXIS2_CALL
+axis2_platform_get_milliseconds(
+    )
 {
-   struct _timeb timebuffer;
-   char *timeline;
-   int milliseconds = 0; 
+    struct _timeb timebuffer;
+    char *timeline;
+    int milliseconds = 0;
+
+    _ftime(&timebuffer);
+    timeline = ctime(&(timebuffer.time));
+    milliseconds = timebuffer.millitm;
 
-   _ftime( &timebuffer );
-   timeline = ctime( & ( timebuffer.time ) );
-   milliseconds = timebuffer.millitm;
-    
-   return milliseconds; 
+    return milliseconds;
 }

Modified: webservices/axis2/trunk/c/util/src/platforms/windows/dir_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/windows/dir_windows.c?rev=580204&r1=580203&r2=580204&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/windows/dir_windows.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/windows/dir_windows.c Thu Sep 27 20:16:58
2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +16,6 @@
  * limitations under the License.
  */
 
-
 #include <malloc.h>
 #include <string.h>
 #include <errno.h>
@@ -24,18 +24,21 @@
 
 /*dirent.h style mehtods for win32*/
 
-DIR * AXIS2_CALL opendir(const char *_dirname)
-{
-    DIR      *dirp;
-    char   *filespec;
-    long   handle;
-    int      index;
+DIR *AXIS2_CALL
+opendir(
+    const char *_dirname)
+{
+    DIR *dirp;
+    char *filespec;
+    long handle;
+    int index;
 
     filespec = malloc(strlen(_dirname) + 2 + 1);
     strcpy(filespec, _dirname);
-    index = (int)strlen(filespec) - 1;
-    if (index >= 0 && (filespec[index] == '/' ||
-            (filespec[index] == '\\' && !IsDBCSLeadByte(filespec[index-1]))))
+    index = (int) strlen(filespec) - 1;
+    if (index >= 0 &&
+        (filespec[index] == '/' ||
+         (filespec[index] == '\\' && !IsDBCSLeadByte(filespec[index - 1]))))
         filespec[index] = '\0';
     strcat(filespec, "/*");
 
@@ -61,7 +64,9 @@
     return dirp;
 }
 
-int AXIS2_CALL closedir(DIR *_dirp)
+int AXIS2_CALL
+closedir(
+    DIR * _dirp)
 {
     int iret = -1;
     if (!_dirp)
@@ -75,7 +80,9 @@
     return iret;
 }
 
-struct dirent * AXIS2_CALL readdir(DIR *_dirp)
+struct dirent *AXIS2_CALL
+readdir(
+    DIR * _dirp)
 {
     if (!_dirp || _dirp->finished)
         return NULL;
@@ -90,15 +97,19 @@
     }
     _dirp->offset++;
 
-    strcpy(_dirp->dent.d_name, _dirp->fileinfo.name);/*, _MAX_FNAME+1);*/
+    strcpy(_dirp->dent.d_name, _dirp->fileinfo.name);   /*, _MAX_FNAME+1); */
     _dirp->dent.d_ino = 1;
-    _dirp->dent.d_reclen = (unsigned short)strlen(_dirp->dent.d_name);
+    _dirp->dent.d_reclen = (unsigned short) strlen(_dirp->dent.d_name);
     _dirp->dent.d_off = _dirp->offset;
 
     return &(_dirp->dent);
 }
 
-int AXIS2_CALL readdir_r(DIR *_dirp, struct dirent *_entry, struct dirent **__result)
+int AXIS2_CALL
+readdir_r(
+    DIR * _dirp,
+    struct dirent *_entry,
+    struct dirent **__result)
 {
     if (!_dirp || _dirp->finished)
     {
@@ -117,9 +128,9 @@
     }
     _dirp->offset++;
 
-    strcpy(_dirp->dent.d_name, _dirp->fileinfo.name);/*, _MAX_FNAME+1);*/
+    strcpy(_dirp->dent.d_name, _dirp->fileinfo.name);   /*, _MAX_FNAME+1); */
     _dirp->dent.d_ino = 1;
-    _dirp->dent.d_reclen = (unsigned short)strlen(_dirp->dent.d_name);
+    _dirp->dent.d_reclen = (unsigned short) strlen(_dirp->dent.d_name);
     _dirp->dent.d_off = _dirp->offset;
 
     memcpy(_entry, &_dirp->dent, sizeof(*_entry));
@@ -129,12 +140,13 @@
     return 0;
 }
 
-
-int AXIS2_CALL rewinddir(DIR *dirp)
-{
-    char   *filespec;
-    long   handle;
-    int      index;
+int AXIS2_CALL
+rewinddir(
+    DIR * dirp)
+{
+    char *filespec;
+    long handle;
+    int index;
 
     _findclose(dirp->handle);
 
@@ -143,7 +155,7 @@
 
     filespec = malloc(strlen(dirp->dirname) + 2 + 1);
     strcpy(filespec, dirp->dirname);
-    index = (int)(strlen(filespec) - 1);
+    index = (int) (strlen(filespec) - 1);
     if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\'))
         filespec[index] = '\0';
     strcat(filespec, "/*");
@@ -159,19 +171,27 @@
     return 0;
 }
 
-int alphasort(const struct dirent **__d1, const struct dirent **__d2)
+int
+alphasort(
+    const struct dirent **__d1,
+    const struct dirent **__d2)
 {
     return strcoll((*__d1)->d_name, (*__d2)->d_name);
 }
 
-
-int AXIS2_CALL scandir(const char *_dirname, struct dirent **__namelist[], int(*selector)(const
struct dirent *entry), int(*compare)(const struct dirent **__d1, const struct dirent **__d2))
-{
-    DIR            *dirp = NULL;
-    struct dirent   **vector = NULL;
-    struct dirent   *dp = NULL;
-    int            vector_size = 0;
-    int            nfiles = 0;
+int AXIS2_CALL
+scandir(
+    const char *_dirname,
+    struct dirent **__namelist[],
+    int (*selector) (const struct dirent * entry),
+    int (*compare) (const struct dirent ** __d1,
+                    const struct dirent ** __d2))
+{
+    DIR *dirp = NULL;
+    struct dirent **vector = NULL;
+    struct dirent *dp = NULL;
+    int vector_size = 0;
+    int nfiles = 0;
 
     if (__namelist == NULL)
     {
@@ -188,7 +208,7 @@
         int dsize = 0;
         struct dirent *newdp = NULL;
 
-        if (selector && (*selector)(dp) == 0)
+        if (selector && (*selector) (dp) == 0)
         {
             continue;
         }
@@ -205,7 +225,10 @@
                 vector_size *= 2;
             }
 
-            newv = (struct dirent **) realloc(vector, vector_size * sizeof(struct dirent
*));
+            newv =
+                (struct dirent **) realloc(vector,
+                                           vector_size *
+                                           sizeof(struct dirent *));
             if (!newv)
             {
                 return -1;
@@ -213,7 +236,9 @@
             vector = newv;
         }
 
-        dsize = (int)sizeof(struct dirent) + (int)((strlen(dp->d_name) + 1) * sizeof(char));
+        dsize =
+            (int) sizeof(struct dirent) +
+            (int) ((strlen(dp->d_name) + 1) * sizeof(char));
         newdp = (struct dirent *) malloc(dsize);
 
         if (newdp == NULL)

Modified: webservices/axis2/trunk/c/util/src/platforms/windows/getopt_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/windows/getopt_windows.c?rev=580204&r1=580203&r2=580204&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/windows/getopt_windows.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/windows/getopt_windows.c Thu Sep 27 20:16:58
2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -21,52 +22,58 @@
 
 #include <platforms/windows/axutil_getopt_windows.h>
 
-int      optind = 1;
-int      opterr = 1;
-int      optopt;
-char*   optarg;
+int optind = 1;
+int opterr = 1;
+int optopt;
+char *optarg;
 
 #define AXIS2_OPT_ERR_NO_ARG         1
 #define AXIS2_OPT_ERR_INVALID_OPTION   2
 #define AXIS2_OPT_ERR_BAD_ARG         3
 
-
-
-int _axis2_opt_error(int __optopt, int __err, int __showerr)
+int
+_axis2_opt_error(
+    int __optopt,
+    int __err,
+    int __showerr)
 {
     switch (__err)
     {
-        case AXIS2_OPT_ERR_NO_ARG:
-            if (__showerr)
-                fprintf(stderr, " option requires an argument -- %c\n", __optopt);
-            break;
-        case AXIS2_OPT_ERR_INVALID_OPTION:
-            if (__showerr)
-                fprintf(stderr, " illegal option -- %c\n", __optopt);
-            break;
-        case AXIS2_OPT_ERR_BAD_ARG:
-            return (int)':';
-        default:
-            if (__showerr)
-                fprintf(stderr, "unknown\n");
+    case AXIS2_OPT_ERR_NO_ARG:
+        if (__showerr)
+            fprintf(stderr, " option requires an argument -- %c\n", __optopt);
+        break;
+    case AXIS2_OPT_ERR_INVALID_OPTION:
+        if (__showerr)
+            fprintf(stderr, " illegal option -- %c\n", __optopt);
+        break;
+    case AXIS2_OPT_ERR_BAD_ARG:
+        return (int) ':';
+    default:
+        if (__showerr)
+            fprintf(stderr, "unknown\n");
     }
-    return (int)'?';
+    return (int) '?';
 }
 
 AXIS2_EXTERN int AXIS2_CALL
-axis2_getopt(int __argc, char * const *__argv, const char *__shortopts)
+axis2_getopt(
+    int __argc,
+    char *const *__argv,
+    const char *__shortopts)
 {
     static char *pos = "";
     char *olstindex;
 
     if (!*pos)
     {
-        /* no option or invalid option*/
+        /* no option or invalid option */
         if (optind >= __argc || *(pos = __argv[optind]) != '-')
         {
             pos = "";
             return -1;
         }
+
         /*-- option*/
         if (pos[1] && *++pos == '-')
         {
@@ -76,11 +83,11 @@
         }
     }
 
-    if ((optopt = (int) * pos++) == (int)':' ||
-            !(olstindex = strchr(__shortopts, optopt)))
+    if ((optopt = (int) *pos++) == (int) ':' ||
+        !(olstindex = strchr(__shortopts, optopt)))
     {
 
-        if (optopt == (int)'-')
+        if (optopt == (int) '-')
             return -1;
         if (!*pos)
             ++optind;
@@ -113,4 +120,3 @@
     }
     return optopt;
 }
-

Modified: webservices/axis2/trunk/c/util/src/platforms/windows/thread_mutex_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/windows/thread_mutex_windows.c?rev=580204&r1=580203&r2=580204&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/windows/thread_mutex_windows.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/windows/thread_mutex_windows.c Thu Sep 27
20:16:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -15,27 +16,28 @@
  * limitations under the License.
  */
 
-
 #include <axutil_thread.h>
 #include <platforms/windows/axutil_thread_mutex_windows.h>
 
-static axis2_status_t thread_mutex_cleanup(void *data)
+static axis2_status_t
+thread_mutex_cleanup(
+    void *data)
 {
     axutil_thread_mutex_t *lock = NULL;
     axutil_allocator_t *allocator = NULL;
     if (!data)
         return AXIS2_FAILURE;
 
-    lock = (axutil_thread_mutex_t *)data;
-    allocator = lock ->allocator;
+    lock = (axutil_thread_mutex_t *) data;
+    allocator = lock->allocator;
 
-if (lock ->type == thread_mutex_critical_section)
+    if (lock->type == thread_mutex_critical_section)
     {
-        DeleteCriticalSection(&lock ->section);
+        DeleteCriticalSection(&lock->section);
     }
     else
     {
-        if (!CloseHandle(lock ->handle))
+        if (!CloseHandle(lock->handle))
         {
             return AXIS2_FAILURE;
         }
@@ -45,15 +47,19 @@
     return AXIS2_SUCCESS;
 }
 
-AXIS2_EXTERN axutil_thread_mutex_t * AXIS2_CALL axutil_thread_mutex_create(axutil_allocator_t
*allocator,
-        unsigned int flags)
+AXIS2_EXTERN axutil_thread_mutex_t *AXIS2_CALL
+axutil_thread_mutex_create(
+    axutil_allocator_t * allocator,
+    unsigned int flags)
 {
     axutil_thread_mutex_t *mutex = NULL;
 
-    mutex = (axutil_thread_mutex_t *)AXIS2_MALLOC(allocator, sizeof(axutil_thread_mutex_t));
+    mutex =
+        (axutil_thread_mutex_t *) AXIS2_MALLOC(allocator,
+                                               sizeof(axutil_thread_mutex_t));
     mutex->allocator = allocator;
 
-    if (flags == AXIS2_THREAD_MUTEX_DEFAULT) /*unnested*/
+    if (flags == AXIS2_THREAD_MUTEX_DEFAULT)    /*unnested */
     {
         /* Use an auto-reset signaled event, ready to accept one
          * waiting thread.
@@ -63,14 +69,15 @@
     }
     else
     {
-        /* TODO :support critical_section and nested_mutex*/
+        /* TODO :support critical_section and nested_mutex */
     }
 
     return mutex;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_thread_mutex_lock(axutil_thread_mutex_t *mutex)
+axutil_thread_mutex_lock(
+    axutil_thread_mutex_t * mutex)
 {
     if (mutex->type == thread_mutex_critical_section)
     {
@@ -82,26 +89,27 @@
         if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED))
         {
             return AXIS2_FAILURE;
-            /*can be either BUSY or an os specific error*/
+            /*can be either BUSY or an os specific error */
         }
     }
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_thread_mutex_trylock(axutil_thread_mutex_t *mutex)
+axutil_thread_mutex_trylock(
+    axutil_thread_mutex_t * mutex)
 {
 
     if (mutex->type == thread_mutex_critical_section)
     {
-        /* TODO :implement trylock for critical section*/
+        /* TODO :implement trylock for critical section */
     }
     else
     {
         DWORD rv = WaitForSingleObject(mutex->handle, 0);
         if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED))
         {
-            /*can be either BUSY or an os specific error*/
+            /*can be either BUSY or an os specific error */
             return AXIS2_FAILURE;
         }
     }
@@ -109,7 +117,8 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_thread_mutex_unlock(axutil_thread_mutex_t *mutex)
+axutil_thread_mutex_unlock(
+    axutil_thread_mutex_t * mutex)
 {
     if (mutex->type == thread_mutex_critical_section)
     {
@@ -119,7 +128,7 @@
     {
         if (!SetEvent(mutex->handle))
         {
-            /*os specific error*/
+            /*os specific error */
             return AXIS2_FAILURE;
         }
     }
@@ -127,7 +136,7 @@
     {
         if (!ReleaseMutex(mutex->handle))
         {
-            /*os specific error*/
+            /*os specific error */
             return AXIS2_FAILURE;
         }
     }
@@ -135,7 +144,8 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_thread_mutex_destroy(axutil_thread_mutex_t *mutex)
+axutil_thread_mutex_destroy(
+    axutil_thread_mutex_t * mutex)
 {
-    return thread_mutex_cleanup((void*)mutex);
+    return thread_mutex_cleanup((void *) mutex);
 }

Modified: webservices/axis2/trunk/c/util/src/platforms/windows/thread_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/windows/thread_windows.c?rev=580204&r1=580203&r2=580204&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/windows/thread_windows.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/windows/thread_windows.c Thu Sep 27 20:16:58
2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -20,15 +21,16 @@
 
 DWORD tls_axutil_thread = 0;
 
-AXIS2_EXTERN axutil_threadattr_t* AXIS2_CALL
-axutil_threadattr_create(axutil_allocator_t *allocator)
+AXIS2_EXTERN axutil_threadattr_t *AXIS2_CALL
+axutil_threadattr_create(
+    axutil_allocator_t * allocator)
 {
     axutil_threadattr_t *new = NULL;
 
     new = AXIS2_MALLOC(allocator, sizeof(axutil_threadattr_t));
-    if (! new)
+    if (!new)
     {
-        /*AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE)*/
+        /*AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE) */
         return NULL;
     }
     new->detach = 0;
@@ -39,15 +41,17 @@
 
 /* Destroy the threadattr object */
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-threadattr_cleanup(void *data)
+threadattr_cleanup(
+    void *data)
 {
     axutil_threadattr_t *attr = data;
-    /*nothing to clean up*/
+    /*nothing to clean up */
     return AXIS2_SUCCESS;
 }
 
-AXIS2_EXTERN axis2_status_t AXIS2_CALL axutil_threadattr_detach_set(
-    axutil_threadattr_t *attr,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_threadattr_detach_set(
+    axutil_threadattr_t * attr,
     axis2_bool_t detached)
 {
     attr->detach = detached;
@@ -55,7 +59,9 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_threadattr_detach_get(axutil_threadattr_t *attr, const axutil_env_t *env)
+axutil_threadattr_detach_get(
+    axutil_threadattr_t * attr,
+    const axutil_env_t * env)
 {
     if (1 == attr->detach)
     {
@@ -65,46 +71,53 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_threadattr_stacksize_set(axutil_threadattr_t *attr, size_t stacksize)
+axutil_threadattr_stacksize_set(
+    axutil_threadattr_t * attr,
+    size_t stacksize)
 {
     attr->stacksize = stacksize;
     return AXIS2_SUCCESS;
 }
 
-static void *dummy_worker(void *opaque)
+static void *
+dummy_worker(
+    void *opaque)
 {
-    axutil_thread_t *thd = (axutil_thread_t *)opaque;
+    axutil_thread_t *thd = (axutil_thread_t *) opaque;
     TlsSetValue(tls_axutil_thread, thd->td);
     return thd->func(thd, thd->data);
 }
 
-AXIS2_EXTERN axutil_thread_t* AXIS2_CALL
-axutil_thread_create(axutil_allocator_t *allocator, axutil_threadattr_t *attr,
-        axutil_thread_start_t func, void *data)
-{
-    HANDLE           handle;
-    unsigned         temp;
-    axutil_thread_t   *new = NULL;
+AXIS2_EXTERN axutil_thread_t *AXIS2_CALL
+axutil_thread_create(
+    axutil_allocator_t * allocator,
+    axutil_threadattr_t * attr,
+    axutil_thread_start_t func,
+    void *data)
+{
+    HANDLE handle;
+    unsigned temp;
+    axutil_thread_t *new = NULL;
 
-    new = (axutil_thread_t *)AXIS2_MALLOC(allocator,
-            sizeof(axutil_thread_t));
+    new = (axutil_thread_t *) AXIS2_MALLOC(allocator, sizeof(axutil_thread_t));
 
-    if (! new)
+    if (!new)
     {
         return NULL;
     }
 
     new->data = data;
     new->func = func;
-    new->td   = NULL;
+    new->td = NULL;
 
     /* Use 0 for Thread Stack Size, because that will default the stack to the
-      * same size as the calling thread. 
-      */
-    if ((handle = CreateThread(NULL,
-            attr && attr->stacksize > 0 ? attr->stacksize : 0,
-            (unsigned int(AXIS2_THREAD_FUNC *)(void *))dummy_worker,
-            new, 0, &temp)) == 0)
+     * same size as the calling thread. 
+     */
+    if ((handle =
+         CreateThread(NULL, attr &&
+                      attr->stacksize > 0 ? attr->stacksize : 0,
+                      (unsigned int (AXIS2_THREAD_FUNC *) (void *))
+                      dummy_worker, new, 0, &temp)) == 0)
     {
         return NULL;
     }
@@ -120,7 +133,9 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_thread_exit(axutil_thread_t *thd, axutil_allocator_t *allocator)
+axutil_thread_exit(
+    axutil_thread_t * thd,
+    axutil_allocator_t * allocator)
 {
     if (thd)
     {
@@ -132,9 +147,10 @@
 }
 
 AXIS2_EXTERN axis2_os_thread_t AXIS2_CALL
-axis2_os_thread_current(void)
+axis2_os_thread_current(
+    void)
 {
-    HANDLE hthread = (HANDLE)TlsGetValue(tls_axutil_thread);
+    HANDLE hthread = (HANDLE) TlsGetValue(tls_axutil_thread);
     HANDLE hproc;
 
     if (hthread)
@@ -144,9 +160,8 @@
 
     hproc = GetCurrentProcess();
     hthread = GetCurrentThread();
-    if (!DuplicateHandle(hproc, hthread,
-            hproc, &hthread, 0, FALSE,
-            DUPLICATE_SAME_ACCESS))
+    if (!DuplicateHandle
+        (hproc, hthread, hproc, &hthread, 0, FALSE, DUPLICATE_SAME_ACCESS))
     {
         return NULL;
     }
@@ -155,15 +170,19 @@
 }
 
 AXIS2_EXTERN int AXIS2_CALL
-axis2_os_thread_equal(axis2_os_thread_t tid1, axis2_os_thread_t tid2)
+axis2_os_thread_equal(
+    axis2_os_thread_t tid1,
+    axis2_os_thread_t tid2)
 {
     return (tid1 == tid2);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_thread_join(axutil_thread_t *thd)
+axutil_thread_join(
+    axutil_thread_t * thd)
 {
-    axis2_status_t rv = AXIS2_SUCCESS, rv1;
+    axis2_status_t rv = AXIS2_SUCCESS,
+        rv1;
 
     if (!thd->td)
     {
@@ -173,7 +192,7 @@
     rv1 = WaitForSingleObject(thd->td, INFINITE);
     if (rv1 == WAIT_OBJECT_0 || rv1 == WAIT_ABANDONED)
     {
-        /*rv = AXIS2_INCOMPLETE;*/
+        /*rv = AXIS2_INCOMPLETE; */
     }
     else
         rv = AXIS2_FAILURE;
@@ -184,7 +203,8 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_thread_detach(axutil_thread_t *thd)
+axutil_thread_detach(
+    axutil_thread_t * thd)
 {
     if (thd->td && CloseHandle(thd->td))
     {
@@ -198,13 +218,16 @@
 }
 
 AXIS2_EXTERN axis2_os_thread_t AXIS2_CALL
-axis2_os_thread_get(axutil_thread_t *thd, const axutil_env_t *env)
+axis2_os_thread_get(
+    axutil_thread_t * thd,
+    const axutil_env_t * env)
 {
     return thd->td;
 }
 
-AXIS2_EXTERN axutil_thread_once_t * AXIS2_CALL
-axutil_thread_once_init(axutil_allocator_t *allocator)
+AXIS2_EXTERN axutil_thread_once_t *AXIS2_CALL
+axutil_thread_once_init(
+    axutil_allocator_t * allocator)
 {
     axutil_thread_once_t *control = NULL;
     control = AXIS2_MALLOC(allocator, sizeof(*control));
@@ -212,7 +235,9 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_thread_once(axutil_thread_once_t *control, void(*func)(void))
+axutil_thread_once(
+    axutil_thread_once_t * control,
+    void (*func) (void))
 {
     if (!InterlockedExchange(&control->value, 1))
     {

Modified: webservices/axis2/trunk/c/util/src/platforms/windows/uuid_gen_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/windows/uuid_gen_windows.c?rev=580204&r1=580203&r2=580204&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/windows/uuid_gen_windows.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/windows/uuid_gen_windows.c Thu Sep 27 20:16:58
2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -20,38 +21,41 @@
 #include <stdio.h>
 #include <string.h>
 #include <axutil_utils_defines.h>
+    

AXIS2_EXTERN axis2_char_t * AXIS2_CALL 
 axutil_platform_uuid_gen(char *s) 
+{
+    
RPC_STATUS retval;
+    
UUID uuid;
+    
unsigned char *str;
+    
axis2_char_t * retstr;
+    

if (!s)
+        
+    {
+        
return NULL;
+    
}
+    
retstr = s;
+    
retval = UuidCreate(&uuid);
+    
if (retval == RPC_S_UUID_LOCAL_ONLY)
+        
printf("warning - unique within computer \n");
+    
+    else if (retval == RPC_S_UUID_NO_ADDRESS)
+        
+    {
+        
return NULL;
+    
}
+    

retval = UuidToStringA(&uuid, &str);
+    
if (retval == RPC_S_OK)
+        
+    {
+        
strcpy(retstr, str);
+        
RpcStringFree(&str);
+    
}
+    
+    else if (retval == RPC_S_OUT_OF_MEMORY)
+        
+    {
+        
return NULL;
+    
}
+    
return retstr;
+
}
+
 
-
-AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-axutil_platform_uuid_gen(char *s)
-{
-    RPC_STATUS         retval;
-    UUID            uuid;
-    unsigned char      *str;
-    axis2_char_t      *retstr;
-
-    if (! s)
-    {
-        return NULL;
-    }
-    retstr = s;
-    retval = UuidCreate(&uuid);
-    if (retval == RPC_S_UUID_LOCAL_ONLY)
-        printf("warning - unique within computer \n");
-    else if (retval == RPC_S_UUID_NO_ADDRESS)
-    {
-        return NULL;
-    }
-
-    retval = UuidToStringA(&uuid, &str);
-    if (retval == RPC_S_OK)
-    {
-        strcpy(retstr, str);
-        RpcStringFree(&str);
-    }
-    else if (retval == RPC_S_OUT_OF_MEMORY)
-    {
-        return NULL;
-    }
-    return retstr;
-}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message