[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: [PATCH 1/9] builtins: extract file content executor function
From: |
Koichi Murase |
Subject: |
Re: Re: [PATCH 1/9] builtins: extract file content executor function |
Date: |
Wed, 8 May 2024 16:59:52 +0900 |
2024年5月8日(水) 6:13 Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>:
> > By exposing this function in `common.h',
> > this effectively becomes a part of the public
> > interface for loadable builtins.
>
> [...]
>
> Are all external functions defined in all files inside the
> builtins directory exposed as part of a public API/ABI?
No.
> If that's the case, then it should also be made static
> as you suggested.
Even if it's not the case, I think one should mark it as `static' as
far as the function is not used by other translation units. Even if
it's not the interface exposed to the users, it's still an interface
for other translation units, and it's a premature exposition of
abstraction at present. No other translation units are using the
function.
> Can you break down for me which parts of the code base
> are public and which are private? This will allow me to
> avoid making such mistakes in the future.
You can check /examples/loadables/loadables.h in the tree. The headers
included from there (and further headers included thereby) are
explicitly the interface that the users can use to implement a
loadable builtin. For a wider public interface, you can look inside
the directory `$prefix/include/bash' (and subdirectories therein)
after running `make install'.
> I'd also like to suggest creating a private commons.c
> file where potentially reusable functionality can be
> moved to without exporting them.
I think such a feature should go into a related file in the main directory.
[PATCH 3/9] findcmd: define the user library finder function, Matheus Afonso Martins Moreira, 2024/05/05
[PATCH 4/9] bashgetopt: define long option shortener function, Matheus Afonso Martins Moreira, 2024/05/05