dir_utils.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Portions of this file are subject to the following copyright(s). See
  2. * the Net-SNMP's COPYING file for more details and other copyrights
  3. * that may apply:
  4. */
  5. /*
  6. * Portions of this file are copyrighted by:
  7. * Copyright (C) 2007 Apple, Inc. All rights reserved.
  8. * Use is subject to license terms specified in the COPYING file
  9. * distributed with the Net-SNMP package.
  10. */
  11. #ifndef NETSNMP_DIR_UTILS_H
  12. #define NETSNMP_DIR_UTILS_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /*
  17. * filter function; return 1 to include file, 0 to exclude
  18. */
  19. #define NETSNMP_DIR_EXCLUDE 0
  20. #define NETSNMP_DIR_INCLUDE 1
  21. typedef int (netsnmp_directory_filter)(const void *text, void *ctx);
  22. /*------------------------------------------------------------------
  23. *
  24. * Prototypes
  25. */
  26. netsnmp_container *
  27. netsnmp_directory_container_read_some(netsnmp_container *user_container,
  28. const char *dirname,
  29. netsnmp_directory_filter *filter,
  30. void *filter_ctx, u_int flags);
  31. #define netsnmp_directory_container_read(c,d,f) \
  32. netsnmp_directory_container_read_some(c,d,NULL,NULL,f);
  33. void netsnmp_directory_container_free(netsnmp_container *c);
  34. /*------------------------------------------------------------------
  35. *
  36. * flags
  37. */
  38. #define NETSNMP_DIR_RECURSE 0x0001
  39. #define NETSNMP_DIR_RELATIVE_PATH 0x0002
  40. #define NETSNMP_DIR_SORTED 0x0004
  41. /** don't return null if dir empty */
  42. #define NETSNMP_DIR_EMPTY_OK 0x0008
  43. /** store netsnmp_file instead of filenames */
  44. #define NETSNMP_DIR_NSFILE 0x0010
  45. /** load stats in netsnmp_file */
  46. #define NETSNMP_DIR_NSFILE_STATS 0x0020
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* NETSNMP_DIR_UTILS_H */