mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
port to sunpro
[SVN r19022]
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
# include "pwd.h"
|
||||
# include "pathsys.h"
|
||||
# include "make.h"
|
||||
# include "hdrmacro.h"
|
||||
# include <ctype.h>
|
||||
|
||||
/*
|
||||
@@ -503,8 +504,8 @@ builtin_hdrmacro(
|
||||
/* helper function for builtin_rulenames(), below */
|
||||
static void add_rule_name( void* r_, void* result_ )
|
||||
{
|
||||
RULE* r = r_;
|
||||
LIST** result = result_;
|
||||
RULE* r = (RULE*)r_;
|
||||
LIST** result = (LIST**)result_;
|
||||
|
||||
if ( r->exported )
|
||||
*result = list_new( *result, copystr( r->name ) );
|
||||
@@ -517,7 +518,7 @@ builtin_rulenames(
|
||||
{
|
||||
LIST *arg0 = lol_get( frame->args, 0 );
|
||||
LIST *result = L0;
|
||||
module* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
module_t* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
|
||||
if ( source_module->rules )
|
||||
hashenumerate( source_module->rules, add_rule_name, &result );
|
||||
@@ -536,7 +537,7 @@ builtin_rulenames(
|
||||
*/
|
||||
static void add_hash_key( void* np, void* result_ )
|
||||
{
|
||||
LIST** result = result_;
|
||||
LIST** result = (LIST**)result_;
|
||||
|
||||
*result = list_new( *result, copystr( *(char**)np ) );
|
||||
}
|
||||
@@ -548,7 +549,7 @@ builtin_varnames(
|
||||
{
|
||||
LIST *arg0 = lol_get( frame->args, 0 );
|
||||
LIST *result = L0;
|
||||
module* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
module_t* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
|
||||
if ( source_module->variables )
|
||||
hashenumerate( source_module->variables, add_hash_key, &result );
|
||||
@@ -567,7 +568,7 @@ builtin_delete_module(
|
||||
{
|
||||
LIST *arg0 = lol_get( frame->args, 0 );
|
||||
LIST *result = L0;
|
||||
module* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
module_t* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
|
||||
delete_module( source_module );
|
||||
return result;
|
||||
@@ -608,8 +609,8 @@ builtin_import(
|
||||
LIST *target_rules = lol_get( frame->args, 3 );
|
||||
LIST *localize = lol_get( frame->args, 4 );
|
||||
|
||||
module* target_module = bindmodule( target_module_list ? target_module_list->string : 0 );
|
||||
module* source_module = bindmodule( source_module_list ? source_module_list->string : 0 );
|
||||
module_t* target_module = bindmodule( target_module_list ? target_module_list->string : 0 );
|
||||
module_t* source_module = bindmodule( source_module_list ? source_module_list->string : 0 );
|
||||
|
||||
LIST *source_name, *target_name;
|
||||
|
||||
@@ -666,7 +667,7 @@ builtin_export(
|
||||
LIST *module_list = lol_get( frame->args, 0 );
|
||||
LIST *rules = lol_get( frame->args, 1 );
|
||||
|
||||
module* m = bindmodule( module_list ? module_list->string : 0 );
|
||||
module_t* m = bindmodule( module_list ? module_list->string : 0 );
|
||||
|
||||
|
||||
for ( ; rules; rules = list_next( rules ) )
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# include "hash.h"
|
||||
# include "modules.h"
|
||||
# include "strings.h"
|
||||
# include "builtins.h"
|
||||
|
||||
# include <time.h>
|
||||
# include <assert.h>
|
||||
@@ -390,7 +391,7 @@ compile_module(
|
||||
LIST* module_name = parse_evaluate( p->left, frame );
|
||||
LIST* result;
|
||||
|
||||
module* outer_module = frame->module;
|
||||
module_t* outer_module = frame->module;
|
||||
frame->module = module_name ? bindmodule( module_name->string ) : root_module();
|
||||
|
||||
if ( outer_module != frame->module )
|
||||
@@ -631,7 +632,7 @@ arg_modifier( LIST* formal )
|
||||
static void
|
||||
type_check( char* type_name, LIST *values, FRAME* caller, RULE* called, LIST* arg_name )
|
||||
{
|
||||
static module *typecheck = 0;
|
||||
static module_t *typecheck = 0;
|
||||
|
||||
/* if nothing to check, bail now */
|
||||
if ( !values || !type_name )
|
||||
@@ -841,7 +842,7 @@ static void profile_exit(profile_frame* frame)
|
||||
|
||||
static void dump_profile_entry(void* p_, void* ignored)
|
||||
{
|
||||
profile_info* p = p_;
|
||||
profile_info* p = (profile_info*)p_;
|
||||
printf("%10d %10d %10d %s\n", p->cumulative, p->net, p->num_entries, p->name);
|
||||
}
|
||||
|
||||
@@ -866,7 +867,7 @@ evaluate_rule(
|
||||
LIST *result = L0;
|
||||
RULE *rule;
|
||||
profile_frame prof[1];
|
||||
module *prev_module = frame->module;
|
||||
module_t *prev_module = frame->module;
|
||||
|
||||
LIST *l;
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
# include "execcmd.h"
|
||||
# include <errno.h>
|
||||
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
#include <unistd.h> // need to include unistd.h on sun for the vfork prototype
|
||||
#include <wait.h>
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#ifndef FILESYS_DWA20011025_H
|
||||
# define FILESYS_DWA20011025_H
|
||||
|
||||
# include "pathsys.h"
|
||||
|
||||
typedef void (*scanback)( void *closure, char *file, int found, time_t t );
|
||||
|
||||
void file_dirscan( char *dir, scanback func, void *closure );
|
||||
@@ -26,4 +28,6 @@ void file_archscan( char *arch, scanback func, void *closure );
|
||||
|
||||
int file_time( char *filename, time_t *time );
|
||||
|
||||
void file_build1(PATHNAME *f, string* file) ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
|
||||
# ifdef USE_FILEUNIX
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
# include <unistd.h> // needed for read and close prototype
|
||||
#endif
|
||||
|
||||
# if defined( OS_SEQUENT ) || \
|
||||
defined( OS_DGUX ) || \
|
||||
defined( OS_SCO ) || \
|
||||
|
||||
@@ -18,7 +18,7 @@ struct frame
|
||||
{
|
||||
FRAME* prev;
|
||||
LOL args[1];
|
||||
module* module;
|
||||
module_t* module;
|
||||
PARSE* procedure;
|
||||
char* rulename;
|
||||
};
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
# include "timestamp.h"
|
||||
# include "make.h"
|
||||
# include "strings.h"
|
||||
# include "expand.h"
|
||||
|
||||
/* Macintosh is "special" */
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
# include "assert.h"
|
||||
# include "variable.h"
|
||||
# include "rules.h"
|
||||
# include "headers.h"
|
||||
|
||||
# include "search.h"
|
||||
# include "newstr.h"
|
||||
@@ -62,6 +63,10 @@
|
||||
# include "command.h"
|
||||
# include "execcmd.h"
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
#include <unistd.h> /* for unlink */
|
||||
#endif
|
||||
|
||||
static CMD *make1cmds( TARGET *t );
|
||||
static LIST *make1list( LIST *l, TARGETS *targets, int flags );
|
||||
static SETTINGS *make1settings( LIST *vars );
|
||||
@@ -733,9 +738,9 @@ make1d(state *pState)
|
||||
* target with those from the new module and target
|
||||
*/
|
||||
static void swap_settings(
|
||||
module** current_module
|
||||
module_t** current_module
|
||||
, TARGET** current_target
|
||||
, module* new_module
|
||||
, module_t* new_module
|
||||
, TARGET* new_target)
|
||||
{
|
||||
if (new_module == root_module())
|
||||
@@ -779,7 +784,7 @@ make1cmds( TARGET *t )
|
||||
CMD *cmds = 0;
|
||||
LIST *shell = 0;
|
||||
|
||||
module *settings_module = 0;
|
||||
module_t *settings_module = 0;
|
||||
TARGET *settings_target = 0;
|
||||
|
||||
/* Step through actions */
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
static struct hash* module_hash = 0;
|
||||
|
||||
static char* new_module_str( module* m, char* suffix )
|
||||
static char* new_module_str( module_t* m, char* suffix )
|
||||
{
|
||||
char* result;
|
||||
string s;
|
||||
@@ -28,13 +28,13 @@ static char* new_module_str( module* m, char* suffix )
|
||||
return result;
|
||||
}
|
||||
|
||||
module* bindmodule( char* name )
|
||||
module_t* bindmodule( char* name )
|
||||
{
|
||||
string s;
|
||||
module m_, *m = &m_;
|
||||
module_t m_, *m = &m_;
|
||||
|
||||
if( !module_hash )
|
||||
module_hash = hashinit( sizeof( module ), "modules" );
|
||||
module_hash = hashinit( sizeof( module_t ), "modules" );
|
||||
|
||||
string_new( &s );
|
||||
if (name)
|
||||
@@ -58,7 +58,7 @@ module* bindmodule( char* name )
|
||||
/*
|
||||
* demand_rules() - Get the module's "rules" hash on demand
|
||||
*/
|
||||
struct hash* demand_rules( module* m )
|
||||
struct hash* demand_rules( module_t* m )
|
||||
{
|
||||
if ( !m->rules )
|
||||
m->rules = hashinit( sizeof( RULE ), new_module_str( m, "rules" ) );
|
||||
@@ -73,7 +73,7 @@ static void delete_rule_( void* xrule, void* data )
|
||||
rule_free( (RULE*)xrule );
|
||||
}
|
||||
|
||||
void delete_module( module* m )
|
||||
void delete_module( module_t* m )
|
||||
{
|
||||
/* clear out all the rules */
|
||||
if ( m->rules )
|
||||
@@ -92,20 +92,20 @@ void delete_module( module* m )
|
||||
}
|
||||
}
|
||||
|
||||
module* root_module()
|
||||
module_t* root_module()
|
||||
{
|
||||
static module* root = 0;
|
||||
static module_t* root = 0;
|
||||
if ( !root )
|
||||
root = bindmodule(0);
|
||||
return root;
|
||||
}
|
||||
|
||||
void enter_module( module* m )
|
||||
void enter_module( module_t* m )
|
||||
{
|
||||
var_hash_swap( &m->variables );
|
||||
}
|
||||
|
||||
void exit_module( module* m )
|
||||
void exit_module( module_t* m )
|
||||
{
|
||||
var_hash_swap( &m->variables );
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ static char* allocate(size_t n)
|
||||
nalloc = STRING_BLOCK;
|
||||
|
||||
/* allocate a new block and link into the chain */
|
||||
new_block = malloc( offsetof( strblock, data[0] ) + nalloc * sizeof(new_block->data[0]) );
|
||||
new_block = (strblock*)malloc( offsetof( strblock, data[0] ) + nalloc * sizeof(new_block->data[0]) );
|
||||
if ( new_block == 0 )
|
||||
return 0;
|
||||
new_block->next = strblock_chain;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
# include "pathsys.h"
|
||||
# include "strings.h"
|
||||
# include "newstr.h"
|
||||
# include "filesys.h"
|
||||
|
||||
# ifdef USE_PATHUNIX
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# include "search.h"
|
||||
# include "lists.h"
|
||||
# include "pathsys.h"
|
||||
# include "timestamp.h"
|
||||
|
||||
/* This file is ALSO:
|
||||
* (C) Copyright David Abrahams 2001. Permission to copy, use,
|
||||
@@ -68,7 +69,7 @@ static struct hash *located_targets = 0;
|
||||
* target_module.
|
||||
*/
|
||||
static RULE *
|
||||
enter_rule( char *rulename, module *target_module )
|
||||
enter_rule( char *rulename, module_t *target_module )
|
||||
{
|
||||
RULE rule, *r = &rule;
|
||||
|
||||
@@ -93,7 +94,7 @@ enter_rule( char *rulename, module *target_module )
|
||||
* src_module.
|
||||
*/
|
||||
static RULE *
|
||||
define_rule( module *src_module, char *rulename, module *target_module )
|
||||
define_rule( module_t *src_module, char *rulename, module_t *target_module )
|
||||
{
|
||||
RULE *r = enter_rule( rulename, target_module );
|
||||
|
||||
@@ -550,7 +551,7 @@ donerules()
|
||||
*/
|
||||
argument_list* args_new()
|
||||
{
|
||||
argument_list* r = malloc( sizeof(argument_list) );
|
||||
argument_list* r = (argument_list*)malloc( sizeof(argument_list) );
|
||||
r->reference_count = 0;
|
||||
lol_init(r->data);
|
||||
return r;
|
||||
@@ -657,7 +658,7 @@ static RULE* global_rule( RULE* r )
|
||||
* true, the rule is exported to the global module as
|
||||
* modulename.rulename.
|
||||
*/
|
||||
RULE* new_rule_body( module* m, char* rulename, argument_list* args, PARSE* procedure, int exported )
|
||||
RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int exported )
|
||||
{
|
||||
RULE* local = define_rule( m, rulename, m );
|
||||
local->exported = exported;
|
||||
@@ -687,7 +688,7 @@ static void set_rule_actions( RULE* rule, rule_actions* actions )
|
||||
|
||||
static rule_actions* actions_new( char* command, LIST* bindlist, int flags )
|
||||
{
|
||||
rule_actions* result = malloc(sizeof(rule_actions));
|
||||
rule_actions* result = (rule_actions*)malloc(sizeof(rule_actions));
|
||||
result->command = copystr( command );
|
||||
result->bindlist = bindlist;
|
||||
result->flags = flags;
|
||||
@@ -695,7 +696,7 @@ static rule_actions* actions_new( char* command, LIST* bindlist, int flags )
|
||||
return result;
|
||||
}
|
||||
|
||||
RULE* new_rule_actions( module* m, char* rulename, char* command, LIST* bindlist, int flags )
|
||||
RULE* new_rule_actions( module_t* m, char* rulename, char* command, LIST* bindlist, int flags )
|
||||
{
|
||||
RULE* local = define_rule( m, rulename, m );
|
||||
RULE* global = global_rule( local );
|
||||
@@ -704,7 +705,7 @@ RULE* new_rule_actions( module* m, char* rulename, char* command, LIST* bindlist
|
||||
return local;
|
||||
}
|
||||
|
||||
RULE *bindrule( char *rulename, module* m )
|
||||
RULE *bindrule( char *rulename, module_t* m )
|
||||
{
|
||||
RULE rule, *r = &rule;
|
||||
r->name = rulename;
|
||||
@@ -715,7 +716,7 @@ RULE *bindrule( char *rulename, module* m )
|
||||
return enter_rule( rulename, root_module() );
|
||||
}
|
||||
|
||||
RULE* import_rule( RULE* source, module* m, char* name )
|
||||
RULE* import_rule( RULE* source, module_t* m, char* name )
|
||||
{
|
||||
RULE* dest = define_rule( source->module, name, m );
|
||||
set_rule_body( dest, source->arguments, source->procedure );
|
||||
|
||||
@@ -223,7 +223,7 @@ struct _target {
|
||||
RULE *bindrule( char *rulename, module_t* );
|
||||
|
||||
RULE* import_rule( RULE* source, module_t* m, char* name );
|
||||
RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int export );
|
||||
RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int exprt );
|
||||
RULE* new_rule_actions( module_t* m, char* rulename, char* command, LIST* bindlist, int flags );
|
||||
TARGET *bindtarget( const char *targetname );
|
||||
TARGET *copytarget( const TARGET *t );
|
||||
|
||||
@@ -375,7 +375,7 @@ var_dump(
|
||||
*/
|
||||
static void delete_var_( void* xvar, void* data )
|
||||
{
|
||||
VARIABLE *v = xvar;
|
||||
VARIABLE *v = (VARIABLE*)xvar;
|
||||
freestr( v->symbol );
|
||||
list_free( v-> value );
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
# include "pwd.h"
|
||||
# include "pathsys.h"
|
||||
# include "make.h"
|
||||
# include "hdrmacro.h"
|
||||
# include <ctype.h>
|
||||
|
||||
/*
|
||||
@@ -503,8 +504,8 @@ builtin_hdrmacro(
|
||||
/* helper function for builtin_rulenames(), below */
|
||||
static void add_rule_name( void* r_, void* result_ )
|
||||
{
|
||||
RULE* r = r_;
|
||||
LIST** result = result_;
|
||||
RULE* r = (RULE*)r_;
|
||||
LIST** result = (LIST**)result_;
|
||||
|
||||
if ( r->exported )
|
||||
*result = list_new( *result, copystr( r->name ) );
|
||||
@@ -517,7 +518,7 @@ builtin_rulenames(
|
||||
{
|
||||
LIST *arg0 = lol_get( frame->args, 0 );
|
||||
LIST *result = L0;
|
||||
module* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
module_t* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
|
||||
if ( source_module->rules )
|
||||
hashenumerate( source_module->rules, add_rule_name, &result );
|
||||
@@ -536,7 +537,7 @@ builtin_rulenames(
|
||||
*/
|
||||
static void add_hash_key( void* np, void* result_ )
|
||||
{
|
||||
LIST** result = result_;
|
||||
LIST** result = (LIST**)result_;
|
||||
|
||||
*result = list_new( *result, copystr( *(char**)np ) );
|
||||
}
|
||||
@@ -548,7 +549,7 @@ builtin_varnames(
|
||||
{
|
||||
LIST *arg0 = lol_get( frame->args, 0 );
|
||||
LIST *result = L0;
|
||||
module* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
module_t* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
|
||||
if ( source_module->variables )
|
||||
hashenumerate( source_module->variables, add_hash_key, &result );
|
||||
@@ -567,7 +568,7 @@ builtin_delete_module(
|
||||
{
|
||||
LIST *arg0 = lol_get( frame->args, 0 );
|
||||
LIST *result = L0;
|
||||
module* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
module_t* source_module = bindmodule( arg0 ? arg0->string : 0 );
|
||||
|
||||
delete_module( source_module );
|
||||
return result;
|
||||
@@ -608,8 +609,8 @@ builtin_import(
|
||||
LIST *target_rules = lol_get( frame->args, 3 );
|
||||
LIST *localize = lol_get( frame->args, 4 );
|
||||
|
||||
module* target_module = bindmodule( target_module_list ? target_module_list->string : 0 );
|
||||
module* source_module = bindmodule( source_module_list ? source_module_list->string : 0 );
|
||||
module_t* target_module = bindmodule( target_module_list ? target_module_list->string : 0 );
|
||||
module_t* source_module = bindmodule( source_module_list ? source_module_list->string : 0 );
|
||||
|
||||
LIST *source_name, *target_name;
|
||||
|
||||
@@ -666,7 +667,7 @@ builtin_export(
|
||||
LIST *module_list = lol_get( frame->args, 0 );
|
||||
LIST *rules = lol_get( frame->args, 1 );
|
||||
|
||||
module* m = bindmodule( module_list ? module_list->string : 0 );
|
||||
module_t* m = bindmodule( module_list ? module_list->string : 0 );
|
||||
|
||||
|
||||
for ( ; rules; rules = list_next( rules ) )
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# include "hash.h"
|
||||
# include "modules.h"
|
||||
# include "strings.h"
|
||||
# include "builtins.h"
|
||||
|
||||
# include <time.h>
|
||||
# include <assert.h>
|
||||
@@ -390,7 +391,7 @@ compile_module(
|
||||
LIST* module_name = parse_evaluate( p->left, frame );
|
||||
LIST* result;
|
||||
|
||||
module* outer_module = frame->module;
|
||||
module_t* outer_module = frame->module;
|
||||
frame->module = module_name ? bindmodule( module_name->string ) : root_module();
|
||||
|
||||
if ( outer_module != frame->module )
|
||||
@@ -631,7 +632,7 @@ arg_modifier( LIST* formal )
|
||||
static void
|
||||
type_check( char* type_name, LIST *values, FRAME* caller, RULE* called, LIST* arg_name )
|
||||
{
|
||||
static module *typecheck = 0;
|
||||
static module_t *typecheck = 0;
|
||||
|
||||
/* if nothing to check, bail now */
|
||||
if ( !values || !type_name )
|
||||
@@ -841,7 +842,7 @@ static void profile_exit(profile_frame* frame)
|
||||
|
||||
static void dump_profile_entry(void* p_, void* ignored)
|
||||
{
|
||||
profile_info* p = p_;
|
||||
profile_info* p = (profile_info*)p_;
|
||||
printf("%10d %10d %10d %s\n", p->cumulative, p->net, p->num_entries, p->name);
|
||||
}
|
||||
|
||||
@@ -866,7 +867,7 @@ evaluate_rule(
|
||||
LIST *result = L0;
|
||||
RULE *rule;
|
||||
profile_frame prof[1];
|
||||
module *prev_module = frame->module;
|
||||
module_t *prev_module = frame->module;
|
||||
|
||||
LIST *l;
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
# include "execcmd.h"
|
||||
# include <errno.h>
|
||||
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
#include <unistd.h> // need to include unistd.h on sun for the vfork prototype
|
||||
#include <wait.h>
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#ifndef FILESYS_DWA20011025_H
|
||||
# define FILESYS_DWA20011025_H
|
||||
|
||||
# include "pathsys.h"
|
||||
|
||||
typedef void (*scanback)( void *closure, char *file, int found, time_t t );
|
||||
|
||||
void file_dirscan( char *dir, scanback func, void *closure );
|
||||
@@ -26,4 +28,6 @@ void file_archscan( char *arch, scanback func, void *closure );
|
||||
|
||||
int file_time( char *filename, time_t *time );
|
||||
|
||||
void file_build1(PATHNAME *f, string* file) ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
|
||||
# ifdef USE_FILEUNIX
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
# include <unistd.h> // needed for read and close prototype
|
||||
#endif
|
||||
|
||||
# if defined( OS_SEQUENT ) || \
|
||||
defined( OS_DGUX ) || \
|
||||
defined( OS_SCO ) || \
|
||||
|
||||
@@ -18,7 +18,7 @@ struct frame
|
||||
{
|
||||
FRAME* prev;
|
||||
LOL args[1];
|
||||
module* module;
|
||||
module_t* module;
|
||||
PARSE* procedure;
|
||||
char* rulename;
|
||||
};
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
# include "timestamp.h"
|
||||
# include "make.h"
|
||||
# include "strings.h"
|
||||
# include "expand.h"
|
||||
|
||||
/* Macintosh is "special" */
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
# include "assert.h"
|
||||
# include "variable.h"
|
||||
# include "rules.h"
|
||||
# include "headers.h"
|
||||
|
||||
# include "search.h"
|
||||
# include "newstr.h"
|
||||
@@ -62,6 +63,10 @@
|
||||
# include "command.h"
|
||||
# include "execcmd.h"
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
#include <unistd.h> /* for unlink */
|
||||
#endif
|
||||
|
||||
static CMD *make1cmds( TARGET *t );
|
||||
static LIST *make1list( LIST *l, TARGETS *targets, int flags );
|
||||
static SETTINGS *make1settings( LIST *vars );
|
||||
@@ -733,9 +738,9 @@ make1d(state *pState)
|
||||
* target with those from the new module and target
|
||||
*/
|
||||
static void swap_settings(
|
||||
module** current_module
|
||||
module_t** current_module
|
||||
, TARGET** current_target
|
||||
, module* new_module
|
||||
, module_t* new_module
|
||||
, TARGET* new_target)
|
||||
{
|
||||
if (new_module == root_module())
|
||||
@@ -779,7 +784,7 @@ make1cmds( TARGET *t )
|
||||
CMD *cmds = 0;
|
||||
LIST *shell = 0;
|
||||
|
||||
module *settings_module = 0;
|
||||
module_t *settings_module = 0;
|
||||
TARGET *settings_target = 0;
|
||||
|
||||
/* Step through actions */
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
static struct hash* module_hash = 0;
|
||||
|
||||
static char* new_module_str( module* m, char* suffix )
|
||||
static char* new_module_str( module_t* m, char* suffix )
|
||||
{
|
||||
char* result;
|
||||
string s;
|
||||
@@ -28,13 +28,13 @@ static char* new_module_str( module* m, char* suffix )
|
||||
return result;
|
||||
}
|
||||
|
||||
module* bindmodule( char* name )
|
||||
module_t* bindmodule( char* name )
|
||||
{
|
||||
string s;
|
||||
module m_, *m = &m_;
|
||||
module_t m_, *m = &m_;
|
||||
|
||||
if( !module_hash )
|
||||
module_hash = hashinit( sizeof( module ), "modules" );
|
||||
module_hash = hashinit( sizeof( module_t ), "modules" );
|
||||
|
||||
string_new( &s );
|
||||
if (name)
|
||||
@@ -58,7 +58,7 @@ module* bindmodule( char* name )
|
||||
/*
|
||||
* demand_rules() - Get the module's "rules" hash on demand
|
||||
*/
|
||||
struct hash* demand_rules( module* m )
|
||||
struct hash* demand_rules( module_t* m )
|
||||
{
|
||||
if ( !m->rules )
|
||||
m->rules = hashinit( sizeof( RULE ), new_module_str( m, "rules" ) );
|
||||
@@ -73,7 +73,7 @@ static void delete_rule_( void* xrule, void* data )
|
||||
rule_free( (RULE*)xrule );
|
||||
}
|
||||
|
||||
void delete_module( module* m )
|
||||
void delete_module( module_t* m )
|
||||
{
|
||||
/* clear out all the rules */
|
||||
if ( m->rules )
|
||||
@@ -92,20 +92,20 @@ void delete_module( module* m )
|
||||
}
|
||||
}
|
||||
|
||||
module* root_module()
|
||||
module_t* root_module()
|
||||
{
|
||||
static module* root = 0;
|
||||
static module_t* root = 0;
|
||||
if ( !root )
|
||||
root = bindmodule(0);
|
||||
return root;
|
||||
}
|
||||
|
||||
void enter_module( module* m )
|
||||
void enter_module( module_t* m )
|
||||
{
|
||||
var_hash_swap( &m->variables );
|
||||
}
|
||||
|
||||
void exit_module( module* m )
|
||||
void exit_module( module_t* m )
|
||||
{
|
||||
var_hash_swap( &m->variables );
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ static char* allocate(size_t n)
|
||||
nalloc = STRING_BLOCK;
|
||||
|
||||
/* allocate a new block and link into the chain */
|
||||
new_block = malloc( offsetof( strblock, data[0] ) + nalloc * sizeof(new_block->data[0]) );
|
||||
new_block = (strblock*)malloc( offsetof( strblock, data[0] ) + nalloc * sizeof(new_block->data[0]) );
|
||||
if ( new_block == 0 )
|
||||
return 0;
|
||||
new_block->next = strblock_chain;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
# include "pathsys.h"
|
||||
# include "strings.h"
|
||||
# include "newstr.h"
|
||||
# include "filesys.h"
|
||||
|
||||
# ifdef USE_PATHUNIX
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# include "search.h"
|
||||
# include "lists.h"
|
||||
# include "pathsys.h"
|
||||
# include "timestamp.h"
|
||||
|
||||
/* This file is ALSO:
|
||||
* (C) Copyright David Abrahams 2001. Permission to copy, use,
|
||||
@@ -68,7 +69,7 @@ static struct hash *located_targets = 0;
|
||||
* target_module.
|
||||
*/
|
||||
static RULE *
|
||||
enter_rule( char *rulename, module *target_module )
|
||||
enter_rule( char *rulename, module_t *target_module )
|
||||
{
|
||||
RULE rule, *r = &rule;
|
||||
|
||||
@@ -93,7 +94,7 @@ enter_rule( char *rulename, module *target_module )
|
||||
* src_module.
|
||||
*/
|
||||
static RULE *
|
||||
define_rule( module *src_module, char *rulename, module *target_module )
|
||||
define_rule( module_t *src_module, char *rulename, module_t *target_module )
|
||||
{
|
||||
RULE *r = enter_rule( rulename, target_module );
|
||||
|
||||
@@ -550,7 +551,7 @@ donerules()
|
||||
*/
|
||||
argument_list* args_new()
|
||||
{
|
||||
argument_list* r = malloc( sizeof(argument_list) );
|
||||
argument_list* r = (argument_list*)malloc( sizeof(argument_list) );
|
||||
r->reference_count = 0;
|
||||
lol_init(r->data);
|
||||
return r;
|
||||
@@ -657,7 +658,7 @@ static RULE* global_rule( RULE* r )
|
||||
* true, the rule is exported to the global module as
|
||||
* modulename.rulename.
|
||||
*/
|
||||
RULE* new_rule_body( module* m, char* rulename, argument_list* args, PARSE* procedure, int exported )
|
||||
RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int exported )
|
||||
{
|
||||
RULE* local = define_rule( m, rulename, m );
|
||||
local->exported = exported;
|
||||
@@ -687,7 +688,7 @@ static void set_rule_actions( RULE* rule, rule_actions* actions )
|
||||
|
||||
static rule_actions* actions_new( char* command, LIST* bindlist, int flags )
|
||||
{
|
||||
rule_actions* result = malloc(sizeof(rule_actions));
|
||||
rule_actions* result = (rule_actions*)malloc(sizeof(rule_actions));
|
||||
result->command = copystr( command );
|
||||
result->bindlist = bindlist;
|
||||
result->flags = flags;
|
||||
@@ -695,7 +696,7 @@ static rule_actions* actions_new( char* command, LIST* bindlist, int flags )
|
||||
return result;
|
||||
}
|
||||
|
||||
RULE* new_rule_actions( module* m, char* rulename, char* command, LIST* bindlist, int flags )
|
||||
RULE* new_rule_actions( module_t* m, char* rulename, char* command, LIST* bindlist, int flags )
|
||||
{
|
||||
RULE* local = define_rule( m, rulename, m );
|
||||
RULE* global = global_rule( local );
|
||||
@@ -704,7 +705,7 @@ RULE* new_rule_actions( module* m, char* rulename, char* command, LIST* bindlist
|
||||
return local;
|
||||
}
|
||||
|
||||
RULE *bindrule( char *rulename, module* m )
|
||||
RULE *bindrule( char *rulename, module_t* m )
|
||||
{
|
||||
RULE rule, *r = &rule;
|
||||
r->name = rulename;
|
||||
@@ -715,7 +716,7 @@ RULE *bindrule( char *rulename, module* m )
|
||||
return enter_rule( rulename, root_module() );
|
||||
}
|
||||
|
||||
RULE* import_rule( RULE* source, module* m, char* name )
|
||||
RULE* import_rule( RULE* source, module_t* m, char* name )
|
||||
{
|
||||
RULE* dest = define_rule( source->module, name, m );
|
||||
set_rule_body( dest, source->arguments, source->procedure );
|
||||
|
||||
@@ -223,7 +223,7 @@ struct _target {
|
||||
RULE *bindrule( char *rulename, module_t* );
|
||||
|
||||
RULE* import_rule( RULE* source, module_t* m, char* name );
|
||||
RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int export );
|
||||
RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int exprt );
|
||||
RULE* new_rule_actions( module_t* m, char* rulename, char* command, LIST* bindlist, int flags );
|
||||
TARGET *bindtarget( const char *targetname );
|
||||
TARGET *copytarget( const TARGET *t );
|
||||
|
||||
@@ -375,7 +375,7 @@ var_dump(
|
||||
*/
|
||||
static void delete_var_( void* xvar, void* data )
|
||||
{
|
||||
VARIABLE *v = xvar;
|
||||
VARIABLE *v = (VARIABLE*)xvar;
|
||||
freestr( v->symbol );
|
||||
list_free( v-> value );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user