Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
ee72ffd0
Commit
ee72ffd0
authored
Nov 20, 2012
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Markdownize CONVENTIONS
parent
41b00ccc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
CONTRIBUTING.md
+1
-1
CONVENTIONS.md
+8
-8
No files found.
CONTRIBUTING.md
View file @
ee72ffd0
...
@@ -43,5 +43,5 @@ porting code *from* to see what you need to do.
...
@@ -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
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
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
)
.
CONVENTIONS
→
CONVENTIONS
.md
View file @
ee72ffd0
...
@@ -14,9 +14,9 @@ Type Definitions
...
@@ -14,9 +14,9 @@ Type Definitions
Most types should be opaque, e.g.:
Most types should be opaque, e.g.:
----
```
C
typedef struct git_odb git_odb;
typedef struct git_odb git_odb;
----
```
with allocation functions returning an "instance" created within
with allocation functions returning an "instance" created within
the library, and not within the application. This allows the type
the library, and not within the application. This allows the type
...
@@ -28,9 +28,9 @@ Public Exported Function Definitions
...
@@ -28,9 +28,9 @@ Public Exported Function Definitions
All exported functions must be declared as:
All exported functions must be declared as:
----
```
C
GIT_EXTERN(result_type) git_modulename_functionname(arg_list);
GIT_EXTERN(result_type) git_modulename_functionname(arg_list);
----
```
Semi-Private Exported Functions
Semi-Private Exported Functions
...
@@ -52,10 +52,10 @@ few arguments if multiple outputs are supplied).
...
@@ -52,10 +52,10 @@ few arguments if multiple outputs are supplied).
int status codes are 0 for GIT_OK and < 0 for an error.
int status codes are 0 for GIT_OK and < 0 for an error.
This permits common POSIX result testing:
This permits common POSIX result testing:
----
```
C
if (git_odb_open(&odb, path))
if (git_odb_open(&odb, path))
abort("odb open failed");
abort("odb open failed");
----
```
Functions returning a pointer may return NULL instead of an int
Functions returning a pointer may return NULL instead of an int
if there is only one type of failure (GIT_ENOMEM).
if there is only one type of failure (GIT_ENOMEM).
...
@@ -84,7 +84,7 @@ All public headers defining types, functions or macros must use
...
@@ -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,
the following form, where ${filename} is the name of the file,
after replacing non-identifier characters with '_'.
after replacing non-identifier characters with '_'.
----
```
C
#ifndef INCLUDE_git_${filename}_h__
#ifndef INCLUDE_git_${filename}_h__
#define INCLUDE_git_${filename}_h__
#define INCLUDE_git_${filename}_h__
...
@@ -104,4 +104,4 @@ after replacing non-identifier characters with '_'.
...
@@ -104,4 +104,4 @@ after replacing non-identifier characters with '_'.
/** @} */
/** @} */
GIT_END_DECL
GIT_END_DECL
#endif
#endif
----
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment