|
| 1 | +% |
| 2 | +% This file is part of AtomVM. |
| 3 | +% |
| 4 | +% Copyright 2025 Paul Guyot <pguyot@kallisys.net> |
| 5 | +% |
| 6 | +% Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +% you may not use this file except in compliance with the License. |
| 8 | +% You may obtain a copy of the License at |
| 9 | +% |
| 10 | +% http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +% |
| 12 | +% Unless required by applicable law or agreed to in writing, software |
| 13 | +% distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +% See the License for the specific language governing permissions and |
| 16 | +% limitations under the License. |
| 17 | +% |
| 18 | +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later |
| 19 | +% |
| 20 | + |
| 21 | +%%----------------------------------------------------------------------------- |
| 22 | +%% @doc An implementation of the Erlang/OTP init interface. |
| 23 | +%% |
| 24 | +%% This module implements a strict subset of the Erlang/OTP init |
| 25 | +%% interface. |
| 26 | +%% @end |
| 27 | +%%----------------------------------------------------------------------------- |
| 28 | +-module(init). |
| 29 | + |
| 30 | +-export([ |
| 31 | + get_argument/1, |
| 32 | + get_plain_arguments/0, |
| 33 | + notify_when_started/1 |
| 34 | +]). |
| 35 | + |
| 36 | +%%----------------------------------------------------------------------------- |
| 37 | +%% @param Flag flag to get values for |
| 38 | +%% @return `error' if no value is associated with provided flag or values in |
| 39 | +%% order of the command line |
| 40 | +%% @doc Returns values associated with a given command-line user flag. |
| 41 | +%% Currently always returns `error' on AtomVM. |
| 42 | +%% @end |
| 43 | +%%----------------------------------------------------------------------------- |
| 44 | +-spec get_argument(Flag :: atom()) -> {ok, [string()]} | error. |
| 45 | +get_argument(_Flag) -> |
| 46 | + error. |
| 47 | + |
| 48 | +%%----------------------------------------------------------------------------- |
| 49 | +%% @return plain command-line arguments as a list of strings. |
| 50 | +%% @doc Gets plain command-line arguments. |
| 51 | +%% Currently always returns `[]' on AtomVM. |
| 52 | +%% @end |
| 53 | +%%----------------------------------------------------------------------------- |
| 54 | +-spec get_plain_arguments() -> [string()]. |
| 55 | +get_plain_arguments() -> |
| 56 | + []. |
| 57 | + |
| 58 | +%% @private |
| 59 | +-spec notify_when_started(Pid :: pid()) -> ok | started. |
| 60 | +notify_when_started(_Pid) -> |
| 61 | + started. |
0 commit comments