Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More C code into separate files

  • Loading branch information...
commit fd62ab76410d7797a9bc9753ab55c9553cf29ba9 1 parent b09f8a5
@corebob corebob authored
View
18 gdkpixbuf/gdkpixbuf.go
@@ -1,22 +1,6 @@
package gdkpixbuf
-/*
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdarg.h>
-#include <string.h>
-
-//static const gchar* to_gcharptr(const char* s) { return (const gchar*)s; }
-static guchar* to_gucharptr(void* s) { return (guchar*)s; }
-
-static void free_string(char* s) { free(s); }
-
-static gchar* to_gcharptr(char* s) { return (gchar*)s; }
-
-//static void free_string(char* s) { free(s); }
-*/
+// #include "gdkpixbuf.go.h"
// #cgo pkg-config: gdk-pixbuf-2.0
import "C"
import "github.com/mattn/go-gtk/glib"
View
20 gdkpixbuf/gdkpixbuf.go.h
@@ -0,0 +1,20 @@
+#ifndef GO_GDK_PIXBUF_H
+#define GO_GDK_PIXBUF_H
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <string.h>
+
+//static const gchar* to_gcharptr(const char* s) { return (const gchar*)s; }
+static guchar* to_gucharptr(void* s) { return (guchar*)s; }
+
+static void free_string(char* s) { free(s); }
+
+static gchar* to_gcharptr(char* s) { return (gchar*)s; }
+
+//static void free_string(char* s) { free(s); }
+
+#endif
View
27 gtksourceview/gtksourceview.go
@@ -1,31 +1,6 @@
package gtksourceview
-/*
-#include <gtksourceview/gtksourceview.h>
-#include <gtksourceview/gtksourcebuffer.h>
-#include <gtksourceview/gtksourcelanguage.h>
-#include <gtksourceview/gtksourcelanguagemanager.h>
-#include <stdlib.h>
-
-static inline gchar** make_strings(int count) {
- return (gchar**)malloc(sizeof(gchar*) * count);
-}
-
-static inline void destroy_strings(gchar** strings) {
- free(strings);
-}
-
-static inline void set_string(gchar** strings, int n, gchar* str) {
- strings[n] = str;
-}
-
-static inline GObject* to_GObject(void* o) { return G_OBJECT(o); }
-static inline gchar* to_gcharptr(const char* s) { return (gchar*)s; }
-static inline char* to_charptr(const gchar* s) { return (char*)s; }
-static inline gchar** next_gcharptr(gchar** s) { return (s+1); }
-static inline void free_string(char* s) { free(s); }
-static GtkSourceView* to_GtkSourceView(void* w) { return GTK_SOURCE_VIEW(w); }
-*/
+// #include "gtksourceview.go.h"
// #cgo pkg-config: gtksourceview-2.0
import "C"
import "github.com/mattn/go-gtk/gtk"
View
29 gtksourceview/gtksourceview.go.h
@@ -0,0 +1,29 @@
+#ifndef GO_GTKSOURCEVIEW_H
+#define GO_GTKSOURCEVIEW_H
+
+#include <gtksourceview/gtksourceview.h>
+#include <gtksourceview/gtksourcebuffer.h>
+#include <gtksourceview/gtksourcelanguage.h>
+#include <gtksourceview/gtksourcelanguagemanager.h>
+#include <stdlib.h>
+
+static inline gchar** make_strings(int count) {
+ return (gchar**)malloc(sizeof(gchar*) * count);
+}
+
+static inline void destroy_strings(gchar** strings) {
+ free(strings);
+}
+
+static inline void set_string(gchar** strings, int n, gchar* str) {
+ strings[n] = str;
+}
+
+static inline GObject* to_GObject(void* o) { return G_OBJECT(o); }
+static inline gchar* to_gcharptr(const char* s) { return (gchar*)s; }
+static inline char* to_charptr(const gchar* s) { return (char*)s; }
+static inline gchar** next_gcharptr(gchar** s) { return (s+1); }
+static inline void free_string(char* s) { free(s); }
+static GtkSourceView* to_GtkSourceView(void* w) { return GTK_SOURCE_VIEW(w); }
+
+#endif
View
21 pango/pango.go
@@ -1,25 +1,6 @@
package pango
-/*
-#ifndef uintptr
-#define uintptr unsigned int*
-#endif
-#include <pango/pango.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdarg.h>
-#include <string.h>
-
-//static const gchar* to_gcharptr(const char* s) { return (const gchar*)s; }
-//static guchar* to_gucharptr(void* s) { return (guchar*)s; }
-
-//static void free_string(char* s) { free(s); }
-
-//static gchar* to_gcharptr(char* s) { return (gchar*)s; }
-
-//static void free_string(char* s) { free(s); }
-*/
+// #include "pango.go.h"
// #cgo pkg-config: pango
import "C"
View
23 pango/pango.go.h
@@ -0,0 +1,23 @@
+#ifndef GO_PANGO_H
+#define GO_PANGO_H
+
+#ifndef uintptr
+#define uintptr unsigned int*
+#endif
+#include <pango/pango.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <string.h>
+
+//static const gchar* to_gcharptr(const char* s) { return (const gchar*)s; }
+//static guchar* to_gucharptr(void* s) { return (guchar*)s; }
+
+//static void free_string(char* s) { free(s); }
+
+//static gchar* to_gcharptr(char* s) { return (gchar*)s; }
+
+//static void free_string(char* s) { free(s); }
+
+#endif
Please sign in to comment.
Something went wrong with that request. Please try again.