dm_c Module

Utility procedures for C interoperability.


Uses

  • module~~dm_c~~UsesGraph module~dm_c dm_c iso_c_binding iso_c_binding module~dm_c->iso_c_binding module~dm_kind dm_kind module~dm_c->module~dm_kind iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env

Used by

  • module~~dm_c~~UsedByGraph module~dm_c dm_c module~dm_crypto dm_crypto module~dm_crypto->module~dm_c module~dm_modbus dm_modbus module~dm_modbus->module~dm_c module~dmpack dmpack module~dmpack->module~dm_c module~dmpack->module~dm_crypto module~dmpack->module~dm_modbus proc~dm_file_status dm_file_status proc~dm_file_status->module~dm_c proc~dm_tty_set_attributes dm_tty_set_attributes proc~dm_tty_set_attributes->module~dm_c

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: c_unsigned_char = c_signed_char

Interfaces

public interface dm_to_signed

Converts unsigned integer to signed integer.

  • public pure elemental function dm_uint16_to_int32(u) result(s)

    Converts unsigned 2-byte integer to signed 4-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=u2), intent(in) :: u

    Unsigned integer.

    Return Value integer(kind=i4)

    Signed integer.

  • public pure elemental function dm_uint32_to_int64(u) result(s)

    Converts unsigned 4-byte integer to signed 8-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=u4), intent(in) :: u

    Unsigned integer.

    Return Value integer(kind=i8)

    Signed integer.

public interface dm_to_unsigned

Converts signed integer to unsigned integer.

  • public pure elemental function dm_int32_to_uint16(s) result(u)

    Converts signed 4-byte integer to unsigned 2-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i4), intent(in) :: s

    Signed integer.

    Return Value integer(kind=u2)

    Unsigned integer.

  • public pure elemental function dm_int64_to_uint32(s) result(u)

    Converts signed 8-byte integer to unsigned 4-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i8), intent(in) :: s

    Signed integer.

    Return Value integer(kind=u4)

    Unsigned integer.


Functions

public pure elemental function dm_c_f_logical(c) result(f)

Converts C logical value to Fortran representation.

Arguments

Type IntentOptional Attributes Name
integer(kind=c_int), intent(in) :: c

Return Value logical

public pure elemental function dm_f_c_logical(f) result(c)

Converts Fortran logical value to C representation.

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: f

Return Value integer(kind=c_int)

public pure elemental function dm_int32_to_uint16(s) result(u)

Converts signed 4-byte integer to unsigned 2-byte integer.

Arguments

Type IntentOptional Attributes Name
integer(kind=i4), intent(in) :: s

Signed integer.

Return Value integer(kind=u2)

Unsigned integer.

public pure elemental function dm_int64_to_uint32(s) result(u)

Converts signed 8-byte integer to unsigned 4-byte integer.

Arguments

Type IntentOptional Attributes Name
integer(kind=i8), intent(in) :: s

Signed integer.

Return Value integer(kind=u4)

Unsigned integer.

public pure elemental function dm_uint16_to_int32(u) result(s)

Converts unsigned 2-byte integer to signed 4-byte integer.

Arguments

Type IntentOptional Attributes Name
integer(kind=u2), intent(in) :: u

Unsigned integer.

Return Value integer(kind=i4)

Signed integer.

public pure elemental function dm_uint32_to_int64(u) result(s)

Converts unsigned 4-byte integer to signed 8-byte integer.

Arguments

Type IntentOptional Attributes Name
integer(kind=u4), intent(in) :: u

Unsigned integer.

Return Value integer(kind=i8)

Signed integer.