Skip to content

Commit

Permalink
Minor updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
interkosmos committed Jun 20, 2024
1 parent e271603 commit c81b682
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/dm_arg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module dm_arg
integer, parameter, public :: ARG_TYPE_CHAR = 4 !! Single character value.
integer, parameter, public :: ARG_TYPE_STRING = 5 !! Character string value.
integer, parameter, public :: ARG_TYPE_ID = 6 !! Valid ID value.
integer, parameter, public :: ARG_TYPE_UUID = 7 !! Valid UUID4 value.
integer, parameter, public :: ARG_TYPE_UUID = 7 !! Valid UUIDv4 value.
integer, parameter, public :: ARG_TYPE_TIME = 8 !! Valid ISO 8601 value.
integer, parameter, public :: ARG_TYPE_LEVEL = 9 !! Log level (name string or integer value).
integer, parameter, public :: ARG_TYPE_FILE = 10 !! Path to file on file system (must exist).
Expand Down Expand Up @@ -320,7 +320,7 @@ integer function dm_arg_read(args, app, major, minor, patch) result(rc)
case (ARG_TYPE_ID)
call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not a valid id')
case (ARG_TYPE_UUID)
call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not a valid UUID4')
call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not a valid UUID')
case (ARG_TYPE_TIME)
call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not in ISO 8601 format')
case (ARG_TYPE_LEVEL)
Expand Down
4 changes: 2 additions & 2 deletions src/dm_observ.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module dm_observ
!! Observation with receivers, requests, and responses. Modifying this
!! type requires changes in `dm_csv`, `dm_db`, `dm_hdf5`, `dm_html`,
!! `dm_json`, and several other modules (you probably don’t want that!).
character(len=OBSERV_ID_LEN) :: id = UUID_DEFAULT !! Observation id (UUID4).
character(len=OBSERV_ID_LEN) :: id = UUID_DEFAULT !! Observation id (UUIDv4).
character(len=NODE_ID_LEN) :: node_id = ' ' !! Node id (`-0-9A-Z_a-z`).
character(len=SENSOR_ID_LEN) :: sensor_id = ' ' !! Sensor id (`-0-9A-Z_a-z`).
character(len=TARGET_ID_LEN) :: target_id = ' ' !! Target id (`-0-9A-Z_a-z`).
Expand All @@ -56,7 +56,7 @@ module dm_observ
! ******************************************************************
type, public :: observ_view_type
!! View of an observation with only one response of a single request.
character(len=OBSERV_ID_LEN) :: observ_id = UUID_DEFAULT !! Observation id (UUID4).
character(len=OBSERV_ID_LEN) :: observ_id = UUID_DEFAULT !! Observation id (UUID).
character(len=NODE_ID_LEN) :: node_id = ' ' !! Node id (`-0-9A-Z_a-z`).
character(len=SENSOR_ID_LEN) :: sensor_id = ' ' !! Sensor id (`-0-9A-Z_a-z`).
character(len=TARGET_ID_LEN) :: target_id = ' ' !! Target id (`-0-9A-Z_a-z`).
Expand Down
2 changes: 1 addition & 1 deletion src/dm_sync.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module dm_sync
implicit none (type, external)
private

integer, parameter, public :: SYNC_ID_LEN = UUID_LEN !! Synchronisation id length (must equal UUID4 length).
integer, parameter, public :: SYNC_ID_LEN = UUID_LEN !! Synchronisation id length (must equal UUID length).

! Synchronisation types.
integer, parameter, public :: SYNC_TYPE_NONE = 0 !! No type (invalid).
Expand Down
14 changes: 7 additions & 7 deletions src/dm_uuid.f90
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
! Author: Philipp Engel
! Licence: ISC
module dm_uuid
!! Provides a UUID4 generator. DMPACK uses 32 characters long UUID4
!! Provides a UUIDv4 generator. DMPACK uses 32 characters long UUIDv4
!! identifiers in hexadecimal format, without hyphens.
implicit none (type, external)
private

integer, parameter, public :: UUID_LEN = 32 !! Hex UUID4 length.
integer, parameter, public :: UUID_FULL_LEN = 36 !! Full UUID4 length (with hypens).
integer, parameter, public :: UUID_LEN = 32 !! Hex UUIDv4 length.
integer, parameter, public :: UUID_FULL_LEN = 36 !! Full UUIDv4 length (with hypens).
character(len=*), parameter, public :: UUID_DEFAULT = repeat('0', UUID_LEN) !! Default ID (hex).

character(len=*), parameter :: UUID_SET = '0123456789abcdef'
Expand All @@ -18,7 +18,7 @@ module dm_uuid
public :: dm_uuid4_valid
contains
impure elemental function dm_uuid4() result(uuid)
!! Generates random UUID4 (RFC 4122) in hexadecimal format, i.e.,
!! Generates random UUIDv4 (RFC 4122) in hexadecimal format, i.e.,
!! without hyphens (32 characters long). The PRNG has to be seeded
!! before the first invocation by calling `dm_init()` once.
character(len=UUID_LEN) :: uuid
Expand All @@ -39,7 +39,7 @@ impure elemental function dm_uuid4() result(uuid)
end function dm_uuid4

impure elemental function dm_uuid4_hyphens() result(uuid)
!! Returns UUID4 with hyphens (36 characters long). The PRNG has to be
!! Returns UUIDv4 with hyphens (36 characters long). The PRNG has to be
!! seeded before the first invocation by calling `dm_init()` once.
character(len=UUID_FULL_LEN) :: uuid

Expand Down Expand Up @@ -81,9 +81,9 @@ pure elemental function dm_uuid4_hyphenize(uuid) result(str)
end function dm_uuid4_hyphenize

pure elemental logical function dm_uuid4_valid(uuid) result(valid)
!! Returns `.true.` if given UUID in hex format is a valid UUID4. Only
!! Returns `.true.` if given UUID in hex format is a valid UUIDv4. Only
!! lower-case letters are valid.
character(len=*), intent(in) :: uuid !! UUID to validate.
character(len=*), intent(in) :: uuid !! UUIDv4 to validate.

character :: a
integer :: i
Expand Down

0 comments on commit c81b682

Please sign in to comment.