Skip to content

Commit

Permalink
Update copyright on native sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
letiemble committed Mar 30, 2014
1 parent 8dbfef2 commit ac53aeb
Show file tree
Hide file tree
Showing 67 changed files with 232 additions and 235 deletions.
2 changes: 1 addition & 1 deletion native/Monobjc/fix_references.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# This file is part of Monobjc, a .NET/Objective-C bridge
# Copyright (C) 2007-2013 - Laurent Etiemble
# Copyright (C) 2007-2014 - Laurent Etiemble
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion native/Monobjc/generate_descriptors.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# This file is part of Monobjc, a .NET/Objective-C bridge
# Copyright (C) 2007-2013 - Laurent Etiemble
# Copyright (C) 2007-2014 - Laurent Etiemble
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions native/Monobjc/include/monobjc.h
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file monobjc.h
* @brief Contains exposed functions for the bridging library.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#ifndef __MONOBJC_H__
#define __MONOBJC_H__
Expand Down
134 changes: 67 additions & 67 deletions native/Monobjc/main.mm
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file main.mm
* @brief Default loader for the Monobjc bridge.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#import <stdlib.h>
#import <Cocoa/Cocoa.h>
Expand All @@ -36,81 +36,81 @@
#include <monobjc.h>

int main(int argc, char *argv[]) {
int i, index = 1, debug = 0;
int i, index = 1, debug = 0, ret = 0;

// Flag to debug command line arguments
char *options = getenv("MONOBJC_ARGS");
if (options && strlen(options) > 0) {
debug = 1;
}

// Create a pool, for the processing
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

// Convert the command line arguments into an array for easy parsing
if (debug) NSLog(@"Raw arguments");
NSMutableArray *arguments = [NSMutableArray array];
for(int i = 0; i < argc; i++) {
NSString *str = [NSString stringWithCString:argv[i] encoding:[NSString defaultCStringEncoding]];
[arguments addObject:str];
if (debug) NSLog(@"%@", str);
}

// Get the full name of the current executable and extract the last part
NSString *fullname = [arguments objectAtIndex:0];
NSString *execname = [[fullname pathComponents] lastObject];

// Scan all the arguments until a "*.exe" is found (or not)
NSString *argument = nil;
for(i = 0; i < [arguments count]; i++) {
NSString *part = [arguments objectAtIndex:i];
if ([[part pathExtension] isEqualToString:@"exe"]) {
argument = part;
break;
@autoreleasepool {

// Convert the command line arguments into an array for easy parsing
if (debug) NSLog(@"Raw arguments");
NSMutableArray *arguments = [NSMutableArray array];
for(int i = 0; i < argc; i++) {
NSString *str = [NSString stringWithCString:argv[i] encoding:[NSString defaultCStringEncoding]];
[arguments addObject:str];
if (debug) NSLog(@"%@", str);
}
}

// Insert options in the argument array
options = getenv("MONO_OPTIONS");
if (options && strlen(options) > 0) {
if (debug) NSLog(@"Parsing MONO_OPTIONS");
NSString *str = [NSString stringWithCString:options encoding:[NSString defaultCStringEncoding]];
NSArray *parts = [str componentsSeparatedByString:@" "];
for(i = 0; i < [parts count]; i++) {
str = [parts objectAtIndex:i];
[arguments insertObject:str atIndex:index];
index++;

// Get the full name of the current executable and extract the last part
NSString *fullname = [arguments objectAtIndex:0];
NSString *execname = [[fullname pathComponents] lastObject];

// Scan all the arguments until a "*.exe" is found (or not)
NSString *argument = nil;
for(i = 0; i < [arguments count]; i++) {
NSString *part = [arguments objectAtIndex:i];
if ([[part pathExtension] isEqualToString:@"exe"]) {
argument = part;
break;
}
}

// Insert options in the argument array
options = getenv("MONO_OPTIONS");
if (options && strlen(options) > 0) {
if (debug) NSLog(@"Parsing MONO_OPTIONS");
NSString *str = [NSString stringWithCString:options encoding:[NSString defaultCStringEncoding]];
NSArray *parts = [str componentsSeparatedByString:@" "];
for(i = 0; i < [parts count]; i++) {
str = [parts objectAtIndex:i];
[arguments insertObject:str atIndex:index];
index++;
}
}

if (!argument) {
if (debug) NSLog(@"Adding the main assembly");
// If the main assembly is not found, compute the assembly path in the resources
// - For command line applications, this is the current folder
// - For bundled applications, this is the "Contents/Resources" folder.
NSString *assemblyArgument = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[execname stringByAppendingString:@".exe"]];
[arguments insertObject:assemblyArgument atIndex:index];
}

// Disabled shared area to avoid /dev/shm access
// Such access is forbidden when the bundle is sandboxed
setenv("MONO_DISABLE_SHARED_AREA", "true", 1);

// Build a new argument array
argc = [arguments count];
char **newargv = (char **) malloc(sizeof(char *) * (argc + 1));
if (debug) NSLog(@"Final arguments");
for (i = 0; i < argc; i++)
{
NSString *str = [arguments objectAtIndex:i];
if (debug) NSLog(@"%@", str);
newargv[i] = (char *) [str UTF8String];
}
newargv[i++] = NULL;

// Call the Mono runtime
ret = mono_main(argc, newargv);
}

if (!argument) {
if (debug) NSLog(@"Adding the main assembly");
// If the main assembly is not found, compute the assembly path in the resources
// - For command line applications, this is the current folder
// - For bundled applications, this is the "Contents/Resources" folder.
NSString *assemblyArgument = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[execname stringByAppendingString:@".exe"]];
[arguments insertObject:assemblyArgument atIndex:index];
}

// Disabled shared area
setenv("MONO_DISABLE_SHARED_AREA", "true", 1);

// Build a new argument array
argc = [arguments count];
char **newargv = (char **) malloc(sizeof(char *) * (argc + 1));
if (debug) NSLog(@"Final arguments");
for (i = 0; i < argc; i++)
{
NSString *str = [arguments objectAtIndex:i];
if (debug) NSLog(@"%@", str);
newargv[i] = (char *) [str UTF8String];
}
newargv[i++] = NULL;

// Call the Mono runtime
int ret = mono_main(argc, newargv);

[pool release];

return ret;
}
4 changes: 2 additions & 2 deletions native/Monobjc/sources/blocks.h
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file blocks.h
* @brief Private headers for blocks.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#ifndef __BLOCKS_H__
#define __BLOCKS_H__
Expand Down
4 changes: 2 additions & 2 deletions native/Monobjc/sources/blocks.mm
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file blocks.mm
* @brief Defines some helper methods for block debugging.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2013-2013
* @date 2013-2014
*/
#include "blocks.h"

Expand Down
4 changes: 2 additions & 2 deletions native/Monobjc/sources/cache.h
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file cache.h
* @brief Defines the cache semantics to for the caches used in the bridge.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#ifndef __CACHE_H__
#define __CACHE_H__
Expand Down
4 changes: 2 additions & 2 deletions native/Monobjc/sources/cache.mm
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file cache.mm
* @brief Defines the cache semantics to for the caches used in the bridge.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#include "cache.h"
#include "definitions.h"
Expand Down
4 changes: 2 additions & 2 deletions native/Monobjc/sources/constants.h
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file constants.h
* @brief Contains common constants.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#ifndef __CONSTANTS_H__
#define __CONSTANTS_H__
Expand Down
2 changes: 1 addition & 1 deletion native/Monobjc/sources/definitions.def
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions native/Monobjc/sources/definitions.h
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file definitions.h
* @brief Defines the accessors to get access to the definition of the managed entities (assemblies, images, classes, methods, etc).
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#ifndef __DEFINITIONS_H__
#define __DEFINITIONS_H__
Expand Down
4 changes: 2 additions & 2 deletions native/Monobjc/sources/definitions.mm
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file definitions.mm
* @brief Defines the accessors to get access to the definition of the managed entities (assemblies, images, classes, methods, etc).
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#include "constants.h"
#include "definitions.h"
Expand Down
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file descriptor-Monobjc.Block.mm
* @brief Contains the descriptor code to handle the Monobjc.Block type.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#include "definitions.h"
#include "icalls.h"
Expand Down
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file descriptor-Monobjc.Class.mm
* @brief Contains the descriptor code to handle the Monobjc.Class type.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#include "definitions.h"
#include "enumerations.h"
Expand Down
4 changes: 2 additions & 2 deletions native/Monobjc/sources/descriptors/descriptor-Monobjc.Id.mm
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file descriptor-Monobjc.Id.mm
* @brief Contains the descriptor code to handle the Monobjc.Id type.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#include "definitions.h"
#include "enumerations.h"
Expand Down
@@ -1,6 +1,6 @@
//
// This file is part of Monobjc, a .NET/Objective-C bridge
// Copyright (C) 2007-2013 - Laurent Etiemble
// Copyright (C) 2007-2014 - Laurent Etiemble
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,7 @@
* @file descriptor-System.Boolean.mm
* @brief Contains the descriptor code to handle the System.Boolean type.
* @author Laurent Etiemble <laurent.etiemble@monobjc.net>
* @date 2009-2013
* @date 2009-2014
*/
#include "logging.h"
#include "marshal.h"
Expand Down

0 comments on commit ac53aeb

Please sign in to comment.