Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify FORTRAN access to the new plugin path mechanism #3058

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

DennisHeimbigner
Copy link
Collaborator

The new plugin path API uses char** to represent a variable lenght vector of variable length strings. FORTRAN is not capable of accessing such structures. So, this PR extends the API to provide a counted string-based API to the plugin path functionality.

The new functions are inserted in the netcdf_aux.h/daux.c files. The new functions are just wrappers around other plugin path API function; they are just (I hope) more convenient for FORTRAN users. The new functions are as follows:

ncaux_plugin_path_stringlen(void)

  • Return the length (as in strlen) of the current plugin path directories encoded as a string. Return -1 if the request fails.

int ncaux_plugin_path_stringget(int pathlen, char path)*

  • Get the current sequence of directories in the internal global plugin path list encoded as a string path using ';' as a path separator. As an example, it might return "/a/b/c;/home/user/me;/tmp". The arguments are as follows:
    • pathlen -- the length of the path argument.
    • path -- a string into which the current plugin path as a string is stored.
  • Return NC_NOERR | NC_EINVAL

int ncaux_plugin_path_stringset(int pathlen, const char path)*

  • Set the current sequence of directories in the internal global plugin path list. As an example, it might take "/a/b/c;/home/user/me;/tmp". The arguments are as follows:
    • pathlen -- the length of the path argument.
    • path -- a string that is parsed to obtain the sequence of directories for the current plugin path.
  • Return NC_NOERR | NC_EINVAL

The new plugin path API uses char** to represent
a variable lenght vector of variable length strings.
FORTRAN is not capable of accessing such structures.
So, this PR extends the API to provide a counted string-based
API to the plugin path functionality.

The new functions are inserted in the netcdf_aux.h/daux.c files.
The new functions are just wrappers around other plugin path API
function; they are just (I hope) more convenient for FORTRAN users.

The new functions are as follows:

### *ncaux_plugin_path_stringlen(void)*
* Return the length (as in strlen) of the current plugin path directories encoded as a string. Return -1 if the request fails.

### *int ncaux_plugin_path_stringget(int pathlen, char* path)*
* Get the current sequence of directories in the internal global plugin path list encoded as a string path using ';' as a path separator. As an example, it might return "/a/b/c;/home/user/me;/tmp". The arguments are as follows:
    * *pathlen* -- the length of the path argument.
    * *path* -- a string into which the current plugin path as a string is stored.
* Return NC_NOERR | NC_EINVAL

### *int ncaux_plugin_path_stringset(int pathlen, const char* path)*
* Set the current sequence of directories in the internal global plugin path list. As an example, it might take "/a/b/c;/home/user/me;/tmp". The arguments are as follows:
    * *pathlen* -- the length of the path argument.
    * *path* -- a string that is parsed to obtain the sequence of directories for the current plugin path.
* Return NC_NOERR | NC_EINVAL
@WardF WardF merged commit a910744 into Unidata:main Dec 2, 2024
107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants