Changeset 136 for trunk/orca

Show
Ignore:
Timestamp:
05/04/06 15:39:15 (3 years ago)
Author:
krobillard
Message:

Orca - Added os_call config option.

Location:
trunk/orca
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/boot.c

    r97 r136  
    303303  "]\n" 
    304304  "getenv: native [name [string!]]\n" 
    305   "call: native [\n" 
    306   "    command [string! block!]\n" 
    307   "    /output\n" 
    308   "    out [string! file! none!]\n" 
    309   "    /wait\n" 
    310   "]\n" 
    311305  "change-dir: native [value]\n" 
    312306  "what-dir: native []\n" 
     
    359353  "cross: native [a [vec3!] b [vec3!]]\n" 
    360354  "normalize: native [vec [vec3!]]\n" 
     355  "call: native [\n" 
     356  "    command [string! block!]\n" 
     357  "    /output\n" 
     358  "    out [string! file! none!]\n" 
     359  "    /wait\n" 
     360  "]\n" 
    361361; 
    362362 
  • trunk/orca/boot.r

    r97 r136  
    406406    getenv: native [name [string!]] 
    407407 
    408     call: native [ 
    409         command [string! block!] 
    410         ;/input 
    411         ;in [string! file! none!]    ; [any-string! port! file! url! none!] 
    412         /output 
    413         out [string! file! none!]    ; [string! port! file! url! none!] 
    414         /wait 
    415         ;/console 
    416         ;/shell 
    417         ;/info 
    418     ] 
    419  
    420408    change-dir: native [value] 
    421409    what-dir: native [] 
     
    719707if find config 'rebol [append boot load %rebol_compat.r] 
    720708 
     709if find config 'os_call [ 
     710    append natives [ 
     711        call: native [ 
     712            command [string! block!] 
     713            ;/input 
     714            ;in [string! file! none!]    ; [any-string! port! file! url! none!] 
     715            /output 
     716            out [string! file! none!]    ; [string! port! file! url! none!] 
     717            /wait 
     718            ;/console 
     719            ;/shell 
     720            ;/info 
     721        ] 
     722    ] 
     723] 
     724 
    721725;eof 
  • trunk/orca/config.r

    r3 r136  
    88    hex_token 
    99    math3d 
     10    os_call 
    1011] 
  • trunk/orca/files.c

    r94 r136  
    2828extern void orReadDir( const char* filename ); 
    2929extern void orNowNative( OValue* a1 ); 
    30 extern void orCallNative( OValue* a1 ); 
    3130extern void orChangeDirNative( OValue* a1 ); 
    3231extern void orWhatDirNative(); 
     
    3534extern void orDeleteNative( OValue* a1 ); 
    3635extern void orGetenvNative( OValue* a1 ); 
     36 
     37#ifdef OR_CONFIG_OS_CALL 
     38extern void orCallNative( OValue* a1 ); 
     39#endif 
    3740 
    3841 
     
    592595    orNative( orRenameNative,     "rename"     ); 
    593596    orNative( orDeleteNative,     "delete"     ); 
    594     orNative( orCallNative,       "call"       ); 
    595597    orNative( orChangeDirNative,  "change-dir" ); 
    596598    orNative( orWhatDirNative,    "what-dir"   ); 
     
    599601    orNative( orGetenvNative,     "getenv"     ); 
    600602    orNative( cleanPathNative,    "clean-path" ); 
     603 
     604#ifdef OR_CONFIG_OS_CALL 
     605    orNative( orCallNative,       "call"       ); 
     606#endif 
     607 
    601608#ifdef OR_CONFIG_COMPRESS 
    602609    orNative( orCompressNative,   "compress"   ); 
  • trunk/orca/unix/os.c

    r98 r136  
    190190 
    191191 
     192#ifdef OR_CONFIG_OS_CALL 
    192193static void argumentList( OString* str, int sindex, char** argv, int maxArg ) 
    193194{ 
     
    361362  command /output out /wait 
    362363*/ 
    363 void orCallNative( OValue* a1 ) 
     364OR_NATIVE_PUB( orCallNative ) 
    364365{ 
    365366    if( a1->type != OT_STRING ) 
     
    378379    } 
    379380} 
    380  
    381  
     381#endif 
     382 
     383 
     384#ifdef OR_CONFIG_OS_CALL 
    382385/* Cleans up after callSimple() */ 
    383386static void child_handler( int sig ) 
     
    392395    } 
    393396} 
     397#endif 
    394398 
    395399#if 0 
     
    411415void orInstallExceptionHandlers() 
    412416{ 
     417#ifdef OR_CONFIG_OS_CALL 
     418    /* NOTE: Cannot use this if using Qt's QProcess (it uses SIGCHLD) */ 
    413419    struct sigaction childSA; 
    414420 
     
    418424 
    419425    sigaction( SIGCHLD, &childSA, NULL ); 
     426#endif 
    420427 
    421428#if 0 
  • trunk/orca/win32/os.c

    r98 r136  
    210210} 
    211211 
     212 
     213#ifdef OR_CONFIG_OS_CALL 
    212214 
    213215#define REF_CALL_OUTPUT     a1+1 
     
    373375 
    374376 
    375 void orCallNative( OValue* a1 ) 
     377OR_NATIVE_PUB( orCallNative ) 
    376378{ 
    377379    if( a1->type != OT_STRING ) 
     
    390392    } 
    391393} 
     394#endif 
    392395 
    393396