sp_dir.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef SP_DIR_H
  2. #define SP_DIR_H
  3. #pragma once
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #define ADAPTER_VERSION_FILE_NAME "depver.txt"
  8. #ifndef SP_MAX_VER_LEN
  9. #define SP_MAX_VER_LEN 128
  10. #endif
  11. /*this path created rely on program executing path*/
  12. typedef struct sp_dir_t {
  13. char *root_path; // c:\run
  14. char *rvc_path; //c:\rvc
  15. char *root_ver_path; // c:\run\ver
  16. char *root_hardwarecfg_path; // c:\run\hardwarecfg
  17. char *root_runinfo_path; // c:\run\runinfo
  18. char *base_path; // current version path, c:\run\ver\0.1
  19. char *bin_path; // $(base_path)\bin
  20. char *cfg_path; // $(base_path)\cfg
  21. char *mod_path; // $(base_path)\mod
  22. char *dep_path; // $(base_path)\dep
  23. char *obj_path; // $(base_path)\obj, for persist objects
  24. char *dbg_path; // $(rvc_path)\dbg
  25. char *slv_path; // $(rvc_path)\slv, for silverlight debug
  26. char *dmp_path; // $(rvc_path)\dmp, for dump
  27. char *ad0_path; // $(rvc_path)\ad0, for AD screen silverlight
  28. char *dep_ver_path; // Run\dep\0.0.0.1
  29. char* dep_base_path; // Run\dep
  30. }sp_dir_t;
  31. /* always return zero.*/
  32. int sp_dir_create(sp_dir_t **p_dir);
  33. void sp_dir_destroy(sp_dir_t*);
  34. #define SP_DIR_ROOT_INI 0
  35. #define SP_DIR_SHELL_INI 1
  36. #define SP_DIR_ENTITY_INI 2
  37. #define SP_DIR_MODULE_BIN 3
  38. #define SP_DIR_DEVICE_ENTITY_INI 4
  39. #define SP_DIR_RUNINFO 5
  40. #define SP_DIR_RUNINFO_BOOT_LOG 6 // runinfo\bootrec\boot201202.log
  41. #define SP_DIR_RUNINFO_INI 7
  42. #define SP_DIR_INSTALL_INI 8
  43. #define SP_DIR_EXPLORER_INI 9
  44. #define SP_DIR_CENTER_SETTING_INI 10
  45. #define SP_DIR_SHELLVAR_INI 11
  46. #define SP_DIR_ENTITY_DBG_LOG 12
  47. #define SP_DIR_RUNINFO_GLOBAL_INI 13
  48. #define SP_DIR_ENV_INI 14
  49. #define SP_DIR_DEPVER_TXT 15
  50. SPBASE_API int sp_dir_get_path_new(sp_dir_t*, int flag, const char* cat_name, char* buf, int len, int mode);
  51. int sp_dir_get_path_version(sp_dir_t*, int major, int minor, int revision, int build, int flag, const char *mod_name, char *buf, int len, int mode);
  52. SPBASE_API int sp_dir_get_path(sp_dir_t*, int flag, const char* cat_name, char* buf, int len);
  53. SPBASE_API void sp_dir_get_cur_drive(char* path);
  54. int sp_dir_inner_get_content(const char* file, char* ver); //SP_MAX_VER_LEN
  55. SPBASE_API int sp_dir_refresh_dep_path(sp_dir_t* dir);
  56. #ifdef __cplusplus
  57. } // extern "C" {
  58. #endif
  59. #endif // SP_DIR_H