flap_utils_m
Source: src/third_party/FLAP/src/lib/flap_utils_m.f90
Dependencies
Contents
- flap_string
- count
- list_items
- list_push
- read_env
- read_line
- tokenize
- split_command_line
- write_text
- csv_split
- skill_name
- error_class
- error_exit_status
- count_substring
- to_characters
- list_count
- list_join
- replace
- replace_all
- json_string
- utf8_sequence
- json_array
- unique
- upper_case
- fish_escape
- ps_escape
- levenshtein
- suggestions
- suggestion_items
- wstrip
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
LIST_SEP | character(len=*) | parameter | |
EXIT_APPLICATION | integer(kind=I4P) | parameter | |
EXIT_USAGE | integer(kind=I4P) | parameter | |
EXIT_ENVIRONMENT | integer(kind=I4P) | parameter | |
EXIT_DEFINITION | integer(kind=I4P) | parameter |
Derived Types
flap_string
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
s | character(len=:) | allocatable |
Interfaces
count
Module procedures: count_substring
Subroutines
list_items
Attributes: pure
subroutine list_items(list, items, n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
list | character(len=*) | in | ||
items | character(len=:) | out | allocatable | |
n | integer(kind=I4P) | out |
Call graph
list_push
Attributes: pure
subroutine list_push(list, item)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
list | character(len=:) | inout | allocatable | |
item | character(len=*) | in |
Call graph
read_env
subroutine read_env(name, value, found, ignore)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
name | character(len=*) | in | ||
value | character(len=:) | out | allocatable | |
found | logical | out | ||
ignore | logical | in | optional |
Call graph
read_line
subroutine read_line(lun, line, iostat, iomsg)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
lun | integer(kind=I4P) | in | ||
line | character(len=:) | out | allocatable | |
iostat | integer(kind=I4P) | out | ||
iomsg | character(len=*) | out | optional |
Call graph
tokenize
Attributes: pure
subroutine tokenize(strin, delimiter, toks, Nt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
strin | character(len=*) | in | ||
delimiter | character(len=*) | in | ||
toks | character(len=len) | out | allocatable | |
Nt | integer(kind=I4P) | out | optional |
Call graph
split_command_line
Attributes: pure
subroutine split_command_line(strin, toks, Nt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
strin | character(len=*) | in | ||
toks | character(len=len) | out | allocatable | |
Nt | integer(kind=I4P) | out |
Call graph
write_text
subroutine write_text(lun, text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
lun | integer(kind=I4P) | in | ||
text | character(len=*) | in |
Call graph
csv_split
Attributes: pure
subroutine csv_split(record, fields, nf, error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
record | character(len=*) | in | ||
fields | type(flap_string) | out | allocatable | |
nf | integer(kind=I4P) | out | ||
error | integer(kind=I4P) | out |
Call graph
Functions
skill_name
Attributes: pure
Returns: character(len=:)
function skill_name(progname) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
progname | character(len=*) | in |
Call graph
error_class
Attributes: pure
Returns: character(len=:)
function error_class(code) result(class_name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
code | integer(kind=I4P) | in |
Call graph
error_exit_status
Attributes: pure
Returns: integer(kind=I4P)
function error_exit_status(code) result(status)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
code | integer(kind=I4P) | in |
Call graph
count_substring
Attributes: elemental
Returns: integer(kind=I4P)
function count_substring(string, substring) result(No)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in | ||
substring | character(len=*) | in |
Call graph
to_characters
Attributes: pure
Returns: character(len=:)
function to_characters(strings) result(chars)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
strings | type(flap_string) | in |
Call graph
list_count
Attributes: pure
Returns: integer(kind=I4P)
function list_count(list) result(n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
list | character(len=*) | in |
Call graph
list_join
Attributes: pure
Returns: character(len=:)
function list_join(list, sep) result(joined)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
list | character(len=*) | in | ||
sep | character(len=*) | in |
Call graph
replace
Attributes: pure
Returns: character(len=:)
function replace(string, substring, restring) result(newstring)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in | ||
substring | character(len=*) | in | ||
restring | character(len=*) | in |
Call graph
replace_all
Attributes: pure
Returns: character(len=:)
function replace_all(string, substring, restring) result(newstring)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in | ||
substring | character(len=*) | in | ||
restring | character(len=*) | in |
Call graph
json_string
Attributes: pure
Returns: character(len=:)
function json_string(text) result(quoted)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
text | character(len=*) | in |
Call graph
utf8_sequence
Attributes: pure
Returns: integer(kind=I4P)
function utf8_sequence(text) result(seq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
text | character(len=*) | in |
Call graph
json_array
Attributes: pure
Returns: character(len=:)
function json_array(items) result(array)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
items | type(flap_string) | in |
Call graph
unique
Attributes: elemental
Returns: character(len=len)
function unique(string, substring) result(uniq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in | ||
substring | character(len=*) | in |
Call graph
upper_case
Attributes: elemental
Returns: character(len=len)
function upper_case(string)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in |
Call graph
fish_escape
Attributes: pure
Returns: character(len=:)
function fish_escape(text) result(escaped)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
text | character(len=*) | in |
Call graph
ps_escape
Attributes: pure
Returns: character(len=:)
function ps_escape(text) result(escaped)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
text | character(len=*) | in |
Call graph
levenshtein
Attributes: pure
Returns: integer(kind=I4P)
function levenshtein(a, b) result(d)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | character(len=*) | in | ||
b | character(len=*) | in |
Call graph
suggestions
Attributes: pure
Returns: character(len=:)
function suggestions(token, candidates, case_insensitive) result(hint)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
token | character(len=*) | in | ||
candidates | type(flap_string) | in | ||
case_insensitive | logical | in |
Call graph
suggestion_items
Attributes: pure
Returns: type(flap_string)
function suggestion_items(token, candidates, case_insensitive) result(items)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
token | character(len=*) | in | ||
candidates | type(flap_string) | in | ||
case_insensitive | logical | in |
Call graph
wstrip
Attributes: pure
Returns: character(len=:)
function wstrip(string) result(newstring)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in |
Call graph