我在 .c 文件中有大量以下全局声明:
fi_status_t ACLINFRA_CORE_OK = { { e_FI_STAT_MODULE_ACLINFRA, e_FI_STAT_ACLINFRA_SUBMOD_CORE, e_FI_STATUS_OK }, NULL };
fi_status_t ACLINFRA_CORE_ERR_GDFW_REG_FAILED = { { e_FI_STAT_MODULE_ACLINFRA, e_FI_STAT_ACLINFRA_SUBMOD_CORE, e_CORE_ERR_GDFW_REG_FAILED }, NULL };
fi_status_t ACLINFRA_CORE_ERR_DHAS_REG_FAILED = { { e_FI_STAT_MODULE_ACLINFRA, e_FI_STAT_ACLINFRA_SUBMOD_CORE, e_CORE_ERR_DHAS_REG_FAILED }, NULL };
fi_status_t ACLINFRA_CORE_ERR_GDFW_REQ_FAILED = { { e_FI_STAT_MODULE_ACLINFRA, e_FI_STAT_ACLINFRA_SUBMOD_CORE, e_CORE_ERR_GDFW_REQ_FAILED }, NULL };
现在,我已将它们拉出并粘贴到一个.h
文件中。但是我如何使用 emacs 轻松地将它们转换为extern
使用的等效声明query-replace-regexp
?
extern 声明如下所示:
extern fi_status_t ACLINFRA_CORE_OK;