rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
194 stars 55 forks source link

C API usage is unclear #1025

Closed jpo234 closed 4 years ago

jpo234 commented 4 years ago

The installed header files reference values from header files that do not get installed

The installation currently installs the following headers:

├── include
│   └── rnp-0
│       ├── rnp_err.h
│       └── rnp.h

The installed file rnp-0/rnp.h says this:

/** create the top-level object used for interacting with the library
 *
 *  @param ffi pointer that will be set to the created ffi object
 *  @param pub_format the format of the public keyring, RNP_KEYSTORE_GPG or other
 *         RNP_KEYSTORE_* constant
 *  @param sec_format the format of the secret keyring, RNP_KEYSTORE_GPG or other
 *         RNP_KEYSTORE_* constant
 *  @return RNP_SUCCESS on success, or any other value on error
 */
rnp_result_t rnp_ffi_create(rnp_ffi_t *ffi, const char *pub_format, const char *sec_format);

These RNP_KEYSTORE_* constants are not in any installed header file:

install/rnpgp$ find . -type f | xargs fgrep RNP_KEYSTORE_
./include/rnp-0/rnp.h: *  @param pub_format the format of the public keyring, RNP_KEYSTORE_GPG or other
./include/rnp-0/rnp.h: *         RNP_KEYSTORE_* constant
./include/rnp-0/rnp.h: *  @param sec_format the format of the secret keyring, RNP_KEYSTORE_GPG or other
./include/rnp-0/rnp.h: *         RNP_KEYSTORE_* constant

And the Using RNP’s C APIs references the include/rnp/rnp.h which doesn't even get installed.

ni4 commented 4 years ago

@jpo234 thanks for noticing this. There could be some problems since we migrated to single rnp.h header/single FFI interface even for CLI utilities. This one should be fixed in #1027 once it is merged.