actually loading and running some libgit2 code
This commit is contained in:
10
geef.c
10
geef.c
@@ -1,4 +1,8 @@
|
||||
#include "erl_nif.h"
|
||||
#include <stdio.h>
|
||||
#include <git/common.h>
|
||||
#include <git/oid.h>
|
||||
|
||||
|
||||
static int
|
||||
load(ErlNifEnv* env, void** priv, ERL_NIF_TERM load_info)
|
||||
@@ -28,6 +32,12 @@ unload(ErlNifEnv* env, void* priv)
|
||||
static ERL_NIF_TERM
|
||||
object_exists(ErlNifEnv* env, ERL_NIF_TERM a1)
|
||||
{
|
||||
git_oid oid;
|
||||
static char *sha = "ce08fe4884650f067bd5703b6a59a8b3b3c99a09";
|
||||
printf("sha: %s\n", sha);
|
||||
git_oid_mkstr(&oid, sha);
|
||||
//printf("raw: %s", (&oid)->id);
|
||||
|
||||
unsigned long val;
|
||||
if(!enif_get_ulong(env, a1, &val)) {
|
||||
return enif_make_badarg(env);
|
||||
|
||||
Reference in New Issue
Block a user