Use util/mklink.pl instead of util/mklink.sh.
[oweals/openssl.git] / crypto / asn1 / a_utctm.c
index 17a7abbb679df027b91b6e5f9ca124f0c174e78b..0fa8ae2ba7a844349833716d76aa8f36860ea6c0 100644 (file)
 #include <stdio.h>
 #include <time.h>
 #include "cryptlib.h"
-#include "asn1.h"
+#include <openssl/asn1.h>
 
-/* ASN1err(ASN1_F_ASN1_UTCTIME_NEW,ASN1_R_UTCTIME_TOO_LONG);
- * ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ASN1_R_EXPECTING_A_UTCTIME);
- */
-
-int i2d_ASN1_UTCTIME(a,pp)
-ASN1_UTCTIME *a;
-unsigned char **pp;
+int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp)
        {
        return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
                V_ASN1_UTCTIME,V_ASN1_UNIVERSAL));
        }
 
 
-ASN1_UTCTIME *d2i_ASN1_UTCTIME(a, pp, length)
-ASN1_UTCTIME **a;
-unsigned char **pp;
-long length;
+ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp,
+            long length)
        {
        ASN1_UTCTIME *ret=NULL;
 
@@ -85,7 +77,7 @@ long length;
                V_ASN1_UTCTIME,V_ASN1_UNIVERSAL);
        if (ret == NULL)
                {
-               ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ASN1_R_ERROR_STACK);
+               ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ERR_R_NESTED_ASN1_ERROR);
                return(NULL);
                }
        if (!ASN1_UTCTIME_check(ret))
@@ -101,8 +93,7 @@ err:
        return(NULL);
        }
 
-int ASN1_UTCTIME_check(d)
-ASN1_UTCTIME *d;
+int ASN1_UTCTIME_check(ASN1_UTCTIME *d)
        {
        static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0};
        static int max[8]={99,12,31,23,59,59,12,59};
@@ -152,9 +143,7 @@ err:
        return(0);
        }
 
-int ASN1_UTCTIME_set_string(s,str)
-ASN1_UTCTIME *s;
-char *str;
+int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str)
        {
        ASN1_UTCTIME t;
 
@@ -174,13 +163,11 @@ char *str;
                return(0);
        }
 
-ASN1_UTCTIME *ASN1_UTCTIME_set(s, t)
-ASN1_UTCTIME *s;
-time_t t;
+ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
        {
        char *p;
        struct tm *ts;
-#if defined(THREADS)
+#if defined(THREADS) && !defined(WIN32)
        struct tm data;
 #endif
 
@@ -189,7 +176,7 @@ time_t t;
        if (s == NULL)
                return(NULL);
 
-#if defined(THREADS)
+#if defined(THREADS) && !defined(WIN32)
        ts=(struct tm *)gmtime_r(&t,&data);
 #else
        ts=(struct tm *)gmtime(&t);