1 // The following ifdef block is the standard way of creating macros which make exporting
2 // from a DLL simpler. All files within this DLL are compiled with the GITDLL_EXPORTS
3 // symbol defined on the command line. this symbol should not be defined on any project
4 // that uses this DLL. This way any other project whose source files include this file see
5 // GITDLL_API functions as being imported from a DLL, whereas this DLL sees symbols
6 // defined with this macro as being exported.
8 #define EXTERN extern "C"
14 #define GITDLL_API __declspec(dllexport) EXTERN
16 #define GITDLL_API __declspec(dllimport) EXTERN
20 // This class is exported from the gitdll.dll
21 class GITDLL_API Cgitdll
{
24 // TODO: add your methods here.
28 #define GIT_HASH_SIZE 20
30 typedef unsigned char GIT_HASH
[GIT_HASH_SIZE
];
31 typedef unsigned int GIT_HANDLE
;
32 typedef unsigned int GIT_LOG
;
34 typedef unsigned int GIT_DIFF
;
35 typedef unsigned int GIT_FILE
;
37 struct GIT_COMMIT_AUTHOR
47 typedef struct GIT_COMMIT_DATA
50 struct GIT_COMMIT_AUTHOR m_Author
;
51 struct GIT_COMMIT_AUTHOR m_Committer
;
56 void * m_pGitCommit
; /** internal used */
61 GITDLL_API
int ngitdll
;
63 GITDLL_API
int fngitdll(void);
65 * Get Git Last Error string.
67 GITDLL_API
char * get_git_last_error();
70 * @param name [IN] Reference name, such as HEAD, master, ...
71 * @param sha1 [OUT] char[20] hash value. Caller prepare char[20] buffer.
74 GITDLL_API
int git_get_sha1(const char *name
, GIT_HASH sha1
);
77 * @remark, this function must be call before other function.
80 GITDLL_API
int git_init();
82 GITDLL_API
int git_open_log(GIT_LOG
* handle
, char * arg
);
83 GITDLL_API
int git_get_log_count(GIT_LOG handle
);
84 GITDLL_API
int git_get_log_firstcommit(GIT_LOG handle
, GIT_COMMIT
*commit
);
85 GITDLL_API
int git_get_log_nextcommit(GIT_LOG handle
, GIT_COMMIT
*commit
, int skip
);
86 GITDLL_API
int git_close_log(GIT_LOG handle
);
88 GITDLL_API
int git_get_commit_from_hash(GIT_COMMIT
*commit
, GIT_HASH hash
);
90 GITDLL_API
int git_get_diff(GIT_COMMIT commit
, GIT_DIFF
*diff
);
91 GITDLL_API
int git_get_diff_firstfile(GIT_DIFF diff
, GIT_FILE
* file
);
92 GITDLL_API
int git_get_diff_nextfile(GIT_DIFF diff
, GIT_FILE
*file
);
93 GITDLL_API
int git_get_diff_status(GIT_DIFF diff
, int * status
);
94 GITDLL_API
int git_get_diff_stat(GIT_FILE file
, int *inc
, int *dec
, int *mode
);
95 GITDLL_API
int git_get_diff_file(GIT_FILE file
, char *newname
, int newsize
, char *oldname
, int oldsize
, int *mode
);