examples: general: convert C99 comments to C90 comments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
diff --git a/examples/general.c b/examples/general.c
index d58e93f..8f4f74a 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -12,33 +12,37 @@
* <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
-// [**libgit2**][lg] is a portable, pure C implementation of the Git core
-// methods provided as a re-entrant linkable library with a solid API,
-// allowing you to write native speed custom Git applications in any
-// language which supports C bindings.
-//
-// This file is an example of using that API in a real, compilable C file.
-// As the API is updated, this file will be updated to demonstrate the new
-// functionality.
-//
-// If you're trying to write something in C using [libgit2][lg], you should
-// also check out the generated [API documentation][ap]. We try to link to
-// the relevant sections of the API docs in each section in this file.
-//
-// **libgit2** (for the most part) only implements the core plumbing
-// functions, not really the higher level porcelain stuff. For a primer on
-// Git Internals that you will need to know to work with Git at this level,
-// check out [Chapter 10][pg] of the Pro Git book.
-//
-// [lg]: http://libgit2.github.com
-// [ap]: http://libgit2.github.com/libgit2
-// [pg]: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain
-
-// ### Includes
-
-// Including the `git2.h` header will include all the other libgit2 headers
-// that you need. It should be the only thing you need to include in order
-// to compile properly and get all the libgit2 API.
+/**
+ * [**libgit2**][lg] is a portable, pure C implementation of the Git core
+ * methods provided as a re-entrant linkable library with a solid API,
+ * allowing you to write native speed custom Git applications in any
+ * language which supports C bindings.
+ *
+ * This file is an example of using that API in a real, compilable C file.
+ * As the API is updated, this file will be updated to demonstrate the new
+ * functionality.
+ *
+ * If you're trying to write something in C using [libgit2][lg], you should
+ * also check out the generated [API documentation][ap]. We try to link to
+ * the relevant sections of the API docs in each section in this file.
+ *
+ * **libgit2** (for the most part) only implements the core plumbing
+ * functions, not really the higher level porcelain stuff. For a primer on
+ * Git Internals that you will need to know to work with Git at this level,
+ * check out [Chapter 10][pg] of the Pro Git book.
+ *
+ * [lg]: http://libgit2.github.com
+ * [ap]: http://libgit2.github.com/libgit2
+ * [pg]: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain
+ */
+
+/**
+ * ### Includes
+ *
+ * Including the `git2.h` header will include all the other libgit2 headers
+ * that you need. It should be the only thing you need to include in order
+ * to compile properly and get all the libgit2 API.
+ */
#include <git2.h>
#include <stdio.h>
#include <string.h>
@@ -55,9 +59,11 @@ static void index_walking(git_repository *repo);
static void reference_listing(git_repository *repo);
static void config_files(const char *repo_path);
-// Almost all libgit2 functions return 0 on success or negative on error.
-// This is not production quality error checking, but should be sufficient
-// as an example.
+/**
+ * Almost all libgit2 functions return 0 on success or negative on error.
+ * This is not production quality error checking, but should be sufficient
+ * as an example.
+ */
static void check_error(int error_code, const char *action)
{
const git_error *error = giterr_last();
@@ -74,19 +80,23 @@ int main (int argc, char** argv)
{
git_oid oid;
- // Initialize the library, this will set up any global state which libgit2 needs
- // including threading and crypto
+ /**
+ * Initialize the library, this will set up any global state which libgit2 needs
+ * including threading and crypto
+ */
git_libgit2_init();
- // ### Opening the Repository
-
- // There are a couple of methods for opening a repository, this being the
- // simplest. There are also [methods][me] for specifying the index file
- // and work tree locations, here we assume they are in the normal places.
- //
- // (Try running this program against tests/resources/testrepo.git.)
- //
- // [me]: http://libgit2.github.com/libgit2/#HEAD/group/repository
+ /**
+ * ### Opening the Repository
+ *
+ * There are a couple of methods for opening a repository, this being the
+ * simplest. There are also [methods][me] for specifying the index file
+ * and work tree locations, here we assume they are in the normal places.
+ *
+ * (Try running this program against tests/resources/testrepo.git.)
+ *
+ * [me]: http://libgit2.github.com/libgit2/#HEAD/group/repository
+ */
int error;
const char *repo_path = (argc > 1) ? argv[1] : "/opt/libgit2-test/.git";
git_repository *repo;
@@ -106,7 +116,9 @@ int main (int argc, char** argv)
reference_listing(repo);
config_files(repo_path);
- // Finally, when you're done with the repository, you can free it as well.
+ /**
+ * Finally, when you're done with the repository, you can free it as well.
+ */
git_repository_free(repo);
return 0;