summaryrefslogtreecommitdiffhomepage
path: root/source.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-07-11 18:03:42 +0200
committerGitHub <noreply@github.com>2021-07-11 18:03:42 +0200
commite4871c661f0bfb979f1b235d7b6e59b70ed1aca6 (patch)
tree40542b06a966366e2e8a3a0118e756874a838ce6 /source.c
parentdad8f3aed4ca5f2f93e2be6f1243632439dec541 (diff)
parentd5b25f942147b09511d77d5470cd38a1e1643fb9 (diff)
Merge pull request #15 from jow-/c-api
C API wip
Diffstat (limited to 'source.c')
-rw-r--r--source.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source.c b/source.c
index 21b9124..b7bb96d 100644
--- a/source.c
+++ b/source.c
@@ -16,14 +16,14 @@
#include <string.h>
-#include "source.h"
+#include "ucode/source.h"
-uc_source *
+uc_source_t *
uc_source_new_file(const char *path)
{
FILE *fp = fopen(path, "rb");
- uc_source *src;
+ uc_source_t *src;
if (!fp)
return NULL;
@@ -41,11 +41,11 @@ uc_source_new_file(const char *path)
return src;
}
-uc_source *
+uc_source_t *
uc_source_new_buffer(const char *name, char *buf, size_t len)
{
FILE *fp = fmemopen(buf, len, "rb");
- uc_source *src;
+ uc_source_t *src;
if (!fp)
return NULL;
@@ -64,9 +64,9 @@ uc_source_new_buffer(const char *name, char *buf, size_t len)
}
size_t
-uc_source_get_line(uc_source *source, size_t *offset)
+uc_source_get_line(uc_source_t *source, size_t *offset)
{
- uc_lineinfo *lines = &source->lineinfo;
+ uc_lineinfo_t *lines = &source->lineinfo;
size_t i, pos = 0, line = 0, lastoff = 0;
for (i = 0; i < lines->count; i++) {
@@ -88,8 +88,8 @@ uc_source_get_line(uc_source *source, size_t *offset)
return 0;
}
-uc_source *
-uc_source_get(uc_source *source)
+uc_source_t *
+uc_source_get(uc_source_t *source)
{
if (!source)
return NULL;
@@ -100,7 +100,7 @@ uc_source_get(uc_source *source)
}
void
-uc_source_put(uc_source *source)
+uc_source_put(uc_source_t *source)
{
if (!source)
return;