# KIM Types and Constants

## Defines

- #define KIM_IDENTITY_ANY ((kim_identity) NULL)
- #define KIM_OPTIONS_DEFAULT ((kim_options) NULL)
- #define KIM_OPTIONS_START_IMMEDIATELY ((kim_time_t) 0)
- #define KIM_NO_ERROR ((kim_error) 0)
- #define kim_comparison_is_less_than(c) (c < 0)
- #define kim_comparison_is_equal_to(c) (c == 0)
- #define kim_comparison_is_greater_than(c) (c > 0)

## Typedefs

- typedef int kim_credential_state
- typedef int32_t kim_error
- typedef int64_t kim_time
- typedef int64_t kim_lifetime
- typedef uint64_t kim_count
- typedef int kim_boolean
- typedef int kim_comparison
- typedef const char * kim_string
- typedef struct
  kim_identity_opaque * kim_identity
- typedef struct
  kim_options_opaque * kim_options
- typedef struct
  kim_selection_hints_opaque * kim_selection_hints
- typedef struct
  kim_preferences_opaque * kim_preferences
- typedef struct
  kim_ccache_iterator_opaque * kim_ccache_iterator
- typedef struct
  kim_ccache_opaque * kim_ccache
- typedef struct
  kim_credential_iterator_opaque * kim_credential_iterator
- typedef struct
  kim_credential_opaque * kim_credential

## Enumerations

- enum kim_credential_state_enum {
  kim_credentials_state_valid = 0, kim_credentials_state_expired = 1, kim_credentials_state_not_yet_valid = 2, kim_credentials_state_needs_validation = 3,
  kim_credentials_state_address_mismatch = 4
  }

## Define Documentation

#define KIM_IDENTITY_ANY ((kim_identity) NULL)

Constant to specify any Kerberos identity is acceptable.

#define KIM_OPTIONS_DEFAULT ((kim_options) NULL)

Specifies the user's default options.

#define KIM_OPTIONS_START_IMMEDIATELY ((kim_time_t) 0)

Specifies that credentials should be valid immediately.

#define KIM_NO_ERROR ((kim_error) 0)

No error value for the kim_error type.

#define kim_comparison_is_less_than | ( | c |  | ) | (c < 0)

Convenience macro for interpreting kim_comparison.

#define kim_comparison_is_equal_to | ( | c |  | ) | (c == 0)

Convenience macro for interpreting kim_comparison.

#define kim_comparison_is_greater_than | ( | c |  | ) | (c > 0)

Convenience macro for interpreting kim_comparison.

## Typedef Documentation

typedef int kim_credential_state

The state of a credential. See kim_credential_state_enum for possible values.

typedef int32_t kim_error

The KIM Error type.

typedef int64_t kim_time

A time value represented in seconds since January 1, 1970.

typedef int64_t kim_lifetime

A duration represented in seconds.

typedef uint64_t kim_count

An quantity, usually used to return the number of elements in an array.

typedef int kim_boolean

A boolean value. 0 means false, all other values mean true.

typedef int kim_comparison

A comparison between two sortable objects.

- Less than 0 means the first object is less than the second.
- 0 means the two objects are identical.
- Greater than 0 means the first object is greater than the second.
  Note:
    Convenience macros are provided for interpreting kim_comparison values to improve code readability. See kim_comparison_is_less_than(), kim_comparison_is_equal_to() and kim_comparison_is_greater_than()

typedef const char* kim_string

The KIM String type. See KIM String Overview for more information.

typedef struct kim_identity_opaque* kim_identity

A KIM Principal object. See KIM Identity Overview for more information.

typedef struct kim_options_opaque* kim_options

A KIM Options object. See KIM Options Overview for more information.

typedef struct kim_selection_hints_opaque* kim_selection_hints

A KIM Selection Hints object. See KIM Selection Hints Overview for more information.

typedef struct kim_preferences_opaque* kim_preferences

A KIM Preferences object. See KIM Preferences Overview for more information.

typedef struct kim_ccache_iterator_opaque* kim_ccache_iterator

A KIM CCache Iterator object. See Acquiring a CCache from the Cache Collection for more information.

typedef struct kim_ccache_opaque* kim_ccache

A KIM CCache object. See KIM CCache Overview for more information.

typedef struct kim_credential_iterator_opaque* kim_credential_iterator

A KIM Credential Iterator object. See Iterating over the Credentials in a CCache for more information.

typedef struct kim_credential_opaque* kim_credential

A KIM Credential object. See KIM Credential Overview for more information.

## Enumeration Type Documentation

enum kim_credential_state_enum

Possible credential states. Credentials may be:

- valid - The credential can be used.
- expired - The credential's lifetime has been exceeded.
- not_yet_valid - The credential is post dated and the time when it becomes valid has not yet been reached.
- needs_validation - The credential is post-dated and although the time when it becomes valid has been reached it has not yet been validated.
- address_mismatch - The credential contains IP address(es) which do not match the host's local address(es).