README 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Adding new libraries
  2. --------------------
  3. When adding a new sub-library to OpenSSL, assign it a library number
  4. ERR_LIB_XXX, define a macro XXXerr() (both in err.h), add its
  5. name to ERR_str_libraries[] (in crypto/err/err.c), and add
  6. ERR_load_XXX_strings() to the ERR_load_crypto_strings() function
  7. (in crypto/err/err_all.c). Finally, add an entry:
  8. L XXX xxx.h xxx_err.c
  9. to crypto/err/openssl.ec, and add xxx_err.c to the Makefile.
  10. Running make errors will then generate a file xxx_err.c, and
  11. add all error codes used in the library to xxx.h.
  12. Additionally the library include file must have a certain form.
  13. Typically it will initially look like this:
  14. #ifndef HEADER_XXX_H
  15. #define HEADER_XXX_H
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /* Include files */
  20. #include <openssl/bio.h>
  21. #include <openssl/x509.h>
  22. /* Macros, structures and function prototypes */
  23. /* BEGIN ERROR CODES */
  24. The BEGIN ERROR CODES sequence is used by the error code
  25. generation script as the point to place new error codes, any text
  26. after this point will be overwritten when make errors is run.
  27. The closing #endif etc will be automatically added by the script.
  28. The generated C error code file xxx_err.c will load the header
  29. files stdio.h, openssl/err.h and openssl/xxx.h so the
  30. header file must load any additional header files containing any
  31. definitions it uses.