Skip to content

Commit

Permalink
Updated syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
interkosmos committed Jul 14, 2024
1 parent 0787d76 commit 4e8a730
Show file tree
Hide file tree
Showing 37 changed files with 91 additions and 90 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ The following programs are based on the **DMPACK** library.
| [dmsend](adoc/dmsend.adoc) | Sends observations and logs to message queue. |
| [dmserial](adoc/dmserial.adoc) | Reads sensor values from serial port. |
| [dmsync](adoc/dmsync.adoc) | Synchronises local databases with RPC API (from client to server). |
| [dmuuid](adoc/dmuuid.adoc) | Generates UUID4s. |
| [dmuuid](adoc/dmuuid.adoc) | Generates UUIDv4 identifiers. |
| [dmweb](adoc/dmweb.adoc) | CGI-based web user interface for database access (client, server). |

## Installation
Expand Down
2 changes: 1 addition & 1 deletion src/dm_arg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module dm_arg
module procedure :: arg_get_logical
module procedure :: arg_get_real64
module procedure :: arg_get_string
end interface
end interface dm_arg_get

public :: dm_arg_get
public :: dm_arg_has
Expand Down
2 changes: 1 addition & 1 deletion src/dm_atom.f90
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module dm_atom
interface atom_entry
!! Generic XML entry generator.
module procedure :: atom_entry_log
end interface
end interface atom_entry

public :: dm_atom_from_logs

Expand Down
4 changes: 2 additions & 2 deletions src/dm_block.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ module dm_block
interface dm_block_from
!! Generic derived type to block converter.
module procedure :: block_from_data_point
end interface
end interface dm_block_from

interface dm_block_write
!! Generic derived type to block writer.
module procedure :: block_write_data_point
module procedure :: block_write_data_points
end interface
end interface dm_block_write

public :: dm_block_from
public :: dm_block_write
Expand Down
4 changes: 2 additions & 2 deletions src/dm_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ module dm_c
!! Converts unsigned integer to signed integer.
module procedure :: dm_uint16_to_int32
module procedure :: dm_uint32_to_int64
end interface
end interface dm_to_signed

interface dm_to_unsigned
!! Converts signed integer to unsigned integer.
module procedure :: dm_int32_to_uint16
module procedure :: dm_int64_to_uint32
end interface
end interface dm_to_unsigned

public :: dm_c_f_logical
public :: dm_f_c_logical
Expand Down
2 changes: 1 addition & 1 deletion src/dm_cgi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module dm_cgi
module procedure :: cgi_get_real32
module procedure :: cgi_get_real64
module procedure :: cgi_get_string
end interface
end interface dm_cgi_get

! Public procedures.
public :: dm_cgi_auth
Expand Down
2 changes: 1 addition & 1 deletion src/dm_config.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module dm_config
module procedure :: config_get_report
module procedure :: config_get_stack
module procedure :: config_get_string
end interface
end interface dm_config_get

public :: dm_config_close
public :: dm_config_get
Expand Down
8 changes: 4 additions & 4 deletions src/dm_csv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module dm_csv
module procedure :: csv_from_sensors
module procedure :: csv_from_target
module procedure :: csv_from_targets
end interface
end interface dm_csv_from

interface dm_csv_read
!! Generic derived type from CSV reader.
Expand All @@ -40,7 +40,7 @@ module dm_csv
module procedure :: csv_read_observ
module procedure :: csv_read_sensor
module procedure :: csv_read_target
end interface
end interface dm_csv_read

interface dm_csv_write
!! Generic derived type to CSV writer.
Expand All @@ -58,7 +58,7 @@ module dm_csv
module procedure :: csv_write_sensors
module procedure :: csv_write_target
module procedure :: csv_write_targets
end interface
end interface dm_csv_write

interface csv_next
!! Generic CSV record reader.
Expand All @@ -67,7 +67,7 @@ module dm_csv
module procedure :: csv_next_real32
module procedure :: csv_next_real64
module procedure :: csv_next_string
end interface
end interface csv_next

! Public procedures.
public :: dm_csv_from
Expand Down
28 changes: 14 additions & 14 deletions src/dm_db.f90
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ end subroutine dm_db_update_handler
module procedure :: db_next_row_string
module procedure :: db_next_row_sync
module procedure :: db_next_row_target
end interface
end interface db_next_row

interface dm_db_insert
!! Generic database insert function.
Expand All @@ -155,7 +155,7 @@ end subroutine dm_db_update_handler
module procedure :: dm_db_insert_observs
module procedure :: dm_db_insert_sensor
module procedure :: dm_db_insert_target
end interface
end interface dm_db_insert

interface dm_db_select
!! Generic database select function.
Expand All @@ -165,76 +165,76 @@ end subroutine dm_db_update_handler
module procedure :: dm_db_select_observ
module procedure :: dm_db_select_sensor
module procedure :: dm_db_select_target
end interface
end interface dm_db_select

interface dm_db_select_beats
!! Generic beats select function.
module procedure :: db_select_beats_array
module procedure :: db_select_beats_iter
end interface
end interface dm_db_select_beats

interface dm_db_select_data_points
!! Generic data points select function.
module procedure :: db_select_data_points_array
module procedure :: db_select_data_points_iter
end interface
end interface dm_db_select_data_points

interface dm_db_select_json_beats
!! Generic JSON logs select function.
module procedure :: db_select_json_beats_array
module procedure :: db_select_json_beats_iter
end interface
end interface dm_db_select_json_beats

interface dm_db_select_json_logs
!! Generic JSON logs select function.
module procedure :: db_select_json_logs_array
module procedure :: db_select_json_logs_iter
end interface
end interface dm_db_select_json_logs

interface dm_db_select_json_nodes
!! Generic JSON nodes select function.
module procedure :: db_select_json_nodes_array
module procedure :: db_select_json_nodes_iter
end interface
end interface dm_db_select_json_nodes

interface dm_db_select_logs
!! Generic logs select function.
module procedure :: db_select_logs_array
module procedure :: db_select_logs_iter
end interface
end interface dm_db_select_logs

interface dm_db_select_nodes
!! Generic nodes select function.
module procedure :: db_select_nodes_array
module procedure :: db_select_nodes_iter
end interface
end interface dm_db_select_nodes

interface dm_db_select_observs
!! Generic observations select function.
module procedure :: db_select_observs_array
module procedure :: db_select_observs_iter
end interface
end interface dm_db_select_observs

interface dm_db_select_sensors
!! Generic sensors select function.
module procedure :: db_select_sensors_array
module procedure :: db_select_sensors_iter
module procedure :: db_select_sensors_by_node_array
module procedure :: db_select_sensors_by_node_iter
end interface
end interface dm_db_select_sensors

interface dm_db_select_targets
!! Generic targets select function.
module procedure :: db_select_targets_array
module procedure :: db_select_targets_iter
end interface
end interface dm_db_select_targets

interface dm_db_update
!! Generic database update function.
module procedure :: dm_db_update_node
module procedure :: dm_db_update_sensor
module procedure :: dm_db_update_target
end interface
end interface dm_db_update

! Abstract interfaces.
public :: dm_db_backup_handler
Expand Down
2 changes: 1 addition & 1 deletion src/dm_env.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module dm_env
module procedure :: env_get_real32
module procedure :: env_get_real64
module procedure :: env_get_string
end interface
end interface dm_env_get

public :: dm_env_get
public :: dm_env_has
Expand Down
2 changes: 1 addition & 1 deletion src/dm_error.f90
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module dm_error
interface dm_perror
!! Alias for `dm_error_out()`, do not use.
module procedure :: dm_error_out
end interface
end interface dm_perror

public :: dm_error_message
public :: dm_error_out
Expand Down
3 changes: 2 additions & 1 deletion src/dm_format.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module dm_format
integer, parameter, public :: FORMAT_NAME_LEN = 5 !! Max. length of format name.

character(len=*), parameter, public :: FORMAT_NAMES(FORMAT_NONE:FORMAT_LAST) = [ &
character(len=FORMAT_NAME_LEN) :: 'none', 'block', 'csv', 'json', 'jsonl', 'nml' ] !! Format names array.
character(len=FORMAT_NAME_LEN) :: 'none', 'block', 'csv', 'json', 'jsonl', 'nml' &
] !! Format names array.

public :: dm_format_from_name
public :: dm_format_valid
Expand Down
3 changes: 1 addition & 2 deletions src/dm_geocom_api.f90
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ module dm_geocom_api
! **************************************************************************
! PRIVATE GEOCOM API CONSTANTS.
! **************************************************************************
character(len=*), parameter :: GEOCOM_DELIMITER = '\r\n' !! Default GeoCOM delimiter.

character(len=*), parameter :: GEOCOM_DELIMITER = '\r\n' !! Default GeoCOM delimiter.
character(len=*), parameter :: GRC_PATTERN = '(?<grc>\d+)' !! Default response pattern (GRC only).
type(response_type), parameter :: GRC_RESPONSES(1) = [ response_type('grc', type=RESPONSE_TYPE_INT32) ] !! Default responses (GRC only).

Expand Down
2 changes: 1 addition & 1 deletion src/dm_hash_table.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module dm_hash_table
!! Generic interface to hash table get functions.
module procedure :: hash_table_get_index
module procedure :: hash_table_get_key
end interface
end interface dm_hash_table_get

public :: dm_hash_table_allocated
public :: dm_hash_table_create
Expand Down
8 changes: 4 additions & 4 deletions src/dm_hdf5.f90
Original file line number Diff line number Diff line change
Expand Up @@ -83,29 +83,29 @@ module dm_hdf5
!! Generic HDF5 close function.
module procedure :: hdf5_close_file
module procedure :: hdf5_close_group
end interface
end interface dm_hdf5_close

interface dm_hdf5_open
!! Generic HDF5 open function.
module procedure :: hdf5_open_file
module procedure :: hdf5_open_group
end interface
end interface dm_hdf5_open

interface dm_hdf5_read
!! Generic HDF5 read function.
module procedure :: hdf5_read_nodes
module procedure :: hdf5_read_observs
module procedure :: hdf5_read_sensors
module procedure :: hdf5_read_targets
end interface
end interface dm_hdf5_read

interface dm_hdf5_write
!! Generic HDF5 write function.
module procedure :: hdf5_write_nodes
module procedure :: hdf5_write_observs
module procedure :: hdf5_write_targets
module procedure :: hdf5_write_sensors
end interface
end interface dm_hdf5_write

! Public procedures.
public :: dm_hdf5_close
Expand Down
4 changes: 2 additions & 2 deletions src/dm_json.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module dm_json
module procedure :: json_from_sensors
module procedure :: json_from_target
module procedure :: json_from_targets
end interface
end interface dm_json_from

interface dm_json_write
!! Generic derived type to JSON writer.
Expand All @@ -43,7 +43,7 @@ module dm_json
module procedure :: json_write_sensors
module procedure :: json_write_target
module procedure :: json_write_targets
end interface
end interface dm_json_write

public :: dm_json_from
public :: dm_json_write
Expand Down
4 changes: 2 additions & 2 deletions src/dm_jsonl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module dm_jsonl
module procedure :: jsonl_from_observs
module procedure :: jsonl_from_sensors
module procedure :: jsonl_from_targets
end interface
end interface dm_jsonl_from

interface dm_jsonl_write
!! Generic derived type to JSON Lines writer.
Expand All @@ -32,7 +32,7 @@ module dm_jsonl
module procedure :: jsonl_write_observs
module procedure :: jsonl_write_sensors
module procedure :: jsonl_write_targets
end interface
end interface dm_jsonl_write

public :: dm_jsonl_from
public :: dm_jsonl_write
Expand Down
4 changes: 2 additions & 2 deletions src/dm_la.f90
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ end subroutine dgelsd
!! Generic LAPACK `gels()` subroutine for `dgels()` and `dgels1()`.
module procedure :: dm_la_dgels
module procedure :: dm_la_dgels1
end interface
end interface dm_la_gels

interface dm_la_gelsd
!! Generic LAPACK `gelsd()` subroutine for `dgelsd()` and `dgelsd1()`.
module procedure :: dm_la_dgelsd
module procedure :: dm_la_dgelsd1
end interface
end interface dm_la_gelsd

public :: dm_la_gels
public :: dm_la_gelsd
Expand Down
2 changes: 1 addition & 1 deletion src/dm_log.f90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module dm_log
!! Generic log validation function.
module procedure :: dm_log_valid_level
module procedure :: dm_log_valid_log
end interface
end interface dm_log_valid

interface operator (==)
!! Returns whether logs are equal.
Expand Down
10 changes: 5 additions & 5 deletions src/dm_lua.f90
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ module dm_lua
implicit none (type, external)
private

type, public :: lua_state_type
!! Lua state type that stores the Lua pointer.
type(c_ptr) :: ptr = c_null_ptr !! C pointer to Lua interpreter.
end type lua_state_type

abstract interface
! int *lua_CFunction(lua_State *L)
function dm_lua_callback(ptr) bind(c)
Expand Down Expand Up @@ -93,11 +98,6 @@ end function dm_lua_callback
module procedure :: lua_to_request
end interface dm_lua_to

type, public :: lua_state_type
!! Lua state type that stores the Lua pointer.
type(c_ptr) :: ptr = c_null_ptr !! C pointer to Lua interpreter.
end type lua_state_type

! Public procedures.
public :: dm_lua_call
public :: dm_lua_callback
Expand Down
2 changes: 1 addition & 1 deletion src/dm_modbus.f90
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module dm_modbus
!! Generic function to create Modbus RTU or TCP context.
module procedure :: dm_modbus_create_rtu
module procedure :: dm_modbus_create_tcp
end interface
end interface dm_modbus_create

public :: dm_modbus_byte_order_from_name
public :: dm_modbus_close
Expand Down
Loading

0 comments on commit 4e8a730

Please sign in to comment.