X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=blobdiff_plain;f=ext%2Fgitdll%2Fgitdll.h;h=2053fc4a41ee3376531ed4c9471d113c66df03ff;hp=f887712ff09ac25a0b1f5a2b2e76493a1218a523;hb=0889bb6e878e97c26399dea045bfe2ddbe4ac744;hpb=05ab712815d1b8d6d26042cdf3439f12c04780bb diff --git a/ext/gitdll/gitdll.h b/ext/gitdll/gitdll.h index f887712..2053fc4 100644 --- a/ext/gitdll/gitdll.h +++ b/ext/gitdll/gitdll.h @@ -25,10 +25,90 @@ public: }; #endif +#define GIT_HASH_SIZE 20 + +typedef unsigned char GIT_HASH[GIT_HASH_SIZE]; +typedef unsigned int GIT_HANDLE; +typedef unsigned int GIT_LOG; + +typedef unsigned int GIT_DIFF; +typedef unsigned int GIT_FILE; + +struct GIT_COMMIT_AUTHOR +{ + char *Name; + int NameSize; + char *Email; + int EmailSize; + int Date; + int TimeZone; + +}; +typedef struct GIT_COMMIT_DATA +{ + GIT_HASH m_hash; + struct GIT_COMMIT_AUTHOR m_Author; + struct GIT_COMMIT_AUTHOR m_Committer; + char * m_Subject; + int m_SubjectSize; + char * m_Body; + int m_BodySize; + void * m_pGitCommit; /** internal used */ + +} GIT_COMMIT; + + GITDLL_API int ngitdll; GITDLL_API int fngitdll(void); - +/** + * Get Git Last Error string. + */ GITDLL_API char * get_git_last_error(); -GITDLL_API int git_get_sha1(const char *name, unsigned char *sha1); -GITDLL_API int git_init(); \ No newline at end of file +/** + * Get hash value. + * @param name [IN] Reference name, such as HEAD, master, ... + * @param sha1 [OUT] char[20] hash value. Caller prepare char[20] buffer. + * @return 0 success. + */ +GITDLL_API int git_get_sha1(const char *name, GIT_HASH sha1); +/** + * Init git dll + * @remark, this function must be call before other function. + * @return 0 success + */ +GITDLL_API int git_init(); + +GITDLL_API int git_open_log(GIT_LOG * handle, char * arg); +GITDLL_API int git_get_log_firstcommit(GIT_LOG handle); + +/** + * Get Next Commit + * @param handle [IN]handle Get handle from git_open_log + * @param commit [OUT]commit Caller need prepare buffer for this call + * @return 0 success + * @remark Caller need call git_free_commit to free internal buffer after use it; + */ +GITDLL_API int git_get_log_nextcommit(GIT_LOG handle, GIT_COMMIT *commit); + +GITDLL_API int git_close_log(GIT_LOG handle); + +/** + * Get Commit information from commit hash + * @param commit [OUT] output commit information + * @param hash [in] hash + * @return 0 success + */ +GITDLL_API int git_get_commit_from_hash(GIT_COMMIT *commit, GIT_HASH hash); +GITDLL_API int git_parse_commit(GIT_COMMIT *commit); +GITDLL_API int git_free_commit(GIT_COMMIT *commit); + +GITDLL_API int git_open_diff(GIT_DIFF *diff, char * arg); +GITDLL_API int git_diff(GIT_DIFF diff, GIT_HASH hash1,GIT_HASH hash2); +GITDLL_API int git_close_diff(GIT_DIFF diff); + +GITDLL_API int git_get_diff_firstfile(GIT_DIFF diff, GIT_FILE * file); +GITDLL_API int git_get_diff_nextfile(GIT_DIFF diff, GIT_FILE *file); +GITDLL_API int git_get_diff_status(GIT_DIFF diff, int * status); +GITDLL_API int git_get_diff_stat(GIT_FILE file, int *inc, int *dec, int *mode); +GITDLL_API int git_get_diff_file(GIT_FILE file, char *newname, int newsize, char *oldname, int oldsize, int *mode); \ No newline at end of file