/* Generated from ./x690sample.asn1 */
/* Do not edit */

#ifndef __x690sample_asn1_h__
#define __x690sample_asn1_h__

#include <stddef.h>
#include <stdint.h>
#include <time.h>

#ifndef __asn1_common_definitions__
#define __asn1_common_definitions__

#ifndef __HEIM_BASE_DATA__
#define __HEIM_BASE_DATA__ 1
struct heim_base_data {
    size_t length;
    void *data;
};
typedef struct heim_base_data heim_octet_string;
#endif

typedef struct heim_integer {
  size_t length;
  void *data;
  int negative;
} heim_integer;

typedef char *heim_general_string;

typedef char *heim_utf8_string;

typedef struct heim_base_data heim_printable_string;

typedef struct heim_base_data heim_ia5_string;

typedef struct heim_bmp_string {
  size_t length;
  uint16_t *data;
} heim_bmp_string;

typedef struct heim_universal_string {
  size_t length;
  uint32_t *data;
} heim_universal_string;

typedef char *heim_visible_string;

typedef struct heim_oid {
  size_t length;
  unsigned *components;
} heim_oid;

typedef struct heim_bit_string {
  size_t length;
  void *data;
} heim_bit_string;

typedef struct heim_base_data heim_any;
typedef struct heim_base_data heim_any_set;
typedef struct heim_base_data HEIM_ANY;
typedef struct heim_base_data HEIM_ANY_SET;

enum asn1_print_flags {
   ASN1_PRINT_INDENT = 1,
};

#define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R)                  \
  do {                                                         \
    (BL) = length_##T((S));                                    \
    (B) = calloc(1, (BL));                                     \
    if((B) == NULL) {                                          \
      *(L) = 0;                                                \
      (R) = ENOMEM;                                            \
    } else {                                                   \
      (R) = encode_##T(((unsigned char*)(B)) + (BL) - 1, (BL), \
                       (S), (L));                              \
      if((R) != 0) {                                           \
        free((B));                                             \
        (B) = NULL;                                            \
        *(L) = 0;                                              \
      }                                                        \
    }                                                          \
  } while (0)

#ifdef _WIN32
#ifndef ASN1_LIB
#define ASN1EXP  __declspec(dllimport)
#else
#define ASN1EXP
#endif
#define ASN1CALL __stdcall
#else
#define ASN1EXP
#define ASN1CALL
#endif
#ifndef ENOTSUP
/* Very old MSVC CRTs lack ENOTSUP */
#define ENOTSUP EINVAL
#endif
struct units;

#endif

typedef struct X690SamplePersonnelRecord X690SamplePersonnelRecord;

typedef struct X690SampleChildInformation X690SampleChildInformation;

typedef struct X690SampleName X690SampleName;

typedef unsigned int X690SampleEmployeeNumber;

typedef heim_visible_string X690SampleDate;

/*
X690SampleName ::= [APPLICATION 1] IMPLICIT SEQUENCE {
  givenName         VisibleString,
  initial           VisibleString,
  familyName        VisibleString,
}
*/

enum { asn1_tag_length_X690SampleName = 1,
       asn1_tag_class_X690SampleName = 1,
       asn1_tag_tag_X690SampleName = 1 };
typedef struct X690SampleName {
  heim_visible_string givenName;
  heim_visible_string initial;
  heim_visible_string familyName;
} X690SampleName;

ASN1EXP int    ASN1CALL decode_X690SampleName(const unsigned char *, size_t, X690SampleName *, size_t *);
ASN1EXP int    ASN1CALL encode_X690SampleName(unsigned char *, size_t, const X690SampleName *, size_t *);
ASN1EXP size_t ASN1CALL length_X690SampleName(const X690SampleName *);
ASN1EXP int    ASN1CALL copy_X690SampleName  (const X690SampleName *, X690SampleName *);
ASN1EXP void   ASN1CALL free_X690SampleName  (X690SampleName *);
ASN1EXP char * ASN1CALL print_X690SampleName (const X690SampleName *, int);


/*
X690SampleEmployeeNumber ::= [APPLICATION 2] IMPLICIT INTEGER (0..4294967295)
*/

enum { asn1_tag_length_X690SampleEmployeeNumber = 1,
       asn1_tag_class_X690SampleEmployeeNumber = 1,
       asn1_tag_tag_X690SampleEmployeeNumber = 2 };
ASN1EXP int    ASN1CALL decode_X690SampleEmployeeNumber(const unsigned char *, size_t, X690SampleEmployeeNumber *, size_t *);
ASN1EXP int    ASN1CALL encode_X690SampleEmployeeNumber(unsigned char *, size_t, const X690SampleEmployeeNumber *, size_t *);
ASN1EXP size_t ASN1CALL length_X690SampleEmployeeNumber(const X690SampleEmployeeNumber *);
ASN1EXP int    ASN1CALL copy_X690SampleEmployeeNumber  (const X690SampleEmployeeNumber *, X690SampleEmployeeNumber *);
ASN1EXP void   ASN1CALL free_X690SampleEmployeeNumber  (X690SampleEmployeeNumber *);
ASN1EXP char * ASN1CALL print_X690SampleEmployeeNumber (const X690SampleEmployeeNumber *, int);


/*
X690SampleDate ::= [APPLICATION 3] IMPLICIT VisibleString
*/

enum { asn1_tag_length_X690SampleDate = 1,
       asn1_tag_class_X690SampleDate = 1,
       asn1_tag_tag_X690SampleDate = 3 };
ASN1EXP int    ASN1CALL decode_X690SampleDate(const unsigned char *, size_t, X690SampleDate *, size_t *);
ASN1EXP int    ASN1CALL encode_X690SampleDate(unsigned char *, size_t, const X690SampleDate *, size_t *);
ASN1EXP size_t ASN1CALL length_X690SampleDate(const X690SampleDate *);
ASN1EXP int    ASN1CALL copy_X690SampleDate  (const X690SampleDate *, X690SampleDate *);
ASN1EXP void   ASN1CALL free_X690SampleDate  (X690SampleDate *);
ASN1EXP char * ASN1CALL print_X690SampleDate (const X690SampleDate *, int);


/*
X690SampleDate ::= [APPLICATION 3] IMPLICIT VisibleString
*/

/*
X690SampleChildInformation ::= SET {
  name            X690SampleName,
  dateOfBirth     [0] X690SampleDate,
}
*/

enum { asn1_tag_length_X690SampleChildInformation = 1,
       asn1_tag_class_X690SampleChildInformation = 0,
       asn1_tag_tag_X690SampleChildInformation = 17 };
typedef struct X690SampleChildInformation {
  X690SampleName name;
  X690SampleDate dateOfBirth;
} X690SampleChildInformation;

ASN1EXP int    ASN1CALL decode_X690SampleChildInformation(const unsigned char *, size_t, X690SampleChildInformation *, size_t *);
ASN1EXP int    ASN1CALL encode_X690SampleChildInformation(unsigned char *, size_t, const X690SampleChildInformation *, size_t *);
ASN1EXP size_t ASN1CALL length_X690SampleChildInformation(const X690SampleChildInformation *);
ASN1EXP int    ASN1CALL copy_X690SampleChildInformation  (const X690SampleChildInformation *, X690SampleChildInformation *);
ASN1EXP void   ASN1CALL free_X690SampleChildInformation  (X690SampleChildInformation *);
ASN1EXP char * ASN1CALL print_X690SampleChildInformation (const X690SampleChildInformation *, int);


/*
X690SampleDate ::= [APPLICATION 3] IMPLICIT VisibleString
*/

/*
X690SampleName ::= [APPLICATION 1] IMPLICIT SEQUENCE {
  givenName         VisibleString,
  initial           VisibleString,
  familyName        VisibleString,
}
*/

/*
X690SamplePersonnelRecord ::= [APPLICATION 0] IMPLICIT SET {
  name            X690SampleName,
  title           [0]   VisibleString,
  number          X690SampleEmployeeNumber,
  dateOfHire      [1] X690SampleDate,
  nameOfSpouse    [2] X690SampleName,
  children        [3] IMPLICIT SEQUENCE OF X690SampleChildInformation,
}
*/

enum { asn1_tag_length_X690SamplePersonnelRecord = 1,
       asn1_tag_class_X690SamplePersonnelRecord = 1,
       asn1_tag_tag_X690SamplePersonnelRecord = 0 };
typedef struct X690SamplePersonnelRecord {
  X690SampleName name;
  heim_visible_string title;
  X690SampleEmployeeNumber number;
  X690SampleDate dateOfHire;
  X690SampleName nameOfSpouse;
  struct X690SamplePersonnelRecord_children {
    unsigned int len;
    X690SampleChildInformation *val;
  } children;
} X690SamplePersonnelRecord;

ASN1EXP int    ASN1CALL decode_X690SamplePersonnelRecord(const unsigned char *, size_t, X690SamplePersonnelRecord *, size_t *);
ASN1EXP int    ASN1CALL encode_X690SamplePersonnelRecord(unsigned char *, size_t, const X690SamplePersonnelRecord *, size_t *);
ASN1EXP size_t ASN1CALL length_X690SamplePersonnelRecord(const X690SamplePersonnelRecord *);
ASN1EXP int    ASN1CALL copy_X690SamplePersonnelRecord  (const X690SamplePersonnelRecord *, X690SamplePersonnelRecord *);
ASN1EXP void   ASN1CALL free_X690SamplePersonnelRecord  (X690SamplePersonnelRecord *);
ASN1EXP char * ASN1CALL print_X690SamplePersonnelRecord (const X690SamplePersonnelRecord *, int);


#endif /* __x690sample_asn1_h__ */
