function.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef OSSL_APPS_FUNCTION_H
  10. # define OSSL_APPS_FUNCTION_H
  11. # include <openssl/lhash.h>
  12. # include "opt.h"
  13. #define DEPRECATED_NO_ALTERNATIVE "unknown"
  14. typedef enum FUNC_TYPE {
  15. FT_none, FT_general, FT_md, FT_cipher, FT_pkey,
  16. FT_md_alg, FT_cipher_alg
  17. } FUNC_TYPE;
  18. typedef struct function_st {
  19. FUNC_TYPE type;
  20. const char *name;
  21. int (*func)(int argc, char *argv[]);
  22. const OPTIONS *help;
  23. const char *deprecated_alternative;
  24. const char *deprecated_version;
  25. } FUNCTION;
  26. DEFINE_LHASH_OF(FUNCTION);
  27. /* Structure to hold the number of columns to be displayed and the
  28. * field width used to display them.
  29. */
  30. typedef struct {
  31. int columns;
  32. int width;
  33. } DISPLAY_COLUMNS;
  34. void calculate_columns(FUNCTION *functions, DISPLAY_COLUMNS *dc);
  35. #endif