pure-data/src/s_loader.c

/* Copyright (c) 1997-1999 Miller Puckette.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.  */
#if !defined (HAVE_LIBDL) && HAVE_DLOPEN
#define HAVE_LIBDL
#endif

#if HAVE_LIBDL
# include <dlfcn.h>
#endif
#ifdef HAVE_UNISTD_H
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#endif
#ifdef _WIN32
#include <io.h>
#include <windows.h>
#endif
#ifdef __APPLE__
#include <mach-o/dyld.h>
#endif
#include <string.h>
#include "m_pd.h"
#include "s_stuff.h"
#include <stdio.h>
#include <sys/stat.h>
#include "m_private_utils.h"
#ifdef _MSC_VER  /* This is only for Microsoft's compiler, not cygwin, e.g. */
#define stat
#endif

t_xxx;

/* naming convention for externs.  The names are kept distinct for those
who wish to make "fat" externs compiled for many platforms.  Less specific
fallbacks are provided, primarily for back-compatibility; these suffice if
you are building a package which will run with a single set of compiled
objects.  The specific name is the letter b, l, d, or m for  BSD, linux,
darwin, or microsoft, followed by a more specific string, either "fat" for
a fat binary or an indication of the instruction set. */

#ifdef __APPLE__
#define FAT_BINARIES
#endif

#define STR(s)
#define STRINGIFY(s)


#if defined(__x86_64__) || defined(_M_X64)
#define ARCHEXT
#elif defined(__i386__) || defined(_M_IX86)
#define ARCHEXT
#elif defined(__arm__)
#define ARCHEXT
#elif defined(__aarch64__)
#define ARCHEXT
#elif defined(__ppc__)
#define ARCHEXT
#endif

#ifdef ARCHEXT
#define ARCHDLLEXT(prefix)
#else
#define ARCHDLLEXT
#endif


#if defined(_WIN32) || defined(__CYGWIN__)
#define SYSTEMEXT
#else
#define SYSTEMEXT
#endif

static const char*sys_dllextent_base[] =;

static const char**sys_dllextent =;
static size_t num_dllextents =;
static void add_dllextension(const char*ext) {}

const char*sys_deken_specifier(char*buf, size_t bufsize, int include_floatsize, int cpu);

static char*add_deken_extension(const char*systemext, int float_agnostic, int cpu)
{}

    /* get an array of dll-extensions */
const char**sys_get_dllextensions(void)
{}

    /* maintain list of loaded modules to avoid repeating loads */
t_loadlist;

static t_loadlist *sys_loaded;
int sys_onloadlist(const char *classname) /* return true if already loaded */
{}

     /* add to list of loaded modules */
void sys_putonloadlist(const char *classname)
{}

void class_set_extern_dir(t_symbol *s);

static int sys_do_load_abs(t_canvas *canvas, const char *objectname,
    const char *path);


static int sys_do_load_lib_from_file(int fd,
    const char*objectname,
    const char*dirbuf,
    const char*nameptr,
    const char*symname) {}

static int sys_do_load_lib(t_canvas *canvas, const char *objectname,
    const char *path)
{}


/* linked list of loaders */
loader_queue_t;

static loader_queue_t loaders =;

/* register class loader function */
void sys_register_loader(loader_t loader)
{}

#include "g_canvas.h"

/* the data passed to the iter-function */
struct _loadlib_data
{};

int sys_loadlib_iter(const char *path, struct _loadlib_data *data)
{}

int sys_load_lib(t_canvas *canvas, const char *classname)
{}

int sys_run_scheduler(const char *externalschedlibname,
    const char *sys_extraflagsstring)
{}


/* abstraction loading */
void canvas_popabstraction(t_canvas *x);
int pd_setloadingabstraction(t_symbol *sym);

static t_pd *do_create_abstraction(t_symbol*s, int argc, t_atom *argv)
{}

/* search for abstraction; register a creator if found */
static int sys_do_load_abs(t_canvas *canvas, const char *objectname,
    const char *path)
{}

t_method sys_getfunbyname(const char *name)
{}