/*===========================================================================*/
/*   (Llib/foreign.scm)                                                      */
/*   Bigloo (4.7a)                                                           */
/*   Inria -- Sophia Antipolis (c)       Thu Feb 19 09:11:58 AM CET 2026     */
/*===========================================================================*/
/* COMPILATION: (/home/serrano/prgm/project/bigloo/4.7a/bin/bigloo -srfi bigloo-safe -O3 -fcfa-arithmetic -q -lib-dir /home/serrano/prgm/project/bigloo/4.7a/lib/bigloo/4.7a +rm -O3 -mklib -cc gcc -fsharing -q -unsafev -eval (set! *indent* 4) -stdc -c Llib/foreign.scm -indent -o objs/obj_s/Llib/foreign.c) */
/* GC selection */
#define THE_GC BOEHM_GC

/* traces mode */
#define BIGLOO_TRACE 0

/* standard Bigloo include */
#include <bigloo.h>

#ifdef __cplusplus
extern "C" {
#endif
#ifndef BGL_MODULE_TYPE_DEFINITIONS
#define BGL_MODULE_TYPE_DEFINITIONS
#ifndef BGL___FOREIGN_TYPE_DEFINITIONS
#define BGL___FOREIGN_TYPE_DEFINITIONS
#endif // BGL___FOREIGN_TYPE_DEFINITIONS
#endif // BGL_MODULE_TYPE_DEFINITIONS

static obj_t BGl_requirezd2initializa7ationz75zz__foreignz00 = BUNSPEC;
static obj_t BGl_z62foreignzd2eqzf3z43zz__foreignz00(obj_t, obj_t, obj_t);
static obj_t BGl_z62makezd2stringzd2ptrzd2nullzb0zz__foreignz00(obj_t);
BGL_EXPORTED_DECL bool_t BGl_foreignzf3zf3zz__foreignz00(obj_t);
extern obj_t BGl_typezd2errorzd2zz__errorz00(obj_t, obj_t, obj_t, obj_t, obj_t);
BGL_EXPORTED_DECL obj_t BGl_modulezd2initializa7ationz75zz__foreignz00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zz__errorz00(long, char *);
BGL_EXPORTED_DECL long BGl_objzd2ze3cobjz31zz__foreignz00(obj_t);
BGL_EXPORTED_DECL char * BGl_makezd2stringzd2ptrzd2nullzd2zz__foreignz00(void);
static obj_t BGl_z62stringzd2ptrzd2nullzf3z91zz__foreignz00(obj_t, obj_t);
static obj_t BGl_z62voidza2zd2nullzf3ze1zz__foreignz00(obj_t, obj_t);
static obj_t BGl_importedzd2moduleszd2initz00zz__foreignz00(void);
static obj_t BGl_gczd2rootszd2initz00zz__foreignz00(void);
static obj_t BGl_z62foreignzf3z91zz__foreignz00(obj_t, obj_t);
BGL_EXPORTED_DECL bool_t BGl_foreignzd2nullzf3z21zz__foreignz00(obj_t);
extern obj_t void_star_to_obj(void *);
BGL_EXPORTED_DECL bool_t BGl_foreignzd2eqzf3z21zz__foreignz00(obj_t, obj_t);
BGL_EXPORTED_DECL void * BGl_makezd2voidza2zd2nullza2zz__foreignz00(void);
static obj_t BGl_z62makezd2voidza2zd2nullzc0zz__foreignz00(obj_t);
static obj_t BGl_z62foreignzd2nullzf3z43zz__foreignz00(obj_t, obj_t);
extern long obj_to_cobj(obj_t);
BGL_EXPORTED_DECL bool_t BGl_stringzd2ptrzd2nullzf3zf3zz__foreignz00(char *);
BGL_EXPORTED_DECL bool_t BGl_voidza2zd2nullzf3z83zz__foreignz00(void *);
static obj_t BGl_z62objzd2ze3cobjz53zz__foreignz00(obj_t, obj_t);
extern obj_t BGl_errorz00zz__errorz00(obj_t, obj_t, obj_t);
static obj_t *__cnst;


DEFINE_EXPORT_BGL_PROCEDURE(BGl_stringzd2ptrzd2nullzf3zd2envz21zz__foreignz00, BgL_bgl_za762stringza7d2ptrza71430za7, BGl_z62stringzd2ptrzd2nullzf3z91zz__foreignz00, 0L, BUNSPEC, 1);
DEFINE_EXPORT_BGL_PROCEDURE(BGl_objzd2ze3cobjzd2envze3zz__foreignz00, BgL_bgl_za762objza7d2za7e3cobj1431za7, BGl_z62objzd2ze3cobjz53zz__foreignz00, 0L, BUNSPEC, 1);
BGL_DEFINE_STRING(BGl_string1420z00zz__foreignz00, BgL_bgl_string1420za700za7za7_1432za7, "/tmp/bigloo/runtime/Llib/foreign.scm", 36 );
BGL_DEFINE_STRING(BGl_string1421z00zz__foreignz00, BgL_bgl_string1421za700za7za7_1433za7, "foreign-eq?", 11 );
BGL_DEFINE_STRING(BGl_string1422z00zz__foreignz00, BgL_bgl_string1422za700za7za7_1434za7, "foreign", 7 );
BGL_DEFINE_STRING(BGl_string1423z00zz__foreignz00, BgL_bgl_string1423za700za7za7_1435za7, "foreign-null?", 13 );
BGL_DEFINE_STRING(BGl_string1424z00zz__foreignz00, BgL_bgl_string1424za700za7za7_1436za7, "not a foreign object", 20 );
BGL_DEFINE_STRING(BGl_string1425z00zz__foreignz00, BgL_bgl_string1425za700za7za7_1437za7, "&string-ptr-null?", 17 );
BGL_DEFINE_STRING(BGl_string1426z00zz__foreignz00, BgL_bgl_string1426za700za7za7_1438za7, "bstring", 7 );
BGL_DEFINE_STRING(BGl_string1427z00zz__foreignz00, BgL_bgl_string1427za700za7za7_1439za7, "&void*-null?", 12 );
BGL_DEFINE_STRING(BGl_string1428z00zz__foreignz00, BgL_bgl_string1428za700za7za7_1440za7, "void*", 5 );
BGL_DEFINE_STRING(BGl_string1429z00zz__foreignz00, BgL_bgl_string1429za700za7za7_1441za7, "__foreign", 9 );
DEFINE_EXPORT_BGL_PROCEDURE(BGl_foreignzf3zd2envz21zz__foreignz00, BgL_bgl_za762foreignza7f3za7911442za7, BGl_z62foreignzf3z91zz__foreignz00, 0L, BUNSPEC, 1);
DEFINE_EXPORT_BGL_PROCEDURE(BGl_makezd2voidza2zd2nullzd2envz70zz__foreignz00, BgL_bgl_za762makeza7d2voidza7a1443za7, BGl_z62makezd2voidza2zd2nullzc0zz__foreignz00, 0L, BUNSPEC, 0);
DEFINE_EXPORT_BGL_PROCEDURE(BGl_makezd2stringzd2ptrzd2nullzd2envz00zz__foreignz00, BgL_bgl_za762makeza7d2string1444z00, BGl_z62makezd2stringzd2ptrzd2nullzb0zz__foreignz00, 0L, BUNSPEC, 0);
DEFINE_EXPORT_BGL_PROCEDURE(BGl_foreignzd2eqzf3zd2envzf3zz__foreignz00, BgL_bgl_za762foreignza7d2eqza71445za7, BGl_z62foreignzd2eqzf3z43zz__foreignz00, 0L, BUNSPEC, 2);
DEFINE_EXPORT_BGL_PROCEDURE(BGl_voidza2zd2nullzf3zd2envz51zz__foreignz00, BgL_bgl_za762voidza7a2za7d2nul1446za7, BGl_z62voidza2zd2nullzf3ze1zz__foreignz00, 0L, BUNSPEC, 1);
DEFINE_EXPORT_BGL_PROCEDURE(BGl_foreignzd2nullzf3zd2envzf3zz__foreignz00, BgL_bgl_za762foreignza7d2nul1447z00, BGl_z62foreignzd2nullzf3z43zz__foreignz00, 0L, BUNSPEC, 1);

/* contant bindings */
static void bgl_constant_bindings() {
BGL_BIND_PROCEDURE(BGl_foreignzd2nullzf3zd2envzf3zz__foreignz00, BgL_bgl_za762foreignza7d2nul1447z00);
BGL_BIND_PROCEDURE(BGl_voidza2zd2nullzf3zd2envz51zz__foreignz00, BgL_bgl_za762voidza7a2za7d2nul1446za7);
BGL_BIND_PROCEDURE(BGl_foreignzd2eqzf3zd2envzf3zz__foreignz00, BgL_bgl_za762foreignza7d2eqza71445za7);
BGL_BIND_PROCEDURE(BGl_makezd2stringzd2ptrzd2nullzd2envz00zz__foreignz00, BgL_bgl_za762makeza7d2string1444z00);
BGL_BIND_PROCEDURE(BGl_makezd2voidza2zd2nullzd2envz70zz__foreignz00, BgL_bgl_za762makeza7d2voidza7a1443za7);
BGL_BIND_PROCEDURE(BGl_foreignzf3zd2envz21zz__foreignz00, BgL_bgl_za762foreignza7f3za7911442za7);
BGL_BIND_STRING(BGl_string1429z00zz__foreignz00, BgL_bgl_string1429za700za7za7_1441za7);
BGL_BIND_STRING(BGl_string1428z00zz__foreignz00, BgL_bgl_string1428za700za7za7_1440za7);
BGL_BIND_STRING(BGl_string1427z00zz__foreignz00, BgL_bgl_string1427za700za7za7_1439za7);
BGL_BIND_STRING(BGl_string1426z00zz__foreignz00, BgL_bgl_string1426za700za7za7_1438za7);
BGL_BIND_STRING(BGl_string1425z00zz__foreignz00, BgL_bgl_string1425za700za7za7_1437za7);
BGL_BIND_STRING(BGl_string1424z00zz__foreignz00, BgL_bgl_string1424za700za7za7_1436za7);
BGL_BIND_STRING(BGl_string1423z00zz__foreignz00, BgL_bgl_string1423za700za7za7_1435za7);
BGL_BIND_STRING(BGl_string1422z00zz__foreignz00, BgL_bgl_string1422za700za7za7_1434za7);
BGL_BIND_STRING(BGl_string1421z00zz__foreignz00, BgL_bgl_string1421za700za7za7_1433za7);
BGL_BIND_STRING(BGl_string1420z00zz__foreignz00, BgL_bgl_string1420za700za7za7_1432za7);
BGL_BIND_PROCEDURE(BGl_objzd2ze3cobjzd2envze3zz__foreignz00, BgL_bgl_za762objza7d2za7e3cobj1431za7);
BGL_BIND_PROCEDURE(BGl_stringzd2ptrzd2nullzf3zd2envz21zz__foreignz00, BgL_bgl_za762stringza7d2ptrza71430za7);
}

/* GC roots registration */
static obj_t bgl_gc_roots_register() {
#if defined( BGL_GC_ROOTS )
#define ADD_ROOT( addr ) (addr > roots_max ? roots_max = addr : (addr < roots_min ? roots_min = addr : 0))
void *roots_min = (void*)ULONG_MAX, *roots_max = 0;
ADD_ROOT( (void *)(&BGl_requirezd2initializa7ationz75zz__foreignz00) );
#undef ADD_ROOT
if( roots_max > 0 ) GC_add_roots( roots_min, ((void **)roots_max) + 1 );
#endif
return BUNSPEC;
}



/* module-initialization */
BGL_EXPORTED_DEF obj_t BGl_modulezd2initializa7ationz75zz__foreignz00(long BgL_checksumz00_1066, char * BgL_fromz00_1067)
{
{ 
if(
CBOOL(BGl_requirezd2initializa7ationz75zz__foreignz00))
{ 
BGl_requirezd2initializa7ationz75zz__foreignz00 = 
BBOOL(((bool_t)0)); 
bgl_constant_bindings(); 
BGl_gczd2rootszd2initz00zz__foreignz00(); 
return 
BGl_importedzd2moduleszd2initz00zz__foreignz00();}  else 
{ 
return BUNSPEC;} } 

}



/* gc-roots-init */
obj_t BGl_gczd2rootszd2initz00zz__foreignz00(void)
{
{ /* Llib/foreign.scm 18 */
return 
bgl_gc_roots_register();} 

}



/* foreign? */
BGL_EXPORTED_DEF bool_t BGl_foreignzf3zf3zz__foreignz00(obj_t BgL_objz00_3)
{
{ /* Llib/foreign.scm 91 */
return 
FOREIGNP(BgL_objz00_3);} 

}



/* &foreign? */
obj_t BGl_z62foreignzf3z91zz__foreignz00(obj_t BgL_envz00_1043, obj_t BgL_objz00_1044)
{
{ /* Llib/foreign.scm 91 */
return 
BBOOL(
BGl_foreignzf3zf3zz__foreignz00(BgL_objz00_1044));} 

}



/* foreign-eq? */
BGL_EXPORTED_DEF bool_t BGl_foreignzd2eqzf3z21zz__foreignz00(obj_t BgL_o1z00_4, obj_t BgL_o2z00_5)
{
{ /* Llib/foreign.scm 97 */
{ /* Llib/foreign.scm 98 */
 obj_t BgL_auxz00_1085; obj_t BgL_tmpz00_1078;
if(
FOREIGNP(BgL_o2z00_5))
{ /* Llib/foreign.scm 98 */
BgL_auxz00_1085 = BgL_o2z00_5
; }  else 
{ 
 obj_t BgL_auxz00_1088;
BgL_auxz00_1088 = 
BGl_typezd2errorzd2zz__errorz00(BGl_string1420z00zz__foreignz00, 
BINT(4208L), BGl_string1421z00zz__foreignz00, BGl_string1422z00zz__foreignz00, BgL_o2z00_5); 
FAILURE(BgL_auxz00_1088,BFALSE,BFALSE);} 
if(
FOREIGNP(BgL_o1z00_4))
{ /* Llib/foreign.scm 98 */
BgL_tmpz00_1078 = BgL_o1z00_4
; }  else 
{ 
 obj_t BgL_auxz00_1081;
BgL_auxz00_1081 = 
BGl_typezd2errorzd2zz__errorz00(BGl_string1420z00zz__foreignz00, 
BINT(4205L), BGl_string1421z00zz__foreignz00, BGl_string1422z00zz__foreignz00, BgL_o1z00_4); 
FAILURE(BgL_auxz00_1081,BFALSE,BFALSE);} 
return 
FOREIGN_EQP(BgL_tmpz00_1078, BgL_auxz00_1085);} } 

}



/* &foreign-eq? */
obj_t BGl_z62foreignzd2eqzf3z43zz__foreignz00(obj_t BgL_envz00_1045, obj_t BgL_o1z00_1046, obj_t BgL_o2z00_1047)
{
{ /* Llib/foreign.scm 97 */
return 
BBOOL(
BGl_foreignzd2eqzf3z21zz__foreignz00(BgL_o1z00_1046, BgL_o2z00_1047));} 

}



/* foreign-null? */
BGL_EXPORTED_DEF bool_t BGl_foreignzd2nullzf3z21zz__foreignz00(obj_t BgL_objz00_6)
{
{ /* Llib/foreign.scm 103 */
if(
FOREIGNP(BgL_objz00_6))
{ /* Llib/foreign.scm 104 */
return 
FOREIGN_NULLP(BgL_objz00_6);}  else 
{ /* Llib/foreign.scm 104 */
return 
CBOOL(
BGl_errorz00zz__errorz00(BGl_string1423z00zz__foreignz00, BGl_string1424z00zz__foreignz00, BgL_objz00_6));} } 

}



/* &foreign-null? */
obj_t BGl_z62foreignzd2nullzf3z43zz__foreignz00(obj_t BgL_envz00_1048, obj_t BgL_objz00_1049)
{
{ /* Llib/foreign.scm 103 */
return 
BBOOL(
BGl_foreignzd2nullzf3z21zz__foreignz00(BgL_objz00_1049));} 

}



/* string-ptr-null? */
BGL_EXPORTED_DEF bool_t BGl_stringzd2ptrzd2nullzf3zf3zz__foreignz00(char * BgL_objz00_7)
{
{ /* Llib/foreign.scm 111 */
return 
STRING_PTR_NULL(BgL_objz00_7);} 

}



/* &string-ptr-null? */
obj_t BGl_z62stringzd2ptrzd2nullzf3z91zz__foreignz00(obj_t BgL_envz00_1050, obj_t BgL_objz00_1051)
{
{ /* Llib/foreign.scm 111 */
{ /* Llib/foreign.scm 112 */
 bool_t BgL_tmpz00_1103;
{ /* Llib/foreign.scm 112 */
 char * BgL_auxz00_1104;
{ /* Llib/foreign.scm 112 */
 obj_t BgL_tmpz00_1105;
if(
STRINGP(BgL_objz00_1051))
{ /* Llib/foreign.scm 112 */
BgL_tmpz00_1105 = BgL_objz00_1051
; }  else 
{ 
 obj_t BgL_auxz00_1108;
BgL_auxz00_1108 = 
BGl_typezd2errorzd2zz__errorz00(BGl_string1420z00zz__foreignz00, 
BINT(4854L), BGl_string1425z00zz__foreignz00, BGl_string1426z00zz__foreignz00, BgL_objz00_1051); 
FAILURE(BgL_auxz00_1108,BFALSE,BFALSE);} 
BgL_auxz00_1104 = 
BSTRING_TO_STRING(BgL_tmpz00_1105); } 
BgL_tmpz00_1103 = 
BGl_stringzd2ptrzd2nullzf3zf3zz__foreignz00(BgL_auxz00_1104); } 
return 
BBOOL(BgL_tmpz00_1103);} } 

}



/* obj->cobj */
BGL_EXPORTED_DEF long BGl_objzd2ze3cobjz31zz__foreignz00(obj_t BgL_objz00_8)
{
{ /* Llib/foreign.scm 117 */
BGL_TAIL return 
obj_to_cobj(BgL_objz00_8);} 

}



/* &obj->cobj */
obj_t BGl_z62objzd2ze3cobjz53zz__foreignz00(obj_t BgL_envz00_1052, obj_t BgL_objz00_1053)
{
{ /* Llib/foreign.scm 117 */
return 
(obj_t)(
BGl_objzd2ze3cobjz31zz__foreignz00(BgL_objz00_1053));} 

}



/* void*-null? */
BGL_EXPORTED_DEF bool_t BGl_voidza2zd2nullzf3z83zz__foreignz00(void * BgL_objz00_9)
{
{ /* Llib/foreign.scm 123 */
return 
FOREIGN_PTR_NULL(BgL_objz00_9);} 

}



/* &void*-null? */
obj_t BGl_z62voidza2zd2nullzf3ze1zz__foreignz00(obj_t BgL_envz00_1054, obj_t BgL_objz00_1055)
{
{ /* Llib/foreign.scm 123 */
{ /* Llib/foreign.scm 124 */
 bool_t BgL_tmpz00_1119;
{ /* Llib/foreign.scm 124 */
 void * BgL_auxz00_1120;
if(
FOREIGNP(BgL_objz00_1055))
{ /* Llib/foreign.scm 124 */
BgL_auxz00_1120 = 
FOREIGN_TO_COBJ(BgL_objz00_1055)
; }  else 
{ 
 obj_t BgL_auxz00_1124;
BgL_auxz00_1124 = 
BGl_typezd2errorzd2zz__errorz00(BGl_string1420z00zz__foreignz00, 
BINT(5421L), BGl_string1427z00zz__foreignz00, BGl_string1428z00zz__foreignz00, BgL_objz00_1055); 
FAILURE(BgL_auxz00_1124,BFALSE,BFALSE);} 
BgL_tmpz00_1119 = 
BGl_voidza2zd2nullzf3z83zz__foreignz00(BgL_auxz00_1120); } 
return 
BBOOL(BgL_tmpz00_1119);} } 

}



/* make-string-ptr-null */
BGL_EXPORTED_DEF char * BGl_makezd2stringzd2ptrzd2nullzd2zz__foreignz00(void)
{
{ /* Llib/foreign.scm 129 */
return 
(0L);} 

}



/* &make-string-ptr-null */
obj_t BGl_z62makezd2stringzd2ptrzd2nullzb0zz__foreignz00(obj_t BgL_envz00_1056)
{
{ /* Llib/foreign.scm 129 */
return 
string_to_bstring(
BGl_makezd2stringzd2ptrzd2nullzd2zz__foreignz00());} 

}



/* make-void*-null */
BGL_EXPORTED_DEF void * BGl_makezd2voidza2zd2nullza2zz__foreignz00(void)
{
{ /* Llib/foreign.scm 135 */
return 
(0L);} 

}



/* &make-void*-null */
obj_t BGl_z62makezd2voidza2zd2nullzc0zz__foreignz00(obj_t BgL_envz00_1057)
{
{ /* Llib/foreign.scm 135 */
return 
void_star_to_obj(
BGl_makezd2voidza2zd2nullza2zz__foreignz00());} 

}



/* imported-modules-init */
obj_t BGl_importedzd2moduleszd2initz00zz__foreignz00(void)
{
{ /* Llib/foreign.scm 18 */
return 
BGl_modulezd2initializa7ationz75zz__errorz00(88804785L, 
BSTRING_TO_STRING(BGl_string1429z00zz__foreignz00));} 

}

#ifdef __cplusplus
}
#endif
