Sha256: 0fe681f2995cb41066b10f40f9791bc37b42047161e1b7ef08b8881c647d0573

Contents?: true

Size: 1.19 KB

Versions: 8

Compression:

Stored size: 1.19 KB

Contents

#ifndef AWS_COMMON_ENVIRONMENT_H
#define AWS_COMMON_ENVIRONMENT_H

/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#include <aws/common/common.h>

struct aws_string;

/*
 * Simple shims to the appropriate platform calls for environment variable manipulation.
 *
 * Not thread safe to use set/unset unsynced with get.  Set/unset only used in unit tests.
 */
AWS_EXTERN_C_BEGIN

/*
 * Get the value of an environment variable.  If the variable is not set, the output string will be set to NULL.
 * Not thread-safe
 */
AWS_COMMON_API
int aws_get_environment_value(
    struct aws_allocator *allocator,
    const struct aws_string *variable_name,
    struct aws_string **value_out);

/*
 * Set the value of an environment variable.  On Windows, setting a variable to the empty string will actually unset it.
 * Not thread-safe
 */
AWS_COMMON_API
int aws_set_environment_value(const struct aws_string *variable_name, const struct aws_string *value);

/*
 * Unset an environment variable.
 * Not thread-safe
 */
AWS_COMMON_API
int aws_unset_environment_value(const struct aws_string *variable_name);

AWS_EXTERN_C_END

#endif /* AWS_COMMON_ENVIRONMENT_H */

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
aws-crt-0.1.8 aws-crt-ffi/crt/aws-c-common/include/aws/common/environment.h
aws-crt-0.1.7 aws-crt-ffi/crt/aws-c-common/include/aws/common/environment.h
aws-crt-0.1.6 aws-crt-ffi/crt/aws-c-common/include/aws/common/environment.h
aws-crt-0.1.5 aws-crt-ffi/crt/aws-c-common/include/aws/common/environment.h
aws-crt-0.1.4 aws-crt-ffi/crt/aws-c-common/include/aws/common/environment.h
aws-crt-0.1.2 aws-crt-ffi/crt/aws-c-common/include/aws/common/environment.h
aws-crt-0.1.1.pre native/crt/aws-c-common/include/aws/common/environment.h
aws-crt-0.1.0.pre native/crt/aws-c-common/include/aws/common/environment.h