-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
859 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace GLibPorts { | ||
public static class CharExtensions { | ||
public static bool IsXDigit(this char @this) { | ||
return GChar.isxdigit(@this); | ||
} | ||
|
||
public static bool IsDigit(this char @this) { | ||
return Char.IsDigit(@this); | ||
} | ||
|
||
public static char ToLower(this char @this) { | ||
return Char.ToLower(@this); | ||
} | ||
|
||
public static char ToUpper(this char @this) { | ||
return Char.ToUpper(@this); | ||
} | ||
|
||
public static bool IsLetter(this char @this) { | ||
return Char.IsLetter(@this); | ||
} | ||
|
||
public static bool IsLetterOrDigit(this char @this) { | ||
return Char.IsLetterOrDigit(@this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace GLibPorts { | ||
public partial class GLib { | ||
internal class File { | ||
public static IntPtr stdin { get; internal set; } | ||
public static IntPtr stderr { get; internal set; } | ||
public static IntPtr stdout { get; internal set; } | ||
|
||
public static void InitializeStatic() { | ||
if (Utils.IsUnix()) { | ||
Native.Unix.UnixFile.InitializeStatic(); | ||
} else { | ||
Native.Win32.Win32File.InitializeStatic(); | ||
} | ||
} | ||
|
||
public static void DisposeStatic() { | ||
if (Utils.IsUnix()) { | ||
Native.Unix.UnixFile.DisposeStatic(); | ||
} else { | ||
Native.Win32.Win32File.DisposeStatic(); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using GLibPorts.Native.Varargs; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace GLibPorts.Native { | ||
public interface IFileStream : IDisposable { | ||
int fileno(); | ||
int printf(string format, params VariableArgument[] args); | ||
int puts(string str); | ||
int putc(int c); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace GLibPorts.Native { | ||
public interface IModuleLoader { | ||
IntPtr GetProcAddress(IntPtr handle, string symbol_name); | ||
IntPtr LoadLibrary(string library_path); | ||
void FreeLibrary(IntPtr handle); | ||
|
||
IntPtr GetModuleHandle(string moduleName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace GLibPorts.Native { | ||
public interface IStrings { | ||
void sprintf(StringBuilder sb, string format, IntPtr args); | ||
int vscprintf(string format, IntPtr args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using GLibPorts.Native.Varargs; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace GLibPorts.Native { | ||
public static class Platform { | ||
public static IModuleLoader ModuleLoader; | ||
public static IStrings Strings; | ||
|
||
public static IVariableCombiner MakeVariableCombiner(params VariableArgument[] args) { | ||
if (Utils.IsUnix()) | ||
return new UnixVariableCombiner(args); | ||
else | ||
return new Win32VariableCombiner(args); | ||
} | ||
|
||
static Platform() { | ||
if (Utils.IsUnix()) { | ||
ModuleLoader = new Unix.UnixModuleLoader(); | ||
Strings = new Unix.UnixStrings(); | ||
} else { | ||
ModuleLoader = new Win32.Win32ModuleLoader(); | ||
Strings = new Win32.Win32Strings(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.