Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

more::lang::package Class Reference

A package of C function and type definitions. More...

#include <more/lang/package.h>

Collaboration diagram for more::lang::package:

Collaboration graph
[legend]
List of all members.

Public Types

Public Methods

Static Public Attributes

Friends


Detailed Description

A package of C function and type definitions.

An internal package has access to a writable directory determined by the package name, where it can place source code and do compilations. An external package acts as a wrapper for an lt_dlhandle (see libltdl in the GNU Libtool).


Member Typedef Documentation

typedef uint_least16_t more::lang::package::flag_type
 

Type used for flags.


Constructor & Destructor Documentation

more::lang::package::package package *    cxt,
identifier    idr,
flag_type    flags_set = 0,
flag_type    flags_clear = 0
 

Construct a package rooted at cxt named idr.

If split_p, use one source file per symbol. cxt may be 0. The flags are set to flags_intern_default & ~flags_clear | flags_set.

more::lang::package::package package *    cxt,
identifier    idr,
lt_dlhandle    h,
flag_type    flags_set = 0,
flag_type    flags_clear = 0
 

Construct an external package idr rooted at cxt with symbols from h.

The destructor will call lt_dlclose(h). cxt may be 0. The flags are set to flags_extern_default & ~flags_clear | flags_set.

more::lang::package::package package *    cxt,
identifier    idr,
char const *    file,
flag_type    flags_set = 0,
flag_type    flags_clear = 0
 

Construct an external package idr rooted at cxt with symbols from lt_dlopenext(file).

cxt may be 0. The flags are set to flags_extern_default & ~flags_clear | flags_set.

more::lang::package::~package  
 

Destruct the package, this should be called by the collector.


Member Function Documentation

void more::lang::package::compile  
 

Create sources and (re-)compile all symbols now.

This is normally done automatically when an identifier is requested.

void more::lang::package::create_sources  
 

Create sources now.

This is normally done automatically.

void more::lang::package::define identifier    idr,
location   locn,
bool    export_p
 

Define the variable of locn in this package under the name idr.

See the other overload for details.

Precondition:
locn->get_resolver() is a cx_package_variable.

void more::lang::package::define identifier    idr,
cx_package_variable   pv,
bool    export_p
 

Define the variable pv in this package under the name idr.

The package name and names of parent packages will be prepended to the name. If export_p is true, the name will have external linkage.

void more::lang::package::define_type identifier    idr,
ct_struct   tp,
bool    export_p
 

Bind idr to tp is this package.

The definition of the type is written out if needed.

flag_type more::lang::package::flags   const [inline]
 

Return the flags.

bool more::lang::package::is_extern   const [inline]
 

True if this is an external package.

cx_package_variable* more::lang::package::lookup identifier    idr [inline]
 

Return the cx_package_variable of idfr or 0 if none.

gen::gc_string more::lang::package::mk_path char const *    sep const
 

Return a path for the package with components separated by sep.

void* more::lang::package::resolve char const *    sym [inline]
 

Resolve sym adding the package prefix if applicable.

void* more::lang::package::resolve_no_prefix char const *    sym [inline]
 

Resolve the fully named symbol sym.

void more::lang::package::undefine identifier    idr
 

Undefine the variable with the name idr.


Friends And Related Function Documentation

friend class cx_package_variable [friend]
 


Member Data Documentation

flag_type const more::lang::package::flag_compile = 1 << 0 [static]
 

Allow compilations to be done for this package.

flag_type const more::lang::package::flag_create_header = 1 << 3 [static]
 

Create a header file.

flag_type const more::lang::package::flag_cxx_symbols = 1 << 10 [static]
 

If generating C++ code, don't use extern "C" linkage for exported names.

Note that C++ mangeling is not handled, so with this flag set, the generated symbols can not be linked into the application.

flag_type const more::lang::package::flag_lang_c = 1 << 8 [static]
 

Generate C code.

flag_type const more::lang::package::flag_lang_cxx = 2 << 8 [static]
 

Generate C++ code (unfinished).

flag_type const more::lang::package::flag_lang_mask = 3 << 8 [static]
 

Mask of backend language specification.

flag_type const more::lang::package::flag_split = 1 << 2 [static]
 

Split source files into one per symbol and compile separately.

flag_type const more::lang::package::flag_use_headers = 1 << 4 [static]
 

Include header files in source file.

flag_type const more::lang::package::flags_extern_default = 0 [static]
 

FYI, the default flags for external packages.

flag_type const more::lang::package::flags_intern_default = flag_compile | flag_create_header | flag_use_headers | flag_lang_c [static]
 

FYI, the default flags for internal packages.


The documentation for this class was generated from the following file:
Generated on Sat Sep 7 19:12:54 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.