LibAwsCommon
Documentation for LibAwsCommon.
LibAwsCommon.AWS_CBOR_TAG_DECIMAL_FRACTION
LibAwsCommon.AWS_CBOR_TAG_EPOCH_TIME
LibAwsCommon.AWS_CBOR_TAG_NEGATIVE_BIGNUM
LibAwsCommon.AWS_CBOR_TAG_STANDARD_TIME
LibAwsCommon.AWS_CBOR_TAG_UNSIGNED_BIGNUM
LibAwsCommon.AWS_CRT_STATISTICS_CATEGORY_STRIDE
LibAwsCommon.AWS_C_COMMON_PACKAGE_ID
LibAwsCommon.AWS_ERROR_ENUM_STRIDE
LibAwsCommon.AWS_ERROR_ENUM_STRIDE_BITS
LibAwsCommon.AWS_LOG_LEVEL_DEBUG
LibAwsCommon.AWS_LOG_LEVEL_ERROR
LibAwsCommon.AWS_LOG_LEVEL_FATAL
LibAwsCommon.AWS_LOG_LEVEL_INFO
LibAwsCommon.AWS_LOG_LEVEL_NONE
LibAwsCommon.AWS_LOG_LEVEL_TRACE
LibAwsCommon.AWS_LOG_LEVEL_WARN
LibAwsCommon.AWS_LOG_SUBJECT_STRIDE
LibAwsCommon.AWS_OP_ERR
LibAwsCommon.AWS_OP_SKIP
LibAwsCommon.AWS_OP_SUCCESS
LibAwsCommon.AWS_PACKAGE_SLOTS
LibAwsCommon.AWS_PATH_DELIM
LibAwsCommon.AWS_PATH_DELIM_STR
LibAwsCommon.AWS_TESTING_REPORT_FD
LibAwsCommon.AWS_THREAD_NAME_RECOMMENDED_STRLEN
LibAwsCommon.FAILURE
LibAwsCommon.FAIL_PREFIX
LibAwsCommon.PRInSTR
LibAwsCommon.SIZE_BITS
LibAwsCommon.SKIP
LibAwsCommon.SUCCESS
LibAwsCommon.__JL_Ctag_1143
LibAwsCommon.__JL_Ctag_1248
LibAwsCommon.__JL_Ctag_1252
LibAwsCommon.__JL_Ctag_1291
LibAwsCommon.__JL_Ctag_1322
LibAwsCommon.__JL_Ctag_1323
LibAwsCommon.__JL_Ctag_1324
LibAwsCommon.__JL_Ctag_1325
LibAwsCommon.__JL_Ctag_1326
LibAwsCommon.__JL_Ctag_1327
LibAwsCommon.__JL_Ctag_1328
LibAwsCommon.__JL_Ctag_317
LibAwsCommon.__JL_Ctag_41
LibAwsCommon.__JL_Ctag_468
LibAwsCommon.__JL_Ctag_705
LibAwsCommon.__JL_Ctag_726
LibAwsCommon.__JL_Ctag_909
LibAwsCommon.___itt_track_group_type
LibAwsCommon.___itt_track_type
LibAwsCommon.__clock_t
LibAwsCommon.__itt_av_data_type
LibAwsCommon.__itt_collection_scope
LibAwsCommon.__itt_collection_state
LibAwsCommon.__itt_context_type
LibAwsCommon.__itt_metadata_type
LibAwsCommon.__itt_model_disable
LibAwsCommon.__itt_module_type
LibAwsCommon.__itt_relation
LibAwsCommon.__itt_scope
LibAwsCommon.__itt_section_type
LibAwsCommon.__itt_suppress_mode
LibAwsCommon.__pid_t
LibAwsCommon.__pthread_internal_list
LibAwsCommon.__pthread_list_t
LibAwsCommon.__pthread_mutex_s
LibAwsCommon.__time_t
LibAwsCommon.__uid_t
LibAwsCommon.aws_allocator
LibAwsCommon.aws_array_list
LibAwsCommon.aws_array_list_comparator_fn
LibAwsCommon.aws_atomic_impl_int_t
LibAwsCommon.aws_atomic_var
LibAwsCommon.aws_byte_buf
LibAwsCommon.aws_byte_cursor
LibAwsCommon.aws_byte_predicate_fn
LibAwsCommon.aws_cache
LibAwsCommon.aws_cache_vtable
LibAwsCommon.aws_cbor_decoder
LibAwsCommon.aws_cbor_encoder
LibAwsCommon.aws_cbor_type
LibAwsCommon.aws_cli_option
LibAwsCommon.aws_cli_options_has_arg
LibAwsCommon.aws_cli_options_subcommand_fn
LibAwsCommon.aws_cli_subcommand_dispatch
LibAwsCommon.aws_common_error
LibAwsCommon.aws_common_log_subject
LibAwsCommon.aws_condition_predicate_fn
LibAwsCommon.aws_condition_variable
LibAwsCommon.aws_cpu_feature_name
LibAwsCommon.aws_cpu_info
LibAwsCommon.aws_cross_process_lock
LibAwsCommon.aws_crt_common_statistics_category
LibAwsCommon.aws_crt_statistics_base
LibAwsCommon.aws_crt_statistics_category_t
LibAwsCommon.aws_crt_statistics_handler
LibAwsCommon.aws_crt_statistics_handler_destroy_fn
LibAwsCommon.aws_crt_statistics_handler_get_report_interval_ms_fn
LibAwsCommon.aws_crt_statistics_handler_process_statistics_fn
LibAwsCommon.aws_crt_statistics_handler_vtable
LibAwsCommon.aws_crt_statistics_sample_interval
LibAwsCommon.aws_date_day_of_week
LibAwsCommon.aws_date_format
LibAwsCommon.aws_date_month
LibAwsCommon.aws_date_time
LibAwsCommon.aws_directory_entry
LibAwsCommon.aws_directory_iterator
LibAwsCommon.aws_error_handler_fn
LibAwsCommon.aws_error_info
LibAwsCommon.aws_error_info_list
LibAwsCommon.aws_file_type
LibAwsCommon.aws_hash_callback_destroy_fn
LibAwsCommon.aws_hash_callback_eq_fn
LibAwsCommon.aws_hash_element
LibAwsCommon.aws_hash_fn
LibAwsCommon.aws_hash_iter
LibAwsCommon.aws_hash_iter_status
LibAwsCommon.aws_hash_table
LibAwsCommon.aws_json_on_member_encountered_const_fn
LibAwsCommon.aws_json_on_value_encountered_const_fn
LibAwsCommon.aws_json_value
LibAwsCommon.aws_linked_hash_table
LibAwsCommon.aws_linked_hash_table_node
LibAwsCommon.aws_linked_list
LibAwsCommon.aws_linked_list_node
LibAwsCommon.aws_log_channel
LibAwsCommon.aws_log_channel_clean_up_fn
LibAwsCommon.aws_log_channel_send_fn
LibAwsCommon.aws_log_channel_vtable
LibAwsCommon.aws_log_formatter
LibAwsCommon.aws_log_formatter_clean_up_fn
LibAwsCommon.aws_log_formatter_format_fn
LibAwsCommon.aws_log_formatter_standard_options
LibAwsCommon.aws_log_formatter_vtable
LibAwsCommon.aws_log_level
LibAwsCommon.aws_log_subject_info
LibAwsCommon.aws_log_subject_info_list
LibAwsCommon.aws_log_subject_t
LibAwsCommon.aws_log_writer
LibAwsCommon.aws_log_writer_clean_up_fn
LibAwsCommon.aws_log_writer_file_options
LibAwsCommon.aws_log_writer_vtable
LibAwsCommon.aws_log_writer_write_fn
LibAwsCommon.aws_logger
LibAwsCommon.aws_logger_pipeline
LibAwsCommon.aws_logger_standard_options
LibAwsCommon.aws_logger_vtable
LibAwsCommon.aws_logging_standard_formatting_data
LibAwsCommon.aws_mem_trace_level
LibAwsCommon.aws_memory_order
LibAwsCommon.aws_memory_usage_stats
LibAwsCommon.aws_mutex
LibAwsCommon.aws_off_t
LibAwsCommon.aws_on_directory_entry
LibAwsCommon.aws_platform_os
LibAwsCommon.aws_priority_queue
LibAwsCommon.aws_priority_queue_compare_fn
LibAwsCommon.aws_priority_queue_node
LibAwsCommon.aws_ref_count
LibAwsCommon.aws_ring_buffer
LibAwsCommon.aws_run_command_options
LibAwsCommon.aws_run_command_result
LibAwsCommon.aws_rw_lock
LibAwsCommon.aws_shutdown_callback_options
LibAwsCommon.aws_simple_completion_callback
LibAwsCommon.aws_string
LibAwsCommon.aws_system_environment
LibAwsCommon.aws_task
LibAwsCommon.aws_task_fn
LibAwsCommon.aws_task_scheduler
LibAwsCommon.aws_task_status
LibAwsCommon.aws_test_after_fn
LibAwsCommon.aws_test_before_fn
LibAwsCommon.aws_test_harness
LibAwsCommon.aws_test_run_fn
LibAwsCommon.aws_text_encoding
LibAwsCommon.aws_thread
LibAwsCommon.aws_thread_atexit_fn
LibAwsCommon.aws_thread_detach_state
LibAwsCommon.aws_thread_id_t
LibAwsCommon.aws_thread_join_strategy
LibAwsCommon.aws_thread_once
LibAwsCommon.aws_thread_options
LibAwsCommon.aws_thread_scheduler
LibAwsCommon.aws_timestamp_unit
LibAwsCommon.aws_uri
LibAwsCommon.aws_uri_builder_options
LibAwsCommon.aws_uri_param
LibAwsCommon.aws_utf8_decoder
LibAwsCommon.aws_utf8_decoder_options
LibAwsCommon.aws_uuid
LibAwsCommon.aws_xml_attribute
LibAwsCommon.aws_xml_node
LibAwsCommon.aws_xml_parser_on_node_encountered_fn
LibAwsCommon.aws_xml_parser_options
LibAwsCommon.hash_table_state
LibAwsCommon.pthread_cond_t
LibAwsCommon.pthread_mutex_t
LibAwsCommon.pthread_once_t
LibAwsCommon.pthread_rwlock_t
LibAwsCommon.pthread_t
LibAwsCommon.siginfo
LibAwsCommon.siginfo_t
LibAwsCommon.sigval
LibAwsCommon.sigval_t
LibAwsCommon.static_assertion_at_line_60
LibAwsCommon.static_assertion_at_line_61
LibAwsCommon.static_assertion_at_line_62
LibAwsCommon.time_t
LibAwsCommon.tm
LibAwsCommon.aws_add_size_checked
LibAwsCommon.aws_add_size_saturating
LibAwsCommon.aws_add_u32_checked
LibAwsCommon.aws_add_u32_saturating
LibAwsCommon.aws_add_u64_checked
LibAwsCommon.aws_add_u64_saturating
LibAwsCommon.aws_aligned_allocator
LibAwsCommon.aws_allocator_is_valid
LibAwsCommon.aws_array_eq
LibAwsCommon.aws_array_eq_c_str
LibAwsCommon.aws_array_eq_c_str_ignore_case
LibAwsCommon.aws_array_eq_ignore_case
LibAwsCommon.aws_array_list_back
LibAwsCommon.aws_array_list_capacity
LibAwsCommon.aws_array_list_clean_up
LibAwsCommon.aws_array_list_clean_up_secure
LibAwsCommon.aws_array_list_clear
LibAwsCommon.aws_array_list_comparator_string
LibAwsCommon.aws_array_list_copy
LibAwsCommon.aws_array_list_ensure_capacity
LibAwsCommon.aws_array_list_erase
LibAwsCommon.aws_array_list_front
LibAwsCommon.aws_array_list_get_at
LibAwsCommon.aws_array_list_get_at_ptr
LibAwsCommon.aws_array_list_init_dynamic
LibAwsCommon.aws_array_list_init_static
LibAwsCommon.aws_array_list_init_static_from_initialized
LibAwsCommon.aws_array_list_is_valid
LibAwsCommon.aws_array_list_length
LibAwsCommon.aws_array_list_pop_back
LibAwsCommon.aws_array_list_pop_front
LibAwsCommon.aws_array_list_pop_front_n
LibAwsCommon.aws_array_list_push_back
LibAwsCommon.aws_array_list_push_front
LibAwsCommon.aws_array_list_set_at
LibAwsCommon.aws_array_list_shrink_to_fit
LibAwsCommon.aws_array_list_sort
LibAwsCommon.aws_array_list_swap
LibAwsCommon.aws_array_list_swap_contents
LibAwsCommon.aws_atomic_compare_exchange_int
LibAwsCommon.aws_atomic_compare_exchange_int_explicit
LibAwsCommon.aws_atomic_compare_exchange_ptr
LibAwsCommon.aws_atomic_compare_exchange_ptr_explicit
LibAwsCommon.aws_atomic_exchange_int
LibAwsCommon.aws_atomic_exchange_int_explicit
LibAwsCommon.aws_atomic_exchange_ptr
LibAwsCommon.aws_atomic_exchange_ptr_explicit
LibAwsCommon.aws_atomic_fetch_add
LibAwsCommon.aws_atomic_fetch_add_explicit
LibAwsCommon.aws_atomic_fetch_and
LibAwsCommon.aws_atomic_fetch_and_explicit
LibAwsCommon.aws_atomic_fetch_or
LibAwsCommon.aws_atomic_fetch_or_explicit
LibAwsCommon.aws_atomic_fetch_sub
LibAwsCommon.aws_atomic_fetch_sub_explicit
LibAwsCommon.aws_atomic_fetch_xor
LibAwsCommon.aws_atomic_fetch_xor_explicit
LibAwsCommon.aws_atomic_init_int
LibAwsCommon.aws_atomic_init_ptr
LibAwsCommon.aws_atomic_load_int
LibAwsCommon.aws_atomic_load_int_explicit
LibAwsCommon.aws_atomic_load_ptr
LibAwsCommon.aws_atomic_load_ptr_explicit
LibAwsCommon.aws_atomic_priv_xlate_order
LibAwsCommon.aws_atomic_store_int
LibAwsCommon.aws_atomic_store_int_explicit
LibAwsCommon.aws_atomic_store_ptr
LibAwsCommon.aws_atomic_store_ptr_explicit
LibAwsCommon.aws_atomic_thread_fence
LibAwsCommon.aws_backtrace
LibAwsCommon.aws_backtrace_addr2line
LibAwsCommon.aws_backtrace_log
LibAwsCommon.aws_backtrace_print
LibAwsCommon.aws_backtrace_symbols
LibAwsCommon.aws_base64_compute_decoded_len
LibAwsCommon.aws_base64_compute_encoded_len
LibAwsCommon.aws_base64_decode
LibAwsCommon.aws_base64_encode
LibAwsCommon.aws_byte_buf_advance
LibAwsCommon.aws_byte_buf_append
LibAwsCommon.aws_byte_buf_append_and_update
LibAwsCommon.aws_byte_buf_append_byte_dynamic
LibAwsCommon.aws_byte_buf_append_byte_dynamic_secure
LibAwsCommon.aws_byte_buf_append_decoding_uri
LibAwsCommon.aws_byte_buf_append_dynamic
LibAwsCommon.aws_byte_buf_append_dynamic_secure
LibAwsCommon.aws_byte_buf_append_encoding_uri_param
LibAwsCommon.aws_byte_buf_append_encoding_uri_path
LibAwsCommon.aws_byte_buf_append_json_string
LibAwsCommon.aws_byte_buf_append_json_string_formatted
LibAwsCommon.aws_byte_buf_append_null_terminator
LibAwsCommon.aws_byte_buf_append_with_lookup
LibAwsCommon.aws_byte_buf_clean_up
LibAwsCommon.aws_byte_buf_clean_up_secure
LibAwsCommon.aws_byte_buf_eq
LibAwsCommon.aws_byte_buf_eq_c_str
LibAwsCommon.aws_byte_buf_eq_c_str_ignore_case
LibAwsCommon.aws_byte_buf_eq_ignore_case
LibAwsCommon.aws_byte_buf_from_array
LibAwsCommon.aws_byte_buf_from_c_str
LibAwsCommon.aws_byte_buf_from_empty_array
LibAwsCommon.aws_byte_buf_init
LibAwsCommon.aws_byte_buf_init_copy
LibAwsCommon.aws_byte_buf_init_copy_from_cursor
LibAwsCommon.aws_byte_buf_init_from_file
LibAwsCommon.aws_byte_buf_init_from_file_with_size_hint
LibAwsCommon.aws_byte_buf_is_valid
LibAwsCommon.aws_byte_buf_reserve
LibAwsCommon.aws_byte_buf_reserve_relative
LibAwsCommon.aws_byte_buf_reset
LibAwsCommon.aws_byte_buf_secure_zero
LibAwsCommon.aws_byte_buf_write
LibAwsCommon.aws_byte_buf_write_be16
LibAwsCommon.aws_byte_buf_write_be24
LibAwsCommon.aws_byte_buf_write_be32
LibAwsCommon.aws_byte_buf_write_be64
LibAwsCommon.aws_byte_buf_write_float_be32
LibAwsCommon.aws_byte_buf_write_float_be64
LibAwsCommon.aws_byte_buf_write_from_whole_buffer
LibAwsCommon.aws_byte_buf_write_from_whole_cursor
LibAwsCommon.aws_byte_buf_write_from_whole_string
LibAwsCommon.aws_byte_buf_write_to_capacity
LibAwsCommon.aws_byte_buf_write_u8
LibAwsCommon.aws_byte_buf_write_u8_n
LibAwsCommon.aws_byte_cursor_advance
LibAwsCommon.aws_byte_cursor_advance_nospec
LibAwsCommon.aws_byte_cursor_compare_lexical
LibAwsCommon.aws_byte_cursor_compare_lookup
LibAwsCommon.aws_byte_cursor_eq
LibAwsCommon.aws_byte_cursor_eq_byte_buf
LibAwsCommon.aws_byte_cursor_eq_byte_buf_ignore_case
LibAwsCommon.aws_byte_cursor_eq_c_str
LibAwsCommon.aws_byte_cursor_eq_c_str_ignore_case
LibAwsCommon.aws_byte_cursor_eq_ignore_case
LibAwsCommon.aws_byte_cursor_find_exact
LibAwsCommon.aws_byte_cursor_from_array
LibAwsCommon.aws_byte_cursor_from_buf
LibAwsCommon.aws_byte_cursor_from_c_str
LibAwsCommon.aws_byte_cursor_from_string
LibAwsCommon.aws_byte_cursor_is_valid
LibAwsCommon.aws_byte_cursor_left_trim_pred
LibAwsCommon.aws_byte_cursor_next_split
LibAwsCommon.aws_byte_cursor_read
LibAwsCommon.aws_byte_cursor_read_and_fill_buffer
LibAwsCommon.aws_byte_cursor_read_be16
LibAwsCommon.aws_byte_cursor_read_be24
LibAwsCommon.aws_byte_cursor_read_be32
LibAwsCommon.aws_byte_cursor_read_be64
LibAwsCommon.aws_byte_cursor_read_float_be32
LibAwsCommon.aws_byte_cursor_read_float_be64
LibAwsCommon.aws_byte_cursor_read_hex_u8
LibAwsCommon.aws_byte_cursor_read_u8
LibAwsCommon.aws_byte_cursor_right_trim_pred
LibAwsCommon.aws_byte_cursor_satisfies_pred
LibAwsCommon.aws_byte_cursor_split_on_char
LibAwsCommon.aws_byte_cursor_split_on_char_n
LibAwsCommon.aws_byte_cursor_starts_with
LibAwsCommon.aws_byte_cursor_starts_with_ignore_case
LibAwsCommon.aws_byte_cursor_trim_pred
LibAwsCommon.aws_byte_cursor_utf8_parse_u64
LibAwsCommon.aws_byte_cursor_utf8_parse_u64_hex
LibAwsCommon.aws_c_string_is_valid
LibAwsCommon.aws_cache_base_default_clear
LibAwsCommon.aws_cache_base_default_destroy
LibAwsCommon.aws_cache_base_default_find
LibAwsCommon.aws_cache_base_default_get_element_count
LibAwsCommon.aws_cache_base_default_remove
LibAwsCommon.aws_cache_clear
LibAwsCommon.aws_cache_destroy
LibAwsCommon.aws_cache_find
LibAwsCommon.aws_cache_get_element_count
LibAwsCommon.aws_cache_new_fifo
LibAwsCommon.aws_cache_new_lifo
LibAwsCommon.aws_cache_new_lru
LibAwsCommon.aws_cache_put
LibAwsCommon.aws_cache_remove
LibAwsCommon.aws_cbor_decoder_consume_next_single_element
LibAwsCommon.aws_cbor_decoder_consume_next_whole_data_item
LibAwsCommon.aws_cbor_decoder_destroy
LibAwsCommon.aws_cbor_decoder_get_remaining_length
LibAwsCommon.aws_cbor_decoder_new
LibAwsCommon.aws_cbor_decoder_peek_type
LibAwsCommon.aws_cbor_decoder_pop_next_array_start
LibAwsCommon.aws_cbor_decoder_pop_next_boolean_val
LibAwsCommon.aws_cbor_decoder_pop_next_bytes_val
LibAwsCommon.aws_cbor_decoder_pop_next_float_val
LibAwsCommon.aws_cbor_decoder_pop_next_map_start
LibAwsCommon.aws_cbor_decoder_pop_next_negative_int_val
LibAwsCommon.aws_cbor_decoder_pop_next_tag_val
LibAwsCommon.aws_cbor_decoder_pop_next_text_val
LibAwsCommon.aws_cbor_decoder_pop_next_unsigned_int_val
LibAwsCommon.aws_cbor_encoder_destroy
LibAwsCommon.aws_cbor_encoder_get_encoded_data
LibAwsCommon.aws_cbor_encoder_new
LibAwsCommon.aws_cbor_encoder_reset
LibAwsCommon.aws_cbor_encoder_write_array_start
LibAwsCommon.aws_cbor_encoder_write_bool
LibAwsCommon.aws_cbor_encoder_write_break
LibAwsCommon.aws_cbor_encoder_write_bytes
LibAwsCommon.aws_cbor_encoder_write_float
LibAwsCommon.aws_cbor_encoder_write_indef_array_start
LibAwsCommon.aws_cbor_encoder_write_indef_bytes_start
LibAwsCommon.aws_cbor_encoder_write_indef_map_start
LibAwsCommon.aws_cbor_encoder_write_indef_text_start
LibAwsCommon.aws_cbor_encoder_write_map_start
LibAwsCommon.aws_cbor_encoder_write_negint
LibAwsCommon.aws_cbor_encoder_write_null
LibAwsCommon.aws_cbor_encoder_write_tag
LibAwsCommon.aws_cbor_encoder_write_text
LibAwsCommon.aws_cbor_encoder_write_uint
LibAwsCommon.aws_cbor_encoder_write_undefined
LibAwsCommon.aws_cbor_type_cstr
LibAwsCommon.aws_char_is_space
LibAwsCommon.aws_cli_dispatch_on_subcommand
LibAwsCommon.aws_cli_getopt_long
LibAwsCommon.aws_cli_reset_state
LibAwsCommon.aws_clz_i32
LibAwsCommon.aws_clz_i64
LibAwsCommon.aws_clz_size
LibAwsCommon.aws_clz_u32
LibAwsCommon.aws_clz_u64
LibAwsCommon.aws_common_fatal_assert_library_initialized
LibAwsCommon.aws_common_library_clean_up
LibAwsCommon.aws_common_library_init
LibAwsCommon.aws_condition_variable_clean_up
LibAwsCommon.aws_condition_variable_init
LibAwsCommon.aws_condition_variable_notify_all
LibAwsCommon.aws_condition_variable_notify_one
LibAwsCommon.aws_condition_variable_wait
LibAwsCommon.aws_condition_variable_wait_for
LibAwsCommon.aws_condition_variable_wait_for_pred
LibAwsCommon.aws_condition_variable_wait_pred
LibAwsCommon.aws_cpu_has_feature
LibAwsCommon.aws_cross_process_lock_release
LibAwsCommon.aws_cross_process_lock_try_acquire
LibAwsCommon.aws_crt_statistics_handler_destroy
LibAwsCommon.aws_crt_statistics_handler_get_report_interval_ms
LibAwsCommon.aws_crt_statistics_handler_process_statistics
LibAwsCommon.aws_ctz_i32
LibAwsCommon.aws_ctz_i64
LibAwsCommon.aws_ctz_size
LibAwsCommon.aws_ctz_u32
LibAwsCommon.aws_ctz_u64
LibAwsCommon.aws_date_time_as_epoch_secs
LibAwsCommon.aws_date_time_as_millis
LibAwsCommon.aws_date_time_as_nanos
LibAwsCommon.aws_date_time_day_of_week
LibAwsCommon.aws_date_time_diff
LibAwsCommon.aws_date_time_dst
LibAwsCommon.aws_date_time_hour
LibAwsCommon.aws_date_time_init_epoch_millis
LibAwsCommon.aws_date_time_init_epoch_secs
LibAwsCommon.aws_date_time_init_from_str
LibAwsCommon.aws_date_time_init_from_str_cursor
LibAwsCommon.aws_date_time_init_now
LibAwsCommon.aws_date_time_minute
LibAwsCommon.aws_date_time_month
LibAwsCommon.aws_date_time_month_day
LibAwsCommon.aws_date_time_second
LibAwsCommon.aws_date_time_to_local_time_short_str
LibAwsCommon.aws_date_time_to_local_time_str
LibAwsCommon.aws_date_time_to_utc_time_short_str
LibAwsCommon.aws_date_time_to_utc_time_str
LibAwsCommon.aws_date_time_year
LibAwsCommon.aws_debug_break
LibAwsCommon.aws_decode_utf8
LibAwsCommon.aws_default_allocator
LibAwsCommon.aws_default_thread_options
LibAwsCommon.aws_device_random_buffer
LibAwsCommon.aws_device_random_buffer_append
LibAwsCommon.aws_device_random_u16
LibAwsCommon.aws_device_random_u32
LibAwsCommon.aws_device_random_u64
LibAwsCommon.aws_device_random_u8
LibAwsCommon.aws_directory_create
LibAwsCommon.aws_directory_delete
LibAwsCommon.aws_directory_entry_iterator_destroy
LibAwsCommon.aws_directory_entry_iterator_get_value
LibAwsCommon.aws_directory_entry_iterator_new
LibAwsCommon.aws_directory_entry_iterator_next
LibAwsCommon.aws_directory_entry_iterator_previous
LibAwsCommon.aws_directory_exists
LibAwsCommon.aws_directory_or_file_move
LibAwsCommon.aws_directory_traverse
LibAwsCommon.aws_error_debug_str
LibAwsCommon.aws_error_lib_name
LibAwsCommon.aws_error_name
LibAwsCommon.aws_error_str
LibAwsCommon.aws_fatal_assert
LibAwsCommon.aws_file_delete
LibAwsCommon.aws_file_get_length
LibAwsCommon.aws_fopen
LibAwsCommon.aws_fopen_safe
LibAwsCommon.aws_fseek
LibAwsCommon.aws_get_cpu_count_for_group
LibAwsCommon.aws_get_cpu_group_count
LibAwsCommon.aws_get_cpu_ids_for_group
LibAwsCommon.aws_get_environment_value
LibAwsCommon.aws_get_hard_limit_io_handles
LibAwsCommon.aws_get_home_directory
LibAwsCommon.aws_get_pid
LibAwsCommon.aws_get_platform_build_os
LibAwsCommon.aws_get_platform_directory_separator
LibAwsCommon.aws_get_soft_limit_io_handles
LibAwsCommon.aws_gmtime
LibAwsCommon.aws_hash_array_ignore_case
LibAwsCommon.aws_hash_byte_cursor_ptr
LibAwsCommon.aws_hash_byte_cursor_ptr_ignore_case
LibAwsCommon.aws_hash_c_string
LibAwsCommon.aws_hash_callback_c_str_eq
LibAwsCommon.aws_hash_callback_string_destroy
LibAwsCommon.aws_hash_callback_string_eq
LibAwsCommon.aws_hash_combine
LibAwsCommon.aws_hash_compare_uint64_t_eq
LibAwsCommon.aws_hash_iter_begin
LibAwsCommon.aws_hash_iter_delete
LibAwsCommon.aws_hash_iter_done
LibAwsCommon.aws_hash_iter_is_valid
LibAwsCommon.aws_hash_iter_next
LibAwsCommon.aws_hash_ptr
LibAwsCommon.aws_hash_string
LibAwsCommon.aws_hash_table_clean_up
LibAwsCommon.aws_hash_table_clear
LibAwsCommon.aws_hash_table_create
LibAwsCommon.aws_hash_table_eq
LibAwsCommon.aws_hash_table_find
LibAwsCommon.aws_hash_table_foreach
LibAwsCommon.aws_hash_table_get_entry_count
LibAwsCommon.aws_hash_table_init
LibAwsCommon.aws_hash_table_is_valid
LibAwsCommon.aws_hash_table_move
LibAwsCommon.aws_hash_table_put
LibAwsCommon.aws_hash_table_remove
LibAwsCommon.aws_hash_table_remove_element
LibAwsCommon.aws_hash_table_swap
LibAwsCommon.aws_hash_uint64_t_by_identity
LibAwsCommon.aws_hex_compute_decoded_len
LibAwsCommon.aws_hex_compute_encoded_len
LibAwsCommon.aws_hex_decode
LibAwsCommon.aws_hex_encode
LibAwsCommon.aws_hex_encode_append_dynamic
LibAwsCommon.aws_high_res_clock_get_ticks
LibAwsCommon.aws_host_utils_is_ipv4
LibAwsCommon.aws_host_utils_is_ipv6
LibAwsCommon.aws_hton16
LibAwsCommon.aws_hton32
LibAwsCommon.aws_hton64
LibAwsCommon.aws_htonf32
LibAwsCommon.aws_htonf64
LibAwsCommon.aws_init_memory_usage_for_current_process
LibAwsCommon.aws_is_any_directory_separator
LibAwsCommon.aws_is_big_endian
LibAwsCommon.aws_is_debugger_present
LibAwsCommon.aws_is_mem_zeroed
LibAwsCommon.aws_is_power_of_two
LibAwsCommon.aws_isalnum
LibAwsCommon.aws_isalpha
LibAwsCommon.aws_isdigit
LibAwsCommon.aws_isspace
LibAwsCommon.aws_isxdigit
LibAwsCommon.aws_json_const_iterate_array
LibAwsCommon.aws_json_const_iterate_object
LibAwsCommon.aws_json_get_array_element
LibAwsCommon.aws_json_get_array_size
LibAwsCommon.aws_json_value_add_array_element
LibAwsCommon.aws_json_value_add_to_object
LibAwsCommon.aws_json_value_compare
LibAwsCommon.aws_json_value_destroy
LibAwsCommon.aws_json_value_duplicate
LibAwsCommon.aws_json_value_get_boolean
LibAwsCommon.aws_json_value_get_from_object
LibAwsCommon.aws_json_value_get_number
LibAwsCommon.aws_json_value_get_string
LibAwsCommon.aws_json_value_has_key
LibAwsCommon.aws_json_value_is_array
LibAwsCommon.aws_json_value_is_boolean
LibAwsCommon.aws_json_value_is_null
LibAwsCommon.aws_json_value_is_number
LibAwsCommon.aws_json_value_is_object
LibAwsCommon.aws_json_value_is_string
LibAwsCommon.aws_json_value_new_array
LibAwsCommon.aws_json_value_new_boolean
LibAwsCommon.aws_json_value_new_from_string
LibAwsCommon.aws_json_value_new_null
LibAwsCommon.aws_json_value_new_number
LibAwsCommon.aws_json_value_new_object
LibAwsCommon.aws_json_value_new_string
LibAwsCommon.aws_json_value_remove_array_element
LibAwsCommon.aws_json_value_remove_from_object
LibAwsCommon.aws_last_error
LibAwsCommon.aws_linked_hash_table_clean_up
LibAwsCommon.aws_linked_hash_table_clear
LibAwsCommon.aws_linked_hash_table_find
LibAwsCommon.aws_linked_hash_table_find_and_move_to_back
LibAwsCommon.aws_linked_hash_table_get_element_count
LibAwsCommon.aws_linked_hash_table_get_iteration_list
LibAwsCommon.aws_linked_hash_table_init
LibAwsCommon.aws_linked_hash_table_move_node_to_end_of_list
LibAwsCommon.aws_linked_hash_table_put
LibAwsCommon.aws_linked_hash_table_remove
LibAwsCommon.aws_linked_list_back
LibAwsCommon.aws_linked_list_begin
LibAwsCommon.aws_linked_list_empty
LibAwsCommon.aws_linked_list_end
LibAwsCommon.aws_linked_list_front
LibAwsCommon.aws_linked_list_init
LibAwsCommon.aws_linked_list_insert_after
LibAwsCommon.aws_linked_list_insert_before
LibAwsCommon.aws_linked_list_is_valid
LibAwsCommon.aws_linked_list_is_valid_deep
LibAwsCommon.aws_linked_list_move_all_back
LibAwsCommon.aws_linked_list_move_all_front
LibAwsCommon.aws_linked_list_next
LibAwsCommon.aws_linked_list_node_is_in_list
LibAwsCommon.aws_linked_list_node_next_is_valid
LibAwsCommon.aws_linked_list_node_prev_is_valid
LibAwsCommon.aws_linked_list_node_reset
LibAwsCommon.aws_linked_list_pop_back
LibAwsCommon.aws_linked_list_pop_front
LibAwsCommon.aws_linked_list_prev
LibAwsCommon.aws_linked_list_push_back
LibAwsCommon.aws_linked_list_push_front
LibAwsCommon.aws_linked_list_rbegin
LibAwsCommon.aws_linked_list_remove
LibAwsCommon.aws_linked_list_rend
LibAwsCommon.aws_linked_list_swap_contents
LibAwsCommon.aws_linked_list_swap_nodes
LibAwsCommon.aws_localtime
LibAwsCommon.aws_log_channel_clean_up
LibAwsCommon.aws_log_channel_init_background
LibAwsCommon.aws_log_channel_init_foreground
LibAwsCommon.aws_log_formatter_clean_up
LibAwsCommon.aws_log_formatter_init_default
LibAwsCommon.aws_log_level_to_string
LibAwsCommon.aws_log_subject_name
LibAwsCommon.aws_log_writer_clean_up
LibAwsCommon.aws_log_writer_init_file
LibAwsCommon.aws_log_writer_init_stderr
LibAwsCommon.aws_log_writer_init_stdout
LibAwsCommon.aws_logger_clean_up
LibAwsCommon.aws_logger_get
LibAwsCommon.aws_logger_get_conditional
LibAwsCommon.aws_logger_init_from_external
LibAwsCommon.aws_logger_init_noalloc
LibAwsCommon.aws_logger_init_standard
LibAwsCommon.aws_logger_set
LibAwsCommon.aws_logger_set_log_level
LibAwsCommon.aws_lookup_table_hex_to_num_get
LibAwsCommon.aws_lookup_table_to_lower_get
LibAwsCommon.aws_lru_cache_get_mru_element
LibAwsCommon.aws_lru_cache_use_lru_element
LibAwsCommon.aws_max_double
LibAwsCommon.aws_max_float
LibAwsCommon.aws_max_i16
LibAwsCommon.aws_max_i32
LibAwsCommon.aws_max_i64
LibAwsCommon.aws_max_i8
LibAwsCommon.aws_max_int
LibAwsCommon.aws_max_size
LibAwsCommon.aws_max_u16
LibAwsCommon.aws_max_u32
LibAwsCommon.aws_max_u64
LibAwsCommon.aws_max_u8
LibAwsCommon.aws_mem_acquire
LibAwsCommon.aws_mem_calloc
LibAwsCommon.aws_mem_realloc
LibAwsCommon.aws_mem_release
LibAwsCommon.aws_mem_tracer_bytes
LibAwsCommon.aws_mem_tracer_count
LibAwsCommon.aws_mem_tracer_destroy
LibAwsCommon.aws_mem_tracer_dump
LibAwsCommon.aws_mem_tracer_new
LibAwsCommon.aws_min_double
LibAwsCommon.aws_min_float
LibAwsCommon.aws_min_i16
LibAwsCommon.aws_min_i32
LibAwsCommon.aws_min_i64
LibAwsCommon.aws_min_i8
LibAwsCommon.aws_min_int
LibAwsCommon.aws_min_size
LibAwsCommon.aws_min_u16
LibAwsCommon.aws_min_u32
LibAwsCommon.aws_min_u64
LibAwsCommon.aws_min_u8
LibAwsCommon.aws_mul_size_checked
LibAwsCommon.aws_mul_size_saturating
LibAwsCommon.aws_mul_u32_checked
LibAwsCommon.aws_mul_u32_saturating
LibAwsCommon.aws_mul_u64_checked
LibAwsCommon.aws_mul_u64_saturating
LibAwsCommon.aws_mutex_clean_up
LibAwsCommon.aws_mutex_init
LibAwsCommon.aws_mutex_lock
LibAwsCommon.aws_mutex_try_lock
LibAwsCommon.aws_mutex_unlock
LibAwsCommon.aws_normalize_directory_separator
LibAwsCommon.aws_ntoh16
LibAwsCommon.aws_ntoh32
LibAwsCommon.aws_ntoh64
LibAwsCommon.aws_ntohf32
LibAwsCommon.aws_ntohf64
LibAwsCommon.aws_path_exists
LibAwsCommon.aws_priority_queue_backpointer_index_valid
LibAwsCommon.aws_priority_queue_backpointers_valid
LibAwsCommon.aws_priority_queue_backpointers_valid_deep
LibAwsCommon.aws_priority_queue_capacity
LibAwsCommon.aws_priority_queue_clean_up
LibAwsCommon.aws_priority_queue_clear
LibAwsCommon.aws_priority_queue_init_dynamic
LibAwsCommon.aws_priority_queue_init_static
LibAwsCommon.aws_priority_queue_is_valid
LibAwsCommon.aws_priority_queue_node_init
LibAwsCommon.aws_priority_queue_node_is_in_queue
LibAwsCommon.aws_priority_queue_pop
LibAwsCommon.aws_priority_queue_push
LibAwsCommon.aws_priority_queue_push_ref
LibAwsCommon.aws_priority_queue_remove
LibAwsCommon.aws_priority_queue_size
LibAwsCommon.aws_priority_queue_top
LibAwsCommon.aws_ptr_eq
LibAwsCommon.aws_query_string_next_param
LibAwsCommon.aws_query_string_params
LibAwsCommon.aws_raise_error
LibAwsCommon.aws_raise_error_private
LibAwsCommon.aws_read_u16
LibAwsCommon.aws_read_u24
LibAwsCommon.aws_read_u32
LibAwsCommon.aws_read_u64
LibAwsCommon.aws_ref_count_acquire
LibAwsCommon.aws_ref_count_init
LibAwsCommon.aws_ref_count_release
LibAwsCommon.aws_register_error_info
LibAwsCommon.aws_register_log_subject_info_list
LibAwsCommon.aws_reset_error
LibAwsCommon.aws_restore_error
LibAwsCommon.aws_ring_buffer_acquire
LibAwsCommon.aws_ring_buffer_acquire_up_to
LibAwsCommon.aws_ring_buffer_buf_belongs_to_pool
LibAwsCommon.aws_ring_buffer_check_atomic_ptr
LibAwsCommon.aws_ring_buffer_clean_up
LibAwsCommon.aws_ring_buffer_init
LibAwsCommon.aws_ring_buffer_is_empty
LibAwsCommon.aws_ring_buffer_is_valid
LibAwsCommon.aws_ring_buffer_release
LibAwsCommon.aws_round_up_to_power_of_two
LibAwsCommon.aws_run_command
LibAwsCommon.aws_run_command_result_cleanup
LibAwsCommon.aws_run_command_result_init
LibAwsCommon.aws_rw_lock_clean_up
LibAwsCommon.aws_rw_lock_init
LibAwsCommon.aws_rw_lock_rlock
LibAwsCommon.aws_rw_lock_runlock
LibAwsCommon.aws_rw_lock_try_rlock
LibAwsCommon.aws_rw_lock_try_wlock
LibAwsCommon.aws_rw_lock_wlock
LibAwsCommon.aws_rw_lock_wunlock
LibAwsCommon.aws_secure_strlen
LibAwsCommon.aws_secure_zero
LibAwsCommon.aws_set_environment_value
LibAwsCommon.aws_set_global_error_handler_fn
LibAwsCommon.aws_set_soft_limit_io_handles
LibAwsCommon.aws_set_thread_local_error_handler_fn
LibAwsCommon.aws_small_block_allocator_bytes_active
LibAwsCommon.aws_small_block_allocator_bytes_reserved
LibAwsCommon.aws_small_block_allocator_destroy
LibAwsCommon.aws_small_block_allocator_new
LibAwsCommon.aws_small_block_allocator_page_size
LibAwsCommon.aws_small_block_allocator_page_size_available
LibAwsCommon.aws_string_bytes
LibAwsCommon.aws_string_c_str
LibAwsCommon.aws_string_clone_or_reuse
LibAwsCommon.aws_string_compare
LibAwsCommon.aws_string_destroy
LibAwsCommon.aws_string_destroy_secure
LibAwsCommon.aws_string_eq
LibAwsCommon.aws_string_eq_byte_buf
LibAwsCommon.aws_string_eq_byte_buf_ignore_case
LibAwsCommon.aws_string_eq_byte_cursor
LibAwsCommon.aws_string_eq_byte_cursor_ignore_case
LibAwsCommon.aws_string_eq_c_str
LibAwsCommon.aws_string_eq_c_str_ignore_case
LibAwsCommon.aws_string_eq_ignore_case
LibAwsCommon.aws_string_is_valid
LibAwsCommon.aws_string_new_from_array
LibAwsCommon.aws_string_new_from_buf
LibAwsCommon.aws_string_new_from_c_str
LibAwsCommon.aws_string_new_from_cursor
LibAwsCommon.aws_string_new_from_string
LibAwsCommon.aws_string_to_log_level
LibAwsCommon.aws_sub_size_checked
LibAwsCommon.aws_sub_size_saturating
LibAwsCommon.aws_sub_u32_checked
LibAwsCommon.aws_sub_u32_saturating
LibAwsCommon.aws_sub_u64_checked
LibAwsCommon.aws_sub_u64_saturating
LibAwsCommon.aws_sys_clock_get_ticks
LibAwsCommon.aws_system_environment_acquire
LibAwsCommon.aws_system_environment_get_cpu_group_count
LibAwsCommon.aws_system_environment_get_processor_count
LibAwsCommon.aws_system_environment_get_virtualization_product_name
LibAwsCommon.aws_system_environment_get_virtualization_vendor
LibAwsCommon.aws_system_environment_load
LibAwsCommon.aws_system_environment_release
LibAwsCommon.aws_system_info_processor_count
LibAwsCommon.aws_task_init
LibAwsCommon.aws_task_run
LibAwsCommon.aws_task_scheduler_cancel_task
LibAwsCommon.aws_task_scheduler_clean_up
LibAwsCommon.aws_task_scheduler_has_tasks
LibAwsCommon.aws_task_scheduler_init
LibAwsCommon.aws_task_scheduler_is_valid
LibAwsCommon.aws_task_scheduler_run_all
LibAwsCommon.aws_task_scheduler_schedule_future
LibAwsCommon.aws_task_scheduler_schedule_now
LibAwsCommon.aws_task_status_to_c_str
LibAwsCommon.aws_text_detect_encoding
LibAwsCommon.aws_text_is_utf8
LibAwsCommon.aws_thread_call_once
LibAwsCommon.aws_thread_clean_up
LibAwsCommon.aws_thread_current_at_exit
LibAwsCommon.aws_thread_current_name
LibAwsCommon.aws_thread_current_sleep
LibAwsCommon.aws_thread_current_thread_id
LibAwsCommon.aws_thread_decrement_unjoined_count
LibAwsCommon.aws_thread_get_detach_state
LibAwsCommon.aws_thread_get_id
LibAwsCommon.aws_thread_id_t_to_string
LibAwsCommon.aws_thread_increment_unjoined_count
LibAwsCommon.aws_thread_init
LibAwsCommon.aws_thread_join
LibAwsCommon.aws_thread_join_all_managed
LibAwsCommon.aws_thread_launch
LibAwsCommon.aws_thread_name
LibAwsCommon.aws_thread_scheduler_acquire
LibAwsCommon.aws_thread_scheduler_cancel_task
LibAwsCommon.aws_thread_scheduler_new
LibAwsCommon.aws_thread_scheduler_release
LibAwsCommon.aws_thread_scheduler_schedule_future
LibAwsCommon.aws_thread_scheduler_schedule_now
LibAwsCommon.aws_thread_set_managed_join_timeout_ns
LibAwsCommon.aws_thread_thread_id_equal
LibAwsCommon.aws_timegm
LibAwsCommon.aws_timestamp_convert
LibAwsCommon.aws_timestamp_convert_u64
LibAwsCommon.aws_translate_and_raise_io_error
LibAwsCommon.aws_translate_and_raise_io_error_or
LibAwsCommon.aws_unregister_error_info
LibAwsCommon.aws_unregister_log_subject_info_list
LibAwsCommon.aws_unset_environment_value
LibAwsCommon.aws_uri_authority
LibAwsCommon.aws_uri_clean_up
LibAwsCommon.aws_uri_host_name
LibAwsCommon.aws_uri_init_from_builder_options
LibAwsCommon.aws_uri_init_parse
LibAwsCommon.aws_uri_path
LibAwsCommon.aws_uri_path_and_query
LibAwsCommon.aws_uri_port
LibAwsCommon.aws_uri_query_string
LibAwsCommon.aws_uri_query_string_next_param
LibAwsCommon.aws_uri_query_string_params
LibAwsCommon.aws_uri_scheme
LibAwsCommon.aws_utf8_decoder_destroy
LibAwsCommon.aws_utf8_decoder_finalize
LibAwsCommon.aws_utf8_decoder_new
LibAwsCommon.aws_utf8_decoder_reset
LibAwsCommon.aws_utf8_decoder_update
LibAwsCommon.aws_uuid_equals
LibAwsCommon.aws_uuid_init
LibAwsCommon.aws_uuid_init_from_str
LibAwsCommon.aws_uuid_to_str
LibAwsCommon.aws_write_u16
LibAwsCommon.aws_write_u24
LibAwsCommon.aws_write_u32
LibAwsCommon.aws_write_u64
LibAwsCommon.aws_xml_node_as_body
LibAwsCommon.aws_xml_node_get_attribute
LibAwsCommon.aws_xml_node_get_name
LibAwsCommon.aws_xml_node_get_num_attributes
LibAwsCommon.aws_xml_node_traverse
LibAwsCommon.aws_xml_parse
LibAwsCommon.enable_vt_mode
LibAwsCommon.s_aws_run_test_case
LibAwsCommon.s_print_stack_trace
LibAwsCommon.AWS_CBOR_TAG_DECIMAL_FRACTION
— ConstantDocumentation not found.
LibAwsCommon.AWS_CBOR_TAG_EPOCH_TIME
— ConstantDocumentation not found.
LibAwsCommon.AWS_CBOR_TAG_NEGATIVE_BIGNUM
— ConstantDocumentation not found.
LibAwsCommon.AWS_CBOR_TAG_STANDARD_TIME
— ConstantDocumentation not found.
LibAwsCommon.AWS_CBOR_TAG_UNSIGNED_BIGNUM
— ConstantDocumentation not found.
LibAwsCommon.AWS_CRT_STATISTICS_CATEGORY_STRIDE
— ConstantDocumentation not found.
LibAwsCommon.AWS_C_COMMON_PACKAGE_ID
— ConstantDocumentation not found.
LibAwsCommon.AWS_ERROR_ENUM_STRIDE
— ConstantDocumentation not found.
LibAwsCommon.AWS_ERROR_ENUM_STRIDE_BITS
— ConstantDocumentation not found.
LibAwsCommon.AWS_LOG_LEVEL_DEBUG
— ConstantDocumentation not found.
LibAwsCommon.AWS_LOG_LEVEL_ERROR
— ConstantDocumentation not found.
LibAwsCommon.AWS_LOG_LEVEL_FATAL
— ConstantDocumentation not found.
LibAwsCommon.AWS_LOG_LEVEL_INFO
— ConstantDocumentation not found.
LibAwsCommon.AWS_LOG_LEVEL_NONE
— ConstantDocumentation not found.
LibAwsCommon.AWS_LOG_LEVEL_TRACE
— ConstantDocumentation not found.
LibAwsCommon.AWS_LOG_LEVEL_WARN
— ConstantDocumentation not found.
LibAwsCommon.AWS_LOG_SUBJECT_STRIDE
— ConstantDocumentation not found.
LibAwsCommon.AWS_OP_ERR
— ConstantDocumentation not found.
LibAwsCommon.AWS_OP_SKIP
— ConstantDocumentation not found.
LibAwsCommon.AWS_OP_SUCCESS
— ConstantDocumentation not found.
LibAwsCommon.AWS_PACKAGE_SLOTS
— ConstantDocumentation not found.
LibAwsCommon.AWS_PATH_DELIM
— ConstantDocumentation not found.
LibAwsCommon.AWS_PATH_DELIM_STR
— ConstantDocumentation not found.
LibAwsCommon.AWS_TESTING_REPORT_FD
— ConstantDocumentation not found.
LibAwsCommon.AWS_THREAD_NAME_RECOMMENDED_STRLEN
— ConstantDocumentation not found.
LibAwsCommon.FAILURE
— ConstantDocumentation not found.
LibAwsCommon.FAIL_PREFIX
— ConstantDocumentation not found.
LibAwsCommon.PRInSTR
— ConstantDocumentation not found.
LibAwsCommon.SIZE_BITS
— ConstantDocumentation not found.
LibAwsCommon.SKIP
— ConstantDocumentation not found.
LibAwsCommon.SUCCESS
— ConstantDocumentation not found.
LibAwsCommon.__JL_Ctag_1143
— Type__JL_Ctag_1143
36 bytes for the UUID plus one more for the null terminator.
LibAwsCommon.__JL_Ctag_1248
— Type__JL_Ctag_1248
Documentation not found.
LibAwsCommon.__JL_Ctag_1252
— Type__JL_Ctag_1252
Documentation not found.
LibAwsCommon.__JL_Ctag_1291
— Type__JL_Ctag_1291
honor the ABI compat
LibAwsCommon.__JL_Ctag_1322
— Type__JL_Ctag_1322
Documentation not found.
LibAwsCommon.__JL_Ctag_1323
— Type__JL_Ctag_1323
Documentation not found.
LibAwsCommon.__JL_Ctag_1324
— Type__JL_Ctag_1324
Documentation not found.
LibAwsCommon.__JL_Ctag_1325
— Type__JL_Ctag_1325
Documentation not found.
LibAwsCommon.__JL_Ctag_1326
— Type__JL_Ctag_1326
Documentation not found.
LibAwsCommon.__JL_Ctag_1327
— Type__JL_Ctag_1327
Documentation not found.
LibAwsCommon.__JL_Ctag_1328
— Type__JL_Ctag_1328
Documentation not found.
LibAwsCommon.__JL_Ctag_317
— Type__JL_Ctag_317
Documentation not found.
LibAwsCommon.__JL_Ctag_41
— Type__JL_Ctag_41
Documentation not found.
LibAwsCommon.__JL_Ctag_468
— Type__JL_Ctag_468
Documentation not found.
LibAwsCommon.__JL_Ctag_705
— Type__JL_Ctag_705
Each library gets space for 2^^10 log subject entries
LibAwsCommon.__JL_Ctag_726
— Type__JL_Ctag_726
Documentation not found.
LibAwsCommon.__JL_Ctag_909
— Type__JL_Ctag_909
Each library gets space for 2^^8 category entries
LibAwsCommon.___itt_track_group_type
— Type___itt_track_group_type
exclude_from_documentation
LibAwsCommon.___itt_track_type
— Type___itt_track_type
Placeholder for custom track types. Currently, "normal" custom track is the only available track type.
LibAwsCommon.__clock_t
— TypeDocumentation not found.
LibAwsCommon.__itt_av_data_type
— Type__itt_av_data_type
__itt_av_data_type
Defines types of arrays data (for C/C++ intrinsic types)
LibAwsCommon.__itt_collection_scope
— Type__itt_collection_scope
__itt_collection_scope
Enumerator for collection scopes
LibAwsCommon.__itt_collection_state
— Type__itt_collection_state
__itt_collection_state
Enumerator for collection state.
LibAwsCommon.__itt_context_type
— Type__itt_context_type
describes the type of context metadata
LibAwsCommon.__itt_metadata_type
— Type__itt_metadata_type
parameters
describes the type of metadata
LibAwsCommon.__itt_model_disable
— Type__itt_model_disable
__itt_model_disable
Enumerator for the disable methods
LibAwsCommon.__itt_module_type
— Type__itt_module_type
exclude_from_documentation
LibAwsCommon.__itt_relation
— Type__itt_relation
relations
The kind of relation between two instances is specified by the enumerated type __itt_relation
. Relations between instances can be added with an API call. The relation API uses instance IDs. Relations can be added before or after the actual instances are created and persist independently of the instances. This is the motivation for having different lifetimes for instance IDs and the actual instances.
LibAwsCommon.__itt_scope
— Type__itt_scope
Describes the scope of an event object in the trace.
LibAwsCommon.__itt_section_type
— Type__itt_section_type
exclude_from_documentation
LibAwsCommon.__itt_suppress_mode
— Type__itt_suppress_mode
__itt_suppress_mode
Enumerator for the suppressing modes
LibAwsCommon.__pid_t
— TypeDocumentation not found.
LibAwsCommon.__pthread_internal_list
— Type__pthread_internal_list
Documentation not found.
LibAwsCommon.__pthread_list_t
— TypeDocumentation not found.
LibAwsCommon.__pthread_mutex_s
— Type__pthread_mutex_s
Documentation not found.
LibAwsCommon.__time_t
— TypeDocumentation not found.
LibAwsCommon.__uid_t
— TypeDocumentation not found.
LibAwsCommon.aws_allocator
— Typeaws_allocator
Allocator structure. An instance of this will be passed around for anything needing memory allocation
LibAwsCommon.aws_array_list
— Typeaws_array_list
Documentation not found.
LibAwsCommon.aws_array_list_comparator_fn
— TypePrototype for a comparator function for sorting elements.
a and b should be cast to pointers to the element type held in the list before being dereferenced. The function should compare the elements and return a positive number if a > b, zero if a = b, and a negative number if a < b.
LibAwsCommon.aws_atomic_impl_int_t
— TypeDocumentation not found.
LibAwsCommon.aws_atomic_var
— Typeaws_atomic_var
struct aws_atomic_var
represents an atomic variable - a value which can hold an integer or pointer that can be manipulated atomically. struct aws_atomic_vars should normally only be manipulated with atomics methods defined in this header.
LibAwsCommon.aws_byte_buf
— Typeaws_byte_buf
Represents a length-delimited binary string or buffer. If byte buffer points to constant memory or memory that should otherwise not be freed by this struct, set allocator to NULL and free function will be a no-op.
This structure used to define the output for all functions that write to a buffer.
Note that this structure allocates memory at the buffer pointer only. The struct itself does not get dynamically allocated and must be either maintained or copied to avoid losing access to the memory.
LibAwsCommon.aws_byte_cursor
— Typeaws_byte_cursor
Represents a movable pointer within a larger binary string or buffer.
This structure is used to define buffers for reading.
LibAwsCommon.aws_byte_predicate_fn
— TypeSignature for function argument to trim APIs
LibAwsCommon.aws_cache
— Typeaws_cache
Base stucture for caches, used the linked hash table implementation.
LibAwsCommon.aws_cache_vtable
— Typeaws_cache_vtable
Documentation not found.
LibAwsCommon.aws_cbor_decoder
— TypeDocumentation not found.
LibAwsCommon.aws_cbor_encoder
— TypeDocumentation not found.
LibAwsCommon.aws_cbor_type
— Typeaws_cbor_type
The types use by APIs, not 1:1 with major type. It's an extension for cbor major type in RFC8949 section 3.1 Major type 0 - AWS_CBOR_TYPE_UINT Major type 1 - AWS_CBOR_TYPE_NEGINT Major type 2 - AWS_CBOR_TYPE_BYTES/AWS_CBOR_TYPE_INDEF_BYTES_START Major type 3 - AWS_CBOR_TYPE_TEXT/AWS_CBOR_TYPE_INDEF_TEXT_START Major type 4 - AWS_CBOR_TYPE_ARRAY_START/AWS_CBOR_TYPE_INDEF_ARRAY_START Major type 5 - AWS_CBOR_TYPE_MAP_START/AWS_CBOR_TYPE_INDEF_MAP_START Major type 6 - AWS_CBOR_TYPE_TAG Major type 7 - 20/21 - AWS_CBOR_TYPE_BOOL - 22 - AWS_CBOR_TYPE_NULL - 23 - AWS_CBOR_TYPE_UNDEFINED - 25/26/27 - AWS_CBOR_TYPE_FLOAT - 31 - AWS_CBOR_TYPE_BREAK - rest of value are not supported.
LibAwsCommon.aws_cli_option
— Typeaws_cli_option
Ignoring padding since we're trying to maintain getopt.h compatibility
NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
LibAwsCommon.aws_cli_options_has_arg
— Typeaws_cli_options_has_arg
Documentation not found.
LibAwsCommon.aws_cli_options_subcommand_fn
— TypeInvoked when a subcommand is encountered. argc and argv[] begins at the command encountered. command_name is the name of the command being handled.
LibAwsCommon.aws_cli_subcommand_dispatch
— Typeaws_cli_subcommand_dispatch
Dispatch table to dispatch cli commands from. command_name should be the exact string for the command you want to handle from the command line.
LibAwsCommon.aws_common_error
— Typeaws_common_error
Documentation not found.
LibAwsCommon.aws_common_log_subject
— Typeaws_common_log_subject
Documentation not found.
LibAwsCommon.aws_condition_predicate_fn
— TypeDocumentation not found.
LibAwsCommon.aws_condition_variable
— Typeaws_condition_variable
Documentation not found.
LibAwsCommon.aws_cpu_feature_name
— Typeaws_cpu_feature_name
Documentation not found.
LibAwsCommon.aws_cpu_info
— Typeaws_cpu_info
Documentation not found.
LibAwsCommon.aws_cross_process_lock
— TypeDocumentation not found.
LibAwsCommon.aws_crt_common_statistics_category
— Typeaws_crt_common_statistics_category
The common-specific range of the aws_crt_statistics_category cross-library enum.
This enum functions as an RTTI value that lets statistics handler's interpret (via cast) a specific statistics structure if the RTTI value is understood.
Common doesn't have any statistics structures presently, so its range is essentially empty.
LibAwsCommon.aws_crt_statistics_base
— Typeaws_crt_statistics_base
Pattern-struct that functions as a base "class" for all statistics structures. To conform to the pattern, a statistics structure must have its first member be the category. In that case it becomes "safe" to cast from aws_crt_statistics_base
to the specific statistics structure based on the category value.
LibAwsCommon.aws_crt_statistics_category_t
— TypeDocumentation not found.
LibAwsCommon.aws_crt_statistics_handler
— Typeaws_crt_statistics_handler
Base structure for all statistics handler implementations.
A statistics handler is an object that listens to a stream of polymorphic (via the category RTTI enum) statistics structures emitted from some arbitrary source. In the initial implementation, statistics handlers are primarily attached to channels, where they monitor IO throughput and state data (from channel handlers) to determine a connection's health.
Statistics handlers are a generalization of the timeout and bandwidth filters that are often associated with SDK network connections. Configurable, default implementations are defined at the protocol level (http, etc...) where they can be attached at connection (channel) creation time.
LibAwsCommon.aws_crt_statistics_handler_destroy_fn
— TypeDestroys a statistics handler implementation
LibAwsCommon.aws_crt_statistics_handler_get_report_interval_ms_fn
— TypeThe period, in milliseconds, that the handler would like to be informed of statistics. Statistics generators are not required to honor this value, but should if able.
LibAwsCommon.aws_crt_statistics_handler_process_statistics_fn
— TypeStatistics intake function. The array_list is a list of pointers to aws_crt_statistics_base
"derived" (via pattern) objects. The handler should iterate the list and downcast elements whose RTTI category it understands, while skipping those it does not understand.
LibAwsCommon.aws_crt_statistics_handler_vtable
— Typeaws_crt_statistics_handler_vtable
Vtable for functions that all statistics handlers must implement
LibAwsCommon.aws_crt_statistics_sample_interval
— Typeaws_crt_statistics_sample_interval
The start and end time, in milliseconds-since-epoch, that a set of statistics was gathered over.
LibAwsCommon.aws_date_day_of_week
— Typeaws_date_day_of_week
Documentation not found.
LibAwsCommon.aws_date_format
— Typeaws_date_format
Documentation not found.
LibAwsCommon.aws_date_month
— Typeaws_date_month
Documentation not found.
LibAwsCommon.aws_date_time
— Typeaws_date_time
Documentation not found.
LibAwsCommon.aws_directory_entry
— Typeaws_directory_entry
Documentation not found.
LibAwsCommon.aws_directory_iterator
— TypeDocumentation not found.
LibAwsCommon.aws_error_handler_fn
— TypeDocumentation not found.
LibAwsCommon.aws_error_info
— Typeaws_error_info
Documentation not found.
LibAwsCommon.aws_error_info_list
— Typeaws_error_info_list
Documentation not found.
LibAwsCommon.aws_file_type
— Typeaws_file_type
Documentation not found.
LibAwsCommon.aws_hash_callback_destroy_fn
— TypePrototype for a hash table key or value destructor function pointer.
This function is used to destroy elements in the hash table when the table is cleared or cleaned up.
Note that functions which remove individual elements from the hash table provide options of whether or not to invoke the destructors on the key and value of a removed element.
LibAwsCommon.aws_hash_callback_eq_fn
— TypePrototype for a hash table equality check function pointer.
This type is usually used for a function that compares two hash table keys, but note that the same type is used for a function that compares two hash table values in aws_hash_table_eq
.
Equality functions used in a hash table must be be reflexive (a == a), symmetric (a == b => b == a), transitive (a == b, b == c => a == c) and consistent (result does not change with time).
LibAwsCommon.aws_hash_element
— Typeaws_hash_element
Represents an element in the hash table. Various operations on the hash table may provide pointers to elements stored within the hash table; generally, calling code may alter value, but must not alter key (or any information used to compute key's hash code).
Pointers to elements within the hash are invalidated whenever an operation which may change the number of elements in the hash is invoked (i.e. put, delete, clear, and clean_up), regardless of whether the number of elements actually changes.
LibAwsCommon.aws_hash_fn
— TypePrototype for a key hashing function pointer.
LibAwsCommon.aws_hash_iter
— Typeaws_hash_iter
Documentation not found.
LibAwsCommon.aws_hash_iter_status
— Typeaws_hash_iter_status
Documentation not found.
LibAwsCommon.aws_hash_table
— Typeaws_hash_table
Documentation not found.
LibAwsCommon.aws_json_on_member_encountered_const_fn
— Typecallback for iterating members of an object Iteration can be controlled as follows: - return AWS_OP_SUCCESS
and out_should_continue is set to true (default value) - continue iteration without error - return AWS_OP_SUCCESS
and out_continue is set to false - stop iteration without error - return AWS_OP_ERR
- stop iteration with error
LibAwsCommon.aws_json_on_value_encountered_const_fn
— Typecallback for iterating values of an array. Iteration can be controlled as follows: - return AWS_OP_SUCCESS
and out_should_continue is set to true (default value) - continue iteration without error - return AWS_OP_SUCCESS
and out_continue is set to false - stop iteration without error - return AWS_OP_ERR
- stop iteration with error
LibAwsCommon.aws_json_value
— TypeDocumentation not found.
LibAwsCommon.aws_linked_hash_table
— Typeaws_linked_hash_table
Simple linked hash table. Preserves insertion order, and can be iterated in insertion order.
You can also change the order safely without altering the shape of the underlying hash table.
LibAwsCommon.aws_linked_hash_table_node
— Typeaws_linked_hash_table_node
Linked-List node stored in the table. This is the node type that will be returned in aws_linked_hash_table_get_iteration_list
().
LibAwsCommon.aws_linked_list
— Typeaws_linked_list
Documentation not found.
LibAwsCommon.aws_linked_list_node
— Typeaws_linked_list_node
Documentation not found.
LibAwsCommon.aws_log_channel
— Typeaws_log_channel
Log channel interface and default implementations
A log channel is an abstraction for the transfer of formatted log data between a source (formatter) and a sink (writer).
LibAwsCommon.aws_log_channel_clean_up_fn
— TypeDocumentation not found.
LibAwsCommon.aws_log_channel_send_fn
— TypeDocumentation not found.
LibAwsCommon.aws_log_channel_vtable
— Typeaws_log_channel_vtable
Documentation not found.
LibAwsCommon.aws_log_formatter
— Typeaws_log_formatter
Log formatter interface and default implementation
Log formatters are invoked by the LOGF_* macros to transform a set of arguments into one or more lines of text to be output to a logging sink (writer).
LibAwsCommon.aws_log_formatter_clean_up_fn
— TypeDocumentation not found.
LibAwsCommon.aws_log_formatter_format_fn
— TypeDocumentation not found.
LibAwsCommon.aws_log_formatter_standard_options
— Typeaws_log_formatter_standard_options
Documentation not found.
LibAwsCommon.aws_log_formatter_vtable
— Typeaws_log_formatter_vtable
Documentation not found.
LibAwsCommon.aws_log_level
— Typeaws_log_level
Controls what log calls pass through the logger and what log calls get filtered out. If a log level has a value of X, then all log calls using a level <= X will appear, while those using a value > X will not occur.
You can filter both dynamically (by setting the log level on the logger object) or statically (by defining AWS_STATIC_LOG_LEVEL to be an appropriate integer module-wide). Statically filtered log calls will be completely compiled out but require a rebuild if you want to get more detail about what's happening.
LibAwsCommon.aws_log_subject_info
— Typeaws_log_subject_info
Documentation not found.
LibAwsCommon.aws_log_subject_info_list
— Typeaws_log_subject_info_list
Documentation not found.
LibAwsCommon.aws_log_subject_t
— TypeLog subject is a way of designating the topic of logging.
The general idea is to support a finer-grained approach to log level control. The primary use case is for situations that require more detailed logging within a specific domain, where enabling that detail globally leads to an untenable flood of information.
For example, enable TRACE logging for tls-related log statements (handshake binary payloads), but only WARN logging everywhere else (because http payloads would blow up the log files).
Log subject is an enum similar to aws error: each library has its own value-space and someone is responsible for registering the value <-> string connections.
LibAwsCommon.aws_log_writer
— Typeaws_log_writer
Log writer interface and default implementation(s)
A log writer functions as a sink for formatted log lines. We provide default implementations that go to stdout, stderr, and a specified file.
LibAwsCommon.aws_log_writer_clean_up_fn
— TypeDocumentation not found.
LibAwsCommon.aws_log_writer_file_options
— Typeaws_log_writer_file_options
Documentation not found.
LibAwsCommon.aws_log_writer_vtable
— Typeaws_log_writer_vtable
Documentation not found.
LibAwsCommon.aws_log_writer_write_fn
— TypeDocumentation not found.
LibAwsCommon.aws_logger
— Typeaws_logger
Documentation not found.
LibAwsCommon.aws_logger_pipeline
— Typeaws_logger_pipeline
Standard logger implementation composing three sub-components:
The formatter takes var args input from the user and produces a formatted log line The writer takes a formatted log line and outputs it somewhere The channel is the transport between the two
LibAwsCommon.aws_logger_standard_options
— Typeaws_logger_standard_options
Options for aws_logger_init_standard
(). Set filename
to open a file for logging and close it when the logger cleans up. Set file
to use a file that is already open, such as stderr
or stdout
.
LibAwsCommon.aws_logger_vtable
— Typeaws_logger_vtable
We separate the log level function from the log call itself so that we can do the filter check in the macros (see below)
By doing so, we make it so that the variadic format arguments are not even evaluated if the filter check does not succeed.
LibAwsCommon.aws_logging_standard_formatting_data
— Typeaws_logging_standard_formatting_data
Documentation not found.
LibAwsCommon.aws_mem_trace_level
— Typeaws_mem_trace_level
Maintainer note: The above function doesn't return the pointer (as with standard C realloc) as this pattern becomes error-prone when OOMs occur. In particular, we want to avoid losing the old pointer when an OOM condition occurs, so we prefer to take the old pointer as an in/out reference argument that we can leave unchanged on failure.
LibAwsCommon.aws_memory_order
— Typeaws_memory_order
This enumeration specifies the memory ordering properties requested for a particular atomic operation. The atomic operation may provide stricter ordering than requested. Note that, within a single thread, all operations are still sequenced (that is, a thread sees its own atomic writes and reads happening in program order, but other threads may disagree on this ordering).
The behavior of these memory orderings are the same as in the C11 atomics API; however, we only implement a subset that can be portably implemented on the compilers we target.
LibAwsCommon.aws_memory_usage_stats
— Typeaws_memory_usage_stats
Documentation not found.
LibAwsCommon.aws_mutex
— Typeaws_mutex
Documentation not found.
LibAwsCommon.aws_off_t
— TypeUse int64_t instead for offsets in public APIs.
LibAwsCommon.aws_on_directory_entry
— TypeInvoked during calls to aws_directory_traverse
() as an entry is encountered. entry will contain the parsed directory entry info.
Return true to continue the traversal, or alternatively, if you have a reason to abort the traversal, return false.
LibAwsCommon.aws_platform_os
— Typeaws_platform_os
Documentation not found.
LibAwsCommon.aws_priority_queue
— Typeaws_priority_queue
Documentation not found.
LibAwsCommon.aws_priority_queue_compare_fn
— TypeThe comparator should return a positive value if the second argument has a higher priority than the first; Otherwise, it should return a negative value or zero. NOTE: priority_queue pops its highest priority element first. For example: int cmp(const void *a, const void *b) { return a < b; } would result in a max heap, while: int cmp(const void *a, const void *b) { return a > b; } would result in a min heap.
LibAwsCommon.aws_priority_queue_node
— Typeaws_priority_queue_node
Documentation not found.
LibAwsCommon.aws_ref_count
— Typeaws_ref_count
A utility type for making ref-counted types, reminiscent of std::shared_ptr in C++
LibAwsCommon.aws_ring_buffer
— Typeaws_ring_buffer
Lockless ring buffer implementation that is thread safe assuming a single thread acquires and a single thread releases. For any other use case (other than the single-threaded use-case), you must manage thread-safety manually.
Also, a very important note: release must happen in the same order as acquire. If you do not your application, and possibly computers within a thousand mile radius, may die terrible deaths, and the local drinking water will be poisoned for generations with fragments of what is left of your radioactive corrupted memory.
LibAwsCommon.aws_run_command_options
— Typeaws_run_command_options
Documentation not found.
LibAwsCommon.aws_run_command_result
— Typeaws_run_command_result
Documentation not found.
LibAwsCommon.aws_rw_lock
— Typeaws_rw_lock
Documentation not found.
LibAwsCommon.aws_shutdown_callback_options
— Typeaws_shutdown_callback_options
Documentation not found.
LibAwsCommon.aws_simple_completion_callback
— TypeDocumentation not found.
LibAwsCommon.aws_string
— Typeaws_string
Documentation not found.
LibAwsCommon.aws_system_environment
— TypeDocumentation not found.
LibAwsCommon.aws_task
— Typeaws_task
A task object. Once added to the scheduler, a task must remain in memory until its function is executed.
LibAwsCommon.aws_task_fn
— TypeA scheduled function.
LibAwsCommon.aws_task_scheduler
— Typeaws_task_scheduler
Documentation not found.
LibAwsCommon.aws_task_status
— Typeaws_task_status
Documentation not found.
LibAwsCommon.aws_test_after_fn
— TypeDocumentation not found.
LibAwsCommon.aws_test_before_fn
— TypeDocumentation not found.
LibAwsCommon.aws_test_harness
— Typeaws_test_harness
Documentation not found.
LibAwsCommon.aws_test_run_fn
— TypeDocumentation not found.
LibAwsCommon.aws_text_encoding
— Typeaws_text_encoding
Documentation not found.
LibAwsCommon.aws_thread
— Typeaws_thread
Documentation not found.
LibAwsCommon.aws_thread_atexit_fn
— TypeDocumentation not found.
LibAwsCommon.aws_thread_detach_state
— Typeaws_thread_detach_state
Documentation not found.
LibAwsCommon.aws_thread_id_t
— TypeDocumentation not found.
LibAwsCommon.aws_thread_join_strategy
— Typeaws_thread_join_strategy
Specifies the join strategy used on an aws_thread
, which in turn controls whether or not a thread participates in the managed thread system. The managed thread system provides logic to guarantee a join on all participating threads at the cost of laziness (the user cannot control when joins happen).
Manual - thread does not participate in the managed thread system; any joins must be done by the user. This is the default. The user must call aws_thread_clean_up
(), but only after any desired join operation has completed. Not doing so will cause the windows handle to leak.
Managed - the managed thread system will automatically perform a join some time after the thread's run function has completed. It is an error to call aws_thread_join
on a thread configured with the managed join strategy. The managed thread system will call aws_thread_clean_up
() on the thread after the background join has completed.
Additionally, an API exists, aws_thread_join_all_managed
(), which blocks and returns when all outstanding threads with the managed strategy have fully joined. This API is useful for tests (rather than waiting for many individual signals) and program shutdown or DLL unload. This API is automatically invoked by the common library clean up function. If the common library clean up is called from a managed thread, this will cause deadlock.
Lazy thread joining is done only when threads finish their run function or when the user calls aws_thread_join_all_managed
(). This means it may be a long time between thread function completion and the join being applied, but the queue of unjoined threads is always one or fewer so there is no critical resource backlog.
Currently, only event loop group async cleanup and host resolver threads participate in the managed thread system. Additionally, event loop threads will increment and decrement the pending join count (they are manually joined internally) in order to have an accurate view of internal thread usage and also to prevent failure to release an event loop group fully from allowing aws_thread_join_all_managed
() from running to completion when its intent is such that it should block instead.
LibAwsCommon.aws_thread_once
— TypeDocumentation not found.
LibAwsCommon.aws_thread_options
— Typeaws_thread_options
Documentation not found.
LibAwsCommon.aws_thread_scheduler
— TypeDocumentation not found.
LibAwsCommon.aws_timestamp_unit
— Typeaws_timestamp_unit
Documentation not found.
LibAwsCommon.aws_uri
— Typeaws_uri
Data representing a URI. uri_str is always allocated and filled in. The other portions are merely storing offsets into uri_str.
LibAwsCommon.aws_uri_builder_options
— Typeaws_uri_builder_options
Arguments for building a URI instance. All members must be initialized before passing them to aws_uri_init().
query_string and query_params are exclusive to each other. If you set query_string, do not prepend it with '?'
LibAwsCommon.aws_uri_param
— Typeaws_uri_param
key/value pairs for a query string. If the query fragment was not in format key=value, the fragment value will be stored in key
LibAwsCommon.aws_utf8_decoder
— TypeDocumentation not found.
LibAwsCommon.aws_utf8_decoder_options
— Typeaws_utf8_decoder_options
Documentation not found.
LibAwsCommon.aws_uuid
— Typeaws_uuid
Documentation not found.
LibAwsCommon.aws_xml_attribute
— Typeaws_xml_attribute
Documentation not found.
LibAwsCommon.aws_xml_node
— TypeDocumentation not found.
LibAwsCommon.aws_xml_parser_on_node_encountered_fn
— TypeCallback for when an xml node is encountered in the document. As a user you have a few options:
- fail the parse by returning
AWS_OP_ERR
(after an error has been raised). This will stop any further parsing. 2. callaws_xml_node_traverse
() on the node to descend into the node with a new callback and user_data. 3. callaws_xml_node_as_body
() to retrieve the contents of the node as text.
You MUST NOT call both aws_xml_node_traverse
() and aws_xml_node_as_body
() on the same node.
return true to continue the parsing operation.
LibAwsCommon.aws_xml_parser_options
— Typeaws_xml_parser_options
Documentation not found.
LibAwsCommon.hash_table_state
— TypeHash table data structure. This module provides an automatically resizing hash table implementation for general purpose use. The hash table stores a mapping between void * keys and values; it is expected that in most cases, these will point to a structure elsewhere in the heap, instead of inlining a key or value into the hash table element itself.
Currently, this hash table implements a variant of robin hood hashing, but we do not guarantee that this won't change in the future.
Associated with each hash function are four callbacks:
hash_fn - A hash function from the keys to a uint64_t. It is critical that the hash function for a key does not change while the key is in the hash table; violating this results in undefined behavior. Collisions are tolerated, though naturally with reduced performance.
equals_fn - An equality comparison function. This function must be reflexive and consistent with hash_fn.
destroy_key_fn, destroy_value_fn - Optional callbacks invoked when the table is cleared or cleaned up and at the caller's option when an element is removed from the table. Either or both may be set to NULL, which has the same effect as a no-op destroy function.
This datastructure can be safely moved between threads, subject to the requirements of the underlying allocator. It is also safe to invoke non-mutating operations on the hash table from multiple threads. A suitable memory barrier must be used when transitioning from single-threaded mutating usage to multithreaded usage.
LibAwsCommon.pthread_cond_t
— Typepthread_cond_t
Documentation not found.
LibAwsCommon.pthread_mutex_t
— Typepthread_mutex_t
Documentation not found.
LibAwsCommon.pthread_once_t
— TypeDocumentation not found.
LibAwsCommon.pthread_rwlock_t
— Typepthread_rwlock_t
Documentation not found.
LibAwsCommon.pthread_t
— TypeDocumentation not found.
LibAwsCommon.siginfo
— Typesiginfo
Documentation not found.
LibAwsCommon.siginfo_t
— TypeDocumentation not found.
LibAwsCommon.sigval
— Typesigval
Documentation not found.
LibAwsCommon.sigval_t
— TypeDocumentation not found.
LibAwsCommon.static_assertion_at_line_60
— TypeDocumentation not found.
LibAwsCommon.static_assertion_at_line_61
— TypeDocumentation not found.
LibAwsCommon.static_assertion_at_line_62
— TypeDocumentation not found.
LibAwsCommon.time_t
— TypeDocumentation not found.
LibAwsCommon.tm
— Typetm
Documentation not found.
LibAwsCommon.aws_add_size_checked
— Methodaws_add_size_checked(a, b, r)
Adds a + b and returns the result in *r. If the result overflows, returns AWS_OP_ERR
; otherwise returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_add_size_checked(size_t a, size_t b, size_t *r);
LibAwsCommon.aws_add_size_saturating
— Methodaws_add_size_saturating(a, b)
Adds a + b. If the result overflows returns SIZE_MAX.
Prototype
AWS_STATIC_IMPL size_t aws_add_size_saturating(size_t a, size_t b);
LibAwsCommon.aws_add_u32_checked
— Methodaws_add_u32_checked(a, b, r)
If a + b overflows, returns AWS_OP_ERR
; otherwise adds a + b, returns the result in *r, and returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_add_u32_checked(uint32_t a, uint32_t b, uint32_t *r);
LibAwsCommon.aws_add_u32_saturating
— Methodaws_add_u32_saturating(a, b)
Adds a + b. If the result overflows, returns 2^32 - 1.
Prototype
AWS_STATIC_IMPL uint32_t aws_add_u32_saturating(uint32_t a, uint32_t b);
LibAwsCommon.aws_add_u64_checked
— Methodaws_add_u64_checked(a, b, r)
If a + b overflows, returns AWS_OP_ERR
; otherwise adds a + b, returns the result in *r, and returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_add_u64_checked(uint64_t a, uint64_t b, uint64_t *r);
LibAwsCommon.aws_add_u64_saturating
— Methodaws_add_u64_saturating(a, b)
Adds a + b. If the result overflows, returns 2^64 - 1.
Prototype
AWS_STATIC_IMPL uint64_t aws_add_u64_saturating(uint64_t a, uint64_t b);
LibAwsCommon.aws_aligned_allocator
— Methodaws_aligned_allocator()
Allocator that align small allocations on 8 byte boundary and big allocations on 32/64 byte boundary.
Prototype
struct aws_allocator *aws_aligned_allocator(void);
LibAwsCommon.aws_allocator_is_valid
— Methodaws_allocator_is_valid(alloc)
Inexpensive (constant time) check of data-structure invariants.
Prototype
bool aws_allocator_is_valid(const struct aws_allocator *alloc);
LibAwsCommon.aws_array_eq
— Methodaws_array_eq(array_a, len_a, array_b, len_b)
Compare two arrays. Return whether their contents are equivalent. NULL may be passed as the array pointer if its length is declared to be 0.
Prototype
bool aws_array_eq(const void *const array_a, const size_t len_a, const void *array_b, const size_t len_b);
LibAwsCommon.aws_array_eq_c_str
— Methodaws_array_eq_c_str(array, array_len, c_str)
Compare an array and a null-terminated string. Returns true if their contents are equivalent. The array should NOT contain a null-terminator, or the comparison will always return false. NULL may be passed as the array pointer if its length is declared to be 0.
Prototype
bool aws_array_eq_c_str(const void *const array, const size_t array_len, const char *const c_str);
LibAwsCommon.aws_array_eq_c_str_ignore_case
— Methodaws_array_eq_c_str_ignore_case(array, array_len, c_str)
Perform a case-insensitive string comparison of an array and a null-terminated string. Return whether their contents are equivalent. The array should NOT contain a null-terminator, or the comparison will always return false. NULL may be passed as the array pointer if its length is declared to be 0. The "C" locale is used for comparing upper and lowercase letters. Data is assumed to be ASCII text, UTF-8 will work fine too.
Prototype
bool aws_array_eq_c_str_ignore_case(const void *const array, const size_t array_len, const char *const c_str);
LibAwsCommon.aws_array_eq_ignore_case
— Methodaws_array_eq_ignore_case(array_a, len_a, array_b, len_b)
Perform a case-insensitive string comparison of two arrays. Return whether their contents are equivalent. NULL may be passed as the array pointer if its length is declared to be 0. The "C" locale is used for comparing upper and lowercase letters. Data is assumed to be ASCII text, UTF-8 will work fine too.
Prototype
bool aws_array_eq_ignore_case( const void *const array_a, const size_t len_a, const void *const array_b, const size_t len_b);
LibAwsCommon.aws_array_list_back
— Methodaws_array_list_back(list, val)
Copies the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised.
Prototype
AWS_STATIC_IMPL int aws_array_list_back(const struct aws_array_list *AWS_RESTRICT list, void *val);
LibAwsCommon.aws_array_list_capacity
— Methodaws_array_list_capacity(list)
Returns the number of elements that can fit in the internal array. If list is initialized in dynamic mode, the capacity changes over time.
Prototype
AWS_STATIC_IMPL size_t aws_array_list_capacity(const struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_clean_up
— Methodaws_array_list_clean_up(list)
Deallocates any memory that was allocated for this list, and resets list for reuse or deletion.
Prototype
AWS_STATIC_IMPL void aws_array_list_clean_up(struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_clean_up_secure
— Methodaws_array_list_clean_up_secure(list)
Erases and then deallocates any memory that was allocated for this list, and resets list for reuse or deletion.
Prototype
AWS_STATIC_IMPL void aws_array_list_clean_up_secure(struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_clear
— Methodaws_array_list_clear(list)
Clears all elements in the array and resets length to zero. Size does not change in this operation.
Prototype
AWS_STATIC_IMPL void aws_array_list_clear(struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_comparator_string
— Methodaws_array_list_comparator_string(a, b)
A convenience function for sorting lists of (const struct aws_string
*) elements. This can be used as a comparator for aws_array_list_sort
. It is just a simple wrapper around aws_string_compare
.
Prototype
int aws_array_list_comparator_string(const void *a, const void *b);
LibAwsCommon.aws_array_list_copy
— Methodaws_array_list_copy(from, to)
Copies the elements from from to to. If to is in static mode, it must at least be the same length as from. Any data in to will be overwritten in this copy.
Prototype
int aws_array_list_copy(const struct aws_array_list *AWS_RESTRICT from, struct aws_array_list *AWS_RESTRICT to);
LibAwsCommon.aws_array_list_ensure_capacity
— Methodaws_array_list_ensure_capacity(list, index)
Ensures that the array list has enough capacity to store a value at the specified index. If there is not already enough capacity, and the list is in dynamic mode, this function will attempt to allocate more memory, expanding the list. In static mode, if 'index' is beyond the maximum index, AWS_ERROR_INVALID_INDEX will be raised.
Prototype
int aws_array_list_ensure_capacity(struct aws_array_list *AWS_RESTRICT list, size_t index);
LibAwsCommon.aws_array_list_erase
— Methodaws_array_list_erase(list, index)
Deletes the element this index in the list if it exists. If element does not exist, AWS_ERROR_INVALID_INDEX will be raised. This call results in shifting all remaining elements towards the front. Avoid this call unless that is intended behavior.
Prototype
AWS_STATIC_IMPL int aws_array_list_erase(struct aws_array_list *AWS_RESTRICT list, size_t index);
LibAwsCommon.aws_array_list_front
— Methodaws_array_list_front(list, val)
Copies the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised
Prototype
AWS_STATIC_IMPL int aws_array_list_front(const struct aws_array_list *AWS_RESTRICT list, void *val);
LibAwsCommon.aws_array_list_get_at
— Methodaws_array_list_get_at(list, val, index)
Copies the memory at index to val. If element does not exist, AWS_ERROR_INVALID_INDEX will be raised.
Prototype
AWS_STATIC_IMPL int aws_array_list_get_at(const struct aws_array_list *AWS_RESTRICT list, void *val, size_t index);
LibAwsCommon.aws_array_list_get_at_ptr
— Methodaws_array_list_get_at_ptr(list, val, index)
Copies the memory address of the element at index to *val. If element does not exist, AWS_ERROR_INVALID_INDEX will be raised.
Prototype
AWS_STATIC_IMPL int aws_array_list_get_at_ptr(const struct aws_array_list *AWS_RESTRICT list, void **val, size_t index);
LibAwsCommon.aws_array_list_init_dynamic
— Methodaws_array_list_init_dynamic(list, alloc, initial_item_allocation, item_size)
Initializes an array list with an array of size initial_item_allocation * item_size. In this mode, the array size will grow by a factor of 2 upon insertion if space is not available. initial_item_allocation is the number of elements you want space allocated for. item_size is the size of each element in bytes. Mixing items types is not supported by this API.
Prototype
AWS_STATIC_IMPL int aws_array_list_init_dynamic( struct aws_array_list *AWS_RESTRICT list, struct aws_allocator *alloc, size_t initial_item_allocation, size_t item_size);
LibAwsCommon.aws_array_list_init_static
— Methodaws_array_list_init_static(list, raw_array, item_count, item_size)
Initializes an array list with a preallocated array of void *. item_count is the number of elements in the array, and item_size is the size in bytes of each element. Mixing items types is not supported by this API. Once this list is full, new items will be rejected.
Prototype
AWS_STATIC_IMPL void aws_array_list_init_static( struct aws_array_list *AWS_RESTRICT list, void *raw_array, size_t item_count, size_t item_size);
LibAwsCommon.aws_array_list_init_static_from_initialized
— Methodaws_array_list_init_static_from_initialized(list, raw_array, item_count, item_size)
Initializes an array list with a preallocated array of already-initialized elements. item_count is the number of elements in the array, and item_size is the size in bytes of each element.
Once initialized, nothing further can be added to the list, since it will be full and cannot resize.
Primary use case is to treat an already-initialized C array as an array list.
Prototype
AWS_STATIC_IMPL void aws_array_list_init_static_from_initialized( struct aws_array_list *AWS_RESTRICT list, void *raw_array, size_t item_count, size_t item_size);
LibAwsCommon.aws_array_list_is_valid
— Methodaws_array_list_is_valid(list)
Set of properties of a valid aws_array_list
.
Prototype
AWS_STATIC_IMPL bool aws_array_list_is_valid(const struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_length
— Methodaws_array_list_length(list)
Returns the number of elements in the internal array.
Prototype
AWS_STATIC_IMPL size_t aws_array_list_length(const struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_pop_back
— Methodaws_array_list_pop_back(list)
Deletes the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised.
Prototype
AWS_STATIC_IMPL int aws_array_list_pop_back(struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_pop_front
— Methodaws_array_list_pop_front(list)
Deletes the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised. This call results in shifting all of the elements at the end of the array to the front. Avoid this call unless that is intended behavior.
Prototype
AWS_STATIC_IMPL int aws_array_list_pop_front(struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_pop_front_n
— Methodaws_array_list_pop_front_n(list, n)
Delete N elements from the front of the list. Remaining elements are shifted to the front of the list. If the list has less than N elements, the list is cleared. This call is more efficient than calling aws_array_list_pop_front
() N times.
Prototype
AWS_STATIC_IMPL void aws_array_list_pop_front_n(struct aws_array_list *AWS_RESTRICT list, size_t n);
LibAwsCommon.aws_array_list_push_back
— Methodaws_array_list_push_back(list, val)
Pushes the memory pointed to by val onto the end of internal list
Prototype
AWS_STATIC_IMPL int aws_array_list_push_back(struct aws_array_list *AWS_RESTRICT list, const void *val);
LibAwsCommon.aws_array_list_push_front
— Methodaws_array_list_push_front(list, val)
Pushes the memory pointed to by val onto the front of internal list. This call results in shifting all of the elements in the list. Avoid this call unless that is intended behavior.
Prototype
AWS_STATIC_IMPL int aws_array_list_push_front(struct aws_array_list *AWS_RESTRICT list, const void *val);
LibAwsCommon.aws_array_list_set_at
— Methodaws_array_list_set_at(list, val, index)
Copies the the memory pointed to by val into the array at index. If in dynamic mode, the size will grow by a factor of two when the array is full. In static mode, AWS_ERROR_INVALID_INDEX will be raised if the index is past the bounds of the array.
Prototype
AWS_STATIC_IMPL int aws_array_list_set_at(struct aws_array_list *AWS_RESTRICT list, const void *val, size_t index);
LibAwsCommon.aws_array_list_shrink_to_fit
— Methodaws_array_list_shrink_to_fit(list)
If in dynamic mode, shrinks the allocated array size to the minimum amount necessary to store its elements.
Prototype
int aws_array_list_shrink_to_fit(struct aws_array_list *AWS_RESTRICT list);
LibAwsCommon.aws_array_list_sort
— Methodaws_array_list_sort(list, compare_fn)
Sort elements in the list in-place according to the comparator function.
Prototype
void aws_array_list_sort(struct aws_array_list *AWS_RESTRICT list, aws_array_list_comparator_fn *compare_fn);
LibAwsCommon.aws_array_list_swap
— Methodaws_array_list_swap(list, a, b)
Swap elements at the specified indices, which must be within the bounds of the array.
Prototype
void aws_array_list_swap(struct aws_array_list *AWS_RESTRICT list, size_t a, size_t b);
LibAwsCommon.aws_array_list_swap_contents
— Methodaws_array_list_swap_contents(list_a, list_b)
Swap contents between two dynamic lists. Both lists must use the same allocator.
Prototype
AWS_STATIC_IMPL void aws_array_list_swap_contents( struct aws_array_list *AWS_RESTRICT list_a, struct aws_array_list *AWS_RESTRICT list_b);
LibAwsCommon.aws_atomic_compare_exchange_int
— Methodaws_atomic_compare_exchange_int(var, expected, desired)
Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure. Returns true if the compare was successful and the variable updated to desired.
Prototype
AWS_STATIC_IMPL bool aws_atomic_compare_exchange_int(volatile struct aws_atomic_var *var, size_t *expected, size_t desired);
LibAwsCommon.aws_atomic_compare_exchange_int_explicit
— Methodaws_atomic_compare_exchange_int_explicit(var, expected, desired, order_success, order_failure)
Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure. order_failure must be no stronger than order_success, and must not be release or acq_rel. Returns true if the compare was successful and the variable updated to desired.
Prototype
AWS_STATIC_IMPL bool aws_atomic_compare_exchange_int_explicit( volatile struct aws_atomic_var *var, size_t *expected, size_t desired, enum aws_memory_order order_success, enum aws_memory_order order_failure);
LibAwsCommon.aws_atomic_compare_exchange_ptr
— Methodaws_atomic_compare_exchange_ptr(var, expected, desired)
Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure. Returns true if the compare was successful and the variable updated to desired.
Prototype
AWS_STATIC_IMPL bool aws_atomic_compare_exchange_ptr(volatile struct aws_atomic_var *var, void **expected, void *desired);
LibAwsCommon.aws_atomic_compare_exchange_ptr_explicit
— Methodaws_atomic_compare_exchange_ptr_explicit(var, expected, desired, order_success, order_failure)
Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure. order_failure must be no stronger than order_success, and must not be release or acq_rel. Returns true if the compare was successful and the variable updated to desired.
Prototype
AWS_STATIC_IMPL bool aws_atomic_compare_exchange_ptr_explicit( volatile struct aws_atomic_var *var, void **expected, void *desired, enum aws_memory_order order_success, enum aws_memory_order order_failure);
LibAwsCommon.aws_atomic_exchange_int
— Methodaws_atomic_exchange_int(var, n)
Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering. Returns the value that was previously in the atomic_var.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_exchange_int(volatile struct aws_atomic_var *var, size_t n);
LibAwsCommon.aws_atomic_exchange_int_explicit
— Methodaws_atomic_exchange_int_explicit(var, n, memory_order)
Exchanges an integer with the value in an atomic_var, using the specified ordering. Returns the value that was previously in the atomic_var.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_exchange_int_explicit( volatile struct aws_atomic_var *var, size_t n, enum aws_memory_order memory_order);
LibAwsCommon.aws_atomic_exchange_ptr
— Methodaws_atomic_exchange_ptr(var, p)
Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering. Returns the value that was previously in the atomic_var.
Prototype
AWS_STATIC_IMPL void *aws_atomic_exchange_ptr(volatile struct aws_atomic_var *var, void *p);
LibAwsCommon.aws_atomic_exchange_ptr_explicit
— Methodaws_atomic_exchange_ptr_explicit(var, p, memory_order)
Exchanges a pointer with the value in an atomic_var, using the specified ordering. Returns the value that was previously in the atomic_var.
Prototype
AWS_STATIC_IMPL void *aws_atomic_exchange_ptr_explicit( volatile struct aws_atomic_var *var, void *p, enum aws_memory_order memory_order);
LibAwsCommon.aws_atomic_fetch_add
— Methodaws_atomic_fetch_add(var, n)
Atomically adds n to *var, and returns the previous value of *var. Uses sequentially consistent ordering.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_add(volatile struct aws_atomic_var *var, size_t n);
LibAwsCommon.aws_atomic_fetch_add_explicit
— Methodaws_atomic_fetch_add_explicit(var, n, order)
Atomically adds n to *var, and returns the previous value of *var.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_add_explicit(volatile struct aws_atomic_var *var, size_t n, enum aws_memory_order order);
LibAwsCommon.aws_atomic_fetch_and
— Methodaws_atomic_fetch_and(var, n)
Atomically ands n into *var, and returns the previous value of *var. Uses sequentially consistent ordering.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_and(volatile struct aws_atomic_var *var, size_t n);
LibAwsCommon.aws_atomic_fetch_and_explicit
— Methodaws_atomic_fetch_and_explicit(var, n, order)
Atomically ANDs n with *var, and returns the previous value of *var.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_and_explicit(volatile struct aws_atomic_var *var, size_t n, enum aws_memory_order order);
LibAwsCommon.aws_atomic_fetch_or
— Methodaws_atomic_fetch_or(var, n)
Atomically ors n into *var, and returns the previous value of *var. Uses sequentially consistent ordering.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_or(volatile struct aws_atomic_var *var, size_t n);
LibAwsCommon.aws_atomic_fetch_or_explicit
— Methodaws_atomic_fetch_or_explicit(var, n, order)
Atomically ORs n with *var, and returns the previous value of *var.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_or_explicit(volatile struct aws_atomic_var *var, size_t n, enum aws_memory_order order);
LibAwsCommon.aws_atomic_fetch_sub
— Methodaws_atomic_fetch_sub(var, n)
Atomically subtracts n from *var, and returns the previous value of *var. Uses sequentially consistent ordering.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_sub(volatile struct aws_atomic_var *var, size_t n);
LibAwsCommon.aws_atomic_fetch_sub_explicit
— Methodaws_atomic_fetch_sub_explicit(var, n, order)
Atomically subtracts n from *var, and returns the previous value of *var.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_sub_explicit(volatile struct aws_atomic_var *var, size_t n, enum aws_memory_order order);
LibAwsCommon.aws_atomic_fetch_xor
— Methodaws_atomic_fetch_xor(var, n)
Atomically xors n into *var, and returns the previous value of *var. Uses sequentially consistent ordering.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_xor(volatile struct aws_atomic_var *var, size_t n);
LibAwsCommon.aws_atomic_fetch_xor_explicit
— Methodaws_atomic_fetch_xor_explicit(var, n, order)
Atomically XORs n with *var, and returns the previous value of *var.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_fetch_xor_explicit(volatile struct aws_atomic_var *var, size_t n, enum aws_memory_order order);
LibAwsCommon.aws_atomic_init_int
— Methodaws_atomic_init_int(var, n)
Initializes an atomic variable with an integer value. This operation should be done before any other operations on this atomic variable, and must be done before attempting any parallel operations.
This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger) when communicating the fact that initialization is complete to the other thread. Launching the thread implies a sufficiently strong barrier.
Prototype
AWS_STATIC_IMPL void aws_atomic_init_int(volatile struct aws_atomic_var *var, size_t n);
LibAwsCommon.aws_atomic_init_ptr
— Methodaws_atomic_init_ptr(var, p)
Initializes an atomic variable with a pointer value. This operation should be done before any other operations on this atomic variable, and must be done before attempting any parallel operations.
This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger) when communicating the fact that initialization is complete to the other thread. Launching the thread implies a sufficiently strong barrier.
Prototype
AWS_STATIC_IMPL void aws_atomic_init_ptr(volatile struct aws_atomic_var *var, void *p);
LibAwsCommon.aws_atomic_load_int
— Methodaws_atomic_load_int(var)
Reads an atomic var as an integer, using sequentially consistent ordering, and returns the result.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_load_int(volatile const struct aws_atomic_var *var);
LibAwsCommon.aws_atomic_load_int_explicit
— Methodaws_atomic_load_int_explicit(var, memory_order)
Reads an atomic var as an integer, using the specified ordering, and returns the result.
Prototype
AWS_STATIC_IMPL size_t aws_atomic_load_int_explicit(volatile const struct aws_atomic_var *var, enum aws_memory_order memory_order);
LibAwsCommon.aws_atomic_load_ptr
— Methodaws_atomic_load_ptr(var)
Reads an atomic var as a pointer, using sequentially consistent ordering, and returns the result.
Prototype
AWS_STATIC_IMPL void *aws_atomic_load_ptr(volatile const struct aws_atomic_var *var);
LibAwsCommon.aws_atomic_load_ptr_explicit
— Methodaws_atomic_load_ptr_explicit(var, memory_order)
Reads an atomic var as a pointer, using the specified ordering, and returns the result.
Prototype
AWS_STATIC_IMPL void *aws_atomic_load_ptr_explicit(volatile const struct aws_atomic_var *var, enum aws_memory_order memory_order);
LibAwsCommon.aws_atomic_priv_xlate_order
— Methodaws_atomic_priv_xlate_order(order)
Documentation not found.
Prototype
static inline int aws_atomic_priv_xlate_order(enum aws_memory_order order);
LibAwsCommon.aws_atomic_store_int
— Methodaws_atomic_store_int(var, n)
Stores an integer into an atomic var, using sequentially consistent ordering.
Prototype
AWS_STATIC_IMPL void aws_atomic_store_int(volatile struct aws_atomic_var *var, size_t n);
LibAwsCommon.aws_atomic_store_int_explicit
— Methodaws_atomic_store_int_explicit(var, n, memory_order)
Stores an integer into an atomic var, using the specified ordering.
Prototype
AWS_STATIC_IMPL void aws_atomic_store_int_explicit(volatile struct aws_atomic_var *var, size_t n, enum aws_memory_order memory_order);
LibAwsCommon.aws_atomic_store_ptr
— Methodaws_atomic_store_ptr(var, p)
Stores a pointer into an atomic var, using sequentially consistent ordering.
Prototype
AWS_STATIC_IMPL void aws_atomic_store_ptr(volatile struct aws_atomic_var *var, void *p);
LibAwsCommon.aws_atomic_store_ptr_explicit
— Methodaws_atomic_store_ptr_explicit(var, p, memory_order)
Stores a pointer into an atomic var, using the specified ordering.
Prototype
AWS_STATIC_IMPL void aws_atomic_store_ptr_explicit(volatile struct aws_atomic_var *var, void *p, enum aws_memory_order memory_order);
LibAwsCommon.aws_atomic_thread_fence
— Methodaws_atomic_thread_fence(order)
Provides the same reordering guarantees as an atomic operation with the specified memory order, without needing to actually perform an atomic operation.
Prototype
AWS_STATIC_IMPL void aws_atomic_thread_fence(enum aws_memory_order order);
LibAwsCommon.aws_backtrace
— Methodaws_backtrace(stack_frames, num_frames)
Records a stack trace from the call site. Returns the number of stack entries/stack depth captured, or 0 if the operation is not supported on this platform
Prototype
size_t aws_backtrace(void **stack_frames, size_t num_frames);
LibAwsCommon.aws_backtrace_addr2line
— Methodaws_backtrace_addr2line(stack_frames, stack_depth)
Converts stack frame pointers to symbols, using all available system tools to try to produce a human readable result. This call will not be quick, as it shells out to addr2line or similar tools. On Windows, this is the same as aws_backtrace_symbols
() Returns an array up to stack_depth long that needs to be free()ed. Missing frames will be NULL. Returns NULL if the platform does not support stack frame translation or an error occurs
Prototype
char **aws_backtrace_addr2line(void *const *stack_frames, size_t stack_depth);
LibAwsCommon.aws_backtrace_log
— Methodaws_backtrace_log(log_level)
Log the callstack from the current stack to the currently configured aws_logger
Prototype
void aws_backtrace_log(int log_level);
LibAwsCommon.aws_backtrace_print
— Methodaws_backtrace_print(fp, call_site_data)
Print a backtrace from either the current stack, or (if provided) the current exception/signal call_site_data is siginfo_t
* on POSIX, and LPEXCEPTION_POINTERS on Windows, and can be null
Prototype
void aws_backtrace_print(FILE *fp, void *call_site_data);
LibAwsCommon.aws_backtrace_symbols
— Methodaws_backtrace_symbols(stack_frames, stack_depth)
Converts stack frame pointers to symbols, if symbols are available Returns an array up to stack_depth long, that needs to be free()ed. stack_depth should be the length of frames. Returns NULL if the platform does not support stack frame translation or an error occurs
Prototype
char **aws_backtrace_symbols(void *const *stack_frames, size_t stack_depth);
LibAwsCommon.aws_base64_compute_decoded_len
— Methodaws_base64_compute_decoded_len(to_decode, decoded_len)
Computes the length necessary to store the output of aws_base64_decode
call. returns -1 on failure, and 0 on success. decoded_len will be set on success.
Prototype
int aws_base64_compute_decoded_len(const struct aws_byte_cursor *AWS_RESTRICT to_decode, size_t *decoded_len);
LibAwsCommon.aws_base64_compute_encoded_len
— Methodaws_base64_compute_encoded_len(to_encode_len, encoded_len)
Computes the length necessary to store the output of aws_base64_encode
call. returns -1 on failure, and 0 on success. encoded_length will be set on success.
Prototype
int aws_base64_compute_encoded_len(size_t to_encode_len, size_t *encoded_len);
LibAwsCommon.aws_base64_decode
— Methodaws_base64_decode(to_decode, output)
Base 64 decodes the contents of to_decode and stores the result in output.
Prototype
int aws_base64_decode(const struct aws_byte_cursor *AWS_RESTRICT to_decode, struct aws_byte_buf *AWS_RESTRICT output);
LibAwsCommon.aws_base64_encode
— Methodaws_base64_encode(to_encode, output)
Base 64 encodes the contents of to_encode and stores the result in output.
Prototype
int aws_base64_encode(const struct aws_byte_cursor *AWS_RESTRICT to_encode, struct aws_byte_buf *AWS_RESTRICT output);
LibAwsCommon.aws_byte_buf_advance
— Methodaws_byte_buf_advance(buffer, output, len)
Appends a sub-buffer to the specified buffer.
If the buffer has at least len' bytes remaining (buffer->capacity - buffer->len >= len), then buffer->len is incremented by len, and an [
awsbytebuf](@ref) is assigned to *output corresponding to the last len bytes of the input buffer. The [
awsbytebuf`](@ref) at *output will have a null allocator, a zero initial length, and a capacity of 'len'. The function then returns true.
If there is insufficient space, then this function nulls all fields in *output and returns false.
Prototype
bool aws_byte_buf_advance( struct aws_byte_buf *const AWS_RESTRICT buffer, struct aws_byte_buf *const AWS_RESTRICT output, const size_t len);
LibAwsCommon.aws_byte_buf_append
— Methodaws_byte_buf_append(to, from)
Copies from to to. If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be returned. dest->len will contain the amount of data actually copied to dest.
from and to may be the same buffer, permitting copying a buffer into itself.
Prototype
int aws_byte_buf_append(struct aws_byte_buf *to, const struct aws_byte_cursor *from);
LibAwsCommon.aws_byte_buf_append_and_update
— Methodaws_byte_buf_append_and_update(to, from_and_update)
Copy contents of cursor to buffer, then update cursor to reference the memory stored in the buffer. If buffer is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be returned.
The cursor is permitted to reference memory from earlier in the buffer.
Prototype
int aws_byte_buf_append_and_update(struct aws_byte_buf *to, struct aws_byte_cursor *from_and_update);
LibAwsCommon.aws_byte_buf_append_byte_dynamic
— Methodaws_byte_buf_append_byte_dynamic(buffer, value)
Copies a single byte into to
. If to
is too small, the buffer will be grown appropriately and the old contents copied over, before the byte is appended.
If the grow fails (overflow or OOM), then an error will be returned.
Prototype
int aws_byte_buf_append_byte_dynamic(struct aws_byte_buf *buffer, uint8_t value);
LibAwsCommon.aws_byte_buf_append_byte_dynamic_secure
— Methodaws_byte_buf_append_byte_dynamic_secure(buffer, value)
Copies a single byte into to
. If to
is too small, the buffer will be grown appropriately and the old contents copied over, before the byte is appended.
If the grow fails (overflow or OOM), then an error will be returned.
If the buffer is grown, the old buffer will be securely cleared before getting freed.
Prototype
int aws_byte_buf_append_byte_dynamic_secure(struct aws_byte_buf *buffer, uint8_t value);
LibAwsCommon.aws_byte_buf_append_decoding_uri
— Methodaws_byte_buf_append_decoding_uri(buffer, cursor)
Writes the uri decoding of a UTF-8 cursor to a buffer, replacing xx escapes by their single byte equivalent. For example, reading "a20b_c" would write "a b_c".
Prototype
int aws_byte_buf_append_decoding_uri(struct aws_byte_buf *buffer, const struct aws_byte_cursor *cursor);
LibAwsCommon.aws_byte_buf_append_dynamic
— Methodaws_byte_buf_append_dynamic(to, from)
Copies from to to. If to is too small, the buffer will be grown appropriately and the old contents copied to, before the new contents are appended.
If the grow fails (overflow or OOM), then an error will be returned.
from and to may be the same buffer, permitting copying a buffer into itself.
Prototype
int aws_byte_buf_append_dynamic(struct aws_byte_buf *to, const struct aws_byte_cursor *from);
LibAwsCommon.aws_byte_buf_append_dynamic_secure
— Methodaws_byte_buf_append_dynamic_secure(to, from)
Copies from
to to
. If to
is too small, the buffer will be grown appropriately and the old contents copied over, before the new contents are appended.
If the grow fails (overflow or OOM), then an error will be returned.
If the buffer is grown, the old buffer will be securely cleared before getting freed.
from
and to
may be the same buffer, permitting copying a buffer into itself.
Prototype
int aws_byte_buf_append_dynamic_secure(struct aws_byte_buf *to, const struct aws_byte_cursor *from);
LibAwsCommon.aws_byte_buf_append_encoding_uri_param
— Methodaws_byte_buf_append_encoding_uri_param(buffer, cursor)
Writes the uri query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 cursor to a buffer For example, reading "a b_c" would write "a20b_c".
Prototype
int aws_byte_buf_append_encoding_uri_param( struct aws_byte_buf *buffer, const struct aws_byte_cursor *cursor);
LibAwsCommon.aws_byte_buf_append_encoding_uri_path
— Methodaws_byte_buf_append_encoding_uri_path(buffer, cursor)
Writes the uri path encoding of a cursor to a buffer. This is the modified version of rfc3986 used by sigv4 signing.
Prototype
int aws_byte_buf_append_encoding_uri_path( struct aws_byte_buf *buffer, const struct aws_byte_cursor *cursor);
LibAwsCommon.aws_byte_buf_append_json_string
— Methodaws_byte_buf_append_json_string(value, output)
Appends a unformatted JSON string representation of the aws_json_value
into the passed byte buffer. The byte buffer is expected to be already initialized so the function can append the JSON into it.
Note: The byte buffer will automatically have its size extended if the JSON string is over the byte buffer capacity AND the byte buffer has an allocator associated with it. If the byte buffer does not have an allocator associated and the JSON string is over capacity, AWS_OP_ERR
will be returned.
Note: When you are finished with the aws_byte_buf
, you must call "aws_byte_buf_clean_up_secure
" to free the memory used, as it will NOT be called automatically.
Arguments
value
: Theaws_json_value
to format.output
: The destination for the JSON string
Returns
AWS_OP_SUCCESS
if the JSON string was allocated to output without any errors Will return AWS_OP_ERR
if the value passed is not an aws_json_value
or if there was an error appending the JSON into the byte buffer.
Prototype
int aws_byte_buf_append_json_string(const struct aws_json_value *value, struct aws_byte_buf *output);
LibAwsCommon.aws_byte_buf_append_json_string_formatted
— Methodaws_byte_buf_append_json_string_formatted(value, output)
Appends a formatted JSON string representation of the aws_json_value
into the passed byte buffer. The byte buffer is expected to already be initialized so the function can append the JSON into it.
Note: The byte buffer will automatically have its size extended if the JSON string is over the byte buffer capacity AND the byte buffer has an allocator associated with it. If the byte buffer does not have an allocator associated and the JSON string is over capacity, AWS_OP_ERR
will be returned.
Note: When you are finished with the aws_byte_buf
, you must call "aws_byte_buf_clean_up_secure
" to free the memory used, as it will NOT be called automatically.
Arguments
value
: Theaws_json_value
to format.output
: The destination for the JSON string
Returns
AWS_OP_SUCCESS
if the JSON string was allocated to output without any errors Will return AWS_OP_ERR
if the value passed is not an aws_json_value
or if there aws an error appending the JSON into the byte buffer.
Prototype
int aws_byte_buf_append_json_string_formatted(const struct aws_json_value *value, struct aws_byte_buf *output);
LibAwsCommon.aws_byte_buf_append_null_terminator
— Methodaws_byte_buf_append_null_terminator(buf)
Appends '\0' at the end of the buffer.
Prototype
int aws_byte_buf_append_null_terminator(struct aws_byte_buf *buf);
LibAwsCommon.aws_byte_buf_append_with_lookup
— Methodaws_byte_buf_append_with_lookup(to, from, lookup_table)
Copies from to to while converting bytes via the passed in lookup table. If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be returned. to->len will contain its original size plus the amount of data actually copied to to.
from and to should not be the same buffer (overlap is not handled) lookup_table must be at least 256 bytes
Prototype
int aws_byte_buf_append_with_lookup( struct aws_byte_buf *AWS_RESTRICT to, const struct aws_byte_cursor *AWS_RESTRICT from, const uint8_t *lookup_table);
LibAwsCommon.aws_byte_buf_clean_up
— Methodaws_byte_buf_clean_up(buf)
Documentation not found.
Prototype
void aws_byte_buf_clean_up(struct aws_byte_buf *buf);
LibAwsCommon.aws_byte_buf_clean_up_secure
— Methodaws_byte_buf_clean_up_secure(buf)
Equivalent to calling aws_byte_buf_secure_zero
and then aws_byte_buf_clean_up
on the buffer.
Prototype
void aws_byte_buf_clean_up_secure(struct aws_byte_buf *buf);
LibAwsCommon.aws_byte_buf_eq
— Methodaws_byte_buf_eq(a, b)
Compare two aws_byte_buf
structures. Return whether their contents are equivalent.
Prototype
bool aws_byte_buf_eq(const struct aws_byte_buf *const a, const struct aws_byte_buf *const b);
LibAwsCommon.aws_byte_buf_eq_c_str
— Methodaws_byte_buf_eq_c_str(buf, c_str)
Compare an aws_byte_buf
and a null-terminated string. Returns true if their contents are equivalent. The buffer should NOT contain a null-terminator, or the comparison will always return false.
Prototype
bool aws_byte_buf_eq_c_str(const struct aws_byte_buf *const buf, const char *const c_str);
LibAwsCommon.aws_byte_buf_eq_c_str_ignore_case
— Methodaws_byte_buf_eq_c_str_ignore_case(buf, c_str)
Perform a case-insensitive string comparison of an aws_byte_buf
and a null-terminated string. Return whether their contents are equivalent. The buffer should NOT contain a null-terminator, or the comparison will always return false. The "C" locale is used for comparing upper and lowercase letters. Data is assumed to be ASCII text, UTF-8 will work fine too.
Prototype
bool aws_byte_buf_eq_c_str_ignore_case(const struct aws_byte_buf *const buf, const char *const c_str);
LibAwsCommon.aws_byte_buf_eq_ignore_case
— Methodaws_byte_buf_eq_ignore_case(a, b)
Perform a case-insensitive string comparison of two aws_byte_buf
structures. Return whether their contents are equivalent. The "C" locale is used for comparing upper and lowercase letters. Data is assumed to be ASCII text, UTF-8 will work fine too.
Prototype
bool aws_byte_buf_eq_ignore_case(const struct aws_byte_buf *const a, const struct aws_byte_buf *const b);
LibAwsCommon.aws_byte_buf_from_array
— Methodaws_byte_buf_from_array(bytes, len)
Documentation not found.
Prototype
struct aws_byte_buf aws_byte_buf_from_array(const void *bytes, size_t len);
LibAwsCommon.aws_byte_buf_from_c_str
— Methodaws_byte_buf_from_c_str(c_str)
For creating a byte buffer from a null-terminated string literal.
Prototype
struct aws_byte_buf aws_byte_buf_from_c_str(const char *c_str);
LibAwsCommon.aws_byte_buf_from_empty_array
— Methodaws_byte_buf_from_empty_array(bytes, capacity)
Documentation not found.
Prototype
struct aws_byte_buf aws_byte_buf_from_empty_array(const void *bytes, size_t capacity);
LibAwsCommon.aws_byte_buf_init
— Methodaws_byte_buf_init(buf, allocator, capacity)
Documentation not found.
Prototype
int aws_byte_buf_init(struct aws_byte_buf *buf, struct aws_allocator *allocator, size_t capacity);
LibAwsCommon.aws_byte_buf_init_copy
— Methodaws_byte_buf_init_copy(dest, allocator, src)
Initializes an aws_byte_buf
structure base on another valid one. Requires: *src and *allocator are valid objects. Ensures: *dest is a valid aws_byte_buf
with a new backing array dest->buffer which is a copy of the elements from src->buffer.
Prototype
int aws_byte_buf_init_copy( struct aws_byte_buf *dest, struct aws_allocator *allocator, const struct aws_byte_buf *src);
LibAwsCommon.aws_byte_buf_init_copy_from_cursor
— Methodaws_byte_buf_init_copy_from_cursor(dest, allocator, src)
Copies src buffer into dest and sets the correct len and capacity. A new memory zone is allocated for dest->buffer. When dest is no longer needed it will have to be cleaned-up using aws_byte_buf_clean_up
(dest). Dest capacity and len will be equal to the src len. Allocator of the dest will be identical with parameter allocator. If src buffer is null the dest will have a null buffer with a len and a capacity of 0 Returns AWS_OP_SUCCESS
in case of success or AWS_OP_ERR
when memory can't be allocated.
Prototype
int aws_byte_buf_init_copy_from_cursor( struct aws_byte_buf *dest, struct aws_allocator *allocator, struct aws_byte_cursor src);
LibAwsCommon.aws_byte_buf_init_from_file
— Methodaws_byte_buf_init_from_file(out_buf, alloc, filename)
Reads 'filename' into 'out_buf'. If successful, 'out_buf' is allocated and filled with the data; It is your responsibility to call 'aws_byte_buf_clean_up
()' on it. Otherwise, 'out_buf' remains unused. In the very unfortunate case where some API needs to treat out_buf as a c_string, a null terminator is appended, but is not included as part of the length field.
Prototype
int aws_byte_buf_init_from_file(struct aws_byte_buf *out_buf, struct aws_allocator *alloc, const char *filename);
LibAwsCommon.aws_byte_buf_init_from_file_with_size_hint
— Methodaws_byte_buf_init_from_file_with_size_hint(out_buf, alloc, filename, size_hint)
Same as aws_byte_buf_init_from_file
(), but for reading "special files" like /proc/cpuinfo. These files don't accurately report their size, so size_hint is used as initial buffer size, and the buffer grows until the while file is read.
Prototype
int aws_byte_buf_init_from_file_with_size_hint( struct aws_byte_buf *out_buf, struct aws_allocator *alloc, const char *filename, size_t size_hint);
LibAwsCommon.aws_byte_buf_is_valid
— Methodaws_byte_buf_is_valid(buf)
Evaluates the set of properties that define the shape of all valid aws_byte_buf
structures. It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion).
Prototype
bool aws_byte_buf_is_valid(const struct aws_byte_buf *const buf);
LibAwsCommon.aws_byte_buf_reserve
— Methodaws_byte_buf_reserve(buffer, requested_capacity)
Attempts to increase the capacity of a buffer to the requested capacity
If the the buffer's capacity is currently larger than the request capacity, the function does nothing (no shrink is performed).
Prototype
int aws_byte_buf_reserve(struct aws_byte_buf *buffer, size_t requested_capacity);
LibAwsCommon.aws_byte_buf_reserve_relative
— Methodaws_byte_buf_reserve_relative(buffer, additional_length)
Convenience function that attempts to increase the capacity of a buffer relative to the current length.
aws_byte_buf_reserve_relative
(buf, x) ~~ aws_byte_buf_reserve
(buf, buf->len + x)
Prototype
int aws_byte_buf_reserve_relative(struct aws_byte_buf *buffer, size_t additional_length);
LibAwsCommon.aws_byte_buf_reset
— Methodaws_byte_buf_reset(buf, zero_contents)
Resets the len of the buffer to 0, but does not free the memory. The buffer can then be reused. Optionally zeroes the contents, if the "zero_contents" flag is true.
Prototype
void aws_byte_buf_reset(struct aws_byte_buf *buf, bool zero_contents);
LibAwsCommon.aws_byte_buf_secure_zero
— Methodaws_byte_buf_secure_zero(buf)
Sets all bytes of buffer to zero and resets len to zero.
Prototype
void aws_byte_buf_secure_zero(struct aws_byte_buf *buf);
LibAwsCommon.aws_byte_buf_write
— Methodaws_byte_buf_write(buf, src, len)
Write specified number of bytes from array to byte buffer.
On success, returns true and updates the buffer length accordingly. If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write( struct aws_byte_buf *AWS_RESTRICT buf, const uint8_t *AWS_RESTRICT src, size_t len);
LibAwsCommon.aws_byte_buf_write_be16
— Methodaws_byte_buf_write_be16(buf, x)
Writes a 16-bit integer in network byte order (big endian) to buffer.
On success, returns true and updates the buffer /length accordingly. If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_be16(struct aws_byte_buf *buf, uint16_t x);
LibAwsCommon.aws_byte_buf_write_be24
— Methodaws_byte_buf_write_be24(buf, x)
Writes low 24-bits (3 bytes) of an unsigned integer in network byte order (big endian) to buffer. Ex: If x is 0x00AABBCC then {0xAA, 0xBB, 0xCC} is written to buffer.
On success, returns true and updates the buffer /length accordingly. If there is insufficient space in the buffer, or x's value cannot fit in 3 bytes, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_be24(struct aws_byte_buf *buf, uint32_t x);
LibAwsCommon.aws_byte_buf_write_be32
— Methodaws_byte_buf_write_be32(buf, x)
Writes a 32-bit integer in network byte order (big endian) to buffer.
On success, returns true and updates the buffer /length accordingly. If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_be32(struct aws_byte_buf *buf, uint32_t x);
LibAwsCommon.aws_byte_buf_write_be64
— Methodaws_byte_buf_write_be64(buf, x)
Writes a 64-bit integer in network byte order (big endian) to buffer.
On success, returns true and updates the buffer /length accordingly. If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_be64(struct aws_byte_buf *buf, uint64_t x);
LibAwsCommon.aws_byte_buf_write_float_be32
— Methodaws_byte_buf_write_float_be32(buf, x)
Writes a 32-bit float in network byte order (big endian) to buffer.
On success, returns true and updates the buffer /length accordingly. If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_float_be32(struct aws_byte_buf *buf, float x);
LibAwsCommon.aws_byte_buf_write_float_be64
— Methodaws_byte_buf_write_float_be64(buf, x)
Writes a 64-bit float in network byte order (big endian) to buffer.
On success, returns true and updates the buffer /length accordingly. If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_float_be64(struct aws_byte_buf *buf, double x);
LibAwsCommon.aws_byte_buf_write_from_whole_buffer
— Methodaws_byte_buf_write_from_whole_buffer(buf, src)
Copies all bytes from buffer to buffer.
On success, returns true and updates the buffer /length accordingly. If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_from_whole_buffer( struct aws_byte_buf *AWS_RESTRICT buf, struct aws_byte_buf src);
LibAwsCommon.aws_byte_buf_write_from_whole_cursor
— Methodaws_byte_buf_write_from_whole_cursor(buf, src)
Copies all bytes from buffer to buffer.
On success, returns true and updates the buffer /length accordingly. If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_from_whole_cursor( struct aws_byte_buf *AWS_RESTRICT buf, struct aws_byte_cursor src);
LibAwsCommon.aws_byte_buf_write_from_whole_string
— Methodaws_byte_buf_write_from_whole_string(buf, src)
Copies all bytes from string to buf.
On success, returns true and updates the buf pointer/length accordingly. If there is insufficient space in the buf, returns false, leaving the buf unchanged.
Prototype
bool aws_byte_buf_write_from_whole_string( struct aws_byte_buf *AWS_RESTRICT buf, const struct aws_string *AWS_RESTRICT src);
LibAwsCommon.aws_byte_buf_write_to_capacity
— Methodaws_byte_buf_write_to_capacity(buf, advancing_cursor)
Without increasing buf's capacity, write as much as possible from advancing_cursor into buf.
buf's len is updated accordingly. advancing_cursor is advanced so it contains the remaining unwritten parts. Returns the section of advancing_cursor which was written.
This function cannot fail. If buf is full (len == capacity) or advancing_len has 0 length, then buf and advancing_cursor are not altered and a cursor with 0 length is returned.
Example: Given a buf with 2 bytes of space available and advancing_cursor with contents "abc". "ab" will be written to buf and buf->len will increase 2 and become equal to buf->capacity. advancing_cursor will advance so its contents become the unwritten "c". The returned cursor's contents will be the "ab" from the original advancing_cursor.
Prototype
struct aws_byte_cursor aws_byte_buf_write_to_capacity( struct aws_byte_buf *buf, struct aws_byte_cursor *advancing_cursor);
LibAwsCommon.aws_byte_buf_write_u8
— Methodaws_byte_buf_write_u8(buf, c)
Copies one byte to buffer.
On success, returns true and updates the cursor /length accordingly.
If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_u8(struct aws_byte_buf *AWS_RESTRICT buf, uint8_t c);
LibAwsCommon.aws_byte_buf_write_u8_n
— Methodaws_byte_buf_write_u8_n(buf, c, count)
Writes one byte repeatedly to buffer (like memset)
If there is insufficient space in the buffer, returns false, leaving the buffer unchanged.
Prototype
bool aws_byte_buf_write_u8_n(struct aws_byte_buf *buf, uint8_t c, size_t count);
LibAwsCommon.aws_byte_cursor_advance
— Methodaws_byte_cursor_advance(cursor, len)
Tests if the given aws_byte_cursor
has at least len bytes remaining. If so, *buf is advanced by len bytes (incrementing ->ptr and decrementing ->len), and an aws_byte_cursor
referring to the first len bytes of the original *buf is returned. Otherwise, an aws_byte_cursor
with ->ptr = NULL, ->len = 0 is returned.
Note that if len is above (SIZE_MAX / 2), this function will also treat it as a buffer overflow, and return NULL without changing *buf.
Prototype
struct aws_byte_cursor aws_byte_cursor_advance(struct aws_byte_cursor *const cursor, const size_t len);
LibAwsCommon.aws_byte_cursor_advance_nospec
— Methodaws_byte_cursor_advance_nospec(cursor, len)
Behaves identically to aws_byte_cursor_advance
, but avoids speculative execution potentially reading out-of-bounds pointers (by returning an empty ptr in such speculated paths).
This should generally be done when using an untrusted or data-dependent value for 'len', to avoid speculating into a path where cursor->ptr points outside the true ptr length.
Prototype
struct aws_byte_cursor aws_byte_cursor_advance_nospec(struct aws_byte_cursor *const cursor, size_t len);
LibAwsCommon.aws_byte_cursor_compare_lexical
— Methodaws_byte_cursor_compare_lexical(lhs, rhs)
Lexical (byte value) comparison of two byte cursors
Prototype
int aws_byte_cursor_compare_lexical(const struct aws_byte_cursor *lhs, const struct aws_byte_cursor *rhs);
LibAwsCommon.aws_byte_cursor_compare_lookup
— Methodaws_byte_cursor_compare_lookup(lhs, rhs, lookup_table)
Lexical (byte value) comparison of two byte cursors where the raw values are sent through a lookup table first
Prototype
int aws_byte_cursor_compare_lookup( const struct aws_byte_cursor *lhs, const struct aws_byte_cursor *rhs, const uint8_t *lookup_table);
LibAwsCommon.aws_byte_cursor_eq
— Methodaws_byte_cursor_eq(a, b)
Compare two aws_byte_cursor
structures. Return whether their contents are equivalent.
Prototype
bool aws_byte_cursor_eq(const struct aws_byte_cursor *a, const struct aws_byte_cursor *b);
LibAwsCommon.aws_byte_cursor_eq_byte_buf
— Methodaws_byte_cursor_eq_byte_buf(a, b)
Compare an aws_byte_cursor
and an aws_byte_buf
. Return whether their contents are equivalent.
Prototype
bool aws_byte_cursor_eq_byte_buf(const struct aws_byte_cursor *const a, const struct aws_byte_buf *const b);
LibAwsCommon.aws_byte_cursor_eq_byte_buf_ignore_case
— Methodaws_byte_cursor_eq_byte_buf_ignore_case(a, b)
Perform a case-insensitive string comparison of an aws_byte_cursor
and an aws_byte_buf
. Return whether their contents are equivalent. The "C" locale is used for comparing upper and lowercase letters. Data is assumed to be ASCII text, UTF-8 will work fine too.
Prototype
bool aws_byte_cursor_eq_byte_buf_ignore_case(const struct aws_byte_cursor *const a, const struct aws_byte_buf *const b);
LibAwsCommon.aws_byte_cursor_eq_c_str
— Methodaws_byte_cursor_eq_c_str(cursor, c_str)
Compare an aws_byte_cursor
and a null-terminated string. Returns true if their contents are equivalent. The cursor should NOT contain a null-terminator, or the comparison will always return false.
Prototype
bool aws_byte_cursor_eq_c_str(const struct aws_byte_cursor *const cursor, const char *const c_str);
LibAwsCommon.aws_byte_cursor_eq_c_str_ignore_case
— Methodaws_byte_cursor_eq_c_str_ignore_case(cursor, c_str)
Perform a case-insensitive string comparison of an aws_byte_cursor
and a null-terminated string. Return whether their contents are equivalent. The cursor should NOT contain a null-terminator, or the comparison will always return false. The "C" locale is used for comparing upper and lowercase letters. Data is assumed to be ASCII text, UTF-8 will work fine too.
Prototype
bool aws_byte_cursor_eq_c_str_ignore_case(const struct aws_byte_cursor *const cursor, const char *const c_str);
LibAwsCommon.aws_byte_cursor_eq_ignore_case
— Methodaws_byte_cursor_eq_ignore_case(a, b)
Perform a case-insensitive string comparison of two aws_byte_cursor
structures. Return whether their contents are equivalent. The "C" locale is used for comparing upper and lowercase letters. Data is assumed to be ASCII text, UTF-8 will work fine too.
Prototype
bool aws_byte_cursor_eq_ignore_case(const struct aws_byte_cursor *a, const struct aws_byte_cursor *b);
LibAwsCommon.aws_byte_cursor_find_exact
— Methodaws_byte_cursor_find_exact(input_str, to_find, first_find)
Search for an exact byte match inside a cursor. The first match will be returned. Returns AWS_OP_SUCCESS
on successful match and first_find will be set to the offset in input_str, and length will be the remaining length from input_str past the returned offset. If the match was not found, AWS_OP_ERR
will be returned and AWS_ERROR_STRING_MATCH_NOT_FOUND will be raised.
Prototype
int aws_byte_cursor_find_exact( const struct aws_byte_cursor *AWS_RESTRICT input_str, const struct aws_byte_cursor *AWS_RESTRICT to_find, struct aws_byte_cursor *first_find);
LibAwsCommon.aws_byte_cursor_from_array
— Methodaws_byte_cursor_from_array(bytes, len)
Documentation not found.
Prototype
struct aws_byte_cursor aws_byte_cursor_from_array(const void *const bytes, const size_t len);
LibAwsCommon.aws_byte_cursor_from_buf
— Methodaws_byte_cursor_from_buf(buf)
Documentation not found.
Prototype
struct aws_byte_cursor aws_byte_cursor_from_buf(const struct aws_byte_buf *const buf);
LibAwsCommon.aws_byte_cursor_from_c_str
— Methodaws_byte_cursor_from_c_str(c_str)
Documentation not found.
Prototype
struct aws_byte_cursor aws_byte_cursor_from_c_str(const char *c_str);
LibAwsCommon.aws_byte_cursor_from_string
— Methodaws_byte_cursor_from_string(src)
Creates an aws_byte_cursor
from an existing string.
Prototype
struct aws_byte_cursor aws_byte_cursor_from_string(const struct aws_string *src);
LibAwsCommon.aws_byte_cursor_is_valid
— Methodaws_byte_cursor_is_valid(cursor)
Evaluates the set of properties that define the shape of all valid aws_byte_cursor
structures. It is also a cheap check, in the sense it runs in constant time (i.e., no loops or recursion).
Prototype
bool aws_byte_cursor_is_valid(const struct aws_byte_cursor *cursor);
LibAwsCommon.aws_byte_cursor_left_trim_pred
— Methodaws_byte_cursor_left_trim_pred(source, predicate)
Shrinks a byte cursor from the left for as long as the supplied predicate is true
Prototype
struct aws_byte_cursor aws_byte_cursor_left_trim_pred( const struct aws_byte_cursor *source, aws_byte_predicate_fn *predicate);
LibAwsCommon.aws_byte_cursor_next_split
— Methodaws_byte_cursor_next_split(input_str, split_on, substr)
No copies, no buffer allocations. Iterates over input_str, and returns the next substring between split_on instances relative to previous substr. Behaves similar to strtok with substr being used as state for next split.
Returns true each time substr is set and false when there is no more splits (substr is set to empty in that case).
Example usage. struct aws_byte_cursor
substr = {0}; while (aws_byte_cursor_next_split
(&input_str, ';', &substr)) { // ...use substr... }
Note: It is the user's responsibility zero-initialize substr before the first call.
Edge case rules are as follows: empty input will have single empty split. ex. "" splits into "" if input starts with split_on then first split is empty. ex ";A" splits into "", "A" adjacent split tokens result in empty split. ex "A;;B" splits into "A", "", "B" If the input ends with split_on, last split is empty. ex. "A;" splits into "A", ""
It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results.
Prototype
bool aws_byte_cursor_next_split( const struct aws_byte_cursor *AWS_RESTRICT input_str, char split_on, struct aws_byte_cursor *AWS_RESTRICT substr);
LibAwsCommon.aws_byte_cursor_read
— Methodaws_byte_cursor_read(cur, dest, len)
Reads specified length of data from byte cursor and copies it to the destination array.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read( struct aws_byte_cursor *AWS_RESTRICT cur, void *AWS_RESTRICT dest, const size_t len);
LibAwsCommon.aws_byte_cursor_read_and_fill_buffer
— Methodaws_byte_cursor_read_and_fill_buffer(cur, dest)
Reads as many bytes from cursor as size of buffer, and copies them to buffer.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_and_fill_buffer( struct aws_byte_cursor *AWS_RESTRICT cur, struct aws_byte_buf *AWS_RESTRICT dest);
LibAwsCommon.aws_byte_cursor_read_be16
— Methodaws_byte_cursor_read_be16(cur, var)
Reads a 16-bit value in network byte order from cur, and places it in host byte order into var.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_be16(struct aws_byte_cursor *cur, uint16_t *var);
LibAwsCommon.aws_byte_cursor_read_be24
— Methodaws_byte_cursor_read_be24(cur, var)
Reads an unsigned 24-bit value (3 bytes) in network byte order from cur, and places it in host byte order into 32-bit var. Ex: if cur's next 3 bytes are {0xAA, 0xBB, 0xCC}, then var becomes 0x00AABBCC.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_be24(struct aws_byte_cursor *cur, uint32_t *var);
LibAwsCommon.aws_byte_cursor_read_be32
— Methodaws_byte_cursor_read_be32(cur, var)
Reads a 32-bit value in network byte order from cur, and places it in host byte order into var.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_be32(struct aws_byte_cursor *cur, uint32_t *var);
LibAwsCommon.aws_byte_cursor_read_be64
— Methodaws_byte_cursor_read_be64(cur, var)
Reads a 64-bit value in network byte order from cur, and places it in host byte order into var.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_be64(struct aws_byte_cursor *cur, uint64_t *var);
LibAwsCommon.aws_byte_cursor_read_float_be32
— Methodaws_byte_cursor_read_float_be32(cur, var)
Reads a 32-bit value in network byte order from cur, and places it in host byte order into var.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_float_be32(struct aws_byte_cursor *cur, float *var);
LibAwsCommon.aws_byte_cursor_read_float_be64
— Methodaws_byte_cursor_read_float_be64(cur, var)
Reads a 64-bit value in network byte order from cur, and places it in host byte order into var.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_float_be64(struct aws_byte_cursor *cur, double *var);
LibAwsCommon.aws_byte_cursor_read_hex_u8
— Methodaws_byte_cursor_read_hex_u8(cur, var)
Reads 2 hex characters from ASCII/UTF-8 text to produce an 8-bit number. Accepts both lowercase 'a'-'f' and uppercase 'A'-'F'. For example: "0F" produces 15.
On success, returns true and advances the cursor by 2. If there is insufficient space in the cursor or an invalid character is encountered, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_hex_u8(struct aws_byte_cursor *cur, uint8_t *var);
LibAwsCommon.aws_byte_cursor_read_u8
— Methodaws_byte_cursor_read_u8(cur, var)
Reads a single byte from cursor, placing it in *var.
On success, returns true and updates the cursor pointer/length accordingly. If there is insufficient space in the cursor, returns false, leaving the cursor unchanged.
Prototype
bool aws_byte_cursor_read_u8(struct aws_byte_cursor *AWS_RESTRICT cur, uint8_t *AWS_RESTRICT var);
LibAwsCommon.aws_byte_cursor_right_trim_pred
— Methodaws_byte_cursor_right_trim_pred(source, predicate)
Shrinks a byte cursor from the right for as long as the supplied predicate is true
Prototype
struct aws_byte_cursor aws_byte_cursor_right_trim_pred( const struct aws_byte_cursor *source, aws_byte_predicate_fn *predicate);
LibAwsCommon.aws_byte_cursor_satisfies_pred
— Methodaws_byte_cursor_satisfies_pred(source, predicate)
Returns true if the byte cursor's range of bytes all satisfy the predicate
Prototype
bool aws_byte_cursor_satisfies_pred(const struct aws_byte_cursor *source, aws_byte_predicate_fn *predicate);
LibAwsCommon.aws_byte_cursor_split_on_char
— Methodaws_byte_cursor_split_on_char(input_str, split_on, output)
No copies, no buffer allocations. Fills in output with a list of aws_byte_cursor
instances where buffer is an offset into the input_str and len is the length of that string in the original buffer.
Edge case rules are as follows: if the input begins with split_on, an empty cursor will be the first entry in output. if the input has two adjacent split_on tokens, an empty cursor will be inserted into the output. if the input ends with split_on, an empty cursor will be appended to the output.
It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from output is your most likely guess for the upper bound of the number of elements resulting from the split.
The type that will be stored in output is struct aws_byte_cursor
(you'll need this for the item size param).
It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results.
Prototype
int aws_byte_cursor_split_on_char( const struct aws_byte_cursor *AWS_RESTRICT input_str, char split_on, struct aws_array_list *AWS_RESTRICT output);
LibAwsCommon.aws_byte_cursor_split_on_char_n
— Methodaws_byte_cursor_split_on_char_n(input_str, split_on, n, output)
No copies, no buffer allocations. Fills in output with a list of aws_byte_cursor
instances where buffer is an offset into the input_str and len is the length of that string in the original buffer. N is the max number of splits, if this value is zero, it will add all splits to the output.
Edge case rules are as follows: if the input begins with split_on, an empty cursor will be the first entry in output if the input has two adjacent split_on tokens, an empty cursor will be inserted into the output. if the input ends with split_on, an empty cursor will be appended to the output.
It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from output is your most likely guess for the upper bound of the number of elements resulting from the split.
If the output array is not large enough, input_str will be updated to point to the first character after the last processed split_on instance.
The type that will be stored in output is struct aws_byte_cursor
(you'll need this for the item size param).
It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results.
Prototype
int aws_byte_cursor_split_on_char_n( const struct aws_byte_cursor *AWS_RESTRICT input_str, char split_on, size_t n, struct aws_array_list *AWS_RESTRICT output);
LibAwsCommon.aws_byte_cursor_starts_with
— Methodaws_byte_cursor_starts_with(input, prefix)
Return true if the input starts with the prefix (exact byte comparison).
Prototype
bool aws_byte_cursor_starts_with(const struct aws_byte_cursor *input, const struct aws_byte_cursor *prefix);
LibAwsCommon.aws_byte_cursor_starts_with_ignore_case
— Methodaws_byte_cursor_starts_with_ignore_case(input, prefix)
Return true if the input starts with the prefix (case-insensitive). The "C" locale is used for comparing upper and lowercase letters. Data is assumed to be ASCII text, UTF-8 will work fine too.
Prototype
bool aws_byte_cursor_starts_with_ignore_case(const struct aws_byte_cursor *input, const struct aws_byte_cursor *prefix);
LibAwsCommon.aws_byte_cursor_trim_pred
— Methodaws_byte_cursor_trim_pred(source, predicate)
Shrinks a byte cursor from both sides for as long as the supplied predicate is true
Prototype
struct aws_byte_cursor aws_byte_cursor_trim_pred( const struct aws_byte_cursor *source, aws_byte_predicate_fn *predicate);
LibAwsCommon.aws_byte_cursor_utf8_parse_u64
— Methodaws_byte_cursor_utf8_parse_u64(cursor, dst)
Read entire cursor as ASCII/UTF-8 unsigned base-10 number. Stricter than strtoull(), which allows whitespace and inputs that start with "0x"
Examples: "0" -> 0 "123" -> 123 "00004" -> 4 // leading zeros ok
Rejects things like: "-1" // negative numbers not allowed "1,000" // only characters 0-9 allowed "" // blank string not allowed " 0 " // whitespace not allowed "0x0" // hex not allowed "FF" // hex not allowed "999999999999999999999999999999999999999999" // larger than max u64
Prototype
int aws_byte_cursor_utf8_parse_u64(struct aws_byte_cursor cursor, uint64_t *dst);
LibAwsCommon.aws_byte_cursor_utf8_parse_u64_hex
— Methodaws_byte_cursor_utf8_parse_u64_hex(cursor, dst)
Read entire cursor as ASCII/UTF-8 unsigned base-16 number with NO "0x" prefix.
Examples: "F" -> 15 "000000ff" -> 255 // leading zeros ok "Ff" -> 255 // mixed case ok "123" -> 291 "FFFFFFFFFFFFFFFF" -> 18446744073709551616 // max u64
Rejects things like: "0x0" // 0x prefix not allowed "" // blank string not allowed " F " // whitespace not allowed "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" // larger than max u64
Prototype
int aws_byte_cursor_utf8_parse_u64_hex(struct aws_byte_cursor cursor, uint64_t *dst);
LibAwsCommon.aws_c_string_is_valid
— Methodaws_c_string_is_valid(str)
Best-effort checks aws_string
invariants, when the str->len is unknown
Prototype
AWS_STATIC_IMPL bool aws_c_string_is_valid(const char *str);
LibAwsCommon.aws_cache_base_default_clear
— Methodaws_cache_base_default_clear(cache)
Documentation not found.
Prototype
void aws_cache_base_default_clear(struct aws_cache *cache);
LibAwsCommon.aws_cache_base_default_destroy
— Methodaws_cache_base_default_destroy(cache)
Default implementations
Prototype
void aws_cache_base_default_destroy(struct aws_cache *cache);
LibAwsCommon.aws_cache_base_default_find
— Methodaws_cache_base_default_find(cache, key, p_value)
Documentation not found.
Prototype
int aws_cache_base_default_find(struct aws_cache *cache, const void *key, void **p_value);
LibAwsCommon.aws_cache_base_default_get_element_count
— Methodaws_cache_base_default_get_element_count(cache)
Documentation not found.
Prototype
size_t aws_cache_base_default_get_element_count(const struct aws_cache *cache);
LibAwsCommon.aws_cache_base_default_remove
— Methodaws_cache_base_default_remove(cache, key)
Documentation not found.
Prototype
int aws_cache_base_default_remove(struct aws_cache *cache, const void *key);
LibAwsCommon.aws_cache_clear
— Methodaws_cache_clear(cache)
Clears all items from the cache.
Prototype
void aws_cache_clear(struct aws_cache *cache);
LibAwsCommon.aws_cache_destroy
— Methodaws_cache_destroy(cache)
Cleans up the cache. Elements in the cache will be evicted and cleanup callbacks will be invoked.
Prototype
void aws_cache_destroy(struct aws_cache *cache);
LibAwsCommon.aws_cache_find
— Methodaws_cache_find(cache, key, p_value)
Finds element in the cache by key. If found, *p_value will hold the stored value, and AWS_OP_SUCCESS
will be returned. If not found, AWS_OP_SUCCESS
will be returned and *p_value will be NULL.
If any errors occur AWS_OP_ERR
will be returned.
Prototype
int aws_cache_find(struct aws_cache *cache, const void *key, void **p_value);
LibAwsCommon.aws_cache_get_element_count
— Methodaws_cache_get_element_count(cache)
Returns the number of elements in the cache.
Prototype
size_t aws_cache_get_element_count(const struct aws_cache *cache);
LibAwsCommon.aws_cache_new_fifo
— Methodaws_cache_new_fifo(allocator, hash_fn, equals_fn, destroy_key_fn, destroy_value_fn, max_items)
Initializes the first-in-first-out cache. Sets up the underlying linked hash table. Once max_items
elements have been added, the oldest(first-in) item will be removed. For the other parameters, see aws/common/hash_table.h. Hash table semantics of these arguments are preserved.
Prototype
struct aws_cache *aws_cache_new_fifo( struct aws_allocator *allocator, aws_hash_fn *hash_fn, aws_hash_callback_eq_fn *equals_fn, aws_hash_callback_destroy_fn *destroy_key_fn, aws_hash_callback_destroy_fn *destroy_value_fn, size_t max_items);
LibAwsCommon.aws_cache_new_lifo
— Methodaws_cache_new_lifo(allocator, hash_fn, equals_fn, destroy_key_fn, destroy_value_fn, max_items)
Initializes the last-in-first-out cache. Sets up the underlying linked hash table. Once max_items
elements have been added, the latest(last-in) item will be removed. For the other parameters, see aws/common/hash_table.h. Hash table semantics of these arguments are preserved.
Prototype
struct aws_cache *aws_cache_new_lifo( struct aws_allocator *allocator, aws_hash_fn *hash_fn, aws_hash_callback_eq_fn *equals_fn, aws_hash_callback_destroy_fn *destroy_key_fn, aws_hash_callback_destroy_fn *destroy_value_fn, size_t max_items);
LibAwsCommon.aws_cache_new_lru
— Methodaws_cache_new_lru(allocator, hash_fn, equals_fn, destroy_key_fn, destroy_value_fn, max_items)
Initializes the Least-recently-used cache. Sets up the underlying linked hash table. Once max_items
elements have been added, the least recently used item will be removed. For the other parameters, see aws/common/hash_table.h. Hash table semantics of these arguments are preserved.(Yes the one that was the answer to that interview question that one time).
Prototype
struct aws_cache *aws_cache_new_lru( struct aws_allocator *allocator, aws_hash_fn *hash_fn, aws_hash_callback_eq_fn *equals_fn, aws_hash_callback_destroy_fn *destroy_key_fn, aws_hash_callback_destroy_fn *destroy_value_fn, size_t max_items);
LibAwsCommon.aws_cache_put
— Methodaws_cache_put(cache, key, p_value)
Puts p_value
at key
. If an element is already stored at key
it will be replaced. If the cache is already full, an item will be removed based on the cache policy.
Prototype
int aws_cache_put(struct aws_cache *cache, const void *key, void *p_value);
LibAwsCommon.aws_cache_remove
— Methodaws_cache_remove(cache, key)
Removes item at key
from the cache.
Prototype
int aws_cache_remove(struct aws_cache *cache, const void *key);
LibAwsCommon.aws_cbor_decoder_consume_next_single_element
— Methodaws_cbor_decoder_consume_next_single_element(decoder)
Consume the next single element, without the content followed by the element.
As an example for the following cbor, this function will only consume the 0xBF, "Start indefinite-length map", not any content of the map represented. The next element to decode will start from 0x63 0xbf6346756ef563416d7421ff BF – Start indefinite-length map 63 – First key, UTF-8 string length 3 46756e – "Fun" F5 – First value, true 63 – Second key, UTF-8 string length 3 416d74 – "Amt" 21 – Second value, -2 FF – "break"
Arguments
decoder
: The decoder to parse data from
Returns
AWS_OP_SUCCESS
successfully consumed the next element, otherwise AWS_OP_ERR
.
Prototype
int aws_cbor_decoder_consume_next_single_element(struct aws_cbor_decoder *decoder);
LibAwsCommon.aws_cbor_decoder_consume_next_whole_data_item
— Methodaws_cbor_decoder_consume_next_whole_data_item(decoder)
Consume the next data item, includes all the content within the data item.
As an example for the following cbor, this function will consume all the data as it's only one cbor data item, an indefinite map with 2 key, value pair: 0xbf6346756ef563416d7421ff BF – Start indefinite-length map 63 – First key, UTF-8 string length 3 46756e – "Fun" F5 – First value, true 63 – Second key, UTF-8 string length 3 416d74 – "Amt" 21 – Second value, -2 FF – "break"
Notes: this function will not ensure the data item is well-formed.
Arguments
src
: The src to parse data from
Returns
AWS_OP_SUCCESS
successfully consumed the next data item, otherwise AWS_OP_ERR
.
Prototype
int aws_cbor_decoder_consume_next_whole_data_item(struct aws_cbor_decoder *decoder);
LibAwsCommon.aws_cbor_decoder_destroy
— Methodaws_cbor_decoder_destroy(decoder)
Documentation not found.
Prototype
struct aws_cbor_decoder *aws_cbor_decoder_destroy(struct aws_cbor_decoder *decoder);
LibAwsCommon.aws_cbor_decoder_get_remaining_length
— Methodaws_cbor_decoder_get_remaining_length(decoder)
Get the length of the remaining bytes of the source. Once the source was decoded, it will be consumed, and result in decrease of the remaining length of bytes.
Arguments
decoder
:
Returns
The length of bytes remaining of the decoder source.
Prototype
size_t aws_cbor_decoder_get_remaining_length(const struct aws_cbor_decoder *decoder);
LibAwsCommon.aws_cbor_decoder_new
— Methodaws_cbor_decoder_new(allocator, src)
Create a cbor decoder to take src to decode. The typical usage of decoder will be: - If the next element type only accept what expected, aws\_cbor\_decoder\_pop\_next\_*
- If the next element type accept different type, invoke aws_cbor_decoder_peek_type
first, then based on the type to invoke corresponding aws\_cbor\_decoder\_pop\_next\_*
- If the next element type doesn't have corrsponding value, specifically: AWS_CBOR_TYPE_NULL, AWS_CBOR_TYPE_UNDEFINED, AWS_CBOR_TYPE_INF_*_START, AWS_CBOR_TYPE_BREAK, call aws_cbor_decoder_consume_next_single_element
to consume it and continues for further decoding. - To ignore the next data item (the element and the content of it), aws_cbor_decoder_consume_next_whole_data_item
Note: it's caller's responsibilty to keep the src outlive the decoder.
Arguments
allocator
:src
: The src data to decode from.
Returns
decoder
Prototype
struct aws_cbor_decoder *aws_cbor_decoder_new(struct aws_allocator *allocator, struct aws_byte_cursor src);
LibAwsCommon.aws_cbor_decoder_peek_type
— Methodaws_cbor_decoder_peek_type(decoder, out_type)
Decode the next element and store it in the decoder cache if there was no element cached. If there was element cached, just return the type of the cached element.
Arguments
decoder
:out_type
:
Returns
AWS_OP_SUCCESS
if succeed, AWS_OP_ERR
for any decoding error and corresponding error code will be raised.
Prototype
int aws_cbor_decoder_peek_type(struct aws_cbor_decoder *decoder, enum aws_cbor_type *out_type);
LibAwsCommon.aws_cbor_decoder_pop_next_array_start
— Methodaws_cbor_decoder_pop_next_array_start(decoder, out_size)
Get the next AWS_CBOR_TYPE_ARRAY_START element. Only consume the AWS_CBOR_TYPE_ARRAY_START element and set the size of array to *out_size, not the content of the array. The next *out_size cbor data items will be the content of the array for a valid cbor data,
Notes: For indefinite-length, this function will fail with "AWS_ERROR_CBOR_UNEXPECTED_TYPE". The designed way to handle indefinite-length is: - Get AWS_CBOR_TYPE_INDEF_ARRAY_START from _peek_type - call aws_cbor_decoder_consume_next_single_element
to pop the indefinite-length start. - Decode the next data item until AWS_CBOR_TYPE_BREAK read.
Arguments
decoder
:out_size
: store the size of array if succeed.
Returns
AWS_OP_SUCCESS
successfully consumed the next element and get the result, otherwise AWS_OP_ERR
.
Prototype
int aws_cbor_decoder_pop_next_array_start(struct aws_cbor_decoder *decoder, uint64_t *out_size);
LibAwsCommon.aws_cbor_decoder_pop_next_boolean_val
— Methodaws_cbor_decoder_pop_next_boolean_val(decoder, out)
Documentation not found.
Prototype
int aws_cbor_decoder_pop_next_boolean_val(struct aws_cbor_decoder *decoder, bool *out);
LibAwsCommon.aws_cbor_decoder_pop_next_bytes_val
— Methodaws_cbor_decoder_pop_next_bytes_val(decoder, out)
Documentation not found.
Prototype
int aws_cbor_decoder_pop_next_bytes_val(struct aws_cbor_decoder *decoder, struct aws_byte_cursor *out);
LibAwsCommon.aws_cbor_decoder_pop_next_float_val
— Methodaws_cbor_decoder_pop_next_float_val(decoder, out)
Documentation not found.
Prototype
int aws_cbor_decoder_pop_next_float_val(struct aws_cbor_decoder *decoder, double *out);
LibAwsCommon.aws_cbor_decoder_pop_next_map_start
— Methodaws_cbor_decoder_pop_next_map_start(decoder, out_size)
Get the next AWS_CBOR_TYPE_MAP_START element. Only consume the AWS_CBOR_TYPE_MAP_START element and set the size of array to *out_size, not the content of the map. The next *out_size pair of cbor data items as key and value will be the content of the array for a valid cbor data,
Notes: For indefinite-length, this function will fail with "AWS_ERROR_CBOR_UNEXPECTED_TYPE". The designed way to handle indefinite-length is: - Get AWS_CBOR_TYPE_INDEF_MAP_START from _peek_type - call aws_cbor_decoder_consume_next_single_element
to pop the indefinite-length start. - Decode the next data item until AWS_CBOR_TYPE_BREAK read.
Arguments
decoder
:out_size
: store the size of map if succeed.
Returns
AWS_OP_SUCCESS
successfully consumed the next element and get the result, otherwise AWS_OP_ERR
.
Prototype
int aws_cbor_decoder_pop_next_map_start(struct aws_cbor_decoder *decoder, uint64_t *out_size);
LibAwsCommon.aws_cbor_decoder_pop_next_negative_int_val
— Methodaws_cbor_decoder_pop_next_negative_int_val(decoder, out)
Documentation not found.
Prototype
int aws_cbor_decoder_pop_next_negative_int_val(struct aws_cbor_decoder *decoder, uint64_t *out);
LibAwsCommon.aws_cbor_decoder_pop_next_tag_val
— Methodaws_cbor_decoder_pop_next_tag_val(decoder, out_tag_val)
Get the next AWS_CBOR_TYPE_TAG element. Only consume the AWS_CBOR_TYPE_TAG element and set the tag value to *out_tag_val, not the content of the tagged. The next cbor data item will be the content of the tagged value for a valid cbor data.
Arguments
decoder
:out_size
: store the size of map if succeed.
Returns
AWS_OP_SUCCESS
successfully consumed the next element and get the result, otherwise AWS_OP_ERR
.
Prototype
int aws_cbor_decoder_pop_next_tag_val(struct aws_cbor_decoder *decoder, uint64_t *out_tag_val);
LibAwsCommon.aws_cbor_decoder_pop_next_text_val
— Methodaws_cbor_decoder_pop_next_text_val(decoder, out)
Documentation not found.
Prototype
int aws_cbor_decoder_pop_next_text_val(struct aws_cbor_decoder *decoder, struct aws_byte_cursor *out);
LibAwsCommon.aws_cbor_decoder_pop_next_unsigned_int_val
— Methodaws_cbor_decoder_pop_next_unsigned_int_val(decoder, out)
Get the next element based on the type. If the next element doesn't match the expected type. Error will be raised. If the next element already been cached, it will consume the cached item when no error was returned. Specifically: AWS_CBOR_TYPE_UINT - aws_cbor_decoder_pop_next_unsigned_int_val
AWS_CBOR_TYPE_NEGINT - aws_cbor_decoder_pop_next_negative_int_val
, it represents (-1 - *out) AWS_CBOR_TYPE_FLOAT - aws_cbor_decoder_pop_next_double_val AWS_CBOR_TYPE_BYTES - aws_cbor_decoder_pop_next_bytes_val
AWS_CBOR_TYPE_TEXT - aws_cbor_decoder_pop_next_text_val
Arguments
decoder
:out
:
Returns
AWS_OP_SUCCESS
successfully consumed the next element and get the result, otherwise AWS_OP_ERR
.
Prototype
int aws_cbor_decoder_pop_next_unsigned_int_val(struct aws_cbor_decoder *decoder, uint64_t *out);
LibAwsCommon.aws_cbor_encoder_destroy
— Methodaws_cbor_encoder_destroy(encoder)
Documentation not found.
Prototype
struct aws_cbor_encoder *aws_cbor_encoder_destroy(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_get_encoded_data
— Methodaws_cbor_encoder_get_encoded_data(encoder)
Get the current encoded data from encoder. The encoded data has the same lifetime as the encoder, and once any other function call invoked for the encoder, the encoded data is no longer valid.
Arguments
encoder
:
Returns
struct aws_byte_cursor
from the encoder buffer.
Prototype
struct aws_byte_cursor aws_cbor_encoder_get_encoded_data(const struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_new
— Methodaws_cbor_encoder_new(allocator)
Create a new cbor encoder. Creating a encoder with a temporay buffer. Every aws_cbor_encoder_write_* will encode directly into the buffer to follow the encoded data.
Arguments
allocator
:
Returns
Prototype
struct aws_cbor_encoder *aws_cbor_encoder_new(struct aws_allocator *allocator);
LibAwsCommon.aws_cbor_encoder_reset
— Methodaws_cbor_encoder_reset(encoder)
Clear the current encoded buffer from encoder.
Arguments
encoder
:
Prototype
void aws_cbor_encoder_reset(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_write_array_start
— Methodaws_cbor_encoder_write_array_start(encoder, number_entries)
Encode a AWS_CBOR_TYPE_ARRAY_START value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1 The "number_entries" is the cbor data items should be followed as the content of the array. Notes: it's user's responsibility to keep the integrity of the array to be encoded.
Arguments
encoder
:number_entries
: The number of data item in array.
Prototype
void aws_cbor_encoder_write_array_start(struct aws_cbor_encoder *encoder, size_t number_entries);
LibAwsCommon.aws_cbor_encoder_write_bool
— Methodaws_cbor_encoder_write_bool(encoder, value)
Encode a simple value AWS_CBOR_TYPE_BOOL
Arguments
encoder
:
Prototype
void aws_cbor_encoder_write_bool(struct aws_cbor_encoder *encoder, bool value);
LibAwsCommon.aws_cbor_encoder_write_break
— Methodaws_cbor_encoder_write_break(encoder)
Encode a simple value AWS_CBOR_TYPE_BREAK
Notes: no error checking, it's user's responsibility to track the break to close the corresponding indef_start
Prototype
void aws_cbor_encoder_write_break(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_write_bytes
— Methodaws_cbor_encoder_write_bytes(encoder, from)
Encode a AWS_CBOR_TYPE_BYTES value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1, the length of "from" will be encoded first and then the value of "from" will be followed.
Arguments
encoder
:from
: value to encode.
Prototype
void aws_cbor_encoder_write_bytes(struct aws_cbor_encoder *encoder, struct aws_byte_cursor from);
LibAwsCommon.aws_cbor_encoder_write_float
— Methodaws_cbor_encoder_write_float(encoder, value)
Encode a AWS_CBOR_TYPE_FLOAT value to "smallest possible", but will not be encoded into half-precision float, as it's not well supported cross languages.
To be more specific, it will be encoded into integer/negative/float (Order with priority) when the conversation will not cause precision loss.
Arguments
encoder
:value
: value to encode.
Prototype
void aws_cbor_encoder_write_float(struct aws_cbor_encoder *encoder, double value);
LibAwsCommon.aws_cbor_encoder_write_indef_array_start
— Methodaws_cbor_encoder_write_indef_array_start(encoder)
Encode a AWS_CBOR_TYPE_INDEF_ARRAY_START
Notes: no error checking, it's user's responsibility to add corresponding data and the break to close the indef_start
Prototype
void aws_cbor_encoder_write_indef_array_start(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_write_indef_bytes_start
— Methodaws_cbor_encoder_write_indef_bytes_start(encoder)
Encode a AWS_CBOR_TYPE_INDEF_BYTES_START
Notes: no error checking, it's user's responsibility to add corresponding data and the break to close the indef_start
Prototype
void aws_cbor_encoder_write_indef_bytes_start(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_write_indef_map_start
— Methodaws_cbor_encoder_write_indef_map_start(encoder)
Encode a AWS_CBOR_TYPE_INDEF_MAP_START
Notes: no error checking, it's user's responsibility to add corresponding data and the break to close the indef_start
Prototype
void aws_cbor_encoder_write_indef_map_start(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_write_indef_text_start
— Methodaws_cbor_encoder_write_indef_text_start(encoder)
Encode a AWS_CBOR_TYPE_INDEF_TEXT_START
Notes: no error checking, it's user's responsibility to add corresponding data and the break to close the indef_start
Prototype
void aws_cbor_encoder_write_indef_text_start(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_write_map_start
— Methodaws_cbor_encoder_write_map_start(encoder, number_entries)
Encode a AWS_CBOR_TYPE_MAP_START value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1 The "number_entries" is the number of pair of cbor data items as key and value should be followed as the content of the map.
Notes: it's user's responsibility to keep the integrity of the map to be encoded.
Arguments
encoder
:number_entries
: The number of data item in map.
Prototype
void aws_cbor_encoder_write_map_start(struct aws_cbor_encoder *encoder, size_t number_entries);
LibAwsCommon.aws_cbor_encoder_write_negint
— Methodaws_cbor_encoder_write_negint(encoder, value)
Encode a AWS_CBOR_TYPE_NEGINT value to "smallest possible" in encoder's buffer. It represents (-1 - value). Referring to RFC8949 section 4.2.1
Arguments
encoder
:value
: The argument to encode to negative integer, which is (-1 - expected_val)
Prototype
void aws_cbor_encoder_write_negint(struct aws_cbor_encoder *encoder, uint64_t value);
LibAwsCommon.aws_cbor_encoder_write_null
— Methodaws_cbor_encoder_write_null(encoder)
Encode a simple value AWS_CBOR_TYPE_NULL
Arguments
encoder
:
Prototype
void aws_cbor_encoder_write_null(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_encoder_write_tag
— Methodaws_cbor_encoder_write_tag(encoder, tag_number)
Encode a AWS_CBOR_TYPE_TAG value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1 The following cbor data item will be the content of the tagged value. Notes: it's user's responsibility to keep the integrity of the tagged value to follow the RFC8949 section 3.4
Arguments
encoder
:tag_number
: The tag value to encode.
Prototype
void aws_cbor_encoder_write_tag(struct aws_cbor_encoder *encoder, uint64_t tag_number);
LibAwsCommon.aws_cbor_encoder_write_text
— Methodaws_cbor_encoder_write_text(encoder, from)
Encode a AWS_CBOR_TYPE_TEXT value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1, the length of "from" will be encoded first and then the value of "from" will be followed.
Arguments
encoder
:from
: value to encode.
Prototype
void aws_cbor_encoder_write_text(struct aws_cbor_encoder *encoder, struct aws_byte_cursor from);
LibAwsCommon.aws_cbor_encoder_write_uint
— Methodaws_cbor_encoder_write_uint(encoder, value)
Encode a AWS_CBOR_TYPE_UINT value to "smallest possible" in encoder's buffer. Referring to RFC8949 section 4.2.1
TODO: maybe add a width of the encoded value.
Arguments
encoder
:value
: value to encode.
Prototype
void aws_cbor_encoder_write_uint(struct aws_cbor_encoder *encoder, uint64_t value);
LibAwsCommon.aws_cbor_encoder_write_undefined
— Methodaws_cbor_encoder_write_undefined(encoder)
Encode a simple value AWS_CBOR_TYPE_UNDEFINED
Arguments
encoder
:
Prototype
void aws_cbor_encoder_write_undefined(struct aws_cbor_encoder *encoder);
LibAwsCommon.aws_cbor_type_cstr
— Methodaws_cbor_type_cstr(type)
Return c-string for aws_cbor_type
Prototype
const char *aws_cbor_type_cstr(enum aws_cbor_type type);
LibAwsCommon.aws_char_is_space
— Methodaws_char_is_space(c)
Evaluates if a char is a white character.
Prototype
AWS_STATIC_IMPL bool aws_char_is_space(uint8_t c);
LibAwsCommon.aws_cli_dispatch_on_subcommand
— Methodaws_cli_dispatch_on_subcommand(argc, argv, dispatch_table, table_length, user_data)
Dispatches the current command line arguments with a subcommand from the second input argument in argv[], if dispatch table contains a command that matches the argument. When the command is dispatched, argc and argv will be updated to reflect the new argument count. The cli options are required to come after the subcommand. If either, no dispatch was found or there was no argument passed to the program, this function will return AWS_OP_ERR
. Check aws_last_error
() for details on the error.
Arguments
argc
: number of arguments passed to int main()argv
: the arguments passed to int main()parse_cb,
: optional, specify NULL if you don't want to handle this. This argument is for parsing "meta" commands from the command line options prior to dispatch occurring.dispatch_table
: table containing functions and command name to dispatch on.table_length
: number of entries in dispatch_table.
Returns
AWS_OP_SUCCESS
(0) on success, AWS_OP_ERR
(-1) on failure
Prototype
int aws_cli_dispatch_on_subcommand( int argc, char *const argv[], struct aws_cli_subcommand_dispatch *dispatch_table, int table_length, void *user_data);
LibAwsCommon.aws_cli_getopt_long
— Methodaws_cli_getopt_long(argc, argv, optstring, longopts, longindex)
A mostly compliant implementation of posix getopt_long(). Parses command-line arguments. argc is the number of command line arguments passed in argv. optstring contains the legitimate option characters. The option characters correspond to aws_cli_option
::val. If the character is followed by a :, the option requires an argument. If it is followed by '::', the argument is optional (not implemented yet).
longopts, is an array of struct aws_cli_option
. These are the allowed options for the program. The last member of the array must be zero initialized.
If longindex is non-null, it will be set to the index in longopts, for the found option.
Returns option val if it was found, '?' if an option was encountered that was not specified in the option string, 0x02 (START_OF_TEXT) will be returned if a positional argument was encountered. returns -1 when all arguments that can be parsed have been parsed.
Prototype
int aws_cli_getopt_long( int argc, char *const argv[], const char *optstring, const struct aws_cli_option *longopts, int *longindex);
LibAwsCommon.aws_cli_reset_state
— Methodaws_cli_reset_state()
Resets global parser state for use in another parser run for the application.
Prototype
void aws_cli_reset_state(void);
LibAwsCommon.aws_clz_i32
— Methodaws_clz_i32(n)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_clz_i32(int32_t n);
LibAwsCommon.aws_clz_i64
— Methodaws_clz_i64(n)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_clz_i64(int64_t n);
LibAwsCommon.aws_clz_size
— Methodaws_clz_size(n)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_clz_size(size_t n);
LibAwsCommon.aws_clz_u32
— Methodaws_clz_u32(n)
Search from the MSB to LSB, looking for a 1
Prototype
AWS_STATIC_IMPL size_t aws_clz_u32(uint32_t n);
LibAwsCommon.aws_clz_u64
— Methodaws_clz_u64(n)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_clz_u64(uint64_t n);
LibAwsCommon.aws_common_fatal_assert_library_initialized
— Methodaws_common_fatal_assert_library_initialized()
Documentation not found.
Prototype
void aws_common_fatal_assert_library_initialized(void);
LibAwsCommon.aws_common_library_clean_up
— Methodaws_common_library_clean_up()
Shuts down the internal data structures used by aws-c-common.
Prototype
void aws_common_library_clean_up(void);
LibAwsCommon.aws_common_library_init
— Methodaws_common_library_init(allocator)
Initializes internal data structures used by aws-c-common. Must be called before using any functionality in aws-c-common.
Prototype
void aws_common_library_init(struct aws_allocator *allocator);
LibAwsCommon.aws_condition_variable_clean_up
— Methodaws_condition_variable_clean_up(condition_variable)
Cleans up a condition variable.
Prototype
void aws_condition_variable_clean_up(struct aws_condition_variable *condition_variable);
LibAwsCommon.aws_condition_variable_init
— Methodaws_condition_variable_init(condition_variable)
Initializes a condition variable.
Prototype
int aws_condition_variable_init(struct aws_condition_variable *condition_variable);
LibAwsCommon.aws_condition_variable_notify_all
— Methodaws_condition_variable_notify_all(condition_variable)
Notifies/Wakes all waiting threads.
Prototype
int aws_condition_variable_notify_all(struct aws_condition_variable *condition_variable);
LibAwsCommon.aws_condition_variable_notify_one
— Methodaws_condition_variable_notify_one(condition_variable)
Notifies/Wakes one waiting thread
Prototype
int aws_condition_variable_notify_one(struct aws_condition_variable *condition_variable);
LibAwsCommon.aws_condition_variable_wait
— Methodaws_condition_variable_wait(condition_variable, mutex)
Waits the calling thread on a notification from another thread.
Prototype
int aws_condition_variable_wait(struct aws_condition_variable *condition_variable, struct aws_mutex *mutex);
LibAwsCommon.aws_condition_variable_wait_for
— Methodaws_condition_variable_wait_for(condition_variable, mutex, time_to_wait)
Waits the calling thread on a notification from another thread. Times out after time_to_wait. time_to_wait is in nanoseconds.
Prototype
int aws_condition_variable_wait_for( struct aws_condition_variable *condition_variable, struct aws_mutex *mutex, int64_t time_to_wait);
LibAwsCommon.aws_condition_variable_wait_for_pred
— Methodaws_condition_variable_wait_for_pred(condition_variable, mutex, time_to_wait, pred, pred_ctx)
Waits the calling thread on a notification from another thread. Times out after time_to_wait. time_to_wait is in nanoseconds. If predicate returns false, the wait is reentered, otherwise control returns to the caller.
Prototype
int aws_condition_variable_wait_for_pred( struct aws_condition_variable *condition_variable, struct aws_mutex *mutex, int64_t time_to_wait, aws_condition_predicate_fn *pred, void *pred_ctx);
LibAwsCommon.aws_condition_variable_wait_pred
— Methodaws_condition_variable_wait_pred(condition_variable, mutex, pred, pred_ctx)
Waits the calling thread on a notification from another thread. If predicate returns false, the wait is reentered, otherwise control returns to the caller.
Prototype
int aws_condition_variable_wait_pred( struct aws_condition_variable *condition_variable, struct aws_mutex *mutex, aws_condition_predicate_fn *pred, void *pred_ctx);
LibAwsCommon.aws_cpu_has_feature
— Methodaws_cpu_has_feature(feature_name)
Returns true if a cpu feature is supported, false otherwise.
Prototype
bool aws_cpu_has_feature(enum aws_cpu_feature_name feature_name);
LibAwsCommon.aws_cross_process_lock_release
— Methodaws_cross_process_lock_release(instance_lock)
Releases the lock so the next caller (may be another process) can get an instance of the lock.
Prototype
void aws_cross_process_lock_release(struct aws_cross_process_lock *instance_lock);
LibAwsCommon.aws_cross_process_lock_try_acquire
— Methodaws_cross_process_lock_try_acquire(allocator, instance_nonce)
Attempts to acquire a system-wide (not per process or per user) lock scoped by instance_nonce. For any given unique nonce, a lock will be returned by the first caller. Subsequent calls will return NULL and raise AWS_ERROR_MUTEX_CALLER_NOT_OWNER until the either the process owning the lock exits or the program owning the lock calls aws_cross_process_lock_release
() explicitly.
If the process exits before the lock is released, the kernel will unlock it for the next consumer.
Prototype
struct aws_cross_process_lock *aws_cross_process_lock_try_acquire( struct aws_allocator *allocator, struct aws_byte_cursor instance_nonce);
LibAwsCommon.aws_crt_statistics_handler_destroy
— Methodaws_crt_statistics_handler_destroy(handler)
completely destroys a statistics handler. The handler's cleanup function must clean up the impl portion completely (including its allocation, if done separately).
Prototype
void aws_crt_statistics_handler_destroy(struct aws_crt_statistics_handler *handler);
LibAwsCommon.aws_crt_statistics_handler_get_report_interval_ms
— Methodaws_crt_statistics_handler_get_report_interval_ms(handler)
Queries the frequency (via an interval in milliseconds) which a statistics handler would like to be informed of statistics.
Prototype
uint64_t aws_crt_statistics_handler_get_report_interval_ms(struct aws_crt_statistics_handler *handler);
LibAwsCommon.aws_crt_statistics_handler_process_statistics
— Methodaws_crt_statistics_handler_process_statistics(handler, interval, stats, context)
Submits a list of statistics objects to a statistics handler for processing
handler - the statistics handler that will process the statistics objects interval - time period over which the statistics were gathered stats - list of pointers to structures that can be case to aws_crt_statistics_base
(i.e. have category as a first member) context - (optional) additional context specific to where the statistics handler has been attached
Prototype
void aws_crt_statistics_handler_process_statistics( struct aws_crt_statistics_handler *handler, struct aws_crt_statistics_sample_interval *interval, struct aws_array_list *stats, void *context);
LibAwsCommon.aws_ctz_i32
— Methodaws_ctz_i32(n)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_ctz_i32(int32_t n);
LibAwsCommon.aws_ctz_i64
— Methodaws_ctz_i64(n)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_ctz_i64(int64_t n);
LibAwsCommon.aws_ctz_size
— Methodaws_ctz_size(n)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_ctz_size(size_t n);
LibAwsCommon.aws_ctz_u32
— Methodaws_ctz_u32(n)
Search from the LSB to MSB, looking for a 1
Prototype
AWS_STATIC_IMPL size_t aws_ctz_u32(uint32_t n);
LibAwsCommon.aws_ctz_u64
— Methodaws_ctz_u64(n)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_ctz_u64(uint64_t n);
LibAwsCommon.aws_date_time_as_epoch_secs
— Methodaws_date_time_as_epoch_secs(dt)
Documentation not found.
Prototype
double aws_date_time_as_epoch_secs(const struct aws_date_time *dt);
LibAwsCommon.aws_date_time_as_millis
— Methodaws_date_time_as_millis(dt)
Documentation not found.
Prototype
uint64_t aws_date_time_as_millis(const struct aws_date_time *dt);
LibAwsCommon.aws_date_time_as_nanos
— Methodaws_date_time_as_nanos(dt)
Documentation not found.
Prototype
uint64_t aws_date_time_as_nanos(const struct aws_date_time *dt);
LibAwsCommon.aws_date_time_day_of_week
— Methodaws_date_time_day_of_week(dt, local_time)
Documentation not found.
Prototype
enum aws_date_day_of_week aws_date_time_day_of_week(const struct aws_date_time *dt, bool local_time);
LibAwsCommon.aws_date_time_diff
— Methodaws_date_time_diff(a, b)
returns the difference of a and b (a - b) in seconds.
Prototype
time_t aws_date_time_diff(const struct aws_date_time *a, const struct aws_date_time *b);
LibAwsCommon.aws_date_time_dst
— Methodaws_date_time_dst(dt, local_time)
Documentation not found.
Prototype
bool aws_date_time_dst(const struct aws_date_time *dt, bool local_time);
LibAwsCommon.aws_date_time_hour
— Methodaws_date_time_hour(dt, local_time)
Documentation not found.
Prototype
uint8_t aws_date_time_hour(const struct aws_date_time *dt, bool local_time);
LibAwsCommon.aws_date_time_init_epoch_millis
— Methodaws_date_time_init_epoch_millis(dt, ms_since_epoch)
Initializes dt to be the time represented in milliseconds since unix epoch.
Prototype
void aws_date_time_init_epoch_millis(struct aws_date_time *dt, uint64_t ms_since_epoch);
LibAwsCommon.aws_date_time_init_epoch_secs
— Methodaws_date_time_init_epoch_secs(dt, sec_ms)
Initializes dt to be the time represented in seconds.millis since unix epoch.
Prototype
void aws_date_time_init_epoch_secs(struct aws_date_time *dt, double sec_ms);
LibAwsCommon.aws_date_time_init_from_str
— Methodaws_date_time_init_from_str(dt, date_str, fmt)
Initializes dt to be the time represented by date_str in format 'fmt'. Returns AWS_OP_SUCCESS
if the string was successfully parsed, returns AWS_OP_ERR
if parsing failed.
The parser is lenient regarding AWS_DATE_FORMAT_ISO_8601 vs AWS_DATE_FORMAT_ISO_8601_BASIC. Regardless of which you pass in, both "2002-10-02T08:05:09Z" and "20021002T080509Z" would be accepted.
Notes for AWS_DATE_FORMAT_RFC822: If no time zone information is provided, it is assumed to be local time (please don't do this).
Only time zones indicating Universal Time (e.g. Z, UT, UTC, or GMT), or offsets from UTC (e.g. +0100, -0700), are accepted.
Really, it's just better if you always use Universal Time.
Prototype
int aws_date_time_init_from_str( struct aws_date_time *dt, const struct aws_byte_buf *date_str, enum aws_date_format fmt);
LibAwsCommon.aws_date_time_init_from_str_cursor
— Methodaws_date_time_init_from_str_cursor(dt, date_str_cursor, fmt)
aws_date_time_init variant that takes a byte_cursor rather than a byte_buf
Prototype
int aws_date_time_init_from_str_cursor( struct aws_date_time *dt, const struct aws_byte_cursor *date_str_cursor, enum aws_date_format fmt);
LibAwsCommon.aws_date_time_init_now
— Methodaws_date_time_init_now(dt)
Initializes dt to be the current system time.
Prototype
void aws_date_time_init_now(struct aws_date_time *dt);
LibAwsCommon.aws_date_time_minute
— Methodaws_date_time_minute(dt, local_time)
Documentation not found.
Prototype
uint8_t aws_date_time_minute(const struct aws_date_time *dt, bool local_time);
LibAwsCommon.aws_date_time_month
— Methodaws_date_time_month(dt, local_time)
Documentation not found.
Prototype
enum aws_date_month aws_date_time_month(const struct aws_date_time *dt, bool local_time);
LibAwsCommon.aws_date_time_month_day
— Methodaws_date_time_month_day(dt, local_time)
Documentation not found.
Prototype
uint8_t aws_date_time_month_day(const struct aws_date_time *dt, bool local_time);
LibAwsCommon.aws_date_time_second
— Methodaws_date_time_second(dt, local_time)
Documentation not found.
Prototype
uint8_t aws_date_time_second(const struct aws_date_time *dt, bool local_time);
LibAwsCommon.aws_date_time_to_local_time_short_str
— Methodaws_date_time_to_local_time_short_str(dt, fmt, output_buf)
Copies the current time as a formatted short date string in local time into output_buf. If buffer is too small, it will return AWS_OP_ERR
. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not allowed.
Prototype
int aws_date_time_to_local_time_short_str( const struct aws_date_time *dt, enum aws_date_format fmt, struct aws_byte_buf *output_buf);
LibAwsCommon.aws_date_time_to_local_time_str
— Methodaws_date_time_to_local_time_str(dt, fmt, output_buf)
Copies the current time as a formatted date string in local time into output_buf. If buffer is too small, it will return AWS_OP_ERR
. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not allowed.
Prototype
int aws_date_time_to_local_time_str( const struct aws_date_time *dt, enum aws_date_format fmt, struct aws_byte_buf *output_buf);
LibAwsCommon.aws_date_time_to_utc_time_short_str
— Methodaws_date_time_to_utc_time_short_str(dt, fmt, output_buf)
Copies the current time as a formatted short date string in utc time into output_buf. If buffer is too small, it will return AWS_OP_ERR
. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not allowed.
Prototype
int aws_date_time_to_utc_time_short_str( const struct aws_date_time *dt, enum aws_date_format fmt, struct aws_byte_buf *output_buf);
LibAwsCommon.aws_date_time_to_utc_time_str
— Methodaws_date_time_to_utc_time_str(dt, fmt, output_buf)
Copies the current time as a formatted date string in utc time into output_buf. If buffer is too small, it will return AWS_OP_ERR
. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not allowed.
Prototype
int aws_date_time_to_utc_time_str( const struct aws_date_time *dt, enum aws_date_format fmt, struct aws_byte_buf *output_buf);
LibAwsCommon.aws_date_time_year
— Methodaws_date_time_year(dt, local_time)
Documentation not found.
Prototype
uint16_t aws_date_time_year(const struct aws_date_time *dt, bool local_time);
LibAwsCommon.aws_debug_break
— Methodaws_debug_break()
If a debugger is attached to the process, trip a breakpoint.
Prototype
void aws_debug_break(void);
LibAwsCommon.aws_decode_utf8
— Methodaws_decode_utf8(bytes, options)
Decode a complete string of UTF8/ASCII text. Text is always validated according to RFC-3629 (you may perform additional validation in the on_codepoint callback). The text does not need to begin with a UTF8 BOM. If you need to decode text incrementally as you receive it, use aws_utf8_decoder_new
() instead.
Arguments
bytes
: Text to decode.options
: Options for decoding. If NULL is passed, the text is simply validated.
Returns
AWS_OP_SUCCESS
if successful. An error is raised if the text is not valid, or the on_codepoint callback raises an error.
Prototype
int aws_decode_utf8(struct aws_byte_cursor bytes, const struct aws_utf8_decoder_options *options);
LibAwsCommon.aws_default_allocator
— Methodaws_default_allocator()
Documentation not found.
Prototype
struct aws_allocator *aws_default_allocator(void);
LibAwsCommon.aws_default_thread_options
— Methodaws_default_thread_options()
Returns an instance of system default thread options.
Prototype
const struct aws_thread_options *aws_default_thread_options(void);
LibAwsCommon.aws_device_random_buffer
— Methodaws_device_random_buffer(output)
Fill the rest of a buffer with unpredictably random bytes, suitable for cryptographic use.
Prototype
int aws_device_random_buffer(struct aws_byte_buf *output);
LibAwsCommon.aws_device_random_buffer_append
— Methodaws_device_random_buffer_append(output, n)
Write N unpredictably random bytes to a buffer, suitable for cryptographic use. If there is insufficient space in the buffer, AWS_ERROR_SHORT_BUFFER is raised and the buffer will be unchanged.
Prototype
int aws_device_random_buffer_append(struct aws_byte_buf *output, size_t n);
LibAwsCommon.aws_device_random_u16
— Methodaws_device_random_u16(output)
Get an unpredictably random 16bit number, suitable for cryptographic use.
Prototype
int aws_device_random_u16(uint16_t *output);
LibAwsCommon.aws_device_random_u32
— Methodaws_device_random_u32(output)
Get an unpredictably random 32bit number, suitable for cryptographic use.
Prototype
int aws_device_random_u32(uint32_t *output);
LibAwsCommon.aws_device_random_u64
— Methodaws_device_random_u64(output)
Get an unpredictably random 64bit number, suitable for cryptographic use.
Prototype
int aws_device_random_u64(uint64_t *output);
LibAwsCommon.aws_device_random_u8
— Methodaws_device_random_u8(output)
Get an unpredictably random 8bit number, suitable for cryptographic use.
Prototype
int aws_device_random_u8(uint8_t *output);
LibAwsCommon.aws_directory_create
— Methodaws_directory_create(dir_path)
Creates a directory if it doesn't currently exist. If the directory already exists, it's ignored and assumed successful.
Returns AWS_OP_SUCCESS
on success. Otherwise, check aws_last_error
().
Prototype
int aws_directory_create(const struct aws_string *dir_path);
LibAwsCommon.aws_directory_delete
— Methodaws_directory_delete(dir_path, recursive)
Deletes a directory. If the directory is not empty, this will fail unless the recursive parameter is set to true. If recursive is true then the entire directory and all of its contents will be deleted. If it is set to false, the directory will be deleted only if it is empty. Returns AWS_OP_SUCCESS
if the operation was successful. Otherwise, aws_last_error
() will contain the error that occurred. If the directory doesn't exist, AWS_OP_SUCCESS
is still returned.
Prototype
int aws_directory_delete(const struct aws_string *dir_path, bool recursive);
LibAwsCommon.aws_directory_entry_iterator_destroy
— Methodaws_directory_entry_iterator_destroy(iterator)
Cleanup and deallocate iterator
Prototype
void aws_directory_entry_iterator_destroy(struct aws_directory_iterator *iterator);
LibAwsCommon.aws_directory_entry_iterator_get_value
— Methodaws_directory_entry_iterator_get_value(iterator)
Gets the aws_directory_entry
value for iterator at the current position. Returns NULL if the iterator contains no entries.
Prototype
const struct aws_directory_entry *aws_directory_entry_iterator_get_value( const struct aws_directory_iterator *iterator);
LibAwsCommon.aws_directory_entry_iterator_new
— Methodaws_directory_entry_iterator_new(allocator, path)
Creates a read-only iterator of a directory starting at path. If path is invalid or there's any other error condition, NULL will be returned. Call aws_last_error
() for the exact error in that case.
Prototype
struct aws_directory_iterator *aws_directory_entry_iterator_new( struct aws_allocator *allocator, const struct aws_string *path);
LibAwsCommon.aws_directory_entry_iterator_next
— Methodaws_directory_entry_iterator_next(iterator)
Moves the iterator to the next entry. Returns AWS_OP_SUCCESS
if another entry is available, or AWS_OP_ERR
with AWS_ERROR_LIST_EMPTY as the value for aws_last_error
() if no more entries are available.
Prototype
int aws_directory_entry_iterator_next(struct aws_directory_iterator *iterator);
LibAwsCommon.aws_directory_entry_iterator_previous
— Methodaws_directory_entry_iterator_previous(iterator)
Moves the iterator to the previous entry. Returns AWS_OP_SUCCESS
if another entry is available, or AWS_OP_ERR
with AWS_ERROR_LIST_EMPTY as the value for aws_last_error
() if no more entries are available.
Prototype
int aws_directory_entry_iterator_previous(struct aws_directory_iterator *iterator);
LibAwsCommon.aws_directory_exists
— Methodaws_directory_exists(dir_path)
Returns true if the directory currently exists. Otherwise, it returns false.
Prototype
bool aws_directory_exists(const struct aws_string *dir_path);
LibAwsCommon.aws_directory_or_file_move
— Methodaws_directory_or_file_move(from, to)
Moves directory at from to to. Returns AWS_OP_SUCCESS
if the operation was successful. Otherwise, aws_last_error
() will contain the error that occurred.
Prototype
int aws_directory_or_file_move(const struct aws_string *from, const struct aws_string *to);
LibAwsCommon.aws_directory_traverse
— Methodaws_directory_traverse(allocator, path, recursive, on_entry, user_data)
Traverse a directory starting at path.
If you want the traversal to recurse the entire directory, pass recursive as true. Passing false for this parameter will only iterate the contents of the directory, but will not descend into any directories it encounters.
If recursive is set to true, the traversal is performed post-order, depth-first (for practical reasons such as deleting a directory that contains subdirectories or files).
returns AWS_OP_SUCCESS
(0) on success.
Prototype
int aws_directory_traverse( struct aws_allocator *allocator, const struct aws_string *path, bool recursive, aws_on_directory_entry *on_entry, void *user_data);
LibAwsCommon.aws_error_debug_str
— Methodaws_error_debug_str(err)
Returns libname concatenated with error string.
Prototype
const char *aws_error_debug_str(int err);
LibAwsCommon.aws_error_lib_name
— Methodaws_error_lib_name(err)
Returns the error lib name corresponding to err
.
Prototype
const char *aws_error_lib_name(int err);
LibAwsCommon.aws_error_name
— Methodaws_error_name(err)
Returns the enum name corresponding to err
.
Prototype
const char *aws_error_name(int err);
LibAwsCommon.aws_error_str
— Methodaws_error_str(err)
Returns the error str corresponding to err
.
Prototype
const char *aws_error_str(int err);
LibAwsCommon.aws_fatal_assert
— Methodaws_fatal_assert(cond_str, file, line)
Documentation not found.
Prototype
void aws_fatal_assert(const char *cond_str, const char *file, int line) AWS_ATTRIBUTE_NORETURN;
LibAwsCommon.aws_file_delete
— Methodaws_file_delete(file_path)
Deletes a file. Returns AWS_OP_SUCCESS
if the operation was successful. Otherwise, aws_last_error
() will contain the error that occurred. If the file doesn't exist, AWS_OP_SUCCESS
is still returned.
Prototype
int aws_file_delete(const struct aws_string *file_path);
LibAwsCommon.aws_file_get_length
— Methodaws_file_get_length(file, length)
Wrapper for os-specific file length query. We can't use fseek(END, 0) because support for it is not technically required.
Unix flavors call fstat, while Windows variants use GetFileSize on a HANDLE queried from the libc FILE pointer.
Prototype
int aws_file_get_length(FILE *file, int64_t *length);
LibAwsCommon.aws_fopen
— Methodaws_fopen(file_path, mode)
Deprecated - Use aws_fopen_safe
() instead, avoid const char * in public APIs. Opens file at file_path using mode. Returns the FILE pointer if successful. Otherwise, aws_last_error
() will contain the error that occurred
Prototype
FILE *aws_fopen(const char *file_path, const char *mode);
LibAwsCommon.aws_fopen_safe
— Methodaws_fopen_safe(file_path, mode)
Opens file at file_path using mode. Returns the FILE pointer if successful. Otherwise, aws_last_error
() will contain the error that occurred
Prototype
FILE *aws_fopen_safe(const struct aws_string *file_path, const struct aws_string *mode);
LibAwsCommon.aws_fseek
— Methodaws_fseek(file, offset, whence)
Wrapper for highest-resolution platform-dependent seek implementation. Maps to:
_fseeki64() on windows fseeko() on linux
whence can either be SEEK_SET or SEEK_END
Returns AWS_OP_SUCCESS
, or AWS_OP_ERR
(after an error has been raised).
Prototype
int aws_fseek(FILE *file, int64_t offset, int whence);
LibAwsCommon.aws_get_cpu_count_for_group
— Methodaws_get_cpu_count_for_group(group_idx)
For a group, returns the number of CPUs it contains.
Prototype
size_t aws_get_cpu_count_for_group(uint16_t group_idx);
LibAwsCommon.aws_get_cpu_group_count
— Methodaws_get_cpu_group_count()
Returns the logical processor groupings on the system (such as multiple numa nodes).
Prototype
uint16_t aws_get_cpu_group_count(void);
LibAwsCommon.aws_get_cpu_ids_for_group
— Methodaws_get_cpu_ids_for_group(group_idx, cpu_ids_array, cpu_ids_array_length)
Fills in cpu_ids_array with the cpu_id's for the group. To obtain the size to allocate for cpu_ids_array and the value for argument for cpu_ids_array_length, call aws_get_cpu_count_for_group
().
Prototype
void aws_get_cpu_ids_for_group(uint16_t group_idx, struct aws_cpu_info *cpu_ids_array, size_t cpu_ids_array_length);
LibAwsCommon.aws_get_environment_value
— Methodaws_get_environment_value(allocator, variable_name, value_out)
Get the value of an environment variable. If the variable is not set, the output string will be set to NULL. Not thread-safe
Prototype
int aws_get_environment_value( struct aws_allocator *allocator, const struct aws_string *variable_name, struct aws_string **value_out);
LibAwsCommon.aws_get_hard_limit_io_handles
— Methodaws_get_hard_limit_io_handles()
Returns the hard limit for max io handles (max fds in unix terminology). This limit is one more than the actual limit. This limit cannot be increased without sudo permissions.
Prototype
size_t aws_get_hard_limit_io_handles(void);
LibAwsCommon.aws_get_home_directory
— Methodaws_get_home_directory(allocator)
Returns the current user's home directory.
Prototype
struct aws_string *aws_get_home_directory(struct aws_allocator *allocator);
LibAwsCommon.aws_get_pid
— Methodaws_get_pid()
Returns the current process's PID (process id).
Returns
PID as int
Prototype
int aws_get_pid(void);
LibAwsCommon.aws_get_platform_build_os
— Methodaws_get_platform_build_os()
Returns the OS this was built under
Prototype
enum aws_platform_os aws_get_platform_build_os(void);
LibAwsCommon.aws_get_platform_directory_separator
— Methodaws_get_platform_directory_separator()
Returns the directory separator used by the local platform
Prototype
char aws_get_platform_directory_separator(void);
LibAwsCommon.aws_get_soft_limit_io_handles
— Methodaws_get_soft_limit_io_handles()
Returns the soft limit for max io handles (max fds in unix terminology). This limit is one more than the actual limit. The soft limit can be changed up to the hard limit by any process regardless of permissions.
Prototype
size_t aws_get_soft_limit_io_handles(void);
LibAwsCommon.aws_gmtime
— Methodaws_gmtime(time, t)
Cross platform friendly version of gmtime_r
Prototype
void aws_gmtime(time_t time, struct tm *t);
LibAwsCommon.aws_hash_array_ignore_case
— Methodaws_hash_array_ignore_case(array, len)
Case-insensitive hash function for array containing ASCII or UTF-8 text.
Prototype
uint64_t aws_hash_array_ignore_case(const void *array, const size_t len);
LibAwsCommon.aws_hash_byte_cursor_ptr
— Methodaws_hash_byte_cursor_ptr(item)
Convenience hash function for struct aws_byte_cursor
. Hash is same as used on the string bytes by aws_hash_c_string
.
Prototype
uint64_t aws_hash_byte_cursor_ptr(const void *item);
LibAwsCommon.aws_hash_byte_cursor_ptr_ignore_case
— Methodaws_hash_byte_cursor_ptr_ignore_case(item)
Case-insensitive hash function for aws_byte_cursors stored in an aws_hash_table
. For case-sensitive hashing, use aws_hash_byte_cursor_ptr
().
Prototype
uint64_t aws_hash_byte_cursor_ptr_ignore_case(const void *item);
LibAwsCommon.aws_hash_c_string
— Methodaws_hash_c_string(item)
Convenience hash function for NULL-terminated C-strings
Prototype
uint64_t aws_hash_c_string(const void *item);
LibAwsCommon.aws_hash_callback_c_str_eq
— Methodaws_hash_callback_c_str_eq(a, b)
Convenience eq callback for NULL-terminated C-strings
Prototype
bool aws_hash_callback_c_str_eq(const void *a, const void *b);
LibAwsCommon.aws_hash_callback_string_destroy
— Methodaws_hash_callback_string_destroy(a)
Convenience destroy callback for AWS strings
Prototype
void aws_hash_callback_string_destroy(void *a);
LibAwsCommon.aws_hash_callback_string_eq
— Methodaws_hash_callback_string_eq(a, b)
Convenience eq callback for AWS strings
Prototype
bool aws_hash_callback_string_eq(const void *a, const void *b);
LibAwsCommon.aws_hash_combine
— Methodaws_hash_combine(item1, item2)
Documentation not found.
Prototype
uint64_t aws_hash_combine(uint64_t item1, uint64_t item2);
LibAwsCommon.aws_hash_compare_uint64_t_eq
— Methodaws_hash_compare_uint64_t_eq(a, b)
Helper function to compare hash keys that are uint64_t values.
Prototype
bool aws_hash_compare_uint64_t_eq(const void *a, const void *b);
LibAwsCommon.aws_hash_iter_begin
— Methodaws_hash_iter_begin(map)
Returns an iterator to be used for iterating through a hash table. Iterator will already point to the first element of the table it finds, which can be accessed as iter.element.
This function cannot fail, but if there are no elements in the table, the returned iterator will return true for aws_hash_iter_done
(&iter).
Prototype
struct aws_hash_iter aws_hash_iter_begin(const struct aws_hash_table *map);
LibAwsCommon.aws_hash_iter_delete
— Methodaws_hash_iter_delete(iter, destroy_contents)
Deletes the element currently pointed-to by the hash iterator. After calling this method, the element member of the iterator should not be accessed until the next call to aws_hash_iter_next
.
Arguments
destroy_contents
: If true, the destructors for the key and value will be called.
Prototype
void aws_hash_iter_delete(struct aws_hash_iter *iter, bool destroy_contents);
LibAwsCommon.aws_hash_iter_done
— Methodaws_hash_iter_done(iter)
Returns true if iterator is done iterating through table, false otherwise. If this is true, the iterator will not include an element of the table.
Prototype
bool aws_hash_iter_done(const struct aws_hash_iter *iter);
LibAwsCommon.aws_hash_iter_is_valid
— Methodaws_hash_iter_is_valid(iter)
Given a pointer to a hash_iter, checks that it is well-formed, with all data-structure invariants.
Prototype
bool aws_hash_iter_is_valid(const struct aws_hash_iter *iter);
LibAwsCommon.aws_hash_iter_next
— Methodaws_hash_iter_next(iter)
Updates iterator so that it points to next element of hash table.
This and the two previous functions are designed to be used together with the following idiom:
for (struct aws_hash_iter iter = aws_hash_iter_begin(&map); !aws_hash_iter_done(&iter); aws_hash_iter_next(&iter)) { const key\_type key = *(const key\_type *)iter.element.key; value\_type value = *(value\_type *)iter.element.value; // etc. }
Note that calling this on an iter which is "done" is idempotent: i.e. it will return another iter which is "done".
Prototype
void aws_hash_iter_next(struct aws_hash_iter *iter);
LibAwsCommon.aws_hash_ptr
— Methodaws_hash_ptr(item)
Convenience hash function which hashes the pointer value directly, without dereferencing. This can be used in cases where pointer identity is desired, or where a uintptr_t is encoded into a const void *.
Prototype
uint64_t aws_hash_ptr(const void *item);
LibAwsCommon.aws_hash_string
— Methodaws_hash_string(item)
Convenience hash function for struct aws_strings. Hash is same as used on the string bytes by aws_hash_c_string
.
Prototype
uint64_t aws_hash_string(const void *item);
LibAwsCommon.aws_hash_table_clean_up
— Methodaws_hash_table_clean_up(map)
Deletes every element from map and frees all associated memory. destroy_fn will be called for each element. aws_hash_table_init
must be called before reusing the hash table.
This method is idempotent.
Prototype
void aws_hash_table_clean_up(struct aws_hash_table *map);
LibAwsCommon.aws_hash_table_clear
— Methodaws_hash_table_clear(map)
Removes every element from the hash map. destroy_fn will be called for each element.
Prototype
void aws_hash_table_clear(struct aws_hash_table *map);
LibAwsCommon.aws_hash_table_create
— Methodaws_hash_table_create(map, key, p_elem, was_created)
Attempts to locate an element at key. If no such element was found, creates a new element, with value initialized to NULL. In either case, a pointer to the element is placed in *p_elem.
If was_created is non-NULL, *was_created is set to 0 if an existing element was found, or 1 is a new element was created.
Returns AWS_OP_SUCCESS
if an item was found or created. Raises AWS_ERROR_OOM if hash table expansion was required and memory allocation failed.
Prototype
int aws_hash_table_create( struct aws_hash_table *map, const void *key, struct aws_hash_element **p_elem, int *was_created);
LibAwsCommon.aws_hash_table_eq
— Methodaws_hash_table_eq(a, b, value_eq)
Compares two hash tables for equality. Both hash tables must have equivalent key comparators; values will be compared using the comparator passed into this function. The key hash function does not need to be equivalent between the two hash tables.
Prototype
bool aws_hash_table_eq( const struct aws_hash_table *a, const struct aws_hash_table *b, aws_hash_callback_eq_fn *value_eq);
LibAwsCommon.aws_hash_table_find
— Methodaws_hash_table_find(map, key, p_elem)
Attempts to locate an element at key. If the element is found, a pointer to the value is placed in *p_elem; if it is not found, *pElem is set to NULL. Either way, AWS_OP_SUCCESS
is returned.
This method does not change the state of the hash table. Therefore, it is safe to call _find from multiple threads on the same hash table, provided no mutating operations happen in parallel.
Calling code may update the value in the hash table by modifying **pElem after a successful find. However, this pointer is not guaranteed to remain usable after a subsequent call to _put, _delete, _clear, or _clean_up.
Prototype
int aws_hash_table_find(const struct aws_hash_table *map, const void *key, struct aws_hash_element **p_elem);
LibAwsCommon.aws_hash_table_foreach
— Methodaws_hash_table_foreach(map, callback, context)
Iterates through every element in the map and invokes the callback on that item. Iteration is performed in an arbitrary, implementation-defined order, and is not guaranteed to be consistent across invocations.
The callback may change the value associated with the key by overwriting the value pointed-to by value. In this case, the on_element_removed callback will not be invoked, unless the callback invokes AWS_COMMON_HASH_TABLE_ITER_DELETE (in which case the on_element_removed is given the updated value).
The callback must return a bitmask of zero or more of the following values ORed together:
AWS_COMMON_HASH_TABLE_ITER_CONTINUE - Continues iteration to the next element (if not set, iteration stops) # AWS_COMMON_HASH_TABLE_ITER_DELETE - Deletes the current value and continues iteration. destroy_fn will NOT be invoked. # AWS_COMMON_HASH_TABLE_ITER_ERROR - Stop iteration with error. No action will be taken for the current value and the value before this. No rolling back. The deleted value before will NOT be back. aws_hash_table_foreach
returns AWS_OP_ERR
after stropping the iteration.
Invoking any method which may change the contents of the hashtable during iteration results in undefined behavior. However, you may safely invoke non-mutating operations during an iteration.
This operation is mutating only if AWS_COMMON_HASH_TABLE_ITER_DELETE is returned at some point during iteration. Otherwise, it is non-mutating and is safe to invoke in parallel with other non-mutating operations.
Prototype
int aws_hash_table_foreach( struct aws_hash_table *map, int (*callback)(void *context, struct aws_hash_element *p_element), void *context);
LibAwsCommon.aws_hash_table_get_entry_count
— Methodaws_hash_table_get_entry_count(map)
Returns the current number of entries in the table.
Prototype
size_t aws_hash_table_get_entry_count(const struct aws_hash_table *map);
LibAwsCommon.aws_hash_table_init
— Methodaws_hash_table_init(map, alloc, size, hash_fn, equals_fn, destroy_key_fn, destroy_value_fn)
Initializes a hash map with initial capacity for 'size' elements without resizing. Uses hash_fn to compute the hash of each element. equals_fn to compute equality of two keys. Whenever an element is removed without being returned, destroy_key_fn is run on the pointer to the key and destroy_value_fn is run on the pointer to the value. Either or both may be NULL if a callback is not desired in this case.
Prototype
int aws_hash_table_init( struct aws_hash_table *map, struct aws_allocator *alloc, size_t size, aws_hash_fn *hash_fn, aws_hash_callback_eq_fn *equals_fn, aws_hash_callback_destroy_fn *destroy_key_fn, aws_hash_callback_destroy_fn *destroy_value_fn);
LibAwsCommon.aws_hash_table_is_valid
— Methodaws_hash_table_is_valid(map)
Best-effort check of hash_table_state
data-structure invariants
Prototype
bool aws_hash_table_is_valid(const struct aws_hash_table *map);
LibAwsCommon.aws_hash_table_move
— Methodaws_hash_table_move(to, from)
Moves the hash table in 'from' to 'to'. After this move, 'from' will be identical to the state of the original 'to' hash table, and 'to' will be in the same state as if it had been passed to aws_hash_table_clean_up
(that is, it will have no memory allocated, and it will be safe to either discard it or call aws_hash_table_clean_up
again).
Note that 'to' will not be cleaned up. You should make sure that 'to' is either uninitialized or cleaned up before moving a hashtable into it.
Prototype
void aws_hash_table_move(struct aws_hash_table *AWS_RESTRICT to, struct aws_hash_table *AWS_RESTRICT from);
LibAwsCommon.aws_hash_table_put
— Methodaws_hash_table_put(map, key, value, was_created)
Inserts a new element at key, with the given value. If another element exists at that key, the old element will be overwritten; both old key and value objects will be destroyed.
If was_created is non-NULL, *was_created is set to 0 if an existing element was found, or 1 is a new element was created.
Returns AWS_OP_SUCCESS
if an item was found or created. Raises AWS_ERROR_OOM if hash table expansion was required and memory allocation failed.
Prototype
int aws_hash_table_put(struct aws_hash_table *map, const void *key, void *value, int *was_created);
LibAwsCommon.aws_hash_table_remove
— Methodaws_hash_table_remove(map, key, p_value, was_present)
Removes element at key. Always returns AWS_OP_SUCCESS
.
If pValue is non-NULL, the existing value (if any) is moved into (*value) before removing from the table, and destroy_fn is _not_ invoked. If pValue is NULL, then (if the element existed) destroy_fn will be invoked on the element being removed.
If was_present is non-NULL, it is set to 0 if the element was not present, or 1 if it was present (and is now removed).
Prototype
int aws_hash_table_remove( struct aws_hash_table *map, const void *key, struct aws_hash_element *p_value, int *was_present);
LibAwsCommon.aws_hash_table_remove_element
— Methodaws_hash_table_remove_element(map, p_value)
Removes element already known (typically by find()).
p_value should point to a valid element returned by create() or find().
NOTE: DO NOT call this method from inside of a aws_hash_table_foreach
callback, return AWS_COMMON_HASH_TABLE_ITER_DELETE instead.
Prototype
int aws_hash_table_remove_element(struct aws_hash_table *map, struct aws_hash_element *p_value);
LibAwsCommon.aws_hash_table_swap
— Methodaws_hash_table_swap(a, b)
Safely swaps two hash tables. Note that we swap the entirety of the hash table, including which allocator is associated.
Neither hash table is required to be initialized; if one or both is uninitialized, then the uninitialized state is also swapped.
Prototype
void aws_hash_table_swap(struct aws_hash_table *AWS_RESTRICT a, struct aws_hash_table *AWS_RESTRICT b);
LibAwsCommon.aws_hash_uint64_t_by_identity
— Methodaws_hash_uint64_t_by_identity(item)
Helper function to hash keys that are uint64_t values.
The function is not a strong hash function in any sense; it merely reflects the uint64 value back. Do not use this function as a hash if you need the properties of a strong hash function.
Prototype
uint64_t aws_hash_uint64_t_by_identity(const void *item);
LibAwsCommon.aws_hex_compute_decoded_len
— Methodaws_hex_compute_decoded_len(to_decode_len, decoded_len)
computes the length necessary to store the result of aws_hex_decode
(). returns -1 on failure, and 0 on success. decoded_len will be set on success.
Prototype
int aws_hex_compute_decoded_len(size_t to_decode_len, size_t *decoded_len);
LibAwsCommon.aws_hex_compute_encoded_len
— Methodaws_hex_compute_encoded_len(to_encode_len, encoded_length)
computes the length necessary to store the result of aws_hex_encode
(). returns -1 on failure, and 0 on success. encoded_length will be set on success.
Prototype
int aws_hex_compute_encoded_len(size_t to_encode_len, size_t *encoded_length);
LibAwsCommon.aws_hex_decode
— Methodaws_hex_decode(to_decode, output)
Base 16 (hex) decodes the contents of to_decode and stores the result in output. If output is NULL, output_size will be set to what the output_size should be.
Prototype
int aws_hex_decode(const struct aws_byte_cursor *AWS_RESTRICT to_decode, struct aws_byte_buf *AWS_RESTRICT output);
LibAwsCommon.aws_hex_encode
— Methodaws_hex_encode(to_encode, output)
Base 16 (hex) encodes the contents of to_encode and stores the result in output. 0 terminates the result. Assumes the buffer is empty and does not resize on insufficient capacity.
Prototype
int aws_hex_encode(const struct aws_byte_cursor *AWS_RESTRICT to_encode, struct aws_byte_buf *AWS_RESTRICT output);
LibAwsCommon.aws_hex_encode_append_dynamic
— Methodaws_hex_encode_append_dynamic(to_encode, output)
Base 16 (hex) encodes the contents of to_encode and appends the result in output. Does not 0-terminate. Grows the destination buffer dynamically if necessary.
Prototype
int aws_hex_encode_append_dynamic( const struct aws_byte_cursor *AWS_RESTRICT to_encode, struct aws_byte_buf *AWS_RESTRICT output);
LibAwsCommon.aws_high_res_clock_get_ticks
— Methodaws_high_res_clock_get_ticks(timestamp)
Get ticks in nanoseconds (usually 100 nanosecond precision) on the high resolution clock (most-likely TSC). This clock has no bearing on the actual system time. On success, timestamp will be set.
Prototype
int aws_high_res_clock_get_ticks(uint64_t *timestamp);
LibAwsCommon.aws_host_utils_is_ipv4
— Methodaws_host_utils_is_ipv4(host)
Determine whether host cursor is IPv4 string.
Prototype
bool aws_host_utils_is_ipv4(struct aws_byte_cursor host);
LibAwsCommon.aws_host_utils_is_ipv6
— Methodaws_host_utils_is_ipv6(host, is_uri_encoded)
Determine whether host cursor is IPv6 string. Supports checking for uri encoded strings and scoped literals.
Prototype
bool aws_host_utils_is_ipv6(struct aws_byte_cursor host, bool is_uri_encoded);
LibAwsCommon.aws_hton16
— Methodaws_hton16(x)
Convert 16 bit integer from host to network byte order.
Prototype
AWS_STATIC_IMPL uint16_t aws_hton16(uint16_t x);
LibAwsCommon.aws_hton32
— Methodaws_hton32(x)
Convert 32 bit integer from host to network byte order.
Prototype
AWS_STATIC_IMPL uint32_t aws_hton32(uint32_t x);
LibAwsCommon.aws_hton64
— Methodaws_hton64(x)
Convert 64 bit integer from host to network byte order.
Prototype
AWS_STATIC_IMPL uint64_t aws_hton64(uint64_t x);
LibAwsCommon.aws_htonf32
— Methodaws_htonf32(x)
Convert 32 bit float from host to network byte order.
Prototype
AWS_STATIC_IMPL float aws_htonf32(float x);
LibAwsCommon.aws_htonf64
— Methodaws_htonf64(x)
Convert 64 bit double from host to network byte order.
Prototype
AWS_STATIC_IMPL double aws_htonf64(double x);
LibAwsCommon.aws_init_memory_usage_for_current_process
— Methodaws_init_memory_usage_for_current_process(memory_usage)
Get memory usage for current process. Raises AWS_ERROR_SYS_CALL_FAILURE on failure.
Prototype
int aws_init_memory_usage_for_current_process(struct aws_memory_usage_stats *memory_usage);
LibAwsCommon.aws_is_any_directory_separator
— Methodaws_is_any_directory_separator(value)
Returns true iff the character is a directory separator on ANY supported platform.
Prototype
bool aws_is_any_directory_separator(char value);
LibAwsCommon.aws_is_big_endian
— Methodaws_is_big_endian()
Returns 1 if machine is big endian, 0 if little endian. If you compile with even -O1 optimization, this check is completely optimized out at compile time and code which calls "if (aws_is_big_endian
())" will do the right thing without branching.
Prototype
AWS_STATIC_IMPL int aws_is_big_endian(void);
LibAwsCommon.aws_is_debugger_present
— Methodaws_is_debugger_present()
Returns true if a debugger is currently attached to the process.
Prototype
bool aws_is_debugger_present(void);
LibAwsCommon.aws_is_mem_zeroed
— Methodaws_is_mem_zeroed(buf, bufsize)
Returns whether each byte is zero.
Prototype
AWS_STATIC_IMPL bool aws_is_mem_zeroed(const void *buf, size_t bufsize);
LibAwsCommon.aws_is_power_of_two
— Methodaws_is_power_of_two(x)
Function to check if x is power of 2
Prototype
AWS_STATIC_IMPL bool aws_is_power_of_two(const size_t x);
LibAwsCommon.aws_isalnum
— Methodaws_isalnum(ch)
Like isalnum(), but ignores C locale. Returns true if ch has the value of ASCII/UTF-8: 'a'-'z', 'A'-'Z', or '0'-'9'.
Prototype
bool aws_isalnum(uint8_t ch);
LibAwsCommon.aws_isalpha
— Methodaws_isalpha(ch)
Like isalpha(), but ignores C locale. Returns true if ch has the value of ASCII/UTF-8: 'a'-'z' or 'A'-'Z'.
Prototype
bool aws_isalpha(uint8_t ch);
LibAwsCommon.aws_isdigit
— Methodaws_isdigit(ch)
Like isdigit(). Returns true if ch has the value of ASCII/UTF-8: '0'-'9'.
Note: C's built-in isdigit() is also supposed to ignore the C locale, but cppreference.com claims "some implementations (e.g. Microsoft in 1252 codepage) may classify additional single-byte characters as digits"
Prototype
bool aws_isdigit(uint8_t ch);
LibAwsCommon.aws_isspace
— Methodaws_isspace(ch)
Like isspace(), but ignores C locale. Return true if ch has the value of ASCII/UTF-8: space (0x20), form feed (0x0C), line feed (0x0A), carriage return (0x0D), horizontal tab (0x09), or vertical tab (0x0B).
Prototype
bool aws_isspace(uint8_t ch);
LibAwsCommon.aws_isxdigit
— Methodaws_isxdigit(ch)
Like isxdigit(). Returns true if ch has the value of ASCII/UTF-8: '0'-'9', 'a'-'f', or 'A'-'F'.
Note: C's built-in isxdigit() is also supposed to ignore the C locale, but cppreference.com claims "some implementations (e.g. Microsoft in 1252 codepage) may classify additional single-byte characters as digits"
Prototype
bool aws_isxdigit(uint8_t ch);
LibAwsCommon.aws_json_const_iterate_array
— Methodaws_json_const_iterate_array(array, on_value, user_data)
iterates through values of an array. iteration is sequential starting with 0th element.
Arguments
array
: array to iterate over.on_value
: callback for when value is encountered.user_data
: user data to pass back in callback.
Returns
AWS_OP_SUCCESS
when iteration finishes completely or exits early, AWS_OP_ERR
if value is not an array.
Prototype
int aws_json_const_iterate_array( const struct aws_json_value *array, aws_json_on_value_encountered_const_fn *on_value, void *user_data);
LibAwsCommon.aws_json_const_iterate_object
— Methodaws_json_const_iterate_object(object, on_member, user_data)
iterates through members of the object. iteration is sequential in order fields were initially parsed.
Arguments
object
: object to iterate over.on_member
: callback for when member is encountered.user_data
: user data to pass back in callback.
Returns
AWS_OP_SUCCESS
when iteration finishes completely or exits early, AWS_OP_ERR
if value is not an object.
Prototype
int aws_json_const_iterate_object( const struct aws_json_value *object, aws_json_on_member_encountered_const_fn *on_member, void *user_data);
LibAwsCommon.aws_json_get_array_element
— Methodaws_json_get_array_element(array, index)
Returns the aws_json_value
at the given index in the array aws_json_value
.
Arguments
array
: The arrayaws_json_value
.index
: The index of theaws_json_value
you want to access.
Returns
A pointer to the aws_json_value
at the given index in the array, otherwise NULL.
Prototype
struct aws_json_value *aws_json_get_array_element(const struct aws_json_value *array, size_t index);
LibAwsCommon.aws_json_get_array_size
— Methodaws_json_get_array_size(array)
Returns the number of items in the array aws_json_value
.
Arguments
array
: The arrayaws_json_value
.
Returns
The number of items in the array_json_value.
Prototype
size_t aws_json_get_array_size(const struct aws_json_value *array);
LibAwsCommon.aws_json_value_add_array_element
— Methodaws_json_value_add_array_element(array, value)
Adds a aws_json_value
to the given array aws_json_value
.
Note that the aws_json_value
will be destroyed when the aws_json_value
array is destroyed by calling "aws_json_destroy()"
Arguments
array
: The arrayaws_json_value
you want to add anaws_json_value
to.value
: Theaws_json_value
you want to add.
Returns
AWS_OP_SUCCESS
if adding the aws_json_value
was successful. Will return AWS_OP_ERR
if the array passed is invalid.
Prototype
int aws_json_value_add_array_element(struct aws_json_value *array, const struct aws_json_value *value);
LibAwsCommon.aws_json_value_add_to_object
— Methodaws_json_value_add_to_object(object, key, value)
Adds a aws_json_value
to a object aws_json_value
.
Note that the aws_json_value
will be destroyed when the aws_json_value
object is destroyed by calling "aws_json_destroy()"
Arguments
object
: The objectaws_json_value
you want to add a value to.key
: The key to add theaws_json_value
at.value
: Theaws_json_value
you want to add.
Returns
AWS_OP_SUCCESS
if adding was successful. Will return AWS_OP_ERROR if the object passed is invalid or if the passed key is already in use in the object.
Prototype
int aws_json_value_add_to_object( struct aws_json_value *object, struct aws_byte_cursor key, struct aws_json_value *value);
LibAwsCommon.aws_json_value_compare
— Methodaws_json_value_compare(a, b, is_case_sensitive)
Checks whether two json values are equivalent.
Arguments
a
: first value to compare.b
: second value to compare.is_case_sensitive
: case sensitive compare or not.
Returns
True is values are equal, false otherwise
Prototype
bool aws_json_value_compare(const struct aws_json_value *a, const struct aws_json_value *b, bool is_case_sensitive);
LibAwsCommon.aws_json_value_destroy
— Methodaws_json_value_destroy(value)
Removes the aws_json_value
from memory. If the aws_json_value
is a object or array, it will also destroy attached aws_json_values as well.
For example, if you called "aws_json_array_add(b, a)" to add an object "a" to an array "b", if you call "aws_json_destroy(b)" then it will also free "a" automatically. All children/attached aws_json_values are freed when the parent/root aws_json_value
is destroyed.
Arguments
value
: Theaws_json_value
to destroy.
Prototype
void aws_json_value_destroy(struct aws_json_value *value);
LibAwsCommon.aws_json_value_duplicate
— Methodaws_json_value_duplicate(value)
Duplicates json value.
Arguments
value
: first value to compare.
Returns
duplicated value. NULL and last error set if value cannot be duplicated.
Prototype
struct aws_json_value *aws_json_value_duplicate(const struct aws_json_value *value);
LibAwsCommon.aws_json_value_get_boolean
— Methodaws_json_value_get_boolean(value, output)
Gets the boolean of a boolean aws_json_value
.
Arguments
value
: The booleanaws_json_value
.output
: The boolean
Returns
AWS_OP_SUCCESS
if the value is a boolean, otherwise AWS_OP_ERR
.
Prototype
int aws_json_value_get_boolean(const struct aws_json_value *value, bool *output);
LibAwsCommon.aws_json_value_get_from_object
— Methodaws_json_value_get_from_object(object, key)
Returns the aws_json_value
at the given key.
Arguments
object
: The objectaws_json_value
you want to get the value from.key
: The key that theaws_json_value
is at. Is case sensitive.
Returns
The aws_json_value
at the given key, otherwise NULL.
Prototype
struct aws_json_value *aws_json_value_get_from_object(const struct aws_json_value *object, struct aws_byte_cursor key);
LibAwsCommon.aws_json_value_get_number
— Methodaws_json_value_get_number(value, output)
Gets the number of a number aws_json_value
.
Arguments
value
: The numberaws_json_value
.output
: The number
Returns
AWS_OP_SUCCESS
if the value is a number, otherwise AWS_OP_ERR
.
Prototype
int aws_json_value_get_number(const struct aws_json_value *value, double *output);
LibAwsCommon.aws_json_value_get_string
— Methodaws_json_value_get_string(value, output)
Gets the string of a string aws_json_value
.
Arguments
value
: The stringaws_json_value
.output
: The string
Returns
AWS_OP_SUCCESS
if the value is a string, otherwise AWS_OP_ERR
.
Prototype
int aws_json_value_get_string(const struct aws_json_value *value, struct aws_byte_cursor *output);
LibAwsCommon.aws_json_value_has_key
— Methodaws_json_value_has_key(object, key)
Checks if there is a aws_json_value
at the given key.
Arguments
object
: The valueaws_json_value
you want to check a key in.key
: The key that you want to check. Is case sensitive.
Returns
True if a aws_json_value
is found.
Prototype
bool aws_json_value_has_key(const struct aws_json_value *object, struct aws_byte_cursor key);
LibAwsCommon.aws_json_value_is_array
— Methodaws_json_value_is_array(value)
Checks if the aws_json_value
is a array.
Arguments
value
: Theaws_json_value
to check.
Returns
True if the aws_json_value
is a array aws_json_value
, otherwise false.
Prototype
bool aws_json_value_is_array(const struct aws_json_value *value);
LibAwsCommon.aws_json_value_is_boolean
— Methodaws_json_value_is_boolean(value)
Checks if the aws_json_value
is a boolean.
Arguments
value
: Theaws_json_value
to check.
Returns
True if the aws_json_value
is a boolean aws_json_value
, otherwise false.
Prototype
bool aws_json_value_is_boolean(const struct aws_json_value *value);
LibAwsCommon.aws_json_value_is_null
— Methodaws_json_value_is_null(value)
Checks if the aws_json_value
is a null aws_json_value
.
Arguments
value
: Theaws_json_value
to check.
Returns
True if the aws_json_value
is a null aws_json_value
, otherwise false.
Prototype
bool aws_json_value_is_null(const struct aws_json_value *value);
LibAwsCommon.aws_json_value_is_number
— Methodaws_json_value_is_number(value)
Checks if the aws_json_value
is a number.
Arguments
value
: Theaws_json_value
to check.
Returns
True if the aws_json_value
is a number aws_json_value
, otherwise false.
Prototype
bool aws_json_value_is_number(const struct aws_json_value *value);
LibAwsCommon.aws_json_value_is_object
— Methodaws_json_value_is_object(value)
Checks if the aws_json_value
is a object aws_json_value
.
Arguments
value
: Theaws_json_value
to check.
Returns
True if the aws_json_value
is a object aws_json_value
, otherwise false.
Prototype
bool aws_json_value_is_object(const struct aws_json_value *value);
LibAwsCommon.aws_json_value_is_string
— Methodaws_json_value_is_string(value)
Checks if the aws_json_value
is a string.
Arguments
value
: Theaws_json_value
to check.
Returns
True if the aws_json_value
is a string aws_json_value
, otherwise false.
Prototype
bool aws_json_value_is_string(const struct aws_json_value *value);
LibAwsCommon.aws_json_value_new_array
— Methodaws_json_value_new_array(allocator)
Creates a new array aws_json_value
and returns a pointer to it.
Note: You will need to free the memory for the aws_json_value
using aws_json_destroy on the aws_json_value
or on the object/array containing the aws_json_value
. Deleting this array will also destroy any aws_json_values it contains.
Arguments
allocator
: The allocator to use when creating the value
Returns
A new array aws_json_value
Prototype
struct aws_json_value *aws_json_value_new_array(struct aws_allocator *allocator);
LibAwsCommon.aws_json_value_new_boolean
— Methodaws_json_value_new_boolean(allocator, boolean)
Creates a new boolean aws_json_value
with the given boolean and returns a pointer to it.
Note: You will need to free the memory for the aws_json_value
using aws_json_destroy on the aws_json_value
or on the object/array containing the aws_json_value
.
Arguments
boolean
: The boolean you want to store in theaws_json_value
allocator
: The allocator to use when creating the value
Returns
A new boolean aws_json_value
Prototype
struct aws_json_value *aws_json_value_new_boolean(struct aws_allocator *allocator, bool boolean);
LibAwsCommon.aws_json_value_new_from_string
— Methodaws_json_value_new_from_string(allocator, string)
Parses the JSON string and returns a aws_json_value
containing the root of the JSON.
Arguments
allocator
: The allocator used to create the valuestring
: The string containing the JSON.
Returns
The root aws_json_value
of the JSON.
Prototype
struct aws_json_value *aws_json_value_new_from_string(struct aws_allocator *allocator, struct aws_byte_cursor string);
LibAwsCommon.aws_json_value_new_null
— Methodaws_json_value_new_null(allocator)
Creates a new null aws_json_value
and returns a pointer to it.
Note: You will need to free the memory for the aws_json_value
using aws_json_destroy on the aws_json_value
or on the object/array containing the aws_json_value
.
Arguments
allocator
: The allocator to use when creating the value
Returns
A new null aws_json_value
Prototype
struct aws_json_value *aws_json_value_new_null(struct aws_allocator *allocator);
LibAwsCommon.aws_json_value_new_number
— Methodaws_json_value_new_number(allocator, number)
Creates a new number aws_json_value
with the given number and returns a pointer to it.
Note: You will need to free the memory for the aws_json_value
using aws_json_destroy on the aws_json_value
or on the object/array containing the aws_json_value
.
Arguments
number
: The number you want to store in theaws_json_value
allocator
: The allocator to use when creating the value
Returns
A new number aws_json_value
Prototype
struct aws_json_value *aws_json_value_new_number(struct aws_allocator *allocator, double number);
LibAwsCommon.aws_json_value_new_object
— Methodaws_json_value_new_object(allocator)
Creates a new object aws_json_value
and returns a pointer to it.
Note: You will need to free the memory for the aws_json_value
using aws_json_destroy on the aws_json_value
or on the object/array containing the aws_json_value
. Deleting this object will also destroy any aws_json_values it contains.
Arguments
allocator
: The allocator to use when creating the value
Returns
A new object aws_json_value
Prototype
struct aws_json_value *aws_json_value_new_object(struct aws_allocator *allocator);
LibAwsCommon.aws_json_value_new_string
— Methodaws_json_value_new_string(allocator, string)
Creates a new string aws_json_value
with the given string and returns a pointer to it.
Note: You will need to free the memory for the aws_json_value
using aws_json_destroy on the aws_json_value
or on the object/array containing the aws_json_value
.
Arguments
string
: A byte pointer to the string you want to store in theaws_json_value
allocator
: The allocator to use when creating the value
Returns
A new string aws_json_value
Prototype
struct aws_json_value *aws_json_value_new_string(struct aws_allocator *allocator, struct aws_byte_cursor string);
LibAwsCommon.aws_json_value_remove_array_element
— Methodaws_json_value_remove_array_element(array, index)
Removes the aws_json_value
at the given index in the array aws_json_value
.
Arguments
array
: The arrayaws_json_value
.index
: The index containing theaws_json_value
you want to remove.
Returns
AWS_OP_SUCCESS
if the aws_json_value
at the index was removed. Will return AWS_OP_ERR
if the array passed is invalid or if the index passed is out of range.
Prototype
int aws_json_value_remove_array_element(struct aws_json_value *array, size_t index);
LibAwsCommon.aws_json_value_remove_from_object
— Methodaws_json_value_remove_from_object(object, key)
Removes the aws_json_value
at the given key.
Arguments
object
: The objectaws_json_value
you want to remove aaws_json_value
in.key
: The key that theaws_json_value
is at. Is case sensitive.
Returns
AWS_OP_SUCCESS
if the aws_json_value
was removed. Will return AWS_OP_ERR
if the object passed is invalid or if the value at the key cannot be found.
Prototype
int aws_json_value_remove_from_object(struct aws_json_value *object, struct aws_byte_cursor key);
LibAwsCommon.aws_last_error
— Methodaws_last_error()
Returns the latest error code on the current thread, or 0 if none have occurred.
Prototype
int aws_last_error(void);
LibAwsCommon.aws_linked_hash_table_clean_up
— Methodaws_linked_hash_table_clean_up(table)
Cleans up the table. Elements in the table will be evicted and cleanup callbacks will be invoked.
Prototype
void aws_linked_hash_table_clean_up(struct aws_linked_hash_table *table);
LibAwsCommon.aws_linked_hash_table_clear
— Methodaws_linked_hash_table_clear(table)
Clears all items from the table.
Prototype
void aws_linked_hash_table_clear(struct aws_linked_hash_table *table);
LibAwsCommon.aws_linked_hash_table_find
— Methodaws_linked_hash_table_find(table, key, p_value)
Finds element in the table by key. If found, AWS_OP_SUCCESS
will be returned. If not found, AWS_OP_SUCCESS
will be returned and *p_value will be NULL.
If any errors occur AWS_OP_ERR
will be returned.
Prototype
int aws_linked_hash_table_find(struct aws_linked_hash_table *table, const void *key, void **p_value);
LibAwsCommon.aws_linked_hash_table_find_and_move_to_back
— Methodaws_linked_hash_table_find_and_move_to_back(table, key, p_value)
Finds element in the table by key. If found, AWS_OP_SUCCESS
will be returned and the item will be moved to the back of the list. If not found, AWS_OP_SUCCESS
will be returned and *p_value will be NULL.
Note: this will change the order of elements
Prototype
int aws_linked_hash_table_find_and_move_to_back(struct aws_linked_hash_table *table, const void *key, void **p_value);
LibAwsCommon.aws_linked_hash_table_get_element_count
— Methodaws_linked_hash_table_get_element_count(table)
returns number of elements in the table.
Prototype
size_t aws_linked_hash_table_get_element_count(const struct aws_linked_hash_table *table);
LibAwsCommon.aws_linked_hash_table_get_iteration_list
— Methodaws_linked_hash_table_get_iteration_list(table)
returns the underlying linked list for iteration.
The returned list has nodes of the type: aws_linked_hash_table_node
. Use AWS_CONTAINER_OF
for access to the element.
Prototype
const struct aws_linked_list *aws_linked_hash_table_get_iteration_list(const struct aws_linked_hash_table *table);
LibAwsCommon.aws_linked_hash_table_init
— Methodaws_linked_hash_table_init(table, allocator, hash_fn, equals_fn, destroy_key_fn, destroy_value_fn, initial_item_count)
Initializes the table. Sets up the underlying hash table and linked list. For the other parameters, see aws/common/hash_table.h. Hash table semantics of these arguments are preserved.
Prototype
int aws_linked_hash_table_init( struct aws_linked_hash_table *table, struct aws_allocator *allocator, aws_hash_fn *hash_fn, aws_hash_callback_eq_fn *equals_fn, aws_hash_callback_destroy_fn *destroy_key_fn, aws_hash_callback_destroy_fn *destroy_value_fn, size_t initial_item_count);
LibAwsCommon.aws_linked_hash_table_move_node_to_end_of_list
— Methodaws_linked_hash_table_move_node_to_end_of_list(table, node)
Move the aws_linked_hash_table_node
to the end of the list.
Note: this will change the order of elements
Prototype
void aws_linked_hash_table_move_node_to_end_of_list( struct aws_linked_hash_table *table, struct aws_linked_hash_table_node *node);
LibAwsCommon.aws_linked_hash_table_put
— Methodaws_linked_hash_table_put(table, key, p_value)
Puts p_value
at key
. If an element is already stored at key
it will be replaced.
Prototype
int aws_linked_hash_table_put(struct aws_linked_hash_table *table, const void *key, void *p_value);
LibAwsCommon.aws_linked_hash_table_remove
— Methodaws_linked_hash_table_remove(table, key)
Removes item at key
from the table.
Prototype
int aws_linked_hash_table_remove(struct aws_linked_hash_table *table, const void *key);
LibAwsCommon.aws_linked_list_back
— Methodaws_linked_list_back(list)
Returns the element in the back of the list.
Prototype
AWS_STATIC_IMPL struct aws_linked_list_node *aws_linked_list_back(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_begin
— Methodaws_linked_list_begin(list)
Returns an iteration pointer for the first element in the list.
Prototype
AWS_STATIC_IMPL struct aws_linked_list_node *aws_linked_list_begin(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_empty
— Methodaws_linked_list_empty(list)
Tests if the list is empty.
Prototype
AWS_STATIC_IMPL bool aws_linked_list_empty(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_end
— Methodaws_linked_list_end(list)
Returns an iteration pointer for one past the last element in the list.
Prototype
AWS_STATIC_IMPL const struct aws_linked_list_node *aws_linked_list_end(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_front
— Methodaws_linked_list_front(list)
Returns the element in the front of the list.
Prototype
AWS_STATIC_IMPL struct aws_linked_list_node *aws_linked_list_front(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_init
— Methodaws_linked_list_init(list)
Initializes the list. List will be empty after this call.
Prototype
AWS_STATIC_IMPL void aws_linked_list_init(struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_insert_after
— Methodaws_linked_list_insert_after(after, to_add)
Inserts to_add immediately after after.
Prototype
AWS_STATIC_IMPL void aws_linked_list_insert_after( struct aws_linked_list_node *after, struct aws_linked_list_node *to_add);
LibAwsCommon.aws_linked_list_insert_before
— Methodaws_linked_list_insert_before(before, to_add)
Inserts to_add immediately before before.
Prototype
AWS_STATIC_IMPL void aws_linked_list_insert_before( struct aws_linked_list_node *before, struct aws_linked_list_node *to_add);
LibAwsCommon.aws_linked_list_is_valid
— Methodaws_linked_list_is_valid(list)
Checks that a linked list is valid.
Prototype
AWS_STATIC_IMPL bool aws_linked_list_is_valid(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_is_valid_deep
— Methodaws_linked_list_is_valid_deep(list)
Checks that a linked list satisfies double linked list connectivity constraints. This check is O(n) as it traverses the whole linked list to ensure that tail is reachable from head (and vice versa) and that every connection is bidirectional.
Note: This check cannot go into an infinite loop, because we ensure that the connection to the next node is bidirectional. Therefore, if a node's [a] a.next is a previous node [b] in the list, b.prev != &a and so this check would fail, thus terminating the loop.
Prototype
AWS_STATIC_IMPL bool aws_linked_list_is_valid_deep(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_move_all_back
— Methodaws_linked_list_move_all_back(dst, src)
Remove all nodes from one list, and add them to the back of another.
Example: if dst={1,2} and src={3,4}, they become dst={1,2,3,4} and src={}
Prototype
AWS_STATIC_IMPL void aws_linked_list_move_all_back( struct aws_linked_list *AWS_RESTRICT dst, struct aws_linked_list *AWS_RESTRICT src);
LibAwsCommon.aws_linked_list_move_all_front
— Methodaws_linked_list_move_all_front(dst, src)
Remove all nodes from one list, and add them to the front of another.
Example: if dst={2,1} and src={4,3}, they become dst={4,3,2,1} and src={}
Prototype
AWS_STATIC_IMPL void aws_linked_list_move_all_front( struct aws_linked_list *AWS_RESTRICT dst, struct aws_linked_list *AWS_RESTRICT src);
LibAwsCommon.aws_linked_list_next
— Methodaws_linked_list_next(node)
Returns the next element in the list.
Prototype
AWS_STATIC_IMPL struct aws_linked_list_node *aws_linked_list_next(const struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_node_is_in_list
— Methodaws_linked_list_node_is_in_list(node)
Returns true if the node is currently in a list, false otherwise.
Prototype
AWS_STATIC_IMPL bool aws_linked_list_node_is_in_list(struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_node_next_is_valid
— Methodaws_linked_list_node_next_is_valid(node)
Checks that the prev of the next pointer of a node points to the node. As this checks whether the [next] connection of a node is bidirectional, it returns false if used for the list tail.
Prototype
AWS_STATIC_IMPL bool aws_linked_list_node_next_is_valid(const struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_node_prev_is_valid
— Methodaws_linked_list_node_prev_is_valid(node)
Checks that the next of the prev pointer of a node points to the node. Similarly to the above, this returns false if used for the head of a list.
Prototype
AWS_STATIC_IMPL bool aws_linked_list_node_prev_is_valid(const struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_node_reset
— Methodaws_linked_list_node_reset(node)
Set node's next and prev pointers to NULL.
Prototype
AWS_STATIC_IMPL void aws_linked_list_node_reset(struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_pop_back
— Methodaws_linked_list_pop_back(list)
Returns the element in the back of the list and removes it
Prototype
AWS_STATIC_IMPL struct aws_linked_list_node *aws_linked_list_pop_back(struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_pop_front
— Methodaws_linked_list_pop_front(list)
Returns the element in the front of the list and removes it
Prototype
AWS_STATIC_IMPL struct aws_linked_list_node *aws_linked_list_pop_front(struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_prev
— Methodaws_linked_list_prev(node)
Returns the previous element in the list.
Prototype
AWS_STATIC_IMPL struct aws_linked_list_node *aws_linked_list_prev(const struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_push_back
— Methodaws_linked_list_push_back(list, node)
Append new_node.
Prototype
AWS_STATIC_IMPL void aws_linked_list_push_back(struct aws_linked_list *list, struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_push_front
— Methodaws_linked_list_push_front(list, node)
Prepend new_node.
Prototype
AWS_STATIC_IMPL void aws_linked_list_push_front(struct aws_linked_list *list, struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_rbegin
— Methodaws_linked_list_rbegin(list)
Returns a pointer for the last element in the list. Used to begin iterating the list in reverse. Ex: for (i = aws_linked_list_rbegin
(list); i != aws_linked_list_rend
(list); i = aws_linked_list_prev
(i)) {...}
Prototype
AWS_STATIC_IMPL struct aws_linked_list_node *aws_linked_list_rbegin(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_remove
— Methodaws_linked_list_remove(node)
Removes the specified node from the list (prev/next point to each other) and returns the next node in the list.
Prototype
AWS_STATIC_IMPL void aws_linked_list_remove(struct aws_linked_list_node *node);
LibAwsCommon.aws_linked_list_rend
— Methodaws_linked_list_rend(list)
Returns the pointer to one before the first element in the list. Used to end iterating the list in reverse.
Prototype
AWS_STATIC_IMPL const struct aws_linked_list_node *aws_linked_list_rend(const struct aws_linked_list *list);
LibAwsCommon.aws_linked_list_swap_contents
— Methodaws_linked_list_swap_contents(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL void aws_linked_list_swap_contents( struct aws_linked_list *AWS_RESTRICT a, struct aws_linked_list *AWS_RESTRICT b);
LibAwsCommon.aws_linked_list_swap_nodes
— Methodaws_linked_list_swap_nodes(a, b)
Swaps the order two nodes in the linked list.
Prototype
AWS_STATIC_IMPL void aws_linked_list_swap_nodes(struct aws_linked_list_node *a, struct aws_linked_list_node *b);
LibAwsCommon.aws_localtime
— Methodaws_localtime(time, t)
Cross platform friendly version of localtime_r
Prototype
void aws_localtime(time_t time, struct tm *t);
LibAwsCommon.aws_log_channel_clean_up
— Methodaws_log_channel_clean_up(channel)
Channel cleanup function
Prototype
void aws_log_channel_clean_up(struct aws_log_channel *channel);
LibAwsCommon.aws_log_channel_init_background
— Methodaws_log_channel_init_background(channel, allocator, writer)
Simple channel that sends log lines to a background thread.
The passed in log writer is not an ownership transfer. The log channel does not clean up the writer.
Prototype
int aws_log_channel_init_background( struct aws_log_channel *channel, struct aws_allocator *allocator, struct aws_log_writer *writer);
LibAwsCommon.aws_log_channel_init_foreground
— Methodaws_log_channel_init_foreground(channel, allocator, writer)
Simple channel that results in log lines being written in the same thread they were generated in.
The passed in log writer is not an ownership transfer. The log channel does not clean up the writer.
Prototype
int aws_log_channel_init_foreground( struct aws_log_channel *channel, struct aws_allocator *allocator, struct aws_log_writer *writer);
LibAwsCommon.aws_log_formatter_clean_up
— Methodaws_log_formatter_clean_up(formatter)
Cleans up a log formatter (minus the base structure memory) by calling the formatter's clean_up function via the vtable.
Prototype
void aws_log_formatter_clean_up(struct aws_log_formatter *formatter);
LibAwsCommon.aws_log_formatter_init_default
— Methodaws_log_formatter_init_default(formatter, allocator, options)
Initializes the default log formatter which outputs lines in the format:
[<LogLevel>] [<Timestamp>] [<ThreadId>] - <User content>
Prototype
int aws_log_formatter_init_default( struct aws_log_formatter *formatter, struct aws_allocator *allocator, struct aws_log_formatter_standard_options *options);
LibAwsCommon.aws_log_level_to_string
— Methodaws_log_level_to_string(log_level, level_string)
Converts a log level to a c-string constant. Intended primarily to support building log lines that include the level in them, i.e.
[ERROR] 10:34:54.642 01-31-19 - Json parse error....
Prototype
int aws_log_level_to_string(enum aws_log_level log_level, const char **level_string);
LibAwsCommon.aws_log_subject_name
— Methodaws_log_subject_name(subject)
Get subject name from log subject.
Prototype
const char *aws_log_subject_name(aws_log_subject_t subject);
LibAwsCommon.aws_log_writer_clean_up
— Methodaws_log_writer_clean_up(writer)
Frees all resources used by a log writer with the exception of the base structure memory
Prototype
void aws_log_writer_clean_up(struct aws_log_writer *writer);
LibAwsCommon.aws_log_writer_init_file
— Methodaws_log_writer_init_file(writer, allocator, options)
Initialize a log writer that sends log lines to a file. Uses C library IO.
Prototype
int aws_log_writer_init_file( struct aws_log_writer *writer, struct aws_allocator *allocator, struct aws_log_writer_file_options *options);
LibAwsCommon.aws_log_writer_init_stderr
— Methodaws_log_writer_init_stderr(writer, allocator)
Initialize a log writer that sends log lines to stderr. Uses C library IO.
Prototype
int aws_log_writer_init_stderr(struct aws_log_writer *writer, struct aws_allocator *allocator);
LibAwsCommon.aws_log_writer_init_stdout
— Methodaws_log_writer_init_stdout(writer, allocator)
Initialize a log writer that sends log lines to stdout. Uses C library IO.
Prototype
int aws_log_writer_init_stdout(struct aws_log_writer *writer, struct aws_allocator *allocator);
LibAwsCommon.aws_logger_clean_up
— Methodaws_logger_clean_up(logger)
Cleans up all resources used by the logger; simply invokes the clean_up v-function
Prototype
void aws_logger_clean_up(struct aws_logger *logger);
LibAwsCommon.aws_logger_get
— Methodaws_logger_get()
Gets the aws logger used globally across the process.
Prototype
struct aws_logger *aws_logger_get(void);
LibAwsCommon.aws_logger_get_conditional
— Methodaws_logger_get_conditional(subject, level)
Gets the aws logger used globally across the process if the logging level is at least the inputted level.
Arguments
subject
: log subject to perform the level check versus, not currently usedlevel
: logging level to check against in order to return the logger
Returns
the current logger if the current logging level is at or more detailed then the supplied logging level
Prototype
struct aws_logger *aws_logger_get_conditional(aws_log_subject_t subject, enum aws_log_level level);
LibAwsCommon.aws_logger_init_from_external
— Methodaws_logger_init_from_external(logger, allocator, formatter, channel, writer, level)
Initializes a pipeline logger from components that have already been initialized. This is not an ownership transfer. After the pipeline logger is cleaned up, the components will have to manually be cleaned up by the user.
Prototype
int aws_logger_init_from_external( struct aws_logger *logger, struct aws_allocator *allocator, struct aws_log_formatter *formatter, struct aws_log_channel *channel, struct aws_log_writer *writer, enum aws_log_level level);
LibAwsCommon.aws_logger_init_noalloc
— Methodaws_logger_init_noalloc(logger, allocator, options)
Initializes a logger that does not perform any allocation during logging. Log lines larger than the internal constant are truncated. Formatting matches the standard logger. Used for memory tracing logging. If no file or filename is set in the aws_logger_standard_options
, then it will use stderr.
Prototype
int aws_logger_init_noalloc( struct aws_logger *logger, struct aws_allocator *allocator, struct aws_logger_standard_options *options);
LibAwsCommon.aws_logger_init_standard
— Methodaws_logger_init_standard(logger, allocator, options)
Initializes a pipeline logger that is built from the default formatter, a background thread-based channel, and a file writer. The default logger in almost all circumstances.
Prototype
int aws_logger_init_standard( struct aws_logger *logger, struct aws_allocator *allocator, struct aws_logger_standard_options *options);
LibAwsCommon.aws_logger_set
— Methodaws_logger_set(logger)
Sets the aws logger used globally across the process. Not thread-safe. Must only be called once.
Prototype
void aws_logger_set(struct aws_logger *logger);
LibAwsCommon.aws_logger_set_log_level
— Methodaws_logger_set_log_level(logger, level)
Sets the current logging level for the logger. Loggers are not require to support this.
Arguments
logger
: logger to set the log level forlevel
: new log level for the logger
Returns
AWS_OP_SUCCESS
if the level was successfully set, AWS_OP_ERR
otherwise
Prototype
int aws_logger_set_log_level(struct aws_logger *logger, enum aws_log_level level);
LibAwsCommon.aws_lookup_table_hex_to_num_get
— Methodaws_lookup_table_hex_to_num_get()
Returns lookup table to go from ASCII/UTF-8 hex character to a number (0-15). Non-hex characters map to 255. Valid examples: '0' -> 0 'F' -> 15 'f' -> 15 Invalid examples: ' ' -> 255 'Z' -> 255 '\0' -> 255
Prototype
const uint8_t *aws_lookup_table_hex_to_num_get(void);
LibAwsCommon.aws_lookup_table_to_lower_get
— Methodaws_lookup_table_to_lower_get()
Returns a lookup table for bytes that is the identity transformation with the exception of uppercase ascii characters getting replaced with lowercase characters. Used in caseless comparisons.
Prototype
const uint8_t *aws_lookup_table_to_lower_get(void);
LibAwsCommon.aws_lru_cache_get_mru_element
— Methodaws_lru_cache_get_mru_element(cache)
Accesses the most-recently-used element and returns its value.
Prototype
void *aws_lru_cache_get_mru_element(const struct aws_cache *cache);
LibAwsCommon.aws_lru_cache_use_lru_element
— Methodaws_lru_cache_use_lru_element(cache)
Accesses the least-recently-used element, sets it to most-recently-used element, and returns the value.
Prototype
void *aws_lru_cache_use_lru_element(struct aws_cache *cache);
LibAwsCommon.aws_max_double
— Methodaws_max_double(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL double aws_max_double(double a, double b);
LibAwsCommon.aws_max_float
— Methodaws_max_float(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL float aws_max_float(float a, float b);
LibAwsCommon.aws_max_i16
— Methodaws_max_i16(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int16_t aws_max_i16(int16_t a, int16_t b);
LibAwsCommon.aws_max_i32
— Methodaws_max_i32(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int32_t aws_max_i32(int32_t a, int32_t b);
LibAwsCommon.aws_max_i64
— Methodaws_max_i64(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int64_t aws_max_i64(int64_t a, int64_t b);
LibAwsCommon.aws_max_i8
— Methodaws_max_i8(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int8_t aws_max_i8(int8_t a, int8_t b);
LibAwsCommon.aws_max_int
— Methodaws_max_int(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int aws_max_int(int a, int b);
LibAwsCommon.aws_max_size
— Methodaws_max_size(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_max_size(size_t a, size_t b);
LibAwsCommon.aws_max_u16
— Methodaws_max_u16(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL uint16_t aws_max_u16(uint16_t a, uint16_t b);
LibAwsCommon.aws_max_u32
— Methodaws_max_u32(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL uint32_t aws_max_u32(uint32_t a, uint32_t b);
LibAwsCommon.aws_max_u64
— Methodaws_max_u64(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL uint64_t aws_max_u64(uint64_t a, uint64_t b);
LibAwsCommon.aws_max_u8
— Methodaws_max_u8(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL uint8_t aws_max_u8(uint8_t a, uint8_t b);
LibAwsCommon.aws_mem_acquire
— Methodaws_mem_acquire(allocator, size)
Returns at least size
of memory ready for usage. In versions v0.6.8 and prior, this function was allowed to return NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a GC etc...before returning.
Prototype
void *aws_mem_acquire(struct aws_allocator *allocator, size_t size);
LibAwsCommon.aws_mem_calloc
— Methodaws_mem_calloc(allocator, num, size)
Allocates a block of memory for an array of num elements, each of them size bytes long, and initializes all its bits to zero. In versions v0.6.8 and prior, this function was allowed to return NULL. In later versions, if allocator->mem_calloc() returns NULL, this function will assert and exit. To handle conditions where OOM is not a fatal error, allocator->mem_calloc() is responsible for finding/reclaiming/running a GC etc...before returning.
Prototype
void *aws_mem_calloc(struct aws_allocator *allocator, size_t num, size_t size);
LibAwsCommon.aws_mem_realloc
— Methodaws_mem_realloc(allocator, ptr, oldsize, newsize)
Attempts to adjust the size of the pointed-to memory buffer from oldsize to newsize. The pointer (*ptr) may be changed if the memory needs to be reallocated.
In versions v0.6.8 and prior, this function was allowed to return NULL. In later versions, if allocator->mem_realloc() returns NULL, this function will assert and exit. To handle conditions where OOM is not a fatal error, allocator->mem_realloc() is responsible for finding/reclaiming/running a GC etc...before returning.
Prototype
int aws_mem_realloc(struct aws_allocator *allocator, void **ptr, size_t oldsize, size_t newsize);
LibAwsCommon.aws_mem_release
— Methodaws_mem_release(allocator, ptr)
Releases ptr back to whatever allocated it. Nothing happens if ptr is NULL.
Prototype
void aws_mem_release(struct aws_allocator *allocator, void *ptr);
LibAwsCommon.aws_mem_tracer_bytes
— Methodaws_mem_tracer_bytes(trace_allocator)
Returns the current number of bytes in outstanding allocations
Prototype
size_t aws_mem_tracer_bytes(struct aws_allocator *trace_allocator);
LibAwsCommon.aws_mem_tracer_count
— Methodaws_mem_tracer_count(trace_allocator)
Returns the current number of outstanding allocations
Prototype
size_t aws_mem_tracer_count(struct aws_allocator *trace_allocator);
LibAwsCommon.aws_mem_tracer_destroy
— Methodaws_mem_tracer_destroy(trace_allocator)
Unwraps the traced allocator and cleans up the tracer. Returns the original allocator
Prototype
struct aws_allocator *aws_mem_tracer_destroy(struct aws_allocator *trace_allocator);
LibAwsCommon.aws_mem_tracer_dump
— Methodaws_mem_tracer_dump(trace_allocator)
If there are outstanding allocations, dumps them to log, along with any information gathered based on the trace level set when aws_mem_trace() was called. Should be passed the tracer allocator returned from aws_mem_trace().
Prototype
void aws_mem_tracer_dump(struct aws_allocator *trace_allocator);
LibAwsCommon.aws_mem_tracer_new
— Methodaws_mem_tracer_new(allocator, deprecated, level, frames_per_stack)
Wraps an allocator and tracks all external allocations. If aws_mem_trace_dump() is called and there are still allocations active, they will be reported to the aws_logger
at TRACE level. allocator - The allocator to wrap deprecated - Deprecated arg, ignored. level - The level to track allocations at frames_per_stack is how many frames to store per callstack if AWS_MEMTRACE_STACKS is in use, otherwise it is ignored. 8 tends to be a pretty good number balancing storage space vs useful stacks. Returns the tracer allocator, which should be used for all allocations that should be tracked.
Prototype
struct aws_allocator *aws_mem_tracer_new( struct aws_allocator *allocator, struct aws_allocator *deprecated, enum aws_mem_trace_level level, size_t frames_per_stack);
LibAwsCommon.aws_min_double
— Methodaws_min_double(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL double aws_min_double(double a, double b);
LibAwsCommon.aws_min_float
— Methodaws_min_float(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL float aws_min_float(float a, float b);
LibAwsCommon.aws_min_i16
— Methodaws_min_i16(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int16_t aws_min_i16(int16_t a, int16_t b);
LibAwsCommon.aws_min_i32
— Methodaws_min_i32(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int32_t aws_min_i32(int32_t a, int32_t b);
LibAwsCommon.aws_min_i64
— Methodaws_min_i64(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int64_t aws_min_i64(int64_t a, int64_t b);
LibAwsCommon.aws_min_i8
— Methodaws_min_i8(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int8_t aws_min_i8(int8_t a, int8_t b);
LibAwsCommon.aws_min_int
— Methodaws_min_int(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL int aws_min_int(int a, int b);
LibAwsCommon.aws_min_size
— Methodaws_min_size(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL size_t aws_min_size(size_t a, size_t b);
LibAwsCommon.aws_min_u16
— Methodaws_min_u16(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL uint16_t aws_min_u16(uint16_t a, uint16_t b);
LibAwsCommon.aws_min_u32
— Methodaws_min_u32(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL uint32_t aws_min_u32(uint32_t a, uint32_t b);
LibAwsCommon.aws_min_u64
— Methodaws_min_u64(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL uint64_t aws_min_u64(uint64_t a, uint64_t b);
LibAwsCommon.aws_min_u8
— Methodaws_min_u8(a, b)
Documentation not found.
Prototype
AWS_STATIC_IMPL uint8_t aws_min_u8(uint8_t a, uint8_t b);
LibAwsCommon.aws_mul_size_checked
— Methodaws_mul_size_checked(a, b, r)
Multiplies a * b and returns the result in *r. If the result overflows, returns AWS_OP_ERR
; otherwise returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_mul_size_checked(size_t a, size_t b, size_t *r);
LibAwsCommon.aws_mul_size_saturating
— Methodaws_mul_size_saturating(a, b)
Multiplies a * b. If the result overflows, returns SIZE_MAX.
Prototype
AWS_STATIC_IMPL size_t aws_mul_size_saturating(size_t a, size_t b);
LibAwsCommon.aws_mul_u32_checked
— Methodaws_mul_u32_checked(a, b, r)
If a * b overflows, returns AWS_OP_ERR
; otherwise multiplies a * b, returns the result in *r, and returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_mul_u32_checked(uint32_t a, uint32_t b, uint32_t *r);
LibAwsCommon.aws_mul_u32_saturating
— Methodaws_mul_u32_saturating(a, b)
Multiplies a * b. If the result overflows, returns 2^32 - 1.
Prototype
AWS_STATIC_IMPL uint32_t aws_mul_u32_saturating(uint32_t a, uint32_t b);
LibAwsCommon.aws_mul_u64_checked
— Methodaws_mul_u64_checked(a, b, r)
If a * b overflows, returns AWS_OP_ERR
; otherwise multiplies a * b, returns the result in *r, and returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_mul_u64_checked(uint64_t a, uint64_t b, uint64_t *r);
LibAwsCommon.aws_mul_u64_saturating
— Methodaws_mul_u64_saturating(a, b)
Multiplies a * b. If the result overflows, returns 2^64 - 1.
Prototype
AWS_STATIC_IMPL uint64_t aws_mul_u64_saturating(uint64_t a, uint64_t b);
LibAwsCommon.aws_mutex_clean_up
— Methodaws_mutex_clean_up(mutex)
Cleans up internal resources.
Prototype
void aws_mutex_clean_up(struct aws_mutex *mutex);
LibAwsCommon.aws_mutex_init
— Methodaws_mutex_init(mutex)
Initializes a new platform instance of mutex.
Prototype
int aws_mutex_init(struct aws_mutex *mutex);
LibAwsCommon.aws_mutex_lock
— Methodaws_mutex_lock(mutex)
Blocks until it acquires the lock. While on some platforms such as Windows, this may behave as a reentrant mutex, you should not treat it like one. On platforms it is possible for it to be non-reentrant, it will be.
Prototype
int aws_mutex_lock(struct aws_mutex *mutex);
LibAwsCommon.aws_mutex_try_lock
— Methodaws_mutex_try_lock(mutex)
Attempts to acquire the lock but returns immediately if it can not. While on some platforms such as Windows, this may behave as a reentrant mutex, you should not treat it like one. On platforms it is possible for it to be non-reentrant, it will be. Note: For windows, minimum support server version is Windows Server 2008 R2 [desktop apps | UWP apps]
Prototype
int aws_mutex_try_lock(struct aws_mutex *mutex);
LibAwsCommon.aws_mutex_unlock
— Methodaws_mutex_unlock(mutex)
Releases the lock.
Prototype
int aws_mutex_unlock(struct aws_mutex *mutex);
LibAwsCommon.aws_normalize_directory_separator
— Methodaws_normalize_directory_separator(path)
Normalizes the path by replacing any directory separator with the local platform's directory separator.
Arguments
path
: path to normalize. Must be writeable.
Prototype
void aws_normalize_directory_separator(struct aws_byte_buf *path);
LibAwsCommon.aws_ntoh16
— Methodaws_ntoh16(x)
Convert 16 bit integer from network to host byte order.
Prototype
AWS_STATIC_IMPL uint16_t aws_ntoh16(uint16_t x);
LibAwsCommon.aws_ntoh32
— Methodaws_ntoh32(x)
Convert 32 bit integer from network to host byte order.
Prototype
AWS_STATIC_IMPL uint32_t aws_ntoh32(uint32_t x);
LibAwsCommon.aws_ntoh64
— Methodaws_ntoh64(x)
Convert 64 bit integer from network to host byte order.
Prototype
AWS_STATIC_IMPL uint64_t aws_ntoh64(uint64_t x);
LibAwsCommon.aws_ntohf32
— Methodaws_ntohf32(x)
Convert 32 bit float from network to host byte order.
Prototype
AWS_STATIC_IMPL float aws_ntohf32(float x);
LibAwsCommon.aws_ntohf64
— Methodaws_ntohf64(x)
Convert 32 bit float from network to host byte order.
Prototype
AWS_STATIC_IMPL double aws_ntohf64(double x);
LibAwsCommon.aws_path_exists
— Methodaws_path_exists(path)
Returns true if a file or path exists, otherwise, false.
Prototype
bool aws_path_exists(const struct aws_string *path);
LibAwsCommon.aws_priority_queue_backpointer_index_valid
— Methodaws_priority_queue_backpointer_index_valid(queue, index)
Checks that the backpointer at a specific index of the queue is NULL or points to a correctly allocated aws_priority_queue_node
.
Prototype
bool aws_priority_queue_backpointer_index_valid(const struct aws_priority_queue *const queue, size_t index);
LibAwsCommon.aws_priority_queue_backpointers_valid
— Methodaws_priority_queue_backpointers_valid(queue)
Checks that the backpointers of the priority queue satisfy validity constraints.
Prototype
bool aws_priority_queue_backpointers_valid(const struct aws_priority_queue *const queue);
LibAwsCommon.aws_priority_queue_backpointers_valid_deep
— Methodaws_priority_queue_backpointers_valid_deep(queue)
Checks that the backpointers of the priority queue are either NULL or correctly allocated to point at aws_priority_queue_nodes. This check is O(n), as it accesses every backpointer in a loop, and thus shouldn't be used carelessly.
Prototype
bool aws_priority_queue_backpointers_valid_deep(const struct aws_priority_queue *const queue);
LibAwsCommon.aws_priority_queue_capacity
— Methodaws_priority_queue_capacity(queue)
Current allocated capacity for the queue, in dynamic mode this grows over time, in static mode, this will never change.
Prototype
size_t aws_priority_queue_capacity(const struct aws_priority_queue *queue);
LibAwsCommon.aws_priority_queue_clean_up
— Methodaws_priority_queue_clean_up(queue)
Cleans up any internally allocated memory and resets the struct for reuse or deletion.
Prototype
void aws_priority_queue_clean_up(struct aws_priority_queue *queue);
LibAwsCommon.aws_priority_queue_clear
— Methodaws_priority_queue_clear(queue)
Removes all elements from the queue, but does not free internal memory.
Prototype
void aws_priority_queue_clear(struct aws_priority_queue *queue);
LibAwsCommon.aws_priority_queue_init_dynamic
— Methodaws_priority_queue_init_dynamic(queue, alloc, default_size, item_size, pred)
Initializes a priority queue struct for use. This mode will grow memory automatically (exponential model) Default size is the inital size of the queue item_size is the size of each element in bytes. Mixing items types is not supported by this API. pred is the function that will be used to determine priority.
Prototype
int aws_priority_queue_init_dynamic( struct aws_priority_queue *queue, struct aws_allocator *alloc, size_t default_size, size_t item_size, aws_priority_queue_compare_fn *pred);
LibAwsCommon.aws_priority_queue_init_static
— Methodaws_priority_queue_init_static(queue, heap, item_count, item_size, pred)
Initializes a priority queue struct for use. This mode will not allocate any additional memory. When the heap fills new enqueue operations will fail with AWS_ERROR_PRIORITY_QUEUE_FULL.
Heaps initialized using this call do not support the aws_priority_queue_push_ref
call with a non-NULL backpointer parameter.
heap is the raw memory allocated for this priority_queue item_count is the maximum number of elements the raw heap can contain item_size is the size of each element in bytes. Mixing items types is not supported by this API. pred is the function that will be used to determine priority.
Prototype
void aws_priority_queue_init_static( struct aws_priority_queue *queue, void *heap, size_t item_count, size_t item_size, aws_priority_queue_compare_fn *pred);
LibAwsCommon.aws_priority_queue_is_valid
— Methodaws_priority_queue_is_valid(queue)
Set of properties of a valid aws_priority_queue
.
Prototype
bool aws_priority_queue_is_valid(const struct aws_priority_queue *const queue);
LibAwsCommon.aws_priority_queue_node_init
— Methodaws_priority_queue_node_init(node)
Initializes a queue node to a default value that indicates the node is not in the queue.
Arguments
node
: priority queue node to initialize with a default value
Prototype
void aws_priority_queue_node_init(struct aws_priority_queue_node *node);
LibAwsCommon.aws_priority_queue_node_is_in_queue
— Methodaws_priority_queue_node_is_in_queue(node)
Checks if a priority queue node is currently in a priority queue.
Arguments
node
: priority queue node to check usage for
Returns
true if the node is in a queue, false otherwise
Prototype
bool aws_priority_queue_node_is_in_queue(const struct aws_priority_queue_node *node);
LibAwsCommon.aws_priority_queue_pop
— Methodaws_priority_queue_pop(queue, item)
Copies the element of the highest priority, and removes it from the queue.. Complexity: O(log(n)). If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised.
Prototype
int aws_priority_queue_pop(struct aws_priority_queue *queue, void *item);
LibAwsCommon.aws_priority_queue_push
— Methodaws_priority_queue_push(queue, item)
Copies item into the queue and places it in the proper priority order. Complexity: O(log(n)).
Prototype
int aws_priority_queue_push(struct aws_priority_queue *queue, void *item);
LibAwsCommon.aws_priority_queue_push_ref
— Methodaws_priority_queue_push_ref(queue, item, backpointer)
Copies item into the queue and places it in the proper priority order. Complexity: O(log(n)).
If the backpointer parameter is non-null, the heap will continually update the pointed-to field with information needed to remove the node later on. *backpointer must remain valid until the node is removed from the heap, and may be updated on any mutating operation on the priority queue.
If the node is removed, the backpointer will be set to a sentinel value that indicates that the node has already been removed. It is safe (and a no-op) to call aws_priority_queue_remove
with such a sentinel value.
Prototype
int aws_priority_queue_push_ref( struct aws_priority_queue *queue, void *item, struct aws_priority_queue_node *backpointer);
LibAwsCommon.aws_priority_queue_remove
— Methodaws_priority_queue_remove(queue, item, node)
Removes a specific node from the priority queue. Complexity: O(log(n)) After removing a node (using either _remove or _pop), the backpointer set at push_ref time is set to a sentinel value. If this sentinel value is passed to aws_priority_queue_remove
, AWS_ERROR_PRIORITY_QUEUE_BAD_NODE will be raised. Note, however, that passing uninitialized aws_priority_queue_nodes, or ones from different priority queues, results in undefined behavior.
Prototype
int aws_priority_queue_remove(struct aws_priority_queue *queue, void *item, const struct aws_priority_queue_node *node);
LibAwsCommon.aws_priority_queue_size
— Methodaws_priority_queue_size(queue)
Current number of elements in the queue
Prototype
size_t aws_priority_queue_size(const struct aws_priority_queue *queue);
LibAwsCommon.aws_priority_queue_top
— Methodaws_priority_queue_top(queue, item)
Obtains a pointer to the element of the highest priority. Complexity: constant time. If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised.
Prototype
int aws_priority_queue_top(const struct aws_priority_queue *queue, void **item);
LibAwsCommon.aws_ptr_eq
— Methodaws_ptr_eq(a, b)
Equality function which compares pointer equality.
Prototype
bool aws_ptr_eq(const void *a, const void *b);
LibAwsCommon.aws_query_string_next_param
— Methodaws_query_string_next_param(query_string, param)
For iterating over the params in the query string. param
is an in/out argument used to track progress, it MUST be zeroed out to start. If true is returned, param
contains the value of the next param. If false is returned, there are no further params.
Edge cases: 1) Entries without '=' sign are treated as having a key and no value. Example: First param in query string "a&b=c" has key="a" value=""
- Blank entries are skipped. Example: The only param in query string "&&a=b" is key="a" value="b"
Prototype
bool aws_query_string_next_param(struct aws_byte_cursor query_string, struct aws_uri_param *param);
LibAwsCommon.aws_query_string_params
— Methodaws_query_string_params(query_string, out_params)
Parses query string and stores the parameters in 'out_params'. Returns AWS_OP_SUCCESS
on success and AWS_OP_ERR
on failure. The user is responsible for initializing out_params with item size of struct aws_query_param. The user is also responsible for cleaning up out_params when finished.
Prototype
int aws_query_string_params(struct aws_byte_cursor query_string, struct aws_array_list *out_params);
LibAwsCommon.aws_raise_error
— Methodaws_raise_error(err)
Raises err
to the installed callbacks, and sets the thread's error.
Prototype
AWS_STATIC_IMPL int aws_raise_error(int err);
LibAwsCommon.aws_raise_error_private
— Methodaws_raise_error_private(err)
Internal implementation detail.
Prototype
void aws_raise_error_private(int err);
LibAwsCommon.aws_read_u16
— Methodaws_read_u16(buffer)
Extracts a 16 bit unsigned integer from buffer. Ensures conversion from network byte order to host byte order. Assumes buffer is at least 2 bytes long.
Prototype
AWS_STATIC_IMPL uint16_t aws_read_u16(const uint8_t *buffer);
LibAwsCommon.aws_read_u24
— Methodaws_read_u24(buffer)
Extracts a 24 bit unsigned integer from buffer. Ensures conversion from network byte order to host byte order. Assumes buffer is at least 3 bytes long.
Prototype
AWS_STATIC_IMPL uint32_t aws_read_u24(const uint8_t *buffer);
LibAwsCommon.aws_read_u32
— Methodaws_read_u32(buffer)
Extracts a 32 bit unsigned integer from buffer. Ensures conversion from network byte order to host byte order. Assumes the buffer size is at least 4 bytes.
Prototype
AWS_STATIC_IMPL uint32_t aws_read_u32(const uint8_t *buffer);
LibAwsCommon.aws_read_u64
— Methodaws_read_u64(buffer)
Extracts a 64 bit unsigned integer from buffer. Ensures conversion from network byte order to host byte order. Assumes buffer size is at least 8 bytes.
Prototype
AWS_STATIC_IMPL uint64_t aws_read_u64(const uint8_t *buffer);
LibAwsCommon.aws_ref_count_acquire
— Methodaws_ref_count_acquire(ref_count)
Increments a ref-counter's ref count
Arguments
ref_count
: ref-counter to increment the count for
Returns
the object being ref-counted
Prototype
void *aws_ref_count_acquire(struct aws_ref_count *ref_count);
LibAwsCommon.aws_ref_count_init
— Methodaws_ref_count_init(ref_count, object, on_zero_fn)
Initializes a ref-counter structure. After initialization, the ref count will be 1.
Arguments
ref_count
: ref-counter to initializeobject
: object being ref countedon_zero_fn
: function to invoke when the ref count reaches zero
Prototype
void aws_ref_count_init( struct aws_ref_count *ref_count, void *object, aws_simple_completion_callback *on_zero_fn);
LibAwsCommon.aws_ref_count_release
— Methodaws_ref_count_release(ref_count)
Decrements a ref-counter's ref count. Invokes the on_zero callback if the ref count drops to zero
Arguments
ref_count
: ref-counter to decrement the count for
Returns
the value of the decremented ref count
Prototype
size_t aws_ref_count_release(struct aws_ref_count *ref_count);
LibAwsCommon.aws_register_error_info
— Methodaws_register_error_info(error_info)
TODO: this needs to be a private function (wait till we have the cmake story better before moving it though). It should be external for the purpose of other libs we own, but customers should not be able to hit it without going out of their way to do so.
Prototype
void aws_register_error_info(const struct aws_error_info_list *error_info);
LibAwsCommon.aws_register_log_subject_info_list
— Methodaws_register_log_subject_info_list(log_subject_list)
Connects log subject strings with log subject integer values
Prototype
void aws_register_log_subject_info_list(struct aws_log_subject_info_list *log_subject_list);
LibAwsCommon.aws_reset_error
— Methodaws_reset_error()
Resets the err
back to defaults
Prototype
void aws_reset_error(void);
LibAwsCommon.aws_restore_error
— Methodaws_restore_error(err)
Sets err
to the latest error. Does not invoke callbacks.
Prototype
void aws_restore_error(int err);
LibAwsCommon.aws_ring_buffer_acquire
— Methodaws_ring_buffer_acquire(ring_buf, requested_size, dest)
Attempts to acquire requested_size
buffer and stores the result in dest
if successful. Returns AWS_OP_SUCCESS
if the requested size was available for use, AWS_OP_ERR
otherwise.
Prototype
int aws_ring_buffer_acquire( struct aws_ring_buffer *ring_buf, size_t requested_size, struct aws_byte_buf *dest);
LibAwsCommon.aws_ring_buffer_acquire_up_to
— Methodaws_ring_buffer_acquire_up_to(ring_buf, minimum_size, requested_size, dest)
Attempts to acquire requested_size
buffer and stores the result in dest
if successful. If not available, it will attempt to acquire anywhere from 1 byte to requested_size
. Returns AWS_OP_SUCCESS
if some buffer space is available for use, AWS_OP_ERR
otherwise.
Prototype
int aws_ring_buffer_acquire_up_to( struct aws_ring_buffer *ring_buf, size_t minimum_size, size_t requested_size, struct aws_byte_buf *dest);
LibAwsCommon.aws_ring_buffer_buf_belongs_to_pool
— Methodaws_ring_buffer_buf_belongs_to_pool(ring_buffer, buf)
Returns true if the memory in buf
was vended by this ring buffer, false otherwise. Make sure buf->buffer
and ring\_buffer->allocation
refer to the same memory region.
Prototype
bool aws_ring_buffer_buf_belongs_to_pool( const struct aws_ring_buffer *ring_buffer, const struct aws_byte_buf *buf);
LibAwsCommon.aws_ring_buffer_check_atomic_ptr
— Methodaws_ring_buffer_check_atomic_ptr(ring_buf, atomic_ptr)
Checks whether atomic_ptr correctly points to a memory location within the bounds of the aws_ring_buffer
Prototype
AWS_STATIC_IMPL bool aws_ring_buffer_check_atomic_ptr( const struct aws_ring_buffer *ring_buf, const uint8_t *atomic_ptr);
LibAwsCommon.aws_ring_buffer_clean_up
— Methodaws_ring_buffer_clean_up(ring_buf)
Cleans up the ring buffer's resources.
Prototype
void aws_ring_buffer_clean_up(struct aws_ring_buffer *ring_buf);
LibAwsCommon.aws_ring_buffer_init
— Methodaws_ring_buffer_init(ring_buf, allocator, size)
Initializes a ring buffer with an allocation of size size
. Returns AWS_OP_SUCCESS
on a successful initialization, AWS_OP_ERR
otherwise.
Prototype
int aws_ring_buffer_init(struct aws_ring_buffer *ring_buf, struct aws_allocator *allocator, size_t size);
LibAwsCommon.aws_ring_buffer_is_empty
— Methodaws_ring_buffer_is_empty(ring_buf)
Checks whether the ring buffer is empty
Prototype
AWS_STATIC_IMPL bool aws_ring_buffer_is_empty(const struct aws_ring_buffer *ring_buf);
LibAwsCommon.aws_ring_buffer_is_valid
— Methodaws_ring_buffer_is_valid(ring_buf)
Evaluates the set of properties that define the shape of all valid aws_ring_buffer
structures. It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion).
Prototype
AWS_STATIC_IMPL bool aws_ring_buffer_is_valid(const struct aws_ring_buffer *ring_buf);
LibAwsCommon.aws_ring_buffer_release
— Methodaws_ring_buffer_release(ring_buffer, buf)
Releases buf
back to the ring buffer for further use. RELEASE MUST HAPPEN in the SAME ORDER AS ACQUIRE. If you do not, your application, and possibly computers within a thousand mile radius, may die terrible deaths, and the local drinking water will be poisoned for generations with fragments of what is left of your radioactive corrupted memory.
Prototype
void aws_ring_buffer_release(struct aws_ring_buffer *ring_buffer, struct aws_byte_buf *buf);
LibAwsCommon.aws_round_up_to_power_of_two
— Methodaws_round_up_to_power_of_two(n, result)
Function to find the smallest result that is power of 2 >= n. Returns AWS_OP_ERR
if this cannot be done without overflow
Prototype
AWS_STATIC_IMPL int aws_round_up_to_power_of_two(size_t n, size_t *result);
LibAwsCommon.aws_run_command
— Methodaws_run_command(allocator, options, result)
Currently this API is implemented using popen on Posix system and _popen on Windows to capture output from running a command. Note that popen only captures stdout, and doesn't provide an option to capture stderr. We will add more options, such as acquire stderr in the future so probably will alter the underlying implementation as well.
Prototype
int aws_run_command( struct aws_allocator *allocator, struct aws_run_command_options *options, struct aws_run_command_result *result);
LibAwsCommon.aws_run_command_result_cleanup
— Methodaws_run_command_result_cleanup(result)
Documentation not found.
Prototype
void aws_run_command_result_cleanup(struct aws_run_command_result *result);
LibAwsCommon.aws_run_command_result_init
— Methodaws_run_command_result_init(allocator, result)
Documentation not found.
Prototype
int aws_run_command_result_init(struct aws_allocator *allocator, struct aws_run_command_result *result);
LibAwsCommon.aws_rw_lock_clean_up
— Methodaws_rw_lock_clean_up(lock)
Cleans up internal resources.
Prototype
void aws_rw_lock_clean_up(struct aws_rw_lock *lock);
LibAwsCommon.aws_rw_lock_init
— Methodaws_rw_lock_init(lock)
Initializes a new platform instance of mutex.
Prototype
int aws_rw_lock_init(struct aws_rw_lock *lock);
LibAwsCommon.aws_rw_lock_rlock
— Methodaws_rw_lock_rlock(lock)
Blocks until it acquires the lock. While on some platforms such as Windows, this may behave as a reentrant mutex, you should not treat it like one. On platforms it is possible for it to be non-reentrant, it will be.
Prototype
int aws_rw_lock_rlock(struct aws_rw_lock *lock);
LibAwsCommon.aws_rw_lock_runlock
— Methodaws_rw_lock_runlock(lock)
Releases the lock.
Prototype
int aws_rw_lock_runlock(struct aws_rw_lock *lock);
LibAwsCommon.aws_rw_lock_try_rlock
— Methodaws_rw_lock_try_rlock(lock)
Attempts to acquire the lock but returns immediately if it can not. While on some platforms such as Windows, this may behave as a reentrant mutex, you should not treat it like one. On platforms it is possible for it to be non-reentrant, it will be. Note: For windows, minimum support server version is Windows Server 2008 R2 [desktop apps | UWP apps]
Prototype
int aws_rw_lock_try_rlock(struct aws_rw_lock *lock);
LibAwsCommon.aws_rw_lock_try_wlock
— Methodaws_rw_lock_try_wlock(lock)
Documentation not found.
Prototype
int aws_rw_lock_try_wlock(struct aws_rw_lock *lock);
LibAwsCommon.aws_rw_lock_wlock
— Methodaws_rw_lock_wlock(lock)
Documentation not found.
Prototype
int aws_rw_lock_wlock(struct aws_rw_lock *lock);
LibAwsCommon.aws_rw_lock_wunlock
— Methodaws_rw_lock_wunlock(lock)
Documentation not found.
Prototype
int aws_rw_lock_wunlock(struct aws_rw_lock *lock);
LibAwsCommon.aws_secure_strlen
— Methodaws_secure_strlen(str, max_read_len, str_len)
Computes the length of a c string in bytes assuming the character set is either ASCII or UTF-8. If no NULL character is found within max_read_len of str, AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED is raised. Otherwise, str_len will contain the string length minus the NULL character, and AWS_OP_SUCCESS
will be returned.
Prototype
int aws_secure_strlen(const char *str, size_t max_read_len, size_t *str_len);
LibAwsCommon.aws_secure_zero
— Methodaws_secure_zero(pBuf, bufsize)
Securely zeroes a memory buffer. This function will attempt to ensure that the compiler will not optimize away this zeroing operation.
Prototype
void aws_secure_zero(void *pBuf, size_t bufsize);
LibAwsCommon.aws_set_environment_value
— Methodaws_set_environment_value(variable_name, value)
Set the value of an environment variable. On Windows, setting a variable to the empty string will actually unset it. Not thread-safe
Prototype
int aws_set_environment_value(const struct aws_string *variable_name, const struct aws_string *value);
LibAwsCommon.aws_set_global_error_handler_fn
— Methodaws_set_global_error_handler_fn(handler, ctx)
Sets an application wide error handler function. This will be overridden by the thread local handler. The previous handler is returned, this can be used for restoring an error handler if it needs to be overridden temporarily. Setting this to NULL will turn off this error callback after it has been enabled.
Prototype
aws_error_handler_fn *aws_set_global_error_handler_fn(aws_error_handler_fn *handler, void *ctx);
LibAwsCommon.aws_set_soft_limit_io_handles
— Methodaws_set_soft_limit_io_handles(max_handles)
Sets the new soft limit for io_handles (max fds). This can be up to the hard limit but may not exceed it.
This operation will always fail with AWS_ERROR_UNIMPLEMENTED error code on Windows.
Prototype
int aws_set_soft_limit_io_handles(size_t max_handles);
LibAwsCommon.aws_set_thread_local_error_handler_fn
— Methodaws_set_thread_local_error_handler_fn(handler, ctx)
Sets a thread-local error handler function. This will override the global handler. The previous handler is returned, this can be used for restoring an error handler if it needs to be overridden temporarily. Setting this to NULL will turn off this error callback after it has been enabled.
Prototype
aws_error_handler_fn *aws_set_thread_local_error_handler_fn(aws_error_handler_fn *handler, void *ctx);
LibAwsCommon.aws_small_block_allocator_bytes_active
— Methodaws_small_block_allocator_bytes_active(sba_allocator)
Returns the number of bytes currently active in the SBA
Prototype
size_t aws_small_block_allocator_bytes_active(struct aws_allocator *sba_allocator);
LibAwsCommon.aws_small_block_allocator_bytes_reserved
— Methodaws_small_block_allocator_bytes_reserved(sba_allocator)
Returns the number of bytes reserved in pages/bins inside the SBA, e.g. the current system memory used by the SBA
Prototype
size_t aws_small_block_allocator_bytes_reserved(struct aws_allocator *sba_allocator);
LibAwsCommon.aws_small_block_allocator_destroy
— Methodaws_small_block_allocator_destroy(sba_allocator)
Destroys a Small Block Allocator instance and frees its memory to the parent allocator. The parent allocator will otherwise be unaffected.
Prototype
void aws_small_block_allocator_destroy(struct aws_allocator *sba_allocator);
LibAwsCommon.aws_small_block_allocator_new
— Methodaws_small_block_allocator_new(allocator, multi_threaded)
Creates a new Small Block Allocator which fronts the supplied parent allocator. The SBA will intercept and handle small allocs, and will forward anything larger to the parent allocator. If multi_threaded is true, the internal allocator will protect its internal data structures with a mutex
Prototype
struct aws_allocator *aws_small_block_allocator_new(struct aws_allocator *allocator, bool multi_threaded);
LibAwsCommon.aws_small_block_allocator_page_size
— Methodaws_small_block_allocator_page_size(sba_allocator)
Returns the page size that the SBA is using
Prototype
size_t aws_small_block_allocator_page_size(struct aws_allocator *sba_allocator);
LibAwsCommon.aws_small_block_allocator_page_size_available
— Methodaws_small_block_allocator_page_size_available(sba_allocator)
Returns the amount of memory in each page available to user allocations
Prototype
size_t aws_small_block_allocator_page_size_available(struct aws_allocator *sba_allocator);
LibAwsCommon.aws_string_bytes
— Methodaws_string_bytes(str)
Equivalent to str->bytes.
Prototype
AWS_STATIC_IMPL const uint8_t *aws_string_bytes(const struct aws_string *str);
LibAwsCommon.aws_string_c_str
— Methodaws_string_c_str(str)
Equivalent to (const char *)str->bytes
.
Prototype
AWS_STATIC_IMPL const char *aws_string_c_str(const struct aws_string *str);
LibAwsCommon.aws_string_clone_or_reuse
— Methodaws_string_clone_or_reuse(allocator, str)
If the string was dynamically allocated, clones it. If the string was statically allocated (i.e. has no allocator), returns the original string.
Prototype
struct aws_string *aws_string_clone_or_reuse(struct aws_allocator *allocator, const struct aws_string *str);
LibAwsCommon.aws_string_compare
— Methodaws_string_compare(a, b)
Compares lexicographical ordering of two strings. This is a binary byte-by-byte comparison, treating bytes as unsigned integers. It is suitable for either textual or binary data and is unaware of unicode or any other byte encoding. If both strings are identical in the bytes of the shorter string, then the longer string is lexicographically after the shorter.
Returns a positive number if string a > string b. (i.e., string a is lexicographically after string b.) Returns zero if string a = string b. Returns negative number if string a < string b.
Prototype
int aws_string_compare(const struct aws_string *a, const struct aws_string *b);
LibAwsCommon.aws_string_destroy
— Methodaws_string_destroy(str)
Deallocate string.
Prototype
void aws_string_destroy(struct aws_string *str);
LibAwsCommon.aws_string_destroy_secure
— Methodaws_string_destroy_secure(str)
Zeroes out the data bytes of string and then deallocates the memory. Not safe to run on a string created with AWS_STATIC_STRING_FROM_LITERAL
.
Prototype
void aws_string_destroy_secure(struct aws_string *str);
LibAwsCommon.aws_string_eq
— Methodaws_string_eq(a, b)
Returns true if bytes of string are the same, false otherwise.
Prototype
bool aws_string_eq(const struct aws_string *a, const struct aws_string *b);
LibAwsCommon.aws_string_eq_byte_buf
— Methodaws_string_eq_byte_buf(str, buf)
Returns true if bytes of string and buffer are the same, false otherwise.
Prototype
bool aws_string_eq_byte_buf(const struct aws_string *str, const struct aws_byte_buf *buf);
LibAwsCommon.aws_string_eq_byte_buf_ignore_case
— Methodaws_string_eq_byte_buf_ignore_case(str, buf)
Returns true if bytes of string and buffer are equivalent, using a case-insensitive comparison.
Prototype
bool aws_string_eq_byte_buf_ignore_case(const struct aws_string *str, const struct aws_byte_buf *buf);
LibAwsCommon.aws_string_eq_byte_cursor
— Methodaws_string_eq_byte_cursor(str, cur)
Returns true if bytes of string and cursor are the same, false otherwise.
Prototype
bool aws_string_eq_byte_cursor(const struct aws_string *str, const struct aws_byte_cursor *cur);
LibAwsCommon.aws_string_eq_byte_cursor_ignore_case
— Methodaws_string_eq_byte_cursor_ignore_case(str, cur)
Returns true if bytes of string and cursor are equivalent, using a case-insensitive comparison.
Prototype
bool aws_string_eq_byte_cursor_ignore_case(const struct aws_string *str, const struct aws_byte_cursor *cur);
LibAwsCommon.aws_string_eq_c_str
— Methodaws_string_eq_c_str(str, c_str)
Documentation not found.
Prototype
bool aws_string_eq_c_str(const struct aws_string *str, const char *c_str);
LibAwsCommon.aws_string_eq_c_str_ignore_case
— Methodaws_string_eq_c_str_ignore_case(str, c_str)
Returns true if bytes of strings are equivalent, using a case-insensitive comparison.
Prototype
bool aws_string_eq_c_str_ignore_case(const struct aws_string *str, const char *c_str);
LibAwsCommon.aws_string_eq_ignore_case
— Methodaws_string_eq_ignore_case(a, b)
Returns true if bytes of string are equivalent, using a case-insensitive comparison.
Prototype
bool aws_string_eq_ignore_case(const struct aws_string *a, const struct aws_string *b);
LibAwsCommon.aws_string_is_valid
— Methodaws_string_is_valid(str)
Evaluates the set of properties that define the shape of all valid aws_string
structures. It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion).
Prototype
AWS_STATIC_IMPL bool aws_string_is_valid(const struct aws_string *str);
LibAwsCommon.aws_string_new_from_array
— Methodaws_string_new_from_array(allocator, bytes, len)
Allocate a new string with the same contents as array.
Prototype
struct aws_string *aws_string_new_from_array(struct aws_allocator *allocator, const uint8_t *bytes, size_t len);
LibAwsCommon.aws_string_new_from_buf
— Methodaws_string_new_from_buf(allocator, buf)
Allocate a new string with the same contents as buf.
Prototype
struct aws_string *aws_string_new_from_buf(struct aws_allocator *allocator, const struct aws_byte_buf *buf);
LibAwsCommon.aws_string_new_from_c_str
— Methodaws_string_new_from_c_str(allocator, c_str)
Constructor functions which copy data from null-terminated C-string or array of bytes.
Prototype
struct aws_string *aws_string_new_from_c_str(struct aws_allocator *allocator, const char *c_str);
LibAwsCommon.aws_string_new_from_cursor
— Methodaws_string_new_from_cursor(allocator, cursor)
Allocate a new string with the same contents as cursor.
Prototype
struct aws_string *aws_string_new_from_cursor(struct aws_allocator *allocator, const struct aws_byte_cursor *cursor);
LibAwsCommon.aws_string_new_from_string
— Methodaws_string_new_from_string(allocator, str)
Allocate a new string with the same contents as another string.
Prototype
struct aws_string *aws_string_new_from_string(struct aws_allocator *allocator, const struct aws_string *str);
LibAwsCommon.aws_string_to_log_level
— Methodaws_string_to_log_level(level_string, log_level)
Converts a c-string constant to a log level value. Uses case-insensitive comparison and simply iterates all possibilities until a match or nothing remains. If no match is found, AWS_OP_ERR
is returned.
Prototype
int aws_string_to_log_level(const char *level_string, enum aws_log_level *log_level);
LibAwsCommon.aws_sub_size_checked
— Methodaws_sub_size_checked(a, b, r)
If a - b overflows, returns AWS_OP_ERR
; otherwise subtracts a - b, returns the result in *r, and returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_sub_size_checked(size_t a, size_t b, size_t *r);
LibAwsCommon.aws_sub_size_saturating
— Methodaws_sub_size_saturating(a, b)
Subtracts a - b. If the result overflows returns 0.
Prototype
AWS_STATIC_IMPL size_t aws_sub_size_saturating(size_t a, size_t b);
LibAwsCommon.aws_sub_u32_checked
— Methodaws_sub_u32_checked(a, b, r)
If a - b overflows, returns AWS_OP_ERR
; otherwise subtracts a - b, returns the result in *r, and returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_sub_u32_checked(uint32_t a, uint32_t b, uint32_t *r);
LibAwsCommon.aws_sub_u32_saturating
— Methodaws_sub_u32_saturating(a, b)
Subtracts a - b. If the result overflows returns 0.
Prototype
AWS_STATIC_IMPL uint32_t aws_sub_u32_saturating(uint32_t a, uint32_t b);
LibAwsCommon.aws_sub_u64_checked
— Methodaws_sub_u64_checked(a, b, r)
If a - b overflows, returns AWS_OP_ERR
; otherwise subtracts a - b, returns the result in *r, and returns AWS_OP_SUCCESS
.
Prototype
AWS_STATIC_IMPL int aws_sub_u64_checked(uint64_t a, uint64_t b, uint64_t *r);
LibAwsCommon.aws_sub_u64_saturating
— Methodaws_sub_u64_saturating(a, b)
Subtracts a - b. If the result overflows returns 0.
Prototype
AWS_STATIC_IMPL uint64_t aws_sub_u64_saturating(uint64_t a, uint64_t b);
LibAwsCommon.aws_sys_clock_get_ticks
— Methodaws_sys_clock_get_ticks(timestamp)
Get ticks in nanoseconds (usually 100 nanosecond precision) on the system clock. Reflects actual system time via nanoseconds since unix epoch. Use with care since an inaccurately set clock will probably cause bugs. On success, timestamp will be set.
Prototype
int aws_sys_clock_get_ticks(uint64_t *timestamp);
LibAwsCommon.aws_system_environment_acquire
— Methodaws_system_environment_acquire(env)
Documentation not found.
Prototype
struct aws_system_environment *aws_system_environment_acquire(struct aws_system_environment *env);
LibAwsCommon.aws_system_environment_get_cpu_group_count
— Methodaws_system_environment_get_cpu_group_count(env)
Returns the number of separate cpu groupings (multi-socket configurations or NUMA).
Prototype
size_t aws_system_environment_get_cpu_group_count(const struct aws_system_environment *env);
LibAwsCommon.aws_system_environment_get_processor_count
— Methodaws_system_environment_get_processor_count(env)
Returns the number of processors for the specified compute environment.
Prototype
size_t aws_system_environment_get_processor_count(struct aws_system_environment *env);
LibAwsCommon.aws_system_environment_get_virtualization_product_name
— Methodaws_system_environment_get_virtualization_product_name(env)
Returns the product name for the specified compute environment. For example, the Amazon EC2 Instance type.
The return value may be empty and in that case no vendor was detected.
Prototype
struct aws_byte_cursor aws_system_environment_get_virtualization_product_name(const struct aws_system_environment *env);
LibAwsCommon.aws_system_environment_get_virtualization_vendor
— Methodaws_system_environment_get_virtualization_vendor(env)
Returns the virtualization vendor for the specified compute environment, e.g. "Xen, Amazon EC2, etc..."
The return value may be empty and in that case no vendor was detected.
Prototype
struct aws_byte_cursor aws_system_environment_get_virtualization_vendor(const struct aws_system_environment *env);
LibAwsCommon.aws_system_environment_load
— Methodaws_system_environment_load(allocator)
Allocates and initializes information about the system the current process is executing on. If successful returns an instance of aws_system_environment
. If it fails, it will return NULL.
Note: This api is used internally and is still early in its evolution. It may change in incompatible ways in the future.
Prototype
struct aws_system_environment *aws_system_environment_load(struct aws_allocator *allocator);
LibAwsCommon.aws_system_environment_release
— Methodaws_system_environment_release(env)
Documentation not found.
Prototype
void aws_system_environment_release(struct aws_system_environment *env);
LibAwsCommon.aws_system_info_processor_count
— Methodaws_system_info_processor_count()
Returns the number of online processors available for usage.
Prototype
size_t aws_system_info_processor_count(void);
LibAwsCommon.aws_task_init
— Methodaws_task_init(task, fn, arg, type_tag)
Init an aws_task
Prototype
void aws_task_init(struct aws_task *task, aws_task_fn *fn, void *arg, const char *type_tag);
LibAwsCommon.aws_task_run
— Methodaws_task_run(task, status)
Runs or cancels a task
Prototype
void aws_task_run(struct aws_task *task, enum aws_task_status status);
LibAwsCommon.aws_task_scheduler_cancel_task
— Methodaws_task_scheduler_cancel_task(scheduler, task)
Removes task from the scheduler and invokes the task with the AWS_TASK_STATUS_CANCELED status.
Prototype
void aws_task_scheduler_cancel_task(struct aws_task_scheduler *scheduler, struct aws_task *task);
LibAwsCommon.aws_task_scheduler_clean_up
— Methodaws_task_scheduler_clean_up(scheduler)
Empties and executes all queued tasks, passing the AWS_TASK_STATUS_CANCELED status to the task function. Cleans up any memory allocated, and prepares the instance for reuse or deletion.
Prototype
void aws_task_scheduler_clean_up(struct aws_task_scheduler *scheduler);
LibAwsCommon.aws_task_scheduler_has_tasks
— Methodaws_task_scheduler_has_tasks(scheduler, next_task_time)
Returns whether the scheduler has any scheduled tasks. next_task_time (optional) will be set to time of the next task, note that 0 will be set if tasks were added via aws_task_scheduler_schedule_now
() and UINT64_MAX will be set if no tasks are scheduled at all.
Prototype
bool aws_task_scheduler_has_tasks(const struct aws_task_scheduler *scheduler, uint64_t *next_task_time);
LibAwsCommon.aws_task_scheduler_init
— Methodaws_task_scheduler_init(scheduler, alloc)
Initializes a task scheduler instance.
Prototype
int aws_task_scheduler_init(struct aws_task_scheduler *scheduler, struct aws_allocator *alloc);
LibAwsCommon.aws_task_scheduler_is_valid
— Methodaws_task_scheduler_is_valid(scheduler)
Documentation not found.
Prototype
bool aws_task_scheduler_is_valid(const struct aws_task_scheduler *scheduler);
LibAwsCommon.aws_task_scheduler_run_all
— Methodaws_task_scheduler_run_all(scheduler, current_time)
Sequentially execute all tasks scheduled to run at, or before current_time. AWS_TASK_STATUS_RUN_READY will be passed to the task function as the task status.
If a task schedules another task, the new task will not be executed until the next call to this function.
Prototype
void aws_task_scheduler_run_all(struct aws_task_scheduler *scheduler, uint64_t current_time);
LibAwsCommon.aws_task_scheduler_schedule_future
— Methodaws_task_scheduler_schedule_future(scheduler, task, time_to_run)
Schedules a task to run at time_to_run. The task should not be cleaned up or modified until its function is executed.
Prototype
void aws_task_scheduler_schedule_future( struct aws_task_scheduler *scheduler, struct aws_task *task, uint64_t time_to_run);
LibAwsCommon.aws_task_scheduler_schedule_now
— Methodaws_task_scheduler_schedule_now(scheduler, task)
Schedules a task to run immediately. The task should not be cleaned up or modified until its function is executed.
Prototype
void aws_task_scheduler_schedule_now(struct aws_task_scheduler *scheduler, struct aws_task *task);
LibAwsCommon.aws_task_status_to_c_str
— Methodaws_task_status_to_c_str(status)
Convert a status value to a c-string suitable for logging
Prototype
const char *aws_task_status_to_c_str(enum aws_task_status status);
LibAwsCommon.aws_text_detect_encoding
— Methodaws_text_detect_encoding(bytes, size)
Checks the BOM in the buffer to see if encoding can be determined. If there is no BOM or it is unrecognizable, then AWS_TEXT_UNKNOWN will be returned.
Prototype
AWS_STATIC_IMPL enum aws_text_encoding aws_text_detect_encoding(const uint8_t *bytes, size_t size);
LibAwsCommon.aws_text_is_utf8
— Methodaws_text_is_utf8(bytes, size)
Returns true if aws_text_detect_encoding
() determines the text is UTF8 or ASCII. Note that this immediately returns true if the UTF8 BOM is seen. To fully validate every byte, use aws_decode_utf8
().
Prototype
AWS_STATIC_IMPL bool aws_text_is_utf8(const uint8_t *bytes, size_t size);
LibAwsCommon.aws_thread_call_once
— Methodaws_thread_call_once(flag, call_once, user_data)
Documentation not found.
Prototype
void aws_thread_call_once(aws_thread_once *flag, void (*call_once)(void *), void *user_data);
LibAwsCommon.aws_thread_clean_up
— Methodaws_thread_clean_up(thread)
Cleans up the thread handle. Don't call this on a managed thread. If you wish to join the thread, you must join before calling this function.
Prototype
void aws_thread_clean_up(struct aws_thread *thread);
LibAwsCommon.aws_thread_current_at_exit
— Methodaws_thread_current_at_exit(callback, user_data)
Adds a callback to the chain to be called when the current thread joins. Callbacks are called from the current thread, in the reverse order they were added, after the thread function returns. If not called from within an aws_thread
, has no effect.
Prototype
int aws_thread_current_at_exit(aws_thread_atexit_fn *callback, void *user_data);
LibAwsCommon.aws_thread_current_name
— Methodaws_thread_current_name(allocator, out_name)
Gets name of the current thread. Caller is responsible for destroying returned string. If thread does not have a name, AWS_OP_SUCCESS
is returned and out_name is set to NULL. If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED will be raised
Prototype
int aws_thread_current_name(struct aws_allocator *allocator, struct aws_string **out_name);
LibAwsCommon.aws_thread_current_sleep
— Methodaws_thread_current_sleep(nanos)
Sleeps the current thread by nanos.
Prototype
void aws_thread_current_sleep(uint64_t nanos);
LibAwsCommon.aws_thread_current_thread_id
— Methodaws_thread_current_thread_id()
Returns the thread id of the calling thread.
Prototype
aws_thread_id_t aws_thread_current_thread_id(void);
LibAwsCommon.aws_thread_decrement_unjoined_count
— Methodaws_thread_decrement_unjoined_count()
Decrements the count of unjoined threads in the managed thread system. Used by managed threads and event loop threads. Additional usage requires the user to join corresponding threads themselves and correctly increment/decrement even in the face of launch/join errors.
aws_thread_join_all_managed
() will not return until this count has gone to zero.
Prototype
void aws_thread_decrement_unjoined_count(void);
LibAwsCommon.aws_thread_get_detach_state
— Methodaws_thread_get_detach_state(thread)
Gets the detach state of the thread. For example, is it safe to call join on this thread? Has it been detached()?
Prototype
enum aws_thread_detach_state aws_thread_get_detach_state(struct aws_thread *thread);
LibAwsCommon.aws_thread_get_id
— Methodaws_thread_get_id(thread)
Gets the id of thread
Prototype
aws_thread_id_t aws_thread_get_id(struct aws_thread *thread);
LibAwsCommon.aws_thread_id_t_to_string
— Methodaws_thread_id_t_to_string(thread_id, buffer, bufsz)
Converts an aws_thread_id_t
to a c-string. For portability, aws_thread_id_t
must not be printed directly. Intended primarily to support building log lines that include the thread id in them. The parameter buffer
must point-to a char buffer of length bufsz == [
AWSTHREADIDTREPR_BUFSZ](@ref)
. The thread id representation is returned in buffer
.
Prototype
int aws_thread_id_t_to_string(aws_thread_id_t thread_id, char *buffer, size_t bufsz);
LibAwsCommon.aws_thread_increment_unjoined_count
— Methodaws_thread_increment_unjoined_count()
Increments the count of unjoined threads in the managed thread system. Used by managed threads and event loop threads. Additional usage requires the user to join corresponding threads themselves and correctly increment/decrement even in the face of launch/join errors.
aws_thread_join_all_managed
() will not return until this count has gone to zero.
Prototype
void aws_thread_increment_unjoined_count(void);
LibAwsCommon.aws_thread_init
— Methodaws_thread_init(thread, allocator)
Initializes a new platform specific thread object struct (not the os-level thread itself).
Prototype
int aws_thread_init(struct aws_thread *thread, struct aws_allocator *allocator);
LibAwsCommon.aws_thread_join
— Methodaws_thread_join(thread)
Joins the calling thread to a thread instance. Returns when thread is finished. Calling this from the associated OS thread will cause a deadlock.
Prototype
int aws_thread_join(struct aws_thread *thread);
LibAwsCommon.aws_thread_join_all_managed
— Methodaws_thread_join_all_managed()
Blocking call that waits for all managed threads to complete their join call. This can only be called from the main thread or a non-managed thread.
This gets called automatically from library cleanup.
By default the wait is unbounded, but that default can be overridden via aws_thread_set_managed_join_timeout_ns
()
Prototype
int aws_thread_join_all_managed(void);
LibAwsCommon.aws_thread_launch
— Methodaws_thread_launch(thread, func, arg, options)
Creates an OS level thread and associates it with func. context will be passed to func when it is executed. options will be applied to the thread if they are applicable for the platform.
After launch, you may join on the thread. A successfully launched thread must have clean_up called on it in order to avoid a handle leak. If you do not join before calling clean_up, the thread will become detached.
Managed threads must not have join or clean_up called on them by external code.
Prototype
int aws_thread_launch( struct aws_thread *thread, void (*func)(void *arg), void *arg, const struct aws_thread_options *options);
LibAwsCommon.aws_thread_name
— Methodaws_thread_name(allocator, thread_id, out_name)
Gets name of the thread. Caller is responsible for destroying returned string. If thread does not have a name, AWS_OP_SUCCESS
is returned and out_name is set to NULL. If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED will be raised
Prototype
int aws_thread_name( struct aws_allocator *allocator, aws_thread_id_t thread_id, struct aws_string **out_name);
LibAwsCommon.aws_thread_scheduler_acquire
— Methodaws_thread_scheduler_acquire(scheduler)
Acquire a reference to the scheduler.
Prototype
void aws_thread_scheduler_acquire(struct aws_thread_scheduler *scheduler);
LibAwsCommon.aws_thread_scheduler_cancel_task
— Methodaws_thread_scheduler_cancel_task(scheduler, task)
Cancel a task that has been scheduled. The cancellation callback will be invoked in the background thread. This function is slow, so please don't do it in the hot path for your code.
Prototype
void aws_thread_scheduler_cancel_task(struct aws_thread_scheduler *scheduler, struct aws_task *task);
LibAwsCommon.aws_thread_scheduler_new
— Methodaws_thread_scheduler_new(allocator, thread_options)
Creates a new instance of a thread scheduler. This object receives scheduled tasks and executes them inside a background thread. On success, this function returns an instance with a ref-count of 1. On failure it returns NULL.
thread_options are optional.
The semantics of this interface conform to the semantics of aws_task_scheduler
.
Prototype
struct aws_thread_scheduler *aws_thread_scheduler_new( struct aws_allocator *allocator, const struct aws_thread_options *thread_options);
LibAwsCommon.aws_thread_scheduler_release
— Methodaws_thread_scheduler_release(scheduler)
Release a reference to the scheduler.
Prototype
void aws_thread_scheduler_release(const struct aws_thread_scheduler *scheduler);
LibAwsCommon.aws_thread_scheduler_schedule_future
— Methodaws_thread_scheduler_schedule_future(scheduler, task, time_to_run)
Schedules a task to run in the future. time_to_run is the absolute time from the system hw_clock.
Prototype
void aws_thread_scheduler_schedule_future( struct aws_thread_scheduler *scheduler, struct aws_task *task, uint64_t time_to_run);
LibAwsCommon.aws_thread_scheduler_schedule_now
— Methodaws_thread_scheduler_schedule_now(scheduler, task)
Schedules a task to run as soon as possible.
Prototype
void aws_thread_scheduler_schedule_now(struct aws_thread_scheduler *scheduler, struct aws_task *task);
LibAwsCommon.aws_thread_set_managed_join_timeout_ns
— Methodaws_thread_set_managed_join_timeout_ns(timeout_in_ns)
Overrides how long, in nanoseconds, that aws_thread_join_all_managed
will wait for threads to complete. A value of zero will result in an unbounded wait.
Prototype
void aws_thread_set_managed_join_timeout_ns(uint64_t timeout_in_ns);
LibAwsCommon.aws_thread_thread_id_equal
— Methodaws_thread_thread_id_equal(t1, t2)
Compare thread ids.
Prototype
bool aws_thread_thread_id_equal(aws_thread_id_t t1, aws_thread_id_t t2);
LibAwsCommon.aws_timegm
— Methodaws_timegm(t)
Cross platform friendly version of timegm
Prototype
time_t aws_timegm(struct tm *const t);
LibAwsCommon.aws_timestamp_convert
— Methodaws_timestamp_convert(timestamp, convert_from, convert_to, remainder)
Converts 'timestamp' from unit 'convert_from' to unit 'convert_to', if the units are the same then 'timestamp' is returned. If 'remainder' is NOT NULL, it will be set to the remainder if convert_from is a more precise unit than convert_to. To avoid unnecessary branching, 'remainder' is not zero initialized in this function, be sure to set it to 0 first if you care about that kind of thing. If conversion would lead to integer overflow, the timestamp returned will be the highest possible time that is representable, i.e. UINT64_MAX.
Prototype
AWS_STATIC_IMPL uint64_t aws_timestamp_convert( uint64_t timestamp, enum aws_timestamp_unit convert_from, enum aws_timestamp_unit convert_to, uint64_t *remainder);
LibAwsCommon.aws_timestamp_convert_u64
— Methodaws_timestamp_convert_u64(ticks, old_frequency, new_frequency, remainder)
More general form of aws_timestamp_convert
that takes arbitrary frequencies rather than the timestamp enum.
Prototype
AWS_STATIC_IMPL uint64_t aws_timestamp_convert_u64(uint64_t ticks, uint64_t old_frequency, uint64_t new_frequency, uint64_t *remainder);
LibAwsCommon.aws_translate_and_raise_io_error
— Methodaws_translate_and_raise_io_error(error_no)
Convert a c library io error into an aws error, and raise it. If no conversion is found, AWS_ERROR_SYS_CALL_FAILURE is raised. Always returns AWS_OP_ERR
.
Prototype
int aws_translate_and_raise_io_error(int error_no);
LibAwsCommon.aws_translate_and_raise_io_error_or
— Methodaws_translate_and_raise_io_error_or(error_no, fallback_aws_error_code)
Convert a c library io error into an aws error, and raise it. If no conversion is found, fallback_aws_error_code is raised. Always returns AWS_OP_ERR
.
Prototype
int aws_translate_and_raise_io_error_or(int error_no, int fallback_aws_error_code);
LibAwsCommon.aws_unregister_error_info
— Methodaws_unregister_error_info(error_info)
Documentation not found.
Prototype
void aws_unregister_error_info(const struct aws_error_info_list *error_info);
LibAwsCommon.aws_unregister_log_subject_info_list
— Methodaws_unregister_log_subject_info_list(log_subject_list)
Disconnects log subject strings with log subject integer values
Prototype
void aws_unregister_log_subject_info_list(struct aws_log_subject_info_list *log_subject_list);
LibAwsCommon.aws_unset_environment_value
— Methodaws_unset_environment_value(variable_name)
Unset an environment variable. Not thread-safe
Prototype
int aws_unset_environment_value(const struct aws_string *variable_name);
LibAwsCommon.aws_uri_authority
— Methodaws_uri_authority(uri)
Returns the authority portion of the uri (host[:port]). If it was not present, this was a request uri. In that case, the value will be empty.
Prototype
const struct aws_byte_cursor *aws_uri_authority(const struct aws_uri *uri);
LibAwsCommon.aws_uri_clean_up
— Methodaws_uri_clean_up(uri)
Documentation not found.
Prototype
void aws_uri_clean_up(struct aws_uri *uri);
LibAwsCommon.aws_uri_host_name
— Methodaws_uri_host_name(uri)
Returns the 'host_name' portion of the authority. If no authority was present, this value will be empty.
Prototype
const struct aws_byte_cursor *aws_uri_host_name(const struct aws_uri *uri);
LibAwsCommon.aws_uri_init_from_builder_options
— Methodaws_uri_init_from_builder_options(uri, allocator, options)
Initializes uri to values specified in options. Returns AWS_OP_SUCCESS
, on success, AWS_OP_ERR
on failure. After calling this function, the parts can be accessed.
Prototype
int aws_uri_init_from_builder_options( struct aws_uri *uri, struct aws_allocator *allocator, struct aws_uri_builder_options *options);
LibAwsCommon.aws_uri_init_parse
— Methodaws_uri_init_parse(uri, allocator, uri_str)
Parses 'uri_str' and initializes uri. Returns AWS_OP_SUCCESS
, on success, AWS_OP_ERR
on failure. After calling this function, the parts can be accessed.
Prototype
int aws_uri_init_parse( struct aws_uri *uri, struct aws_allocator *allocator, const struct aws_byte_cursor *uri_str);
LibAwsCommon.aws_uri_path
— Methodaws_uri_path(uri)
Returns the path portion of the uri, including any leading '/'. If not present, this value will be empty.
Prototype
const struct aws_byte_cursor *aws_uri_path(const struct aws_uri *uri);
LibAwsCommon.aws_uri_path_and_query
— Methodaws_uri_path_and_query(uri)
Returns the path and query portion of the uri (i.e., the thing you send across the wire).
Prototype
const struct aws_byte_cursor *aws_uri_path_and_query(const struct aws_uri *uri);
LibAwsCommon.aws_uri_port
— Methodaws_uri_port(uri)
Returns the port portion of the authority if it was present, otherwise, returns 0. If this is 0, it is the users job to determine the correct port based on scheme and protocol.
Prototype
uint32_t aws_uri_port(const struct aws_uri *uri);
LibAwsCommon.aws_uri_query_string
— Methodaws_uri_query_string(uri)
Returns the query string portion of the uri, minus the '?'. If not present, this value will be empty.
Prototype
const struct aws_byte_cursor *aws_uri_query_string(const struct aws_uri *uri);
LibAwsCommon.aws_uri_query_string_next_param
— Methodaws_uri_query_string_next_param(uri, param)
For iterating over the params in the uri query string. param
is an in/out argument used to track progress, it MUST be zeroed out to start. If true is returned, param
contains the value of the next param. If false is returned, there are no further params.
Edge cases: 1) Entries without '=' sign are treated as having a key and no value. Example: First param in query string "a&b=c" has key="a" value=""
- Blank entries are skipped. Example: The only param in query string "&&a=b" is key="a" value="b"
Prototype
bool aws_uri_query_string_next_param(const struct aws_uri *uri, struct aws_uri_param *param);
LibAwsCommon.aws_uri_query_string_params
— Methodaws_uri_query_string_params(uri, out_params)
Parses query string and stores the parameters in 'out_params'. Returns AWS_OP_SUCCESS
on success and AWS_OP_ERR
on failure. The user is responsible for initializing out_params with item size of struct aws_query_param. The user is also responsible for cleaning up out_params when finished.
Prototype
int aws_uri_query_string_params(const struct aws_uri *uri, struct aws_array_list *out_params);
LibAwsCommon.aws_uri_scheme
— Methodaws_uri_scheme(uri)
Returns the scheme portion of the uri (e.g. http, https, ftp, ftps, etc...). If the scheme was not present in the uri, the returned value will be empty. It is the users job to determine the appropriate defaults if this field is empty, based on protocol, port, etc...
Prototype
const struct aws_byte_cursor *aws_uri_scheme(const struct aws_uri *uri);
LibAwsCommon.aws_utf8_decoder_destroy
— Methodaws_utf8_decoder_destroy(decoder)
Documentation not found.
Prototype
void aws_utf8_decoder_destroy(struct aws_utf8_decoder *decoder);
LibAwsCommon.aws_utf8_decoder_finalize
— Methodaws_utf8_decoder_finalize(decoder)
Tell the decoder that you've reached the end of your text. Raises AWS_ERROR_INVALID_UTF8 if the text did not end with a complete UTF8 codepoint. This also resets the decoder.
Prototype
int aws_utf8_decoder_finalize(struct aws_utf8_decoder *decoder);
LibAwsCommon.aws_utf8_decoder_new
— Methodaws_utf8_decoder_new(allocator, options)
Create a UTF8/ASCII decoder, which can process text incrementally as you receive it. Text is always validated according to RFC-3629 (you may perform additional validation in the on_codepoint callback). The text does not need to begin with a UTF8 BOM. To decode text all at once, simply use aws_decode_utf8
().
Feed bytes into the decoder with aws_utf8_decoder_update
(), and call aws_utf8_decoder_finalize
() when the text is complete.
Arguments
allocator
: Allocatoroptions
: Options for decoder. If NULL is passed, the text is simply validated.
Prototype
struct aws_utf8_decoder *aws_utf8_decoder_new( struct aws_allocator *allocator, const struct aws_utf8_decoder_options *options);
LibAwsCommon.aws_utf8_decoder_reset
— Methodaws_utf8_decoder_reset(decoder)
Documentation not found.
Prototype
void aws_utf8_decoder_reset(struct aws_utf8_decoder *decoder);
LibAwsCommon.aws_utf8_decoder_update
— Methodaws_utf8_decoder_update(decoder, bytes)
Update the decoder with more bytes of text. The on_codepoint callback will be invoked for each codepoint encountered. Raises an error if invalid UTF8 is encountered or the on_codepoint callback reports an error.
Note: You must call aws_utf8_decoder_finalize
() when the text is 100% complete, to ensure the input was completely valid.
Prototype
int aws_utf8_decoder_update(struct aws_utf8_decoder *decoder, struct aws_byte_cursor bytes);
LibAwsCommon.aws_uuid_equals
— Methodaws_uuid_equals(a, b)
Documentation not found.
Prototype
bool aws_uuid_equals(const struct aws_uuid *a, const struct aws_uuid *b);
LibAwsCommon.aws_uuid_init
— Methodaws_uuid_init(uuid)
Documentation not found.
Prototype
int aws_uuid_init(struct aws_uuid *uuid);
LibAwsCommon.aws_uuid_init_from_str
— Methodaws_uuid_init_from_str(uuid, uuid_str)
Documentation not found.
Prototype
int aws_uuid_init_from_str(struct aws_uuid *uuid, const struct aws_byte_cursor *uuid_str);
LibAwsCommon.aws_uuid_to_str
— Methodaws_uuid_to_str(uuid, output)
Documentation not found.
Prototype
int aws_uuid_to_str(const struct aws_uuid *uuid, struct aws_byte_buf *output);
LibAwsCommon.aws_write_u16
— Methodaws_write_u16(value, buffer)
Add a 16 bit unsigned integer to the buffer, ensuring network-byte order return the new position in the buffer for the next operation. Assumes buffer is at least 2 bytes long.
Prototype
AWS_STATIC_IMPL void aws_write_u16(uint16_t value, uint8_t *buffer);
LibAwsCommon.aws_write_u24
— Methodaws_write_u24(value, buffer)
Add a 24 bit unsigned integer to the buffer, ensuring network - byte order return the new position in the buffer for the next operation. Note, since this uses uint32_t for storage, the 3 least significant bytes will be used. Assumes buffer is at least 3 bytes long.
Prototype
AWS_STATIC_IMPL void aws_write_u24(uint32_t value, uint8_t *buffer);
LibAwsCommon.aws_write_u32
— Methodaws_write_u32(value, buffer)
Add a 32 bit unsigned integer to the buffer, ensuring network - byte order Assumes the buffer size is at least 4 bytes.
Prototype
AWS_STATIC_IMPL void aws_write_u32(uint32_t value, uint8_t *buffer);
LibAwsCommon.aws_write_u64
— Methodaws_write_u64(value, buffer)
Add a 64 bit unsigned integer to the buffer, ensuring network - byte order Assumes the buffer size is at least 8 bytes.
Prototype
AWS_STATIC_IMPL void aws_write_u64(uint64_t value, uint8_t *buffer);
LibAwsCommon.aws_xml_node_as_body
— Methodaws_xml_node_as_body(node, out_body)
Writes the contents of the body of node into out_body. out_body is an output parameter in this case. Upon success, out_body will contain the body of the node.
Prototype
int aws_xml_node_as_body(struct aws_xml_node *node, struct aws_byte_cursor *out_body);
LibAwsCommon.aws_xml_node_get_attribute
— Methodaws_xml_node_get_attribute(node, attribute_index)
Get an attribute for an xml node by its index.
Prototype
struct aws_xml_attribute aws_xml_node_get_attribute(const struct aws_xml_node *node, size_t attribute_index);
LibAwsCommon.aws_xml_node_get_name
— Methodaws_xml_node_get_name(node)
Get the name of an xml node.
Prototype
struct aws_byte_cursor aws_xml_node_get_name(const struct aws_xml_node *node);
LibAwsCommon.aws_xml_node_get_num_attributes
— Methodaws_xml_node_get_num_attributes(node)
Get the number of attributes for an xml node.
Prototype
size_t aws_xml_node_get_num_attributes(const struct aws_xml_node *node);
LibAwsCommon.aws_xml_node_traverse
— Methodaws_xml_node_traverse(node, on_node_encountered, user_data)
Traverse node and invoke on_node_encountered when a nested node is encountered.
Prototype
int aws_xml_node_traverse( struct aws_xml_node *node, aws_xml_parser_on_node_encountered_fn *on_node_encountered, void *user_data);
LibAwsCommon.aws_xml_parse
— Methodaws_xml_parse(allocator, options)
Parse an XML document. WARNING: This is not a public API. It is only intended for use within the aws-c libraries.
Prototype
int aws_xml_parse(struct aws_allocator *allocator, const struct aws_xml_parser_options *options);
LibAwsCommon.enable_vt_mode
— Methodenable_vt_mode()
Documentation not found.
Prototype
static inline int enable_vt_mode(void);
LibAwsCommon.s_aws_run_test_case
— Methods_aws_run_test_case(harness)
Documentation not found.
Prototype
static inline int s_aws_run_test_case(struct aws_test_harness *harness);
LibAwsCommon.s_print_stack_trace
— Methods_print_stack_trace(sig, sig_info, user_data)
Documentation not found.
Prototype
static void s_print_stack_trace(int sig, siginfo_t *sig_info, void *user_data);