summaryrefslogtreecommitdiff
path: root/include/git2/sys/refdb_backend.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-01-09 18:25:10 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2019-01-17 21:17:32 +0000
commit22d2062d954dcb88fa3dc65281d3f3d88ae87d68 (patch)
tree22852e22d6c571be8ccc1cdaece3d926360fc191 /include/git2/sys/refdb_backend.h
parent57b753a0dc0db2d89341300470653e8a4d066c0b (diff)
downloadlibgit2-22d2062d954dcb88fa3dc65281d3f3d88ae87d68.tar.gz
Introduce GIT_CALLBACK macro to enforce cdecl
Since we now always build the library with cdecl calling conventions, our callbacks should be decorated as such so that users will not be able to provide callbacks defined with other calling conventions. The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as appropriate.
Diffstat (limited to 'include/git2/sys/refdb_backend.h')
-rw-r--r--include/git2/sys/refdb_backend.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/include/git2/sys/refdb_backend.h b/include/git2/sys/refdb_backend.h
index 5129ad84a..2ed6efd5a 100644
--- a/include/git2/sys/refdb_backend.h
+++ b/include/git2/sys/refdb_backend.h
@@ -38,21 +38,21 @@ struct git_reference_iterator {
/**
* Return the current reference and advance the iterator.
*/
- int (*next)(
+ int GIT_CALLBACK(next)(
git_reference **ref,
git_reference_iterator *iter);
/**
* Return the name of the current reference and advance the iterator
*/
- int (*next_name)(
+ int GIT_CALLBACK(next_name)(
const char **ref_name,
git_reference_iterator *iter);
/**
* Free the iterator
*/
- void (*free)(
+ void GIT_CALLBACK(free)(
git_reference_iterator *iter);
};
@@ -64,7 +64,7 @@ struct git_refdb_backend {
* Queries the refdb backend to determine if the given ref_name
* exists. A refdb implementation must provide this function.
*/
- int (*exists)(
+ int GIT_CALLBACK(exists)(
int *exists,
git_refdb_backend *backend,
const char *ref_name);
@@ -73,7 +73,7 @@ struct git_refdb_backend {
* Queries the refdb backend for a given reference. A refdb
* implementation must provide this function.
*/
- int (*lookup)(
+ int GIT_CALLBACK(lookup)(
git_reference **out,
git_refdb_backend *backend,
const char *ref_name);
@@ -83,7 +83,7 @@ struct git_refdb_backend {
*
* A refdb implementation must provide this function.
*/
- int (*iterator)(
+ int GIT_CALLBACK(iterator)(
git_reference_iterator **iter,
struct git_refdb_backend *backend,
const char *glob);
@@ -92,12 +92,12 @@ struct git_refdb_backend {
* Writes the given reference to the refdb. A refdb implementation
* must provide this function.
*/
- int (*write)(git_refdb_backend *backend,
+ int GIT_CALLBACK(write)(git_refdb_backend *backend,
const git_reference *ref, int force,
const git_signature *who, const char *message,
const git_oid *old, const char *old_target);
- int (*rename)(
+ int GIT_CALLBACK(rename)(
git_reference **out, git_refdb_backend *backend,
const char *old_name, const char *new_name, int force,
const git_signature *who, const char *message);
@@ -107,7 +107,7 @@ struct git_refdb_backend {
* from the refdb. A refdb implementation must provide this
* function.
*/
- int (*del)(git_refdb_backend *backend, const char *ref_name, const git_oid *old_id, const char *old_target);
+ int GIT_CALLBACK(del)(git_refdb_backend *backend, const char *ref_name, const git_oid *old_id, const char *old_target);
/**
* Suggests that the given refdb compress or optimize its references.
@@ -116,56 +116,56 @@ struct git_refdb_backend {
* implementation may provide this function; if it is not provided,
* nothing will be done.
*/
- int (*compress)(git_refdb_backend *backend);
+ int GIT_CALLBACK(compress)(git_refdb_backend *backend);
/**
* Query whether a particular reference has a log (may be empty)
*/
- int (*has_log)(git_refdb_backend *backend, const char *refname);
+ int GIT_CALLBACK(has_log)(git_refdb_backend *backend, const char *refname);
/**
* Make sure a particular reference will have a reflog which
* will be appended to on writes.
*/
- int (*ensure_log)(git_refdb_backend *backend, const char *refname);
+ int GIT_CALLBACK(ensure_log)(git_refdb_backend *backend, const char *refname);
/**
* Frees any resources held by the refdb (including the `git_refdb_backend`
* itself). A refdb backend implementation must provide this function.
*/
- void (*free)(git_refdb_backend *backend);
+ void GIT_CALLBACK(free)(git_refdb_backend *backend);
/**
* Read the reflog for the given reference name.
*/
- int (*reflog_read)(git_reflog **out, git_refdb_backend *backend, const char *name);
+ int GIT_CALLBACK(reflog_read)(git_reflog **out, git_refdb_backend *backend, const char *name);
/**
* Write a reflog to disk.
*/
- int (*reflog_write)(git_refdb_backend *backend, git_reflog *reflog);
+ int GIT_CALLBACK(reflog_write)(git_refdb_backend *backend, git_reflog *reflog);
/**
* Rename a reflog
*/
- int (*reflog_rename)(git_refdb_backend *_backend, const char *old_name, const char *new_name);
+ int GIT_CALLBACK(reflog_rename)(git_refdb_backend *_backend, const char *old_name, const char *new_name);
/**
* Remove a reflog.
*/
- int (*reflog_delete)(git_refdb_backend *backend, const char *name);
+ int GIT_CALLBACK(reflog_delete)(git_refdb_backend *backend, const char *name);
/**
* Lock a reference. The opaque parameter will be passed to the unlock function
*/
- int (*lock)(void **payload_out, git_refdb_backend *backend, const char *refname);
+ int GIT_CALLBACK(lock)(void **payload_out, git_refdb_backend *backend, const char *refname);
/**
* Unlock a reference. Only one of target or symbolic_target
* will be set. success indicates whether to update the
* reference or discard the lock (if it's false)
*/
- int (*unlock)(git_refdb_backend *backend, void *payload, int success, int update_reflog,
+ int GIT_CALLBACK(unlock)(git_refdb_backend *backend, void *payload, int success, int update_reflog,
const git_reference *ref, const git_signature *sig, const char *message);
};