Skip to content

Commit

Permalink
Renmae GLibCocoaBridge to GLibFacade to reflect the fact that it's a …
Browse files Browse the repository at this point in the history
…self-contained POSIX implementation of the desired library functionality, and not a bridge to Cocoa implementations of the same functionality, as I had originally planned.
  • Loading branch information
danielpunkass committed Jul 28, 2011
1 parent 2636cbc commit 93ab4f7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
25 changes: 11 additions & 14 deletions GLibCocoaBridge.h → GLibFacade.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// GLibCocoaBridge.h
// GLibFacade.h
// MultiMarkdown
//
// Created by Daniel Jalkut on 7/26/11.
Expand All @@ -11,17 +11,20 @@
typedef int gboolean;
typedef char gchar;

// WE implement minimal cover structs and associated call-through functions to implement
// glib's GString and GSList as NSMutableString and NSMutableArray, respectively.

// GString declarations
// WE implement minimal mirror implementations of GLib's GString and GSList
// sufficient to cover the functionality required by MultiMarkdown.
//
// NOTE: THese are 100% clean, from-scratch implementations using only the
// GLib function prototype as guide for behavior.
//

typedef struct
{
// Current UTF8 byte stream this string represents
char* str;

// Where in the str buffer will we add new cahracters?

// Where in the str buffer will we add new characters
// or append new strings?
int currentStringBufferSize;
int currentStringLength;
} GString;
Expand All @@ -36,16 +39,10 @@ void g_string_prepend(GString* baseString, char* prependedString);

void g_string_append_printf(GString* baseString, char* format, ...);

// GSList declarations

// Don't know yet how to tackle the problem of GSList bridging. It's a little tougher than
// GString because it strongly embraces a standard linked list paradigm. It might make most
// sense to just implement the simple linked list functionality, unless there's some CoreFoundation
// or POSIX library that is omni-present on Macs to support this.
// Just implement a very simple singly linked list.

typedef struct _GSList
{
// And caches a reference to the data itself
void* data;
struct _GSList* next;
} GSList;
Expand Down
4 changes: 2 additions & 2 deletions GLibCocoaBridge.m → GLibFacade.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// GLibCocoaBridge.m
// GLibFacade.m
// MultiMarkdown
//
// Created by Daniel Jalkut on 7/26/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GLibCocoaBridge.h"
#import "GLibFacade.h"

// GString

Expand Down
2 changes: 1 addition & 1 deletion MarkdownMacPrefix.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <stdio.h>

#import "GLibCocoaBridge.h"
#import "GLibFacade.h"
#import "markdown_lib.h"

#define link PEG_link
Expand Down
12 changes: 6 additions & 6 deletions MultiMarkdown.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
651A528313E1C30100BCB02A /* GLibFacade.m in Sources */ = {isa = PBXBuildFile; fileRef = 651A528213E1C30100BCB02A /* GLibFacade.m */; };
65F0B69B13DF47CC00D0980C /* markdown_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = 65F0B66113DF47CC00D0980C /* markdown_lib.c */; };
65F0B69C13DF47CC00D0980C /* markdown_output.c in Sources */ = {isa = PBXBuildFile; fileRef = 65F0B66313DF47CC00D0980C /* markdown_output.c */; };
65F0B69E13DF47CC00D0980C /* markdown.c in Sources */ = {isa = PBXBuildFile; fileRef = 65F0B66713DF47CC00D0980C /* markdown.c */; };
65F0B78D13DF573600D0980C /* GLibCocoaBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 65F0B78C13DF573600D0980C /* GLibCocoaBridge.m */; };
65F0B7B713DF5BEF00D0980C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65F0B7B613DF5BEF00D0980C /* Foundation.framework */; };
65F0B8B213DF6D4000D0980C /* markdown_parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 65F0B8B113DF6D4000D0980C /* markdown_parser.c */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -61,6 +61,8 @@

/* Begin PBXFileReference section */
651A525B13E1BEFE00BCB02A /* TODO.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO.txt; sourceTree = "<group>"; };
651A528113E1C30100BCB02A /* GLibFacade.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLibFacade.h; sourceTree = "<group>"; };
651A528213E1C30100BCB02A /* GLibFacade.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLibFacade.m; sourceTree = "<group>"; };
65F0B66113DF47CC00D0980C /* markdown_lib.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = markdown_lib.c; sourceTree = "<group>"; };
65F0B66213DF47CC00D0980C /* markdown_lib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = markdown_lib.h; sourceTree = "<group>"; };
65F0B66313DF47CC00D0980C /* markdown_output.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = markdown_output.c; sourceTree = "<group>"; };
Expand All @@ -87,8 +89,6 @@
65F0B6C513DF485F00D0980C /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
65F0B6D713DF4C6B00D0980C /* MarkdownMacPrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkdownMacPrefix.h; sourceTree = "<group>"; };
65F0B6F313DF4D9800D0980C /* glib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glib.h; sourceTree = "<group>"; };
65F0B78B13DF573600D0980C /* GLibCocoaBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLibCocoaBridge.h; sourceTree = "<group>"; };
65F0B78C13DF573600D0980C /* GLibCocoaBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLibCocoaBridge.m; sourceTree = "<group>"; };
65F0B7B613DF5BEF00D0980C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
65F0B8B113DF6D4000D0980C /* markdown_parser.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = markdown_parser.c; sourceTree = "<group>"; };
8DD76FB20486AB0100D96B5E /* multimarkdown */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = multimarkdown; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -110,9 +110,9 @@
isa = PBXGroup;
children = (
651A525B13E1BEFE00BCB02A /* TODO.txt */,
651A528113E1C30100BCB02A /* GLibFacade.h */,
651A528213E1C30100BCB02A /* GLibFacade.m */,
65F0B6D713DF4C6B00D0980C /* MarkdownMacPrefix.h */,
65F0B78B13DF573600D0980C /* GLibCocoaBridge.h */,
65F0B78C13DF573600D0980C /* GLibCocoaBridge.m */,
65F0B6F313DF4D9800D0980C /* glib.h */,
65F0B8B513DF6D4700D0980C /* Generated Sources */,
08FB7795FE84155DC02AAC07 /* Source */,
Expand Down Expand Up @@ -290,8 +290,8 @@
65F0B69B13DF47CC00D0980C /* markdown_lib.c in Sources */,
65F0B69C13DF47CC00D0980C /* markdown_output.c in Sources */,
65F0B69E13DF47CC00D0980C /* markdown.c in Sources */,
65F0B78D13DF573600D0980C /* GLibCocoaBridge.m in Sources */,
65F0B8B213DF6D4000D0980C /* markdown_parser.c in Sources */,
651A528313E1C30100BCB02A /* GLibFacade.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

0 comments on commit 93ab4f7

Please sign in to comment.