summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-11-20 21:04:52 -0700
committerBen Straub <bs@github.com>2012-11-20 21:11:41 -0700
commitee72ffd060aa45e3ce0c8865145f99f96d00a563 (patch)
treec35cf4e6e2d1bac3dc569a5b7ee4109110b0c974
parent41b00cccb14ad1ffae703fe0f7f5843a5ec7b5b0 (diff)
downloadlibgit2-ee72ffd060aa45e3ce0c8865145f99f96d00a563.tar.gz
Markdownize CONVENTIONS
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--CONVENTIONS.md (renamed from CONVENTIONS)16
2 files changed, 9 insertions, 9 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 488732a62..856179481 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -43,5 +43,5 @@ porting code *from* to see what you need to do.
We like to keep the source code consistent and easy to read. Maintaining this
takes some discipline, but it's been more than worth it. Take a look at the
-[conventions file](https://github.com/libgit2/libgit2/blob/development/CONVENTIONS).
+[conventions file](https://github.com/libgit2/libgit2/blob/development/CONVENTIONS.md).
diff --git a/CONVENTIONS b/CONVENTIONS.md
index f082d8e6c..06d3e875d 100644
--- a/CONVENTIONS
+++ b/CONVENTIONS.md
@@ -14,9 +14,9 @@ Type Definitions
Most types should be opaque, e.g.:
-----
+```C
typedef struct git_odb git_odb;
-----
+```
with allocation functions returning an "instance" created within
the library, and not within the application. This allows the type
@@ -28,9 +28,9 @@ Public Exported Function Definitions
All exported functions must be declared as:
-----
+```C
GIT_EXTERN(result_type) git_modulename_functionname(arg_list);
-----
+```
Semi-Private Exported Functions
@@ -52,10 +52,10 @@ few arguments if multiple outputs are supplied).
int status codes are 0 for GIT_OK and < 0 for an error.
This permits common POSIX result testing:
-----
+```C
if (git_odb_open(&odb, path))
abort("odb open failed");
-----
+```
Functions returning a pointer may return NULL instead of an int
if there is only one type of failure (GIT_ENOMEM).
@@ -84,7 +84,7 @@ All public headers defining types, functions or macros must use
the following form, where ${filename} is the name of the file,
after replacing non-identifier characters with '_'.
-----
+```C
#ifndef INCLUDE_git_${filename}_h__
#define INCLUDE_git_${filename}_h__
@@ -104,4 +104,4 @@ after replacing non-identifier characters with '_'.
/** @} */
GIT_END_DECL
#endif
-----
+```