/*===========================================================================*/
/*   (Cc/exec.scm)                                                           */
/*   Bigloo (2.6b)                                                           */
/*   Inria -- Sophia Antipolis (c)       Mon Dec 15 12:14:36 CET 2003        */
/*===========================================================================*/
/* COMPILATION: (/users/serrano/prgm/project/bigloo/bin/bigloo -q -afile .afile -fsharing -fno-reflection -cc gcc-2.95 -lib-dir /users/serrano/prgm/project/bigloo/lib/2.6b -unsafev -no-hello -O2 -rm -unsafe -s -indent Cc/exec.scm)*/
/* GC selection */
#define THE_GC BOEHM_GC

#include <bigloo.h>

BGL_EXPORTED_DECL obj_t BGl_modulezd2initializa7ationz75zzcc_execz00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zztools_tracez00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zztools_errorz00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zzengine_paramz00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zzinit_mainz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__osz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__readerz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__r4_output_6_10_3z00(long, char *);
static obj_t BGl__execz00zzcc_execz00(obj_t, obj_t, obj_t, obj_t);
static obj_t BGl_systemzf2killzf2zzcc_execz00(obj_t);
extern obj_t BGl_za2shellza2z00zzengine_paramz00;
extern obj_t BGl_internalzd2errorzd2zztools_errorz00(obj_t, obj_t, obj_t);
BGL_IMPORT obj_t BGl_systemz00zz__osz00(obj_t);
BGL_IMPORT obj_t BGl_displayzd22zd2zz__r4_output_6_10_3z00(obj_t, obj_t);
static obj_t BGl_importedzd2moduleszd2initz00zzcc_execz00();
BGL_EXPORTED_DECL obj_t BGl_execz00zzcc_execz00(obj_t, bool_t, obj_t);
static obj_t BGl_requirezd2initializa7ationz75zzcc_execz00 = BUNSPEC;
static obj_t BGl_libraryzd2moduleszd2initz00zzcc_execz00();
extern obj_t BGl_exitzd2bigloozd2zzinit_mainz00(obj_t);
static obj_t *__cnst;


DEFINE_EXPORT_PROCEDURE( BGl_execzd2envzd2zzcc_execz00, BgL_bgl__execza700za7za7cc_execza7001045z00, BGl__execz00zzcc_execz00, 0L, 3 );
DEFINE_STRING( BGl_string1036z00zzcc_execz00, BgL_bgl_string1036za700za7za7cc_execza7001046z00, "Can't execute cmd", 17 );
DEFINE_STRING( BGl_string1035z00zzcc_execz00, BgL_bgl_string1035za700za7za7cc_execza7001047z00, "system/kill", 11 );



/* module-initialization */
BGL_EXPORTED_DEF obj_t BGl_modulezd2initializa7ationz75zzcc_execz00(long BgL_checksumz00_20, char * BgL_fromz00_21)
{ AN_OBJECT;
{ 
if(
CBOOL(BGl_requirezd2initializa7ationz75zzcc_execz00))
{ 
BGl_requirezd2initializa7ationz75zzcc_execz00 = 
BBOOL(((bool_t)0)); 
BGl_libraryzd2moduleszd2initz00zzcc_execz00(); 
BGl_importedzd2moduleszd2initz00zzcc_execz00(); 
return BUNSPEC;}  else 
{ 
return BUNSPEC;} } 
}



/* library-modules-init */
obj_t BGl_libraryzd2moduleszd2initz00zzcc_execz00()
{ AN_OBJECT;
{ /* ./Cc/exec.scm 20 */
BGl_modulezd2initializa7ationz75zz__osz00(((long)0), "cc_exec"); 
BGl_modulezd2initializa7ationz75zz__r4_output_6_10_3z00(((long)0), "cc_exec"); 
BGl_modulezd2initializa7ationz75zz__readerz00(((long)0), "cc_exec"); 
return BUNSPEC;} 
}



/* exec */
BGL_EXPORTED_DEF obj_t BGl_execz00zzcc_execz00(obj_t BgL_cmdz00_1, bool_t BgL_comezd2backzd2_2, obj_t BgL_namez00_3)
{ AN_OBJECT;
{ /* ./Cc/exec.scm 38 */
{ /* ./Cc/exec.scm 39 */
bool_t BgL_test1004z00_5;
if(BgL_comezd2backzd2_2)
{ /* ./Cc/exec.scm 39 */
BgL_test1004z00_5 = ((bool_t)1); }  else 
{ /* ./Cc/exec.scm 39 */
bool_t BgL_test1012z00_9;
{ /* ./Cc/exec.scm 39 */
obj_t BgL_objz00_12;
BgL_objz00_12 = BGl_za2shellza2z00zzengine_paramz00; 
BgL_test1012z00_9 = 
STRINGP(BgL_objz00_12); } 
if(BgL_test1012z00_9)
{ /* ./Cc/exec.scm 39 */
BgL_test1004z00_5 = ((bool_t)0); }  else 
{ /* ./Cc/exec.scm 39 */
BgL_test1004z00_5 = ((bool_t)1); } } 
if(BgL_test1004z00_5)
{ /* ./Cc/exec.scm 39 */
{ /* ./Cc/exec.scm 42 */
obj_t BgL_resz00_6;
{ /* ./Cc/exec.scm 42 */
obj_t BgL_list1009z00_8;
BgL_list1009z00_8 = 
MAKE_PAIR(BgL_cmdz00_1, BNIL); 
BgL_resz00_6 = 
BGl_systemz00zz__osz00(BgL_list1009z00_8); } 
{ /* ./Cc/exec.scm 43 */
bool_t BgL_test1005z00_7;
{ /* ./Cc/exec.scm 43 */
long BgL_auxz00_36;
BgL_auxz00_36 = 
(long)CINT(BgL_resz00_6); 
BgL_test1005z00_7 = 
(BgL_auxz00_36==((long)0)); } 
if(BgL_test1005z00_7)
{ /* ./Cc/exec.scm 43 */
return BgL_resz00_6;}  else 
{ /* ./Cc/exec.scm 43 */
return 
BGl_exitzd2bigloozd2zzinit_mainz00(
BINT(((long)1)));} } } }  else 
{ /* ./Cc/exec.scm 39 */
return 
BGl_systemzf2killzf2zzcc_execz00(BgL_cmdz00_1);} } } 
}



/* _exec */
obj_t BGl__execz00zzcc_execz00(obj_t BgL_envz00_16, obj_t BgL_cmdz00_17, obj_t BgL_comezd2backzd2_18, obj_t BgL_namez00_19)
{ AN_OBJECT;
{ /* ./Cc/exec.scm 38 */
return 
BGl_execz00zzcc_execz00(BgL_cmdz00_17, 
CBOOL(BgL_comezd2backzd2_18), BgL_namez00_19);} 
}



/* system/kill */
obj_t BGl_systemzf2killzf2zzcc_execz00(obj_t BgL_cmdz00_4)
{ AN_OBJECT;
{ /* ./Cc/exec.scm 53 */
{ /* ./Cc/exec.scm 57 */
obj_t BgL_port1003z00_10;
BgL_port1003z00_10 = 
BGL_CURRENT_OUTPUT_PORT(); 
{ /* ./Cc/exec.scm 57 */
int BgL_arg1015z00_11;
{ /* ./Cc/exec.scm 57 */
char * BgL_auxz00_50;char * BgL_auxz00_48;char * BgL_auxz00_46;
BgL_auxz00_50 = 
BSTRING_TO_STRING(BgL_cmdz00_4); 
BgL_auxz00_48 = 
BSTRING_TO_STRING(BGl_za2shellza2z00zzengine_paramz00); 
BgL_auxz00_46 = 
BSTRING_TO_STRING(BGl_za2shellza2z00zzengine_paramz00); 
BgL_arg1015z00_11 = 
execl(BgL_auxz00_46, BgL_auxz00_48, "-c", BgL_auxz00_50, ((long)0)); } 
BGl_displayzd22zd2zz__r4_output_6_10_3z00(
BINT(BgL_arg1015z00_11), BgL_port1003z00_10); } 
WRITE_CHAR(((unsigned char)'\n'), BgL_port1003z00_10); } 
return 
BGl_internalzd2errorzd2zztools_errorz00(BGl_string1035z00zzcc_execz00, BGl_string1036z00zzcc_execz00, BgL_cmdz00_4);} 
}



/* imported-modules-init */
obj_t BGl_importedzd2moduleszd2initz00zzcc_execz00()
{ AN_OBJECT;
{ /* ./Cc/exec.scm 20 */
BGl_modulezd2initializa7ationz75zztools_tracez00(((long)59211), "cc_exec"); 
BGl_modulezd2initializa7ationz75zztools_errorz00(((long)25566), "cc_exec"); 
BGl_modulezd2initializa7ationz75zzengine_paramz00(((long)14260), "cc_exec"); 
return 
BGl_modulezd2initializa7ationz75zzinit_mainz00(((long)6610), "cc_exec");} 
}

