diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6522706..23dcfb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,12 +9,12 @@ jobs: strategy: fail-fast: false matrix: - otp: ['19.3', '21.3', 24] - runs-on: ubuntu-20.04 + otp: ['20', '21', '22', '23', '24', '25', '26', '27'] + runs-on: ubuntu-24.04 container: image: erlang:${{ matrix.otp }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: rebar3 compile - run: rebar3 xref - run: rebar3 dialyzer @@ -23,9 +23,13 @@ jobs: cover: name: Cover needs: [tests] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - uses: erlef/setup-beam@v1 + with: + otp-version: '27' + rebar3-version: "3.24.0" - run: ./configure --enable-gcov - run: rebar3 compile - name: Run tests to obtain Erlang coverage diff --git a/src/stringprep.app.src b/src/stringprep.app.src index 49a9de1..d7da1b5 100644 --- a/src/stringprep.app.src +++ b/src/stringprep.app.src @@ -26,7 +26,6 @@ {modules, []}, {registered, []}, {applications, [kernel, stdlib, p1_utils]}, - {mod, {stringprep_app,[]}}, %% hex.pm packaging: {files, ["src/", "c_src/stringprep.cpp", "c_src/uni_data.c", "c_src/uni_norm.c", "configure", "rebar.config", "rebar.config.script", "vars.config.in", "README.md", "LICENSE.txt", "LICENCE.ALL", "LICENSE.TCL"]}, diff --git a/src/stringprep.erl b/src/stringprep.erl index c9aa9f0..5268e6f 100644 --- a/src/stringprep.erl +++ b/src/stringprep.erl @@ -22,13 +22,13 @@ %%%---------------------------------------------------------------------- -module(stringprep). +-on_load(load_nif/0). +-nifs([tolower/1, tolower_nofilter/1, nameprep/1, nodeprep/1, resourceprep/1]). -author('alexey@process-one.net'). --compile(no_native). - --export([start/0, load_nif/0, tolower/1, nameprep/1, - nodeprep/1, resourceprep/1, tolower_nofilter/1]). +-export([start/0, tolower/1, nameprep/1, + nodeprep/1, resourceprep/1, tolower_nofilter/1]). %%%=================================================================== %%% API functions diff --git a/src/stringprep_app.erl b/src/stringprep_app.erl deleted file mode 100644 index 0cc335b..0000000 --- a/src/stringprep_app.erl +++ /dev/null @@ -1,74 +0,0 @@ -%%%---------------------------------------------------------------------- -%%% File : stringprep_app.erl -%%% Author : Evgeniy Khramtsov -%%% Purpose : stringprep application -%%% Created : 4 Apr 2013 by Evgeniy Khramtsov -%%% -%%% -%%% Copyright (C) 2002-2021 ProcessOne, SARL. All Rights Reserved. -%%% -%%% Licensed under the Apache License, Version 2.0 (the "License"); -%%% you may not use this file except in compliance with the License. -%%% You may obtain a copy of the License at -%%% -%%% http://www.apache.org/licenses/LICENSE-2.0 -%%% -%%% Unless required by applicable law or agreed to in writing, software -%%% distributed under the License is distributed on an "AS IS" BASIS, -%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%%% See the License for the specific language governing permissions and -%%% limitations under the License. -%%% -%%%---------------------------------------------------------------------- - --module(stringprep_app). - --behaviour(application). - -%% Application callbacks --export([start/2, stop/1]). - -%%%=================================================================== -%%% Application callbacks -%%%=================================================================== - -%%-------------------------------------------------------------------- -%% @private -%% @doc -%% This function is called whenever an application is started using -%% application:start/[1,2], and should start the processes of the -%% application. If the application is structured according to the OTP -%% design principles as a supervision tree, this means starting the -%% top supervisor of the tree. -%% -%% @spec start(StartType, StartArgs) -> {ok, Pid} | -%% {ok, Pid, State} | -%% {error, Reason} -%% StartType = normal | {takeover, Node} | {failover, Node} -%% StartArgs = term() -%% @end -%%-------------------------------------------------------------------- -start(_StartType, _StartArgs) -> - case stringprep:load_nif() of - ok -> - stringprep_sup:start_link(); - Err -> - Err - end. - -%%-------------------------------------------------------------------- -%% @private -%% @doc -%% This function is called whenever an application has stopped. It -%% is intended to be the opposite of Module:start/2 and should do -%% any necessary cleaning up. The return value is ignored. -%% -%% @spec stop(State) -> void() -%% @end -%%-------------------------------------------------------------------- -stop(_State) -> - ok. - -%%%=================================================================== -%%% Internal functions -%%%=================================================================== diff --git a/src/stringprep_sup.erl b/src/stringprep_sup.erl deleted file mode 100644 index 6768bd7..0000000 --- a/src/stringprep_sup.erl +++ /dev/null @@ -1,40 +0,0 @@ -%%%------------------------------------------------------------------- -%%% File : stringprep_sup.erl -%%% Author : Mickael Remond -%%% Description : stringprep supervisor -%%% Created : 29 Jun 2007 by Mickael Remond -%%% -%%% -%%% Copyright (C) 2002-2021 ProcessOne, SARL. All Rights Reserved. -%%% -%%% Licensed under the Apache License, Version 2.0 (the "License"); -%%% you may not use this file except in compliance with the License. -%%% You may obtain a copy of the License at -%%% -%%% http://www.apache.org/licenses/LICENSE-2.0 -%%% -%%% Unless required by applicable law or agreed to in writing, software -%%% distributed under the License is distributed on an "AS IS" BASIS, -%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%%% See the License for the specific language governing permissions and -%%% limitations under the License. -%%% -%%%------------------------------------------------------------------- - --module(stringprep_sup). - --behaviour(supervisor). - -%% API --export([start_link/0]). - -%% Supervisor callbacks --export([init/1]). - --define(SERVER, ?MODULE). - -start_link() -> - supervisor:start_link({local, ?SERVER}, ?MODULE, []). - -init([]) -> - {ok, {{one_for_all, 10, 1}, []}}.