text:
Q: iTask - how to use variables as parameters to TTask procedure I need to create a number of iTasks that will populate the same array in different positions. Since the code to be performed for each Task is the same, I decided to create an array of iTasks and created 4 tasks.  I got a problem when passing parameters to the major procedure inside the iTask. when I use variables as parameters , only the values of the last Task created are being considered.  When I pass the parameters as values (hard-coded) it respect all values for each task.  Please see my code :
uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
  UNTThreads, Vcl.StdCtrls,
  System.Threading ;

type
 Vet         = array of integer;

type
  TFMThreadArray = class(TForm)
    EDTArraySize: TEdit;
    EDTNumberofThreads: TEdit;
    Memo1: TMemo;
    LBArraySize: TLabel;
    LBThreads: TLabel;
    BTUsingForLoop: TButton;
    EDTThread: TEdit;
    BTHardCoded: TButton;

    procedure BTUsingForLoopClick(Sender: TObject);
    procedure BTHardCodedClick(Sender: TObject);

  private
    { Private declarations }

    procedure  ProcA ( Const  pin, pfin, Psize, Ptask  : integer;
                       Var   Parray : vet);

  public
    { Public declarations }
  end;

var
  FMThreadArray: TFMThreadArray;

implementation

{$R *.dfm}

// Procedure to be called by each iTask
    procedure TFMThreadArray.ProcA ( Const  pin, pfin, Psize, Ptask  : integer;
                                      Var   Parray : vet);
    var
        vind : integer;

    begin
          for vind := pin to pfin do
          begin
               Parray[vind]   := vind * 10;
          end;
    end;

==> This below method,  BTHardCodedClick, produces the expected result.  It populates the array accordingly. BUT it is hard coded in creating 4 iTasks and in passing parameters in ProcA. I don't want to implement this way !
procedure TFMThreadArray.BTHardCodedClick(Sender: TObject);

var
    varray                   : vet;
    ind, indtask             : Integer;
    Ptasks                   : array of iTask;

begin
     memo1.Clear;

     SetLength(PTasks,Strtoint(EDTNumberofThreads.text));
     SetLength(varray,StrToint(EDTarraysize.text));

     // fill array with a initial value -2
     for ind := Low(varray) to High(varray) do
            varray[ind] :=-2;

     // when call ProcA passing values parameters it works propperly
     PTasks[0] := TTask.Create( procedure
                                      begin
                                             ProcA(0,3,16,0,varray) ;
                                      end
                                     ) ;

     PTasks[1] := TTask.Create( procedure
                                      begin
                                             ProcA(4,7,16,1,varray) ;
                                      end
                                     ) ;

     PTasks[2] := TTask.Create( procedure
                                      begin
                                             ProcA(8,11,16,2,varray) ;
                                      end
                                     ) ;

     PTasks[3] := TTask.Create( procedure
                                      begin
                                             ProcA(12,15,16,3,varray) ;
                                      end
                                     ) ;

     for Indtask := Low(Ptasks) to High(Ptasks) do
         Ptasks[Indtask].Start;

     TTask.WaitForAll(Ptasks);

     memo1.Clear;
     memo1.Lines.Add(' ============== Creating TASKs with hard-coded parameters ===============');
     memo1.lines.add(' Array size : '        + EDTArraySize.text +
                      ' number of Tasks : ' + EDTNumberofThreads.text);
     memo1.Lines.Add(' =========================================================');

     for ind := Low(varray) to High(varray) do
          memo1.Lines.Add(' Array position  : '    + Format('%.3d',[ind])  +
                          '   content  : ' + varray[ind].ToString   );

end;

===>  The following method is the one I want to implement BUT it is not working !, because it is not populating the array.  It seems that only the last iTask " PTasks[indtask]" is being performed.
procedure TFMThreadArray.BTUsingForLoopClick(Sender: TObject);
var
    varray                           : vet;
    Ptasks                           : array of iTask;
    vind, indtask, vslice            : Integer;
    vfirst, vlast, vthreads, vsize   : Integer;

begin

     vthreads := Strtoint(EDTNumberofThreads.text);
     vsize    := StrToint(EDTArraysize.text);

     SetLength(PTasks,vthreads);
     SetLength(varray,vsize);

     for vind := Low(varray) to High(varray) do
            varray[vind]:=-33;

     vslice := Length(varray) div vthreads;

     for indtask := Low(PTasks) to High(PTasks) do
     begin
          vfirst := indtask       * vslice;
          vlast  := (indtask + 1) * vslice - 1;

          if (Length(varray) mod vthreads <> 0) and (indtask = High(Ptasks)) then
               vlast := HIgh(varray);

          PTasks[indtask] := TTask.Create( procedure
                                            begin
                                                  procA(vfirst,vlast,vsize,indtask,varray) ;
                                            end
                                           ) ;
     end;

     // Starting all Tasks
     for Indtask := Low(Ptasks) to High(Ptasks) do
         Ptasks[Indtask].Start;

     // Waits until all Tasks been concluded
     TTask.WaitForAll(Ptasks);

     memo1.Clear;
     memo1.Lines.Add(' =============  Using For Loop to create the TASKs =====================');
     memo1.lines.add(' Array size : '        + EDTArraySize.text +
                      ' number of Tasks : ' + EDTNumberofThreads.text);
     memo1.Lines.Add(' =========================================================');

     for vind := Low(varray) to High(varray) do
         memo1.Lines.Add(' Array position  : '    + Format('%.3d',[vind])  +
                         '   content  : '         + varray[vind].ToString   );

end;

end.

I can't understand why a call to procA(vfirst,vlast,vsize,indtask,varray) inside the iTask  is not considering the values of parameters vfirst, vlast.
Thanks in advance for your help !

A: The effect you are observing is due to anonymous method variable capture mechanism. It does not capture variable values at specific point during code execution, but location of the variables.
Since all tasks run after the loop where you create them, you will see only the last value stored.
To solve your problem you have to add additional function ensuring that you don't capture common variables in your task.
function CreateTask(vfirst, vlast, vsize, indtask: integer; var varray: Vet): ITask;
var
  va: Vet;
begin
  // var parameter cannot be captured so we have to store it into
  // local variable - dynamic arrays act like pointers and any changes
  // to local variable will actually change the original too
  va := varray;
  Result := TTask.Create(
        procedure
        begin
          ProcA(vfirst, vlast, vsize, indtask, va);
        end);
end;

And then you call it like
  Ptasks[indtask] := CreateTask(vfirst, vlast, vsize, indtask, varray);

Of course, you can also remove your ProcA procedure and incorporate its logic directly inside CreateTask function if that suits your needs.


text:
#ifndef OS_SLOT_H_
#define OS_SLOT_H_

#ifndef GRANARY_INTERNAL
# error "This code is internal to Granary."
#endif

#include "os/slot.h"
#include "arch/base.h"

namespace granary {
namespace os {

enum SlotCategory : size_t {
  SLOT_VIRTUAL_REGISTER,
  SLOT_PRIVATE_STACK,
  SLOT_SAVED_FLAGS
};

struct SlotSet {
  // Pointer to a thread- or CPU-private stack.
  uintptr_t stack_slot;

  // Saved flags.
  uint64_t flags;

  // Used for spilling general-purpose registers, so that a spilled GPR can be
  // used to hold the value of a virtual register.
  uintptr_t spill_slots[arch::MAX_NUM_SPILL_SLOTS];
};

// Access the value of some kind of private slot (by reference). This is an
// instance of the requested slot, although many such instances might actually
// exist.
uintptr_t Slot(os::SlotCategory category, size_t sub_category=0);

}  // namespace os
}  // namespace granary

#endif  // OS_SLOT_H_

redpajama_set_name: RedPajamaGithub


text:
#ifndef __CONDITIONALMACROS__
#define __CONDITIONALMACROS__

/****************************************************************************************************
    UNIVERSAL_INTERFACES_VERSION

        0x0400 --> version 4.0 (Mac OS X only)
        0x0335 --> version 3.4
        0x0331 --> version 3.3.1
        0x0330 --> version 3.3
        0x0320 --> version 3.2
        0x0310 --> version 3.1
        0x0301 --> version 3.0.1
        0x0300 --> version 3.0
        0x0210 --> version 2.1
        This conditional did not exist prior to version 2.1
****************************************************************************************************/
#define UNIVERSAL_INTERFACES_VERSION 0x0340
#define UNIVERSAL_INTERFACES_SEED_VERSION 22

/****************************************************************************************************

    TARGET_CPU_*
    These conditionals specify which microprocessor instruction set is being
    generated.  At most one of these is true, the rest are false.

        TARGET_CPU_PPC          - Compiler is generating PowerPC instructions
        TARGET_CPU_68K          - Compiler is generating 680x0 instructions
        TARGET_CPU_X86          - Compiler is generating x86 instructions
        TARGET_CPU_MIPS         - Compiler is generating MIPS instructions
        TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
        TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions

    TARGET_OS_*
    These conditionals specify in which Operating System the generated code will
    run. At most one of the these is true, the rest are false.

        TARGET_OS_MAC           - Generate code will run under Mac OS
        TARGET_OS_WIN32         - Generate code will run under 32-bit Windows
        TARGET_OS_UNIX          - Generate code will run under some unix

    TARGET_RT_*
    These conditionals specify in which runtime the generated code will
    run. This is needed when the OS and CPU support more than one runtime
    (e.g. MacOS on 68K supports CFM68K and Classic 68k).

        TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers
        TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers
        TARGET_RT_MAC_CFM       - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used
        TARGET_RT_MAC_MACHO     - TARGET_OS_MAC is true and Mach-O style runtime
        TARGET_RT_MAC_68881     - TARGET_OS_MAC is true and 68881 floating point instructions used

    TARGET__API_*_*
    These conditionals are used to differentiate between sets of API's on the same
    processor under the same OS.  The first section after _API_ is the OS.  The
    second section is the API set.  Unlike TARGET_OS_ and TARGET_CPU_, these
    conditionals are not mutally exclusive. This file will attempt to auto-configure
    all TARGET_API_*_* values, but will often need a TARGET_API_*_* value predefined
    in order to disambiguate.

        TARGET_API_MAC_OS8      - Code is being compiled to run on System 7 through Mac OS 8.x
        TARGET_API_MAC_CARBON   - Code is being compiled to run on Mac OS 8 and Mac OS X via CarbonLib
        TARGET_API_MAC_OSX      - Code is being compiled to run on Mac OS X

    PRAGMA_*
    These conditionals specify whether the compiler supports particular #pragma's

        PRAGMA_IMPORT           - Compiler supports: #pragma import on/off/reset
        PRAGMA_ONCE             - Compiler supports: #pragma once
        PRAGMA_STRUCT_ALIGN     - Compiler supports: #pragma options align=mac68k/power/reset
        PRAGMA_STRUCT_PACK      - Compiler supports: #pragma pack(n)
        PRAGMA_STRUCT_PACKPUSH  - Compiler supports: #pragma pack(push, n)/pack(pop)
        PRAGMA_ENUM_PACK        - Compiler supports: #pragma options(!pack_enums)
        PRAGMA_ENUM_ALWAYSINT   - Compiler supports: #pragma enumsalwaysint on/off/reset
        PRAGMA_ENUM_OPTIONS     - Compiler supports: #pragma options enum=int/small/reset

    FOUR_CHAR_CODE
    This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
    is compiled down to the correct value on all compilers.

        FOUR_CHAR_CODE('abcd')  - Convert a four-char-code to the correct 32-bit value

    TYPE_*
    These conditionals specify whether the compiler supports particular types.

        TYPE_LONGLONG               - Compiler supports "long long" 64-bit integers
        TYPE_BOOL                   - Compiler supports "bool"
        TYPE_EXTENDED               - Compiler supports "extended" 80/96 bit floating point
        TYPE_LONGDOUBLE_IS_DOUBLE   - Compiler implements "long double" same as "double"

    FUNCTION_*
    These conditionals specify whether the compiler supports particular language extensions
    to function prototypes and definitions.

        FUNCTION_PASCAL         - Compiler supports "pascal void Foo()"
        FUNCTION_DECLSPEC       - Compiler supports "__declspec(xxx) void Foo()"
        FUNCTION_WIN32CC        - Compiler supports "void __cdecl Foo()" and "void __stdcall Foo()"

****************************************************************************************************/

#if defined(__MRC__)
  /*
     MrC[pp] compiler from Apple Computer, Inc.
 */
 #define TARGET_CPU_PPC              1
  #define TARGET_CPU_68K              0
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_OS_MAC               1
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              0
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define TARGET_RT_MAC_CFM           1
  #define TARGET_RT_MAC_MACHO         0
  #define TARGET_RT_MAC_68881         0
  #if (__MRC__  > 0x0200) && (__MRC__ < 0x0700)
      #define PRAGMA_IMPORT           1
  #else
      #define PRAGMA_IMPORT           0
  #endif
 #define PRAGMA_STRUCT_ALIGN         1
  #define PRAGMA_ONCE                 1
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            1
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)

   #if (__MRC__  > 0x0300) && (__MRC__ < 0x0700)
      #if __option(longlong)

           #define TYPE_LONGLONG       1

       #else
          #define TYPE_LONGLONG       0
      #endif
     #if __option(bool)
         #define TYPE_BOOL           1
      #else
          #define TYPE_BOOL           0
      #endif
     #define SLASH_INCLUDES_UNSUPPORTED      !__option(unix_includes)
   #else
      #define TYPE_LONGLONG           0
      #define TYPE_BOOL               0
      #define SLASH_INCLUDES_UNSUPPORTED      1
  #endif
 #define TYPE_EXTENDED               0
  #define TYPE_LONGDOUBLE_IS_DOUBLE   0

   #define FUNCTION_PASCAL             1
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0

#elif defined(__SC__) && (defined(MPW_CPLUS) || defined(MPW_C))
   /*
     SC[pp] compiler from Apple Computer, Inc.
  */
 #define TARGET_CPU_PPC              0
  #define TARGET_CPU_68K              1
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_OS_MAC               1
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              0
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #if defined(__CFM68K__)
        #define TARGET_RT_MAC_CFM       1
  #else
      #define TARGET_RT_MAC_CFM       0
  #endif
 #define TARGET_RT_MAC_MACHO         0
  #if defined(mc68881)
       #define TARGET_RT_MAC_68881     1
  #else
      #define TARGET_RT_MAC_68881     0
  #endif
 #if TARGET_RT_MAC_CFM
     #define PRAGMA_IMPORT           1
      #if (__SC__ <= 0x0810)
         /* old versions of SC don't support Ò#pragma import resetÓ */
          #define PRAGMA_IMPORT_OFF   1
      #endif
 #else
      #define PRAGMA_IMPORT           0
  #endif
 #if (__SC__  >= 0x0801)
        #define PRAGMA_STRUCT_ALIGN     1
  #else
      #define PRAGMA_STRUCT_ALIGN     0
  #endif
 #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            1
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)

   #define TYPE_LONGLONG               0
  #define TYPE_EXTENDED               1
  #define TYPE_LONGDOUBLE_IS_DOUBLE   0
  #if (__SC__  > 0x0810)
     #if __option(bool)
         #define TYPE_BOOL           1
      #else
          #define TYPE_BOOL           0
      #endif
 #else
      #define TYPE_BOOL               0
  #endif
 #if TARGET_RT_MAC_CFM
      #define FUNCTION_PASCAL         0
  #else
      #define FUNCTION_PASCAL         1
  #endif
 #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0
   #define SLASH_INCLUDES_UNSUPPORTED  !__option(unix_includes)

#elif defined(__MWERKS__)
 /*
     CodeWarrior compiler from Metrowerks, Inc.
 */
 #if (__MWERKS__ < 0x0900) || macintosh
     #define TARGET_OS_MAC               1
      #define TARGET_OS_WIN32             0
      #define TARGET_OS_UNIX              0
      #define TARGET_CPU_X86              0
      #define TARGET_CPU_MIPS             0
      #define TARGET_CPU_SPARC            0
       #define TARGET_CPU_ALPHA            0
      #define TARGET_RT_LITTLE_ENDIAN     0
      #define TARGET_RT_BIG_ENDIAN        1
      #if powerc
         #define TARGET_CPU_PPC              1
          #define TARGET_CPU_68K              0
          #define TARGET_RT_MAC_CFM           1
          #define TARGET_RT_MAC_MACHO         0
          #define TARGET_RT_MAC_68881         0
          #define TYPE_LONGDOUBLE_IS_DOUBLE   1
      #else
          #define TARGET_CPU_PPC          0
          #define TARGET_CPU_68K          1
          #if defined(__CFM68K__)
                #define TARGET_RT_MAC_CFM   1
          #else
              #define TARGET_RT_MAC_CFM   0
          #endif
         #define TARGET_RT_MAC_MACHO     0
          #if __MC68881__
                #define TARGET_RT_MAC_68881 1
          #else
              #define TARGET_RT_MAC_68881 0
          #endif
         #if __option(IEEEdoubles)
              #define TYPE_LONGDOUBLE_IS_DOUBLE   0
          #else
              #define TYPE_LONGDOUBLE_IS_DOUBLE   1
          #endif
     #endif
     #define PRAGMA_ONCE                 1
      #if (__MWERKS__ >= 0x0700)
         #define PRAGMA_IMPORT           TARGET_RT_MAC_CFM
      #else
          #define PRAGMA_IMPORT           0
      #endif
     #define PRAGMA_STRUCT_ALIGN         1
      #define PRAGMA_STRUCT_PACK          0
      #define PRAGMA_STRUCT_PACKPUSH      0
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       1
      #define PRAGMA_ENUM_OPTIONS         0
      #if __option(enumsalwaysint) && __option(ANSI_strict)
          #define FOUR_CHAR_CODE(x)       ((long)(x)) /* otherwise compiler will complain about values with high bit set */
      #else
          #define FOUR_CHAR_CODE(x)       (x)
        #endif
     #if TARGET_CPU_68K && !TARGET_RT_MAC_CFM
           #define FUNCTION_PASCAL         1
      #else
          #define FUNCTION_PASCAL         1
      #endif
     #if (__MWERKS__ >= 0x2000)
         #define FUNCTION_DECLSPEC       1
      #else
          #define FUNCTION_DECLSPEC       0
      #endif
     #define FUNCTION_WIN32CC            0

   #elif (__MWERKS__ >= 0x0900) && __INTEL__
      #define TARGET_CPU_PPC              0
      #define TARGET_CPU_68K              0
      #define TARGET_CPU_X86              1
      #define TARGET_CPU_MIPS             0
      #define TARGET_CPU_SPARC            0
       #define TARGET_CPU_ALPHA            0
      #define TARGET_OS_MAC               0
      #define TARGET_OS_WIN32             1
      #define TARGET_OS_UNIX              0
      #define TARGET_RT_LITTLE_ENDIAN     1
      #define TARGET_RT_BIG_ENDIAN        0
      #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
      #define PRAGMA_ONCE                 1
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         0
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      1
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       1
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)           (x)
        #define FUNCTION_PASCAL             0
      #ifndef FUNCTION_DECLSPEC                   /* allow use of __declspec(dllimport) to be enabled */
         #define FUNCTION_DECLSPEC       0       /* QuickTime for Windows cannot use dllimport */
       #endif
     #ifndef FUNCTION_WIN32CC                    /* allow calling convention to be overriddden */
           #define FUNCTION_WIN32CC        1
       #endif
     #define TYPE_LONGDOUBLE_IS_DOUBLE   1

   #elif (__MWERKS__ >= 0x1900) && __MIPS__
       #define TARGET_CPU_PPC              0
      #define TARGET_CPU_68K              0
      #define TARGET_CPU_X86              0
      #define TARGET_CPU_MIPS             1
      #define TARGET_CPU_SPARC            0
       #define TARGET_CPU_ALPHA            0
      #define TARGET_OS_MAC               0
      #define TARGET_OS_WIN32             0
      #define TARGET_OS_UNIX              1
      #if __option(little_endian)
            #define TARGET_RT_LITTLE_ENDIAN 1
          #define TARGET_RT_BIG_ENDIAN    0
      #else
          #define TARGET_RT_LITTLE_ENDIAN 0
          #define TARGET_RT_BIG_ENDIAN    1
      #endif
     #define PRAGMA_ONCE                 1
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         0
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      0
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       1
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)           (x)
        #define FUNCTION_PASCAL             0
      #define FUNCTION_DECLSPEC           0
      #define FUNCTION_WIN32CC            0
       #define TYPE_LONGDOUBLE_IS_DOUBLE   1

   #elif (__MWERKS__ >= 0x2110) && __MACH__
       #define TARGET_CPU_PPC              1
      #define TARGET_CPU_68K              0
      #define TARGET_CPU_X86              0
      #define TARGET_CPU_MIPS             0
      #define TARGET_CPU_SPARC            0
       #define TARGET_CPU_ALPHA            0
      #define TARGET_OS_MAC               1
       #define TARGET_OS_WIN32             0
      #define TARGET_OS_UNIX              0
      #if __option(little_endian)
            #define TARGET_RT_LITTLE_ENDIAN 1
          #define TARGET_RT_BIG_ENDIAN    0
      #else
          #define TARGET_RT_LITTLE_ENDIAN 0
          #define TARGET_RT_BIG_ENDIAN    1
      #endif
     #define TARGET_RT_MAC_CFM           0
      #define TARGET_RT_MAC_MACHO         1
      #define TARGET_RT_MAC_68881         0
      #define PRAGMA_ONCE                 1
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         1
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      0
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       1
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)           (x)
        #define FUNCTION_PASCAL             1
      #define FUNCTION_DECLSPEC           1
      #define FUNCTION_WIN32CC            0
       #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #else
       #error unknown Metrowerks compiler
 #endif

   #if (__MWERKS__ >= 0x1100)
     #if __option(longlong)
         #define TYPE_LONGLONG       1
      #else
          #define TYPE_LONGLONG       0
      #endif
 #else
      #define TYPE_LONGLONG           0
  #endif
 #if (__MWERKS__ >= 0x1000)
     #if __option(bool)
         #define TYPE_BOOL           1
      #else
          #define TYPE_BOOL           0
      #endif
 #else
      #define TYPE_BOOL               0
  #endif
 #define TYPE_EXTENDED               0
  #define SLASH_INCLUDES_UNSUPPORTED  1

#elif defined(SYMANTEC_CPLUS) || defined(SYMANTEC_C)
  /*
     C and C++ compiler from Symantec, Inc.
 */
 #define TARGET_OS_MAC               1
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              0
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #if powerc
     #define TARGET_CPU_PPC          1
      #define TARGET_CPU_68K          0
      #define TARGET_RT_MAC_CFM       1
      #define TARGET_RT_MAC_MACHO     0
      #define TARGET_RT_MAC_68881     0
  #else
      #define TARGET_CPU_PPC          0
      #define TARGET_CPU_68K          1
      #if defined(__CFM68K)
          #define TARGET_RT_MAC_CFM   1
      #else
          #define TARGET_RT_MAC_CFM   0
      #endif
     #define TARGET_RT_MAC_MACHO     0
      #if mc68881
            #define TARGET_RT_MAC_68881 1
      #else
          #define TARGET_RT_MAC_68881 0
      #endif
 #endif
 #define PRAGMA_IMPORT               0
  #define PRAGMA_ONCE                 1
  #define PRAGMA_STRUCT_ALIGN         1
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            1
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)

   #if __useAppleExts__
       #define TYPE_EXTENDED           1
  #else
      #define TYPE_EXTENDED           0
  #endif
 #define TYPE_LONGLONG               0
  #define TYPE_BOOL                   0
  #define TYPE_LONGDOUBLE_IS_DOUBLE   1

   #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0
   #define SLASH_INCLUDES_UNSUPPORTED  1

#elif defined(THINK_C)
    /*
     THINK C compiler from Symantec, Inc.        << WARNING: Unsupported Compiler >>
    */
 #define TARGET_CPU_PPC              0
  #define TARGET_CPU_68K              1
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_OS_MAC               1
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              0
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define TARGET_RT_MAC_CFM           0
  #define TARGET_RT_MAC_MACHO         0
  #if defined(mc68881)
       #define TARGET_RT_MAC_68881     1
  #else
      #define TARGET_RT_MAC_68881     0
  #endif
 #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         0
  #define PRAGMA_ONCE                 1
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            1
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)

   #define TYPE_EXTENDED               1
  #define TYPE_LONGLONG               0
  #define TYPE_BOOL                   0
  #define TYPE_LONGDOUBLE_IS_DOUBLE   1

   #define FUNCTION_PASCAL             1
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0
  #define SLASH_INCLUDES_UNSUPPORTED  1

#elif defined(__PPCC__)
   /*
     PPCC compiler from Apple Computer, Inc.     << WARNING: Unsupported Compiler >>
    */
 #define TARGET_CPU_PPC              1
  #define TARGET_CPU_68K              0
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_OS_MAC               1
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              0
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define TARGET_RT_MAC_CFM           1
  #define TARGET_RT_MAC_MACHO         0
  #define TARGET_RT_MAC_68881         0
  #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         1
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)

   #define TYPE_EXTENDED               0
  #define TYPE_LONGLONG               0
  #define TYPE_BOOL                   0
  #define TYPE_LONGDOUBLE_IS_DOUBLE   1

   #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0
   #define SLASH_INCLUDES_UNSUPPORTED  1

#elif defined(applec) && !defined(__SC__)
 /*
     MPW C compiler from Apple Computer, Inc.    << WARNING: Unsupported Compiler >>
    */
 #define TARGET_CPU_PPC              0
  #define TARGET_CPU_68K              1
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_OS_MAC               1
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              0
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define TARGET_RT_MAC_CFM           0
  #define TARGET_RT_MAC_MACHO         0
  #if defined(mc68881)
       #define TARGET_RT_MAC_68881     1
  #else
      #define TARGET_RT_MAC_68881     0
  #endif
 #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         0
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  /* Note: MPW C 3.2 had a bug where MACRO('xx   ') would cause 'xx  ' to be misevaluated */
 #define FOUR_CHAR_CODE

  #define TYPE_EXTENDED               1
  #define TYPE_LONGLONG               0
  #define TYPE_BOOL                   0
  #define TYPE_LONGDOUBLE_IS_DOUBLE   0

 #define FUNCTION_PASCAL             1
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0
   #define SLASH_INCLUDES_UNSUPPORTED  1

#elif defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__NEXT_CPP__))
 /*
     gcc based compilers used on OpenStep -> Rhapsody -> Mac OS X
   */
 #if defined(__ppc__) || defined(powerpc) || defined(ppc)
       #define TARGET_CPU_PPC          1
      #define TARGET_CPU_68K          0
      #define TARGET_CPU_X86          0
      #define TARGET_CPU_MIPS         0
      #define TARGET_CPU_SPARC        0
       #define TARGET_CPU_ALPHA        0
      #define TARGET_RT_MAC_68881     0
      #define TARGET_RT_LITTLE_ENDIAN 0
      #define TARGET_RT_BIG_ENDIAN    1
      #ifdef __MACH__
            #define TARGET_RT_MAC_MACHO 1
          #define TARGET_RT_MAC_CFM   0
      #else
          #define TARGET_RT_MAC_MACHO 0
          #define TARGET_RT_MAC_CFM   1
      #endif
 #elif defined(m68k)
        #define TARGET_CPU_PPC          0
      #define TARGET_CPU_68K          1
      #define TARGET_CPU_X86          0
      #define TARGET_CPU_MIPS         0
      #define TARGET_CPU_SPARC        0
       #define TARGET_CPU_ALPHA        0
      #define TARGET_RT_MAC_CFM       0
      #define TARGET_RT_MAC_MACHO     1
      #define TARGET_RT_MAC_68881     0
      #define TARGET_RT_LITTLE_ENDIAN 0
      #define TARGET_RT_BIG_ENDIAN    1
  #elif defined(sparc)
       #define TARGET_CPU_PPC          0
      #define TARGET_CPU_68K          0
      #define TARGET_CPU_X86          0
      #define TARGET_CPU_MIPS         0
      #define TARGET_CPU_SPARC        1
      #define TARGET_CPU_ALPHA        0
      #define TARGET_RT_MAC_CFM       0
      #define TARGET_RT_MAC_MACHO     1
      #define TARGET_RT_MAC_68881     0
      #define TARGET_RT_LITTLE_ENDIAN 0
      #define TARGET_RT_BIG_ENDIAN    1
  #elif defined(__i386__) || defined(i386) || defined(intel)
     #define TARGET_CPU_PPC          0
      #define TARGET_CPU_68K          0
      #define TARGET_CPU_X86          1
      #define TARGET_CPU_MIPS         0
      #define TARGET_CPU_SPARC        0
      #define TARGET_CPU_ALPHA        0
      #define TARGET_RT_MAC_CFM       0
      #define TARGET_RT_MAC_MACHO     1
      #define TARGET_RT_MAC_68881     0
      #define TARGET_RT_LITTLE_ENDIAN 1
      #define TARGET_RT_BIG_ENDIAN    0
  #else
      #error unrecognized GNU C compiler
 #endif

#ifndef TARGET_OS_MAC
 #define TARGET_OS_MAC               1
#endif
#ifndef TARGET_OS_WIN32
   #define TARGET_OS_WIN32             0
#endif
#ifndef TARGET_OS_UNIX
    #define TARGET_OS_UNIX              0
#endif

  #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         1
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)

   #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #define TYPE_EXTENDED               0
  #if __GNUC__ >= 2
      #define TYPE_LONGLONG           1
  #else
      #define TYPE_LONGLONG           0
  #endif
 #ifdef __cplusplus
     #define TYPE_BOOL               1
  #else
      #define TYPE_BOOL               0
  #endif

   #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0

#elif defined(__GNUC__) && defined(__linux__)
 /*
     gcc (egcs, really) for MkLinux.             << WARNING: Unsupported Compiler >>
    */
 #if #cpu(powerpc)
      #define TARGET_CPU_PPC          1
      #define TARGET_CPU_68K          0
      #define TARGET_CPU_X86          0
      #define TARGET_CPU_MIPS         0
      #define TARGET_CPU_SPARC        0
       #define TARGET_CPU_ALPHA        0
      #define TARGET_RT_MAC_CFM       1
      #define TARGET_RT_MAC_MACHO     0
      #define TARGET_RT_MAC_68881     0
  #elif #cpu(m68k)
       #define TARGET_CPU_PPC          0
      #define TARGET_CPU_68K          1
      #define TARGET_CPU_X86          0
      #define TARGET_CPU_MIPS         0
      #define TARGET_CPU_SPARC        0
       #define TARGET_CPU_ALPHA        0
      #define TARGET_RT_MAC_CFM       0
      #define TARGET_RT_MAC_MACHO     0
      #define TARGET_RT_MAC_68881     0
  #else
      #error unsupported GNU C compiler
  #endif

   #if #system(macos)
     #define TARGET_OS_MAC           1
      #define TARGET_OS_WIN32         0
      #define TARGET_OS_UNIX          0
  #elif #system(unix)
        #define TARGET_OS_MAC           0
      #define TARGET_OS_WIN32         0
      #define TARGET_OS_UNIX          1
  #else
      #error unsupported GNU C compiler
  #endif

   #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         0
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          1
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)

   #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #define TYPE_EXTENDED               0
  #ifdef _LONG_LONG
      #define TYPE_LONGLONG           1
  #else
      #define TYPE_LONGLONG           0
  #endif
 #define TYPE_BOOL                   0

   #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0

#elif defined(__GNUC__) && defined(__MINGW32__)
   /*
     Mingw gnu gcc/egcs compiler for Win32 systems (http://www.mingw.org).
  */
 #define TARGET_CPU_PPC              0
  #define TARGET_CPU_68K              0
  #define TARGET_CPU_X86              1
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_RT_MAC_CFM           0
  #define TARGET_RT_MAC_MACHO         0
  #define TARGET_RT_MAC_68881         0
  #define TARGET_OS_MAC               0
  #define TARGET_OS_WIN32             1
  #define TARGET_OS_UNIX              0
  #define TARGET_RT_LITTLE_ENDIAN     1
  #define TARGET_RT_BIG_ENDIAN        0
  #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
  #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         0
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          1
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)
    #define TYPE_EXTENDED               0
  #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #define TYPE_LONGLONG               1
  #define TYPE_BOOL                   1
  #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0

#elif defined(__GNUC__)
   /*
     gC for MPW from Free Software Foundation, Inc.
 */
 #if #cpu(powerpc)
      #define TARGET_CPU_PPC          1
      #define TARGET_CPU_68K          0
      #define TARGET_CPU_X86          0
      #define TARGET_CPU_MIPS         0
      #define TARGET_CPU_SPARC        0
       #define TARGET_CPU_ALPHA        0
      #define TARGET_RT_MAC_CFM       1
      #define TARGET_RT_MAC_MACHO     0
      #define TARGET_RT_MAC_68881     0
  #elif #cpu(m68k)
       #define TARGET_CPU_PPC          0
      #define TARGET_CPU_68K          1
      #define TARGET_CPU_X86          0
      #define TARGET_CPU_MIPS         0
      #define TARGET_CPU_SPARC        0
       #define TARGET_CPU_ALPHA        0
      #define TARGET_RT_MAC_CFM       0
      #define TARGET_RT_MAC_MACHO     0
      #define TARGET_RT_MAC_68881     0
  #else
      #error unsupported GNU C compiler
  #endif

   #if #system(macos)
     #define TARGET_OS_MAC           1
      #define TARGET_OS_WIN32         0
      #define TARGET_OS_UNIX          0
  #elif #system(unix)
        #define TARGET_OS_MAC           0
      #define TARGET_OS_WIN32         0
      #define TARGET_OS_UNIX          1
  #else
      #error unsupported GNU C compiler
  #endif

   #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         1
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)

   #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #define TYPE_EXTENDED               0
  #ifdef _LONG_LONG
      #define TYPE_LONGLONG           1
  #else
      #define TYPE_LONGLONG           0
  #endif
 #define TYPE_BOOL                   0

 #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0

#elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
 /*
     xlc and xlC on RS/6000 from IBM, Inc.
  */
 #define TARGET_CPU_PPC              1
  #define TARGET_CPU_68K              0
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #if defined(_AIX)
      #define TARGET_OS_MAC           0
      #define TARGET_OS_UNIX          1
  #else
      #define TARGET_OS_MAC           1
      #define TARGET_OS_UNIX          0
  #endif
 #define TARGET_OS_WIN32             0
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define TARGET_RT_MAC_CFM           1
  #define TARGET_RT_MAC_MACHO         0
  #define TARGET_RT_MAC_68881         0
  #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         1
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         1
  #define FOUR_CHAR_CODE(x)           (x)

   #define TYPE_LONGDOUBLE_IS_DOUBLE   0
  #define TYPE_EXTENDED               0
  #ifdef _LONG_LONG
      #define TYPE_LONGLONG           1
  #else
      #define TYPE_LONGLONG           0
  #endif
 #define TYPE_BOOL                   0

   #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
  #define FUNCTION_WIN32CC            0

#elif defined(_MSC_VER) && !defined(__MWERKS__)
  /*
     Visual Studio C/C++ from Microsoft, Inc.
   */
 #if defined(_M_M68K)    /* Visual C++ with Macintosh 68K target */
     #define TARGET_CPU_PPC              0
      #define TARGET_CPU_68K              1
      #define TARGET_CPU_X86              0
      #define TARGET_CPU_MIPS             0
      #define TARGET_CPU_SPARC            0
      #define TARGET_CPU_ALPHA            0
      #define TARGET_OS_MAC               1
      #define TARGET_OS_WIN32             0
      #define TARGET_OS_UNIX              0
      #define TARGET_RT_LITTLE_ENDIAN     0
      #define TARGET_RT_BIG_ENDIAN        1
      #define TARGET_RT_MAC_CFM           0
      #define TARGET_RT_MAC_MACHO         0
      #define TARGET_RT_MAC_68881         0
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         1
      #define PRAGMA_ONCE                 0
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      1
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       0
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)           (x)
        #define TYPE_LONGDOUBLE_IS_DOUBLE   1
      #define TYPE_EXTENDED               0
      #define TYPE_LONGLONG               0
      #define TYPE_BOOL                   0
      #define FUNCTION_PASCAL             1
      #define FUNCTION_DECLSPEC           0
      #define FUNCTION_WIN32CC            0

    #elif defined(_M_MPPC)  /* Visual C++ with Macintosh PowerPC target */
     #define TARGET_CPU_PPC              1
      #define TARGET_CPU_68K              0
      #define TARGET_CPU_X86              0
      #define TARGET_CPU_MIPS             0
      #define TARGET_CPU_SPARC            0
      #define TARGET_CPU_ALPHA            0
      #define TARGET_OS_MAC               1
      #define TARGET_OS_WIN32             0
      #define TARGET_OS_UNIX              0
      #define TARGET_RT_LITTLE_ENDIAN     0
      #define TARGET_RT_BIG_ENDIAN        1
      #define TARGET_RT_MAC_CFM           1
      #define TARGET_RT_MAC_MACHO         0
      #define TARGET_RT_MAC_68881         0
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         1
      #define PRAGMA_ONCE                 0
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      1
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       0
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)           (x)
        #define TYPE_LONGDOUBLE_IS_DOUBLE   1
      #define TYPE_EXTENDED               0
      #define TYPE_LONGLONG               0
      #define TYPE_BOOL                   0
      #define FUNCTION_PASCAL             0
      #define FUNCTION_DECLSPEC           0
       #define FUNCTION_WIN32CC            0

    #elif defined(_M_IX86)  /* Visual Studio with Intel x86 target */
      #define TARGET_CPU_PPC              0
      #define TARGET_CPU_68K              0
      #define TARGET_CPU_X86              1
      #define TARGET_CPU_MIPS             0
      #define TARGET_CPU_SPARC            0
      #define TARGET_CPU_ALPHA            0
      #define TARGET_OS_MAC               0
      #define TARGET_OS_WIN32             1
      #define TARGET_OS_UNIX              0
      #define TARGET_RT_LITTLE_ENDIAN     1
      #define TARGET_RT_BIG_ENDIAN        0
      #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         0
      #define PRAGMA_ONCE                 0
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      1
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       0
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)           (x)
       #define TYPE_LONGDOUBLE_IS_DOUBLE   1
      #define TYPE_EXTENDED               0
      #define TYPE_LONGLONG               1   /* note: uses __int64 instead of long long */
      #define LONGLONG_TYPENAME           __int64

       #define LONGLONG_SIGNED_MAX         (9223372036854775807i64)
       #define LONGLONG_SIGNED_MIN         (-9223372036854775807i64 - 1)
      #define LONGLONG_UNSIGNED_MAX       (0xffffffffffffffffui64)

       #if defined(__cplusplus) && (_MSC_VER >= 1100)
         #define TYPE_BOOL               1
      #else
          #define TYPE_BOOL               0
      #endif
     #define FUNCTION_PASCAL             0
      #ifndef FUNCTION_DECLSPEC               /* allow use of __declspec(dllimport) to be enabled */
         #define FUNCTION_DECLSPEC       0   /* QuickTime for Windows cannot use dllimport */
       #endif
     #ifndef FUNCTION_WIN32CC                /* allow calling convention to be overriddden */
           #define FUNCTION_WIN32CC        1
       #endif
     /* Warning:  This macros away the pascal word in source code. */
       /* Very useful for code that needs to compile on Mac 68k and Windows */
        /* but can silently change code */
     #undef pascal
      #define pascal

        #elif defined(_M_ALPHA)     /* Visual C++ with Dec Alpha target */
     #define TARGET_CPU_PPC              0
      #define TARGET_CPU_68K              0
      #define TARGET_CPU_X86              0
      #define TARGET_CPU_MIPS             0
      #define TARGET_CPU_SPARC            0
      #define TARGET_CPU_ALPHA            1
      #define TARGET_OS_MAC               0
      #define TARGET_OS_WIN32             1
      #define TARGET_OS_UNIX              0
      #define TARGET_RT_LITTLE_ENDIAN     1
      #define TARGET_RT_BIG_ENDIAN        0
      #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         0
      #define PRAGMA_ONCE                 0
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      1
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       0
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)       (((unsigned long) ((x) & 0x000000FF)) << 24) \
                                 | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
                                    | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
                                    | (((unsigned long) ((x) & 0xFF000000)) >> 24)
     #define TYPE_EXTENDED               0
      #define TYPE_LONGDOUBLE_IS_DOUBLE   1
      #define TYPE_LONGLONG               0
      #define TYPE_BOOL                   0
      #define FUNCTION_PASCAL             0
      #define FUNCTION_DECLSPEC           0
       #define FUNCTION_WIN32CC            0

    #elif defined(_M_PPC)   /* Visual C++ for Windows NT on PowerPC target */
      #define TARGET_CPU_PPC              1
      #define TARGET_CPU_68K              0
      #define TARGET_CPU_X86              0
      #define TARGET_CPU_MIPS             0
      #define TARGET_CPU_SPARC            0
      #define TARGET_CPU_ALPHA            0
      #define TARGET_OS_MAC               0
      #define TARGET_OS_WIN32             1
      #define TARGET_OS_UNIX              0
      #define TARGET_RT_LITTLE_ENDIAN     1
      #define TARGET_RT_BIG_ENDIAN        0
      #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         0
      #define PRAGMA_ONCE                 0
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      1
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       0
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)       (((unsigned long) ((x) & 0x000000FF)) << 24) \
                                 | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
                                    | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
                                    | (((unsigned long) ((x) & 0xFF000000)) >> 24)
     #define TYPE_EXTENDED               0
      #define TYPE_LONGLONG               0
      #define TYPE_BOOL                   0
      #define FUNCTION_PASCAL             0
      #define FUNCTION_DECLSPEC           0
       #define FUNCTION_WIN32CC            0

        #elif defined(_M_MRX000)    /* Visual C++ for Windows NT on MIPS target */
     #define TARGET_CPU_PPC              0
      #define TARGET_CPU_68K              0
      #define TARGET_CPU_X86              0
      #define TARGET_CPU_MIPS             1
      #define TARGET_CPU_SPARC            0
      #define TARGET_CPU_ALPHA            0
      #define TARGET_OS_MAC               0
      #define TARGET_OS_WIN32             1
      #define TARGET_OS_UNIX              0
      #define TARGET_RT_LITTLE_ENDIAN     1
      #define TARGET_RT_BIG_ENDIAN        0
      #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
      #define PRAGMA_IMPORT               0
      #define PRAGMA_STRUCT_ALIGN         0
      #define PRAGMA_ONCE                 0
      #define PRAGMA_STRUCT_PACK          1
      #define PRAGMA_STRUCT_PACKPUSH      1
      #define PRAGMA_ENUM_PACK            0
      #define PRAGMA_ENUM_ALWAYSINT       0
      #define PRAGMA_ENUM_OPTIONS         0
      #define FOUR_CHAR_CODE(x)       (((unsigned long) ((x) & 0x000000FF)) << 24) \
                                 | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
                                    | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
                                    | (((unsigned long) ((x) & 0xFF000000)) >> 24)
     #define TYPE_EXTENDED               0
      #define TYPE_LONGDOUBLE_IS_DOUBLE   1
      #define TYPE_LONGLONG               0
      #define TYPE_BOOL                   0
      #define FUNCTION_PASCAL             0
      #define FUNCTION_DECLSPEC           0
       #define FUNCTION_WIN32CC            0
   #endif

#elif defined(__MOTO__)
   /*
     mcc from Motorola, Inc.
   */
 #define TARGET_CPU_PPC              1
  #define TARGET_CPU_68K              0
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_OS_MAC               1
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              0
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define TARGET_RT_MAC_CFM           1
  #define TARGET_RT_MAC_MACHO         0
  #define TARGET_RT_MAC_68881         0
  #define PRAGMA_IMPORT               0           /* how is this detected ?? */
  #define PRAGMA_STRUCT_ALIGN         1
  #if __MOTO__ >= 40702                           /* MCC version 4.7.2 */
      #define PRAGMA_ONCE               1
  #else
    #define PRAGMA_ONCE               0
  #endif
 #define PRAGMA_STRUCT_PACK          0
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)
    #define TYPE_LONGLONG               0           /* how is this detected ?? */
  #ifdef _BOOL
       #define TYPE_BOOL               1
   #else
      #define TYPE_BOOL               0
   #endif
 #define TYPE_EXTENDED               0
  #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
   #define FUNCTION_WIN32CC            0

#elif defined(_MIPS_ISA)
  /*
     MIPSpro compiler from Silicon Graphics Inc.
    */
 #define TARGET_CPU_PPC              0
  #define TARGET_CPU_68K              0
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             1
  #define TARGET_CPU_SPARC            0
   #define TARGET_CPU_ALPHA            0
  #define TARGET_OS_MAC               0
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              1
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         0
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          1
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)           (x)
    #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #define TYPE_EXTENDED               0
  #define TYPE_LONGLONG               0
  #define TYPE_BOOL                   0
  #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
   #define FUNCTION_WIN32CC            0

#elif defined(__sparc)
    /*
     SPARCompiler compiler from Sun Microsystems Inc.
   */
 #define TARGET_CPU_PPC              0
  #define TARGET_CPU_68K              0
  #define TARGET_CPU_X86              0
  #define TARGET_CPU_MIPS             0
  #define TARGET_CPU_SPARC            1
   #define TARGET_CPU_ALPHA            0
  #define TARGET_OS_MAC               0
  #define TARGET_OS_WIN32             0
  #define TARGET_OS_UNIX              1
  #define TARGET_RT_LITTLE_ENDIAN     0
  #define TARGET_RT_BIG_ENDIAN        1
  #define PRAGMA_IMPORT               0
  #define PRAGMA_STRUCT_ALIGN         0
  #define PRAGMA_ONCE                 0
  #define PRAGMA_STRUCT_PACK          1
  #define PRAGMA_STRUCT_PACKPUSH      0
  #define PRAGMA_ENUM_PACK            0
  #define PRAGMA_ENUM_ALWAYSINT       0
  #define PRAGMA_ENUM_OPTIONS         0
  #define FOUR_CHAR_CODE(x)       (((unsigned long) ((x) & 0x000000FF)) << 24) \
                                 | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
                                    | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
                                    | (((unsigned long) ((x) & 0xFF000000)) >> 24)
 #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #define TYPE_EXTENDED               0
  #define TYPE_LONGLONG               0
  #define TYPE_BOOL                   0
  #define FUNCTION_PASCAL             0
  #define FUNCTION_DECLSPEC           0
   #define FUNCTION_WIN32CC            0

#else
 /*
     Unknown compiler, perhaps set up from the command line (e.g. -d TARGET_CPU_MIPS , etc.)
    */
 #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
      #define TARGET_CPU_68K   0
     #define TARGET_CPU_X86   0
     #define TARGET_CPU_MIPS  0
     #define TARGET_CPU_SPARC 0
     #define TARGET_CPU_ALPHA 0
 #elif defined(TARGET_CPU_68K) && TARGET_CPU_68K
        #define TARGET_CPU_PPC   0
     #define TARGET_CPU_X86   0
     #define TARGET_CPU_MIPS  0
     #define TARGET_CPU_SPARC 0
     #define TARGET_CPU_ALPHA 0
 #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
        #define TARGET_CPU_PPC   0
     #define TARGET_CPU_68K   0
     #define TARGET_CPU_MIPS  0
     #define TARGET_CPU_SPARC 0
     #define TARGET_CPU_ALPHA 0
 #elif defined(TARGET_CPU_MIPS) && TARGET_CPU_MIPS
      #define TARGET_CPU_PPC   0
     #define TARGET_CPU_68K   0
     #define TARGET_CPU_X86   0
     #define TARGET_CPU_SPARC 0
     #define TARGET_CPU_ALPHA 0
 #elif defined(TARGET_CPU_SPARC) && TARGET_CPU_SPARC
        #define TARGET_CPU_PPC   0
     #define TARGET_CPU_68K   0
     #define TARGET_CPU_X86   0
     #define TARGET_CPU_MIPS  0
     #define TARGET_CPU_ALPHA 0
 #elif defined(TARGET_CPU_ALPHA) && TARGET_CPU_ALPHA
        #define TARGET_CPU_PPC   0
     #define TARGET_CPU_68K   0
     #define TARGET_CPU_X86   0
     #define TARGET_CPU_MIPS  0
     #define TARGET_CPU_SPARC 0

   #else
      /*
         NOTE:   If your compiler errors out here then support for your compiler
                   has not yet been added to ConditionalMacros.h.

                   ConditionalMacros.h is designed to be plug-and-play.  It auto detects
                  which compiler is being run and configures the TARGET_ conditionals
                    appropriately.

                   The short term work around is to set the TARGET_CPU_ and TARGET_OS_
                    on the command line to the compiler (e.g. d TARGET_CPU_MIPS -d TARGET_OS_UNIX)

                   The long term solution is to add a new case to this file which
                 auto detects your compiler and sets up the TARGET_ conditionals.
                   If you do this, send the changes you made to devsupport@apple.com
                  to get it integrated into the next release of ConditionalMacros.h.
     */
     #error ConditionalMacros.h: unknown compiler (see comment above)
       #define TARGET_CPU_PPC   0
     #define TARGET_CPU_68K   0
     #define TARGET_CPU_X86   0
     #define TARGET_CPU_MIPS  0
     #define TARGET_CPU_SPARC 0
     #define TARGET_CPU_ALPHA 0
 #endif

   #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
        #define TARGET_OS_WIN32  0
     #define TARGET_OS_UNIX   0
 #elif defined(TARGET_OS_WIN32) && TARGET_OS_WIN32
      #define TARGET_OS_MAC    0
     #define TARGET_OS_UNIX   0
 #elif defined(TARGET_OS_UNIX) && TARGET_OS_UNIX
        #define TARGET_OS_MAC    0
     #define TARGET_OS_WIN32  0
 #elif TARGET_CPU_PPC || TARGET_CPU_68K
     #define TARGET_OS_MAC    1
     #define TARGET_OS_WIN32  0
     #define TARGET_OS_UNIX   0
 #else
      #error ConditionalMacros.h: unknown target OS (see comment above)
  #endif

    #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
        #if TARGET_OS_MAC
          #define TARGET_RT_LITTLE_ENDIAN     0
          #define TARGET_RT_BIG_ENDIAN        1
      #elif TARGET_OS_WIN32
          #define TARGET_RT_LITTLE_ENDIAN     1
          #define TARGET_RT_BIG_ENDIAN        0
      #endif
 #endif

   #if defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
     #define TARGET_RT_LITTLE_ENDIAN     !TARGET_RT_BIG_ENDIAN
  #elif !defined(TARGET_RT_BIG_ENDIAN) && defined(TARGET_RT_LITTLE_ENDIAN)
       #define TARGET_RT_BIG_ENDIAN        !TARGET_RT_LITTLE_ENDIAN
   #endif

   #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
        #error unknown endianess of target processor
   #endif

    #if TARGET_OS_MAC
  #ifndef TARGET_RT_MAC_CFM
  #define TARGET_RT_MAC_CFM           TARGET_CPU_PPC
 #endif
 #ifndef TARGET_RT_MAC_68881
    #define TARGET_RT_MAC_68881         0
  #endif
     #ifndef TARGET_RT_MAC_MACHO
        #define TARGET_RT_MAC_MACHO         !TARGET_RT_MAC_CFM
     #endif
   #endif

   #ifndef PRAGMA_IMPORT
  #define PRAGMA_IMPORT               0
  #endif
 #ifndef PRAGMA_STRUCT_ALIGN
    #define PRAGMA_STRUCT_ALIGN         0
  #endif
 #ifndef PRAGMA_ONCE
    #define PRAGMA_ONCE                 0
  #endif
 #ifndef PRAGMA_STRUCT_PACK
 #define PRAGMA_STRUCT_PACK          0
  #endif
 #ifndef PRAGMA_STRUCT_PACKPUSH
 #define PRAGMA_STRUCT_PACKPUSH      0
  #endif
 #ifndef PRAGMA_ENUM_PACK
   #define PRAGMA_ENUM_PACK            0
  #endif
 #ifndef PRAGMA_ENUM_ALWAYSINT
  #define PRAGMA_ENUM_ALWAYSINT       0
  #endif
 #ifndef PRAGMA_ENUM_OPTIONS
    #define PRAGMA_ENUM_OPTIONS         0
  #endif
 #ifndef FOUR_CHAR_CODE
 #define FOUR_CHAR_CODE(x)           (x)
    #endif

    #ifndef TYPE_LONGDOUBLE_IS_DOUBLE
  #define TYPE_LONGDOUBLE_IS_DOUBLE   1
  #endif
 #ifndef TYPE_EXTENDED
  #define TYPE_EXTENDED               0
  #endif
 #ifndef TYPE_LONGLONG
  #define TYPE_LONGLONG               0
  #endif
 #ifndef TYPE_BOOL
  #define TYPE_BOOL                   0
  #endif
 #ifndef FUNCTION_PASCAL
    #define FUNCTION_PASCAL             0
  #endif
 #ifndef FUNCTION_DECLSPEC
  #define FUNCTION_DECLSPEC           0
  #endif
 #ifndef FUNCTION_WIN32CC
   #define FUNCTION_WIN32CC            0
  #endif
#endif

/****************************************************************************************************

    Under MacOS, the classic 68k runtime has two calling conventions: pascal or C
    Under Win32, there are two calling conventions: __cdecl or __stdcall
    Headers and implementation files can use the following macros to make their
    source more portable by hiding the calling convention details:

    EXTERN_API*
    These macros are used to specify the calling convention on a function prototype.

        EXTERN_API              - Classic 68k: pascal, Win32: __cdecl
        EXTERN_API_C            - Classic 68k: C,      Win32: __cdecl
        EXTERN_API_STDCALL      - Classic 68k: pascal, Win32: __stdcall
        EXTERN_API_C_STDCALL    - Classic 68k: C,      Win32: __stdcall

    DEFINE_API*
    These macros are used to specify the calling convention on a function definition.

        DEFINE_API              - Classic 68k: pascal, Win32: __cdecl
        DEFINE_API_C            - Classic 68k: C,      Win32: __cdecl
        DEFINE_API_STDCALL      - Classic 68k: pascal, Win32: __stdcall
        DEFINE_API_C_STDCALL    - Classic 68k: C,      Win32: __stdcall

    CALLBACK_API*
    These macros are used to specify the calling convention of a function pointer.

        CALLBACK_API            - Classic 68k: pascal, Win32: __stdcall
        CALLBACK_API_C          - Classic 68k: C,      Win32: __stdcall
        CALLBACK_API_STDCALL    - Classic 68k: pascal, Win32: __cdecl
        CALLBACK_API_C_STDCALL  - Classic 68k: C,      Win32: __cdecl

****************************************************************************************************/

#if FUNCTION_PASCAL && !FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
    /* compiler supports pascal keyword only  */
    #define EXTERN_API(_type)                       extern pascal _type
    #define EXTERN_API_C(_type)                     extern        _type
    #define EXTERN_API_STDCALL(_type)               extern pascal _type
    #define EXTERN_API_C_STDCALL(_type)             extern        _type

    #define DEFINE_API(_type)                       pascal _type
    #define DEFINE_API_C(_type)                            _type
    #define DEFINE_API_STDCALL(_type)               pascal _type
    #define DEFINE_API_C_STDCALL(_type)                    _type

    #define CALLBACK_API(_type, _name)              pascal _type (*_name)
    #define CALLBACK_API_C(_type, _name)                   _type (*_name)
    #define CALLBACK_API_STDCALL(_type, _name)      pascal _type (*_name)
    #define CALLBACK_API_C_STDCALL(_type, _name)           _type (*_name)

#elif FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
    /* compiler supports pascal and __declspec() */
    #define EXTERN_API(_type)                       extern pascal __declspec(dllimport) _type
    #define EXTERN_API_C(_type)                     extern        __declspec(dllimport) _type
    #define EXTERN_API_STDCALL(_type)               extern pascal __declspec(dllimport) _type
    #define EXTERN_API_C_STDCALL(_type)             extern        __declspec(dllimport) _type

    #define DEFINE_API(_type)                       pascal __declspec(dllexport) _type
    #define DEFINE_API_C(_type)                            __declspec(dllexport) _type
    #define DEFINE_API_STDCALL(_type)               pascal __declspec(dllexport) _type
    #define DEFINE_API_C_STDCALL(_type)                    __declspec(dllexport) _type

    #define CALLBACK_API(_type, _name)              pascal _type (*_name)
    #define CALLBACK_API_C(_type, _name)                   _type (*_name)
    #define CALLBACK_API_STDCALL(_type, _name)      pascal _type (*_name)
    #define CALLBACK_API_C_STDCALL(_type, _name)           _type (*_name)

#elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
    /* compiler supports __declspec() */
    #define EXTERN_API(_type)                       extern __declspec(dllimport) _type
    #define EXTERN_API_C(_type)                     extern __declspec(dllimport) _type
    #define EXTERN_API_STDCALL(_type)               extern __declspec(dllimport) _type
    #define EXTERN_API_C_STDCALL(_type)             extern __declspec(dllimport) _type

    #define DEFINE_API(_type)                       __declspec(dllexport) _type
    #define DEFINE_API_C(_type)                     __declspec(dllexport) _type
    #define DEFINE_API_STDCALL(_type)               __declspec(dllexport) _type
    #define DEFINE_API_C_STDCALL(_type)             __declspec(dllexport) _type

    #define CALLBACK_API(_type, _name)              _type ( * _name)
    #define CALLBACK_API_C(_type, _name)            _type ( * _name)
    #define CALLBACK_API_STDCALL(_type, _name)      _type ( * _name)
    #define CALLBACK_API_C_STDCALL(_type, _name)    _type ( * _name)

#elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && FUNCTION_WIN32CC
    /* compiler supports __declspec() and __cdecl */
    #define EXTERN_API(_type)                       __declspec(dllimport) _type __cdecl
    #define EXTERN_API_C(_type)                     __declspec(dllimport) _type __cdecl
    #define EXTERN_API_STDCALL(_type)               __declspec(dllimport) _type __stdcall
    #define EXTERN_API_C_STDCALL(_type)             __declspec(dllimport) _type __stdcall

    #define DEFINE_API(_type)                       __declspec(dllexport) _type __cdecl
    #define DEFINE_API_C(_type)                     __declspec(dllexport) _type __cdecl
    #define DEFINE_API_STDCALL(_type)               __declspec(dllexport) _type __stdcall
    #define DEFINE_API_C_STDCALL(_type)             __declspec(dllexport) _type __stdcall

    #define CALLBACK_API(_type, _name)              _type (__cdecl * _name)
    #define CALLBACK_API_C(_type, _name)            _type (__cdecl * _name)
    #define CALLBACK_API_STDCALL(_type, _name)      _type (__stdcall * _name)
    #define CALLBACK_API_C_STDCALL(_type, _name)    _type (__stdcall * _name)

#elif !FUNCTION_PASCAL && !FUNCTION_DECLSPEC && FUNCTION_WIN32CC
    /* compiler supports __cdecl */
    #define EXTERN_API(_type)                       _type __cdecl
    #define EXTERN_API_C(_type)                     _type __cdecl
    #define EXTERN_API_STDCALL(_type)               _type __stdcall
    #define EXTERN_API_C_STDCALL(_type)             _type __stdcall

    #define DEFINE_API(_type)                       _type __cdecl
    #define DEFINE_API_C(_type)                     _type __cdecl
    #define DEFINE_API_STDCALL(_type)               _type __stdcall
    #define DEFINE_API_C_STDCALL(_type)             _type __stdcall

    #define CALLBACK_API(_type, _name)              _type (__cdecl * _name)
    #define CALLBACK_API_C(_type, _name)            _type (__cdecl * _name)
    #define CALLBACK_API_STDCALL(_type, _name)      _type (__stdcall * _name)
    #define CALLBACK_API_C_STDCALL(_type, _name)    _type (__stdcall * _name)

#else
    /* compiler supports no extensions */
    #define EXTERN_API(_type)                       extern _type
    #define EXTERN_API_C(_type)                     extern _type
    #define EXTERN_API_STDCALL(_type)               extern _type
    #define EXTERN_API_C_STDCALL(_type)             extern _type

    #define DEFINE_API(_type)                       _type
    #define DEFINE_API_C(_type)                     _type
    #define DEFINE_API_STDCALL(_type)               _type
    #define DEFINE_API_C_STDCALL(_type)             _type

    #define CALLBACK_API(_type, _name)              _type ( * _name)
    #define CALLBACK_API_C(_type, _name)            _type ( * _name)
    #define CALLBACK_API_STDCALL(_type, _name)      _type ( * _name)
    #define CALLBACK_API_C_STDCALL(_type, _name)    _type ( * _name)
    #undef pascal
    #define pascal
#endif

/* On classic 68k, some callbacks are register based.  The only way to */
/* write them in C is to make a function with no parameters and a void */
/* return.  Inside the function you manually get and set registers. */
#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
    #define CALLBACK_API_REGISTER68K(_type, _name, _params) CALLBACK_API(void, _name)()
#else
    #define CALLBACK_API_REGISTER68K(_type, _name, _params) CALLBACK_API(_type, _name)_params
#endif
/****************************************************************************************************

    Set up TARGET_API_*_* values

****************************************************************************************************/
#if TARGET_OS_MAC
#if !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON)
/* No TARGET_API_MAC_* predefined on command line */
#if TARGET_RT_MAC_MACHO
/* Looks like MachO style compiler */
#define TARGET_API_MAC_OS8 0
#define TARGET_API_MAC_CARBON 1
#define TARGET_API_MAC_OSX 1
#elif defined(TARGET_CARBON) && TARGET_CARBON
/* grandfather in use of TARGET_CARBON */
#define TARGET_API_MAC_OS8 0
#define TARGET_API_MAC_CARBON 1
#define TARGET_API_MAC_OSX 0
#elif TARGET_CPU_PPC && TARGET_RT_MAC_CFM
/* Looks like CFM style PPC compiler */
#define TARGET_API_MAC_OS8 1
#define TARGET_API_MAC_CARBON 0
#define TARGET_API_MAC_OSX 0
#else
/* 68k or some other compiler */
#define TARGET_API_MAC_OS8 1
#define TARGET_API_MAC_CARBON 0
#define TARGET_API_MAC_OSX 0
#endif  /*  */

#else
#ifndef TARGET_API_MAC_OS8
#define TARGET_API_MAC_OS8 0
#endif  /* !defined(TARGET_API_MAC_OS8) */

#ifndef TARGET_API_MAC_OSX
#define TARGET_API_MAC_OSX TARGET_RT_MAC_MACHO
#endif  /* !defined(TARGET_API_MAC_OSX) */

#ifndef TARGET_API_MAC_CARBON
#define TARGET_API_MAC_CARBON TARGET_API_MAC_OSX
#endif  /* !defined(TARGET_API_MAC_CARBON) */

#endif  /* !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON) */

#if TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX
#error TARGET_API_MAC_OS8 and TARGET_API_MAC_OSX are mutually exclusive
#endif  /* TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX */

#if !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX
#error At least one of TARGET_API_MAC_* must be true
#endif  /* !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX */

#else
#define TARGET_API_MAC_OS8 0
#define TARGET_API_MAC_CARBON 0
#define TARGET_API_MAC_OSX 0
#endif  /* TARGET_OS_MAC */

/* Support source code still using TARGET_CARBON */
#ifndef TARGET_CARBON
#if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
#define TARGET_CARBON 1
#else
#define TARGET_CARBON 0
#endif  /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */

#endif  /* !defined(TARGET_CARBON) */

/* Set forCarbon to 0 if it's not already defined */
#ifndef forCarbon
#define forCarbon 0
#endif  /* !defined(forCarbon) */

/****************************************************************************************************
    Backward compatibility for clients expecting 2.x version on ConditionalMacros.h

    GENERATINGPOWERPC       - Compiler is generating PowerPC instructions
    GENERATING68K           - Compiler is generating 68k family instructions
    GENERATING68881         - Compiler is generating mc68881 floating point instructions
    GENERATINGCFM           - Code being generated assumes CFM calling conventions
    CFMSYSTEMCALLS          - No A-traps.  Systems calls are made using CFM and UPP's
    PRAGMA_ALIGN_SUPPORTED  - Compiler supports: #pragma options align=mac68k/power/reset
    PRAGMA_IMPORT_SUPPORTED - Compiler supports: #pragma import on/off/reset
    CGLUESUPPORTED          - Clients can use all lowercase toolbox functions that take C strings instead of pascal strings

****************************************************************************************************/
#if !TARGET_API_MAC_CARBON
#define GENERATINGPOWERPC TARGET_CPU_PPC
#define GENERATING68K TARGET_CPU_68K
#define GENERATING68881 TARGET_RT_MAC_68881
#define GENERATINGCFM TARGET_RT_MAC_CFM
#define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
#ifndef CGLUESUPPORTED
#define CGLUESUPPORTED 0
#endif  /* !defined(CGLUESUPPORTED) */

#ifndef OLDROUTINELOCATIONS
#define OLDROUTINELOCATIONS 0
#endif  /* !defined(OLDROUTINELOCATIONS) */

#define PRAGMA_ALIGN_SUPPORTED  PRAGMA_STRUCT_ALIGN
#define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
#else
/* Carbon code should not use old conditionals */
#define PRAGMA_ALIGN_SUPPORTED  ..PRAGMA_ALIGN_SUPPORTED_is_obsolete..
#define GENERATINGPOWERPC       ..GENERATINGPOWERPC_is_obsolete..
#define GENERATING68K           ..GENERATING68K_is_obsolete..
#define GENERATING68881         ..GENERATING68881_is_obsolete..
#define GENERATINGCFM           ..GENERATINGCFM_is_obsolete..
#define CFMSYSTEMCALLS          ..CFMSYSTEMCALLS_is_obsolete..
#endif  /* !TARGET_API_MAC_CARBON */

/****************************************************************************************************

    OLDROUTINENAMES         - "Old" names for Macintosh system calls are allowed in source code.
                              (e.g. DisposPtr instead of DisposePtr). The names of system routine
                              are now more sensitive to change because CFM binds by name.  In the
                              past, system routine names were compiled out to just an A-Trap.
                              Macros have been added that each map an old name to its new name.
                              This allows old routine names to be used in existing source files,
                              but the macros only work if OLDROUTINENAMES is true.  This support
                              will be removed in the near future.  Thus, all source code should
                              be changed to use the new names! You can set OLDROUTINENAMES to false
                              to see if your code has any old names left in it.

****************************************************************************************************/
#ifndef OLDROUTINENAMES
#define OLDROUTINENAMES 0
#endif  /* !defined(OLDROUTINENAMES) */

/****************************************************************************************************
 The following macros isolate the use of 68K inlines in function prototypes.
    On the Mac OS under the Classic 68K runtime, function prototypes were followed
 by a list of 68K opcodes which the compiler inserted in the generated code instead
 of a JSR.  Under Classic 68K on the Mac OS, this macro will put the opcodes
    in the right syntax.  For all other OS's and runtimes the macro suppress the opcodes.
  Example:

       EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
            ONEWORDINLINE(0xA8F6);

****************************************************************************************************/

#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
 #define ONEWORDINLINE(w1) = w1
 #define TWOWORDINLINE(w1,w2) = {w1,w2}
 #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
 #define FOURWORDINLINE(w1,w2,w3,w4)  = {w1,w2,w3,w4}
   #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
  #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)     = {w1,w2,w3,w4,w5,w6}
 #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)    = {w1,w2,w3,w4,w5,w6,w7}
  #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)     = {w1,w2,w3,w4,w5,w6,w7,w8}
   #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)   = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
    #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)  = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
  #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)     = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
    #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)     = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12}
#else
  #define ONEWORDINLINE(w1)
  #define TWOWORDINLINE(w1,w2)
   #define THREEWORDINLINE(w1,w2,w3)
  #define FOURWORDINLINE(w1,w2,w3,w4)
    #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
 #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
   #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
  #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
   #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
 #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
  #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
   #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
#endif

/****************************************************************************************************

    TARGET_CARBON                   - default: false. Switches all of the above as described.  Overrides all others
                                    - NOTE: If you set TARGET_CARBON to 1, then the other switches will be setup by
                                            ConditionalMacros, and should not be set manually.

    If you wish to do development for pre-Carbon Systems, you can set the following:

    OPAQUE_TOOLBOX_STRUCTS          - default: false. True for Carbon builds, hides struct fields.
    OPAQUE_UPP_TYPES                - default: false. True for Carbon builds, UPP types are unique and opaque.
    ACCESSOR_CALLS_ARE_FUNCTIONS    - default: false. True for Carbon builds, enables accessor functions.
    CALL_NOT_IN_CARBON              - default: true.  False for Carbon builds, hides calls not supported in Carbon.

    Specifically, if you are building a non-Carbon application (one that links against InterfaceLib)
    but you wish to use some of the accessor functions, you can set ACCESSOR_CALLS_ARE_FUNCTIONS to 1
    and link with CarbonAccessors.o, which implements just the accessor functions. This will help you
    preserve source compatibility between your Carbon and non-Carbon application targets.

    MIXEDMODE_CALLS_ARE_FUNCTIONS   - deprecated.

****************************************************************************************************/
#if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
#ifndef OPAQUE_TOOLBOX_STRUCTS
#define OPAQUE_TOOLBOX_STRUCTS 1
#endif  /* !defined(OPAQUE_TOOLBOX_STRUCTS) */

#ifndef OPAQUE_UPP_TYPES
#define OPAQUE_UPP_TYPES 1
#endif  /* !defined(OPAQUE_UPP_TYPES) */

#ifndef ACCESSOR_CALLS_ARE_FUNCTIONS
#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#endif  /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */

#ifndef CALL_NOT_IN_CARBON
#define CALL_NOT_IN_CARBON 0
#endif  /* !defined(CALL_NOT_IN_CARBON) */

#ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS
#define MIXEDMODE_CALLS_ARE_FUNCTIONS 1
#endif  /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */

#else
#ifndef OPAQUE_TOOLBOX_STRUCTS
#define OPAQUE_TOOLBOX_STRUCTS 0
#endif  /* !defined(OPAQUE_TOOLBOX_STRUCTS) */

#ifndef OPAQUE_UPP_TYPES
#define OPAQUE_UPP_TYPES 0
#endif  /* !defined(OPAQUE_UPP_TYPES) */

#ifndef ACCESSOR_CALLS_ARE_FUNCTIONS
#define ACCESSOR_CALLS_ARE_FUNCTIONS 0
#endif  /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */

/*
     * It's possible to have ACCESSOR_CALLS_ARE_FUNCTIONS set to true and OPAQUE_TOOLBOX_STRUCTS
     * set to false, but not the other way around, so make sure the defines are not set this way.
     */
#if OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
#error OPAQUE_TOOLBOX_STRUCTS cannot be true when ACCESSOR_CALLS_ARE_FUNCTIONS is false
#endif  /* OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS */

#ifndef CALL_NOT_IN_CARBON
#define CALL_NOT_IN_CARBON 1
#endif  /* !defined(CALL_NOT_IN_CARBON) */

#ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS
#define MIXEDMODE_CALLS_ARE_FUNCTIONS 0
#endif  /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */

#endif  /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */

#if TARGET_RT_MAC_MACHO && TARGET_RT_LITTLE_ENDIAN
#define OLD_COMPONENT_GLUE 1
#endif

#endif /* __CONDITIONALMACROS__ */


text:
package org.opentosca.yamlconverter.main.utils;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.opentosca.yamlconverter.yamlmodel.yaml.element.ServiceTemplate;

public class CSARUtil {

	/**
	 * TOSCA specific constants, for XML and XSD documents
	 */
	private static final String TOSCA_FOLDER = "/tosca";
	public static final String TOSCA_BASE_TYPES_DIAGRAM = TOSCA_FOLDER + "/" + "TOSCA-v1.0-BaseTypes-Diagram.xml";
	public static final String TOSCA_SPECIFIC_TYPES_DIAGRAM = TOSCA_FOLDER + "/" + "TOSCA-v1.0-SpecificTypes-Diagram.xml";
	public static final String TOSCA_BASE_TYPE_FILENAME = "TOSCA-v1.0-BaseTypes-Definitions.xml";
	private static final String TOSCA_BASE_TYPES = TOSCA_FOLDER + "/" + TOSCA_BASE_TYPE_FILENAME;
	public static final String TOSCA_SPECIFIC_TYPE_FILENAME = "TOSCA-v1.0-SpecificTypes-Definitions.xml";
	private static final String TOSCA_SPECIFIC_TYPES = TOSCA_FOLDER + "/" + TOSCA_SPECIFIC_TYPE_FILENAME;
	private static final String TOSCA_TYPES_FOLDER = "types";
	private static final String TOSCA_BASE_TYPE_XSD_FILENAME = "TOSCA-v1.0-BaseTypes.xsd";
	public static final String TOSCA_BASE_TYPES_XSD_PATH = TOSCA_TYPES_FOLDER + "/" + TOSCA_BASE_TYPE_XSD_FILENAME;
	private static final String TOSCA_BASE_TYPES_XSD = TOSCA_FOLDER + "/" + TOSCA_BASE_TYPE_XSD_FILENAME;
	private static final String TOSCA_SPECIFIC_TYPES_XSD_FILENAME = "TOSCA-v1.0-SpecificTypes.xsd";
	public static final String TOSCA_SPECIFIC_TYPES_XSD_PATH = TOSCA_TYPES_FOLDER + "/" + TOSCA_SPECIFIC_TYPES_XSD_FILENAME;
	private static final String TOSCA_SPECIFIC_TYPES_XSD = TOSCA_FOLDER + "/" + TOSCA_SPECIFIC_TYPES_XSD_FILENAME;
	private static final String TOSCA_ARTIFACTS_XSD_FILENAME = "Artifacts.xsd";
	public static final String TOSCA_ARTIFACTS_XSD_PATH = TOSCA_TYPES_FOLDER + "/" + TOSCA_ARTIFACTS_XSD_FILENAME;
	private static final String TOSCA_ARTIFACTS_XSD = TOSCA_FOLDER + "/" + TOSCA_ARTIFACTS_XSD_FILENAME;

	public static final String TYPES_XSD_FILENAME = "types.xsd";
	public static final String DEFINITIONS_XML_FILENAME = "Definitions.xml";
	public static final String DEFINITIONS_FOLDER = "Definitions";
	public static final String DEF_BASE_TYPES = DEFINITIONS_FOLDER + "/" + TOSCA_BASE_TYPE_FILENAME;
	public static final String DEF_BASE_TYPES_DIAGRAM = DEFINITIONS_FOLDER + "/" + "TOSCA-v1.0-BaseTypes-Diagram.xml";
	public static final String DEF_SPECIFIC_TYPES = DEFINITIONS_FOLDER + "/" + TOSCA_SPECIFIC_TYPE_FILENAME;
	public static final String DEF_SPECIFIC_TYPES_DIAGRAM = DEFINITIONS_FOLDER + "/" + "TOSCA-v1.0-SpecificTypes-Diagram.xml";
	private static final String META_FILENAME = "TOSCA.meta";
	private static final String META_FOLDER = "TOSCA-Metadata";
	private static final String TOSCA_META_VERSION = "1.0";
	private static final String DEFAULT_TEMPLATE_VERSION = "1.0";
	private static final String DEFAULT_TEMPLATE_AUTHOR = "YAML";

	/**
	 * Creates a CSAR file based on a YAML {@link org.opentosca.yamlconverter.yamlmodel.yaml.element.ServiceTemplate}, a String containing
	 * the generated XML, a String containing the generated and corresponding XSD and a filename for that CSAR file. A CSAR file is simply a
	 * ZIP folder. The method creates and prepares three temporal folders: {@link #META_FOLDER}, {@link #DEFINITIONS_FOLDER} and
	 * {@link #TOSCA_TYPES_FOLDER} which contain different files. {@link #META_FOLDER} contains the CSAR meta file called
	 * {@link #META_FILENAME}. {@link #DEFINITIONS_FOLDER} contains the generated XML and two XML documents to provide the Base- and
	 * SpecificTypes for TOSCA XML. {@link #TOSCA_TYPES_FOLDER} contains the XSD files for the mentioned XML documents (exception: the XSD
	 * for the generated XML file can be found in {@link #DEFINITIONS_FOLDER}).

	 * The CSAR file will be put to the current working directory, e.g. if you're using the program as a JAR, then the CSAR is put into the
	 * same folder where the JAR is.

	 * After generating, the pre-mentioned temporal folders will be deleted!
	 *
	 * @param serviceTemplate Service template containing all YAML elements; will be used for the META file production only
	 * @param xml generated XML as String for {@code serviceTemplate}
	 * @param xsd generated XSD as String for {@code xml}
	 * @param csarFilename the name of the generated CSAR file
	 * @throws IOException
	 */
	public static void createCSAR(ServiceTemplate serviceTemplate, String xml, String xsd, String csarFilename) throws IOException {
		final ZipUtils appZip = new ZipUtils();
		final FileUtil fileUtil = new FileUtil();
		final File[] csarFolders = new File[] { new File(META_FOLDER), new File(DEFINITIONS_FOLDER), new File(TOSCA_TYPES_FOLDER) };
		prepareFoldersWithFiles(serviceTemplate, xml, xsd, fileUtil);

		// generate zip
		for (final File folder : csarFolders) {
			appZip.generateFileList(folder);
		}

		appZip.zipIt(csarFilename);

		// clean directory
		for (final File folder : csarFolders) {
			FileUtil.deleteDirectory(folder);
		}
	}

	private static void prepareFoldersWithFiles(final ServiceTemplate serviceTemplate, final String xml, final String xsd,
			final FileUtil fileUtil) throws IOException {
		// prepare folders
		FileUtil.saveStringAsFile(DEFINITIONS_FOLDER + "/" + TYPES_XSD_FILENAME, xsd);
		FileUtil.saveStringAsFile(DEFINITIONS_FOLDER + "/" + DEFINITIONS_XML_FILENAME, xml);
		FileUtil.saveStringAsFile(META_FOLDER + "/" + META_FILENAME, generateMetaFileContent(serviceTemplate));
		FileUtils.copyInputStreamToFile(fileUtil.getResourceAsStream(TOSCA_BASE_TYPES), new File(DEF_BASE_TYPES));
		FileUtils.copyInputStreamToFile(fileUtil.getResourceAsStream(TOSCA_BASE_TYPES_DIAGRAM), new File(DEF_BASE_TYPES_DIAGRAM));
		FileUtils.copyInputStreamToFile(fileUtil.getResourceAsStream(TOSCA_SPECIFIC_TYPES), new File(DEF_SPECIFIC_TYPES));
		FileUtils.copyInputStreamToFile(fileUtil.getResourceAsStream(TOSCA_SPECIFIC_TYPES_DIAGRAM), new File(DEF_SPECIFIC_TYPES_DIAGRAM));
		FileUtils.copyInputStreamToFile(fileUtil.getResourceAsStream(TOSCA_BASE_TYPES_XSD), new File(TOSCA_BASE_TYPES_XSD_PATH));
		FileUtils.copyInputStreamToFile(fileUtil.getResourceAsStream(TOSCA_SPECIFIC_TYPES_XSD), new File(TOSCA_SPECIFIC_TYPES_XSD_PATH));
		FileUtils.copyInputStreamToFile(fileUtil.getResourceAsStream(TOSCA_ARTIFACTS_XSD), new File(TOSCA_ARTIFACTS_XSD_PATH));
	}

	private static String generateMetaFileContent(ServiceTemplate st) {
		final StringBuilder result = new StringBuilder();
		result.append("TOSCA-Meta-Version: " + TOSCA_META_VERSION + "\n");
		result.append("CSAR-Version: " + DEFAULT_TEMPLATE_VERSION + "\n");
		if (st.getTemplate_author() != null && !st.getTemplate_author().equals("")) {
			result.append("Created-By: " + st.getTemplate_author() + "\n");
		} else {
			result.append("Created-By: " + DEFAULT_TEMPLATE_AUTHOR + "\n");
		}
		result.append("Entry-Definitions: " + DEFINITIONS_FOLDER + "/" + DEFINITIONS_XML_FILENAME + "\n");
		result.append("Name: ").append(DEF_BASE_TYPES).append("\n").append("Content-Type: application/vnd.oasis.tosca.definitions\n")
				.append("Diagram: ").append(DEF_BASE_TYPES_DIAGRAM).append("\n").append("\n").append("Name: ").append(DEF_SPECIFIC_TYPES)
		.append("\n").append("Content-Type: application/vnd.oasis.tosca.definitions\n").append("Diagram: ")
		.append(DEF_SPECIFIC_TYPES_DIAGRAM);
		return result.toString();
	}
}


text:
Q: How to do sets in bash 3? Is it possible to do sets (with puts and gets) in bash 3? If not supported by the language (my searching got nothing), is there a common way of doing a work-around? I would have max number of items in the low hundreds.
I'm building up two sets and then wanting the difference between them (all items in set A but not B, I'm not interested in the reverse). The sets themselves are a list of dependencies/directories.

A: Workaround using common utils, supposing set A is {1,2,3} and set B is {2,3,4}, and output should be the unique items in set A only:
diff -y <(seq 3) <(seq 2 1 4) | grep '<' | cut -f1

Output:
1

If combine is available, the same can be done like so:
combine <(seq 3) not <(seq 2 1 4)

redpajama_set_name: RedPajamaStackExchange


* EMSB and LBPSB School boards are registered trademarks. EMSB and LBPSB school boards do not endorse The Learning Center and are not affiliated with these tutoring services.
* EMSB and LBPSB are mentioned only as collaborators in the Ya Writers Contest.


text:
Q: Bug with LinearRecurrence and Slot/SlotSequence? The code below runs without any error:
LinearRecurrence[{##}, {1}, 5]

Each term is the previous term squared, times the index of the previous term.
If the ## is substituted with ##2 or ##3, the code returns an array of 1s. ##4 or higher SlotSequences throw errors.
I'm sure this is a bug, but I don't understand why this is happening; Trace doesn't seem to reveal anything. Why does the above code behave that way?


text:
Almost With you
Echo of Your Voice
150.00 x 150.00 cm
High, Low and In-Between
Straight to You
Tattooed Everything
Everything Zen
I'm Almost With You, Wait for Me
Touching from a Distance
If I Needed You
She Moves Among the Flowers
Wategos
Staying Close to this Frozen Border
Some Strange Religion
"When you start working, everybody is in your studio – the past, your friends, enemies, the art world and above all, your own ideas – all are there. But as you continue painting, they start leaving one by one and you are left completely alone. Then, if you're lucky, even you leave." John Cage said this in 1965 and for me it is a very accurate description of my studio practice and my process of painting. Specifically, it's the balancing act between the known and the unknown, the conscious and the subconscious, and most importantly, when to be in control and conversely when to be reckless and abandon the rational you, in the hope of making or seeing something you haven't before. It's a thing that can exist on its own, beyond me, born through invention, an image that can only be arrived at by painting towards it, so it has its own past and a feeling that the image has lived.
Strictly speaking, I'm neither a figurative nor an abstract painter and I find the space between figurative and non-figurative art an exhilarating place to work. I'm drawn to images that possess a mystery that hides things, being out of focus and relying more on evocation than a simple recognition. The figure and the landscape are both elements present in my work, evidenced or acknowledged through colour and form, but most importantly through a dynamic or force. By this, I mean dealing with movement and magnetism, the pulls between one form or another and what the spaces between and around this pull look like. It's the abstraction of forces and the residue or traces of these forms that survive the many erasures that become the elements of the painting. The problem I see, for me, is not the object in the painting but the painting as object.
I draw a lot with the paint, either with a brush, or direct from the tube. Drawing is an important element in my overall process. Often the forms I begin with are derived from these, which now, working and living in Northern NSW, are concerned with the landscape around me.
The most important element I have taken from drawing is that of erasure. It is to a large extent the crux of my process. Once I reach a certain point in the painting, it becomes more about taking things out – erasing – than putting things in. Remembering though, and I am learning this, to take things out is to actually put things in. It's an instinctual exercise of exposing and revealing and the accompanying high of discovery of finding the hidden. It's about finishing and leaving the image unsettled, caught in its moment like it has won its freedom, and pregnant with possibility for the next picture. Often, I feel, to over-finish or explain a painting is to rob it of its power and potential.
My studio is never silent, everything is accompanied by music. It intimately influences my work. Almost all my titles are derived from lyrics or song titles that have influenced that work and the psychological overtones the music has imbued on the work. It's never arbitrary. At some stage during the painting process, early or late, a lyric or song will attach itself through its relevance to me and my life, or through the process of making the image it becomes relevant. It sets the rhythm by which the thing is made and it changes with each painting.
It's autobiographical, reflecting in the image, becoming my mix tape, the soundtrack to my life. This is where the contradiction lies, in as much as the image needs to exist independently and reflect its own history or personality for me, but there must still be a recognition of self in the picture made from my sensations. When I leave the studio, I have left there a person or something totemic, an organic thing that can lead its own life, that doesn't need me anymore, or my thoughts about it. A painting is a painting."

redpajama_set_name: RedPajamaCommonCrawl


text:
When you are only shown what you are familiar with, there is little left to learn.
Eli Pariser
The Filter Bubble
Author, activist, and entrepreneur, 6 articles
A world constructed from the familiar is the world in which there's nothing to learn.
Other entries from " The Filter Bubble
Our information environment only supports the notions already acquired.
The anonymous internet is long over
We are in the process of developing the psychological equivalent of obesity.
Personalized filtering of online contents may result in a "self-loop", amplifying your own interests and opinions.
The personalized environment does not allow us to perceive out of sight problems
One sees only with the heart. What is essential is invisible to the eye
- Go and see the roses again. You will understand that yours is unique in the world. You will return to ...
By Antoine de Saint-Exupery, French writer, poet, aristocrat, journalist, and pioneering aviator
Happiness is found when you add up small pleasures of life
By Arthur Schopenhauer, German philosopher
Happiness consists in frequent repetition of pleasure.
Happiness is our true destiny
I wish you endless dreams and the furious desire to make some of them come true. I wish you to ...
By Jacques Brel, Belgian singer
Everything starts with a small step
By Laozi (Lao Tzu, Lao-Tze), ancient Chinese philosopher
The journey of a thousand miles begins with a single step.
For more convenient, more consistent inbound information, we trade our sense of discovery
Over the years, the Spotify algorithms have correctly identified that I tend to like "chill" music of a certain BPM ...
By Jenny Odell, American artist, writer and educator
How to Do Nothing


Monika Halan, editor at Mint Money replies to queries on mutual funds, insurance and retirement plans.
100 Days Of Ayushman Bharat: Is It Really A Game Changer?
The NDTV Dialogues: Is Modicare A Gamechanger?
Modicare: Where Is The Money?


Here's a cool movie from open day on May 27th, 1937.
May 27, 1937, the opening ot the Golden Gate Bridge in San Francisco. The public was invited to "Walk the Bridge" to see this incredible achievement of American engineering expertise. My wife's Uncle was there and took his 8MM movie camera. Apparently he was one of the few to do so. The resulting video is precious because it is rare, but also because so many people have been affected by this great and famous bridge. Many people have relatives who "Walked the Bridge" that day. If you are one of those, I hope you spot your relative.
Also, be sure to visit www.GoldenGateBridge75.org for lots of other information about the bridge and planned festivities to celebrate the 75th anniversary.
I love the way everyone is wearing hats. We should bring back hates for everyone.... they look so neat!
I had a look at the site and found it most interesting.