#ifndef _MKSH_DEFS_H
#define _MKSH_DEFS_H
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <limits.h> /* MB_LEN_MAX */
#include <stdio.h>
#include <stdlib.h> /* wchar_t */
#include <string.h> /* strcmp() */
#include <errno.h> /* errno */
#include <wctype.h>
/*
* A type and some utilities for boolean values
*/
#define false BOOLEAN_false
#define true BOOLEAN_true
typedef enum {
false = 0,
true = 1,
failed = 0,
} Boolean;
/*
* Some random constants (in an enum so dbx knows their values)
*/
enum {
};
/*
* Symbols that defines all the different char constants make uses
*/
enum {
};
/*
* For make i18n. Codeset independent.
* Setup character semantics by identifying all the special characters
* of make, and assigning each an entry in the char_semantics[] vector.
*/
enum {
};
/*
* CHAR_SEMANTICS_ENTRIES should be the number of entries above.
* The last entry in char_semantics[] should be blank.
*/
/*
#define CHAR_SEMANTICS_STRING "&*@`\\|[]:$=!>-\n#()%+?;^<'\""
*/
/*
* Some utility macros
*/
#define VSIZEOF(v) (sizeof (v) / sizeof ((v)[0]))
/*
* Bits stored in funny vector to classify chars
*/
enum {
};
/*
* Type returned from doname class functions
*/
typedef enum {
build_dont_know = 0,
} Doname;
/*
* The String struct defines a string with the following layout
* "xxxxxxxxxxxxxxxCxxxxxxxxxxxxxxx________"
* ^ ^ ^ ^
* | | | |
* buffer.start text.p text.end buffer.end
*/
struct _String {
struct Text {
} text;
struct Physical_buffer {
} buffer;
};
+ (sizeof (buf)/SIZEOFWCHAR_T); \
str.free_after_use = false; \
}
Wstring();
~Wstring();
unsigned length() {
};
};
};
};
/*
* Used for storing the $? list and also for the "target + target:"
* construct.
*/
struct _Chain {
};
/*
* Stores one command line for a rule
*/
struct _Cmd_line {
/*
* Remember any command line prefixes given
*/
};
/*
*/
struct _Dependency {
};
/*
* The specials are markers for targets that the reader should special case
*/
typedef enum {
} Special;
typedef enum {
} Separator;
/*
* Magic values for the timestamp stored with each name object
*/
extern const timestruc_t file_no_time;
extern const timestruc_t file_doesnt_exist;
extern const timestruc_t file_is_dir;
extern const timestruc_t file_min_time;
extern const timestruc_t file_max_time;
/*
* Each Name has a list of properties
* The properties are used to store information that only
* a subset of the Names need
*/
typedef enum {
} Property_id;
typedef enum {
no_daemon = 0,
} Daemon;
struct _Env_mem {
char *value;
};
struct _Macro_appendix {
};
struct _Macro {
/*
* For "ABC = xyz" constructs
* Name "ABC" get one macro prop
*/
/*
* This macro is defined conditionally
*/
/*
* The list for $? is stored as a structured list that
* is translated into a string iff it is referenced.
* This is why some macro values need a daemon.
*/
};
struct _Macro_list {
char *macro_name;
char *value;
};
enum sccs_stat {
DONT_KNOW_SCCS = 0,
};
struct _Name {
struct {
unsigned int length;
} hash;
struct {
} stat;
/*
* Count instances of :: definitions for this target
*/
short colon_splits;
/*
* We only clear the automatic depes once per target per report
*/
short temp_file_number;
/*
* Count how many conditional macros this target has defined
*/
short conditional_cnt;
/*
* A conditional macro was used when building this target
*/
/*
* Pointer to list of conditional macros which were used to build
* this target
*/
/*
* This target is a directory that has been read
*/
/*
* This name is a macro that is now being expanded
*/
/*
* This name is a magic name that the reader must know about
*/
/*
* This target has been built during this make run
*/
/*
* allowed to run in parallel
*/
/*
* not allowed to run in parallel
*/
/*
* used in dependency_conflict
*/
/*
* rechecking target for possible rebuild
*/
/*
* build this target in silent mode
*/
/*
* build this target in ignore error mode
*/
/*
* allowed to run serially on local host
*/
};
/*
* Stores the % matched default rules
*/
struct _Percent {
int patterns_total;
};
struct Conditional {
/*
* For "foo := ABC [+]= xyz" constructs
* Name "foo" gets one conditional prop
*/
int sequence;
};
struct Line {
/*
* For "target : dependencies" constructs
* Name "target" gets one line prop
*/
/*
* Values for the dynamic macros
*/
};
struct Makefile {
/*
* Names that reference makefiles gets one prop
*/
};
struct Member {
/*
* For "lib(member)" and "lib((entry))" constructs
* Name "lib(member)" gets one member prop
* Name "lib((entry))" gets one member prop
* The member field is filled in when the prop is refd
*/
};
struct Recursive {
/*
* For "target: .RECURSIVE dir makefiles" constructs
* Used to keep track of recursive calls to make
* Name "target" gets one recursive prop
*/
};
struct Sccs {
/*
* Each file that has a SCCS s. file gets one prop
*/
};
struct Suffix {
/*
* Cached list of suffixes that can build this target
* suffix is built from .SUFFIXES
*/
};
struct Target {
/*
* For "target:: dependencies" constructs
* The "::" construct is handled by converting it to
* "foo: 1@foo" + "1@foo: dependecies"
* "1@foo" gets one target prop
* This target prop cause $@ to be bound to "foo"
* not "1@foo" when the rule is evaluated
*/
};
struct STime {
/*
* Save the original time for :: targets
*/
};
struct Vpath_alias {
/*
* If a file was found using the VPATH it gets
* a vpath_alias prop
*/
};
struct Long_member_name {
/*
* Targets with a truncated member name carries
* the full lib(member) name for the state file
*/
};
union Body {
};
struct _Property {
};
/* Structure for dynamic "ascii" arrays */
struct ASCII_Dyn_Array {
char *start;
};
struct _Envvar {
char *env_string;
};
/*
* Macros for the reader
*/
goto enter_state; \
}
}
(comp); \
}
CACHE_SOURCE(0) \
}
} \
}
struct _Source {
short fd;
char *inp_buf;
char *inp_buf_end;
char *inp_buf_ptr;
};
typedef enum {
/*
* Typedefs for all structs
*/
/*
* name records hash table.
*/
struct Name_set {
// single node in a tree
struct entry {
left(0),
right(0),
depth(1)
{}
unsigned depth;
void setup_depth() {
}
};
// make iterator a friend of Name_set to have access to struct entry
struct iterator;
// iterator over tree nodes
struct iterator {
// constructors
// dereference operator
// conversion operator
// assignment operator
// equality/inequality operators
// the node iterator points to
};
// constructor
// lookup, insert and remove operations
// rebalance given node
// tree root
};
/*
* extern declarations for all global variables.
* The actual declarations are in globals.cc
*/
extern char char_semantics[];
extern wchar_t char_semantics_char[];
extern Macro_list cond_macro_list;
extern Boolean conditional_macro_used;
extern Boolean dollarget_seen;
extern Boolean dollarless_flag;
extern Name dollarless_value;
extern char **environ;
extern int exit_status;
extern wchar_t *file_being_read;
/* Variable gnu_style=true if env. var. SUN_MAKE_COMPAT_MODE=GNU (RFE 4866328) */
extern int line_number;
extern char *make_state_lockfile;
extern Boolean make_word_mentioned;
extern Makefile_type makefile_type;
extern char mbs_buffer[];
extern Boolean query_mentioned;
extern Boolean reading_environment;
extern Name shell_name;
extern Name target_arch;
extern Name target_mach;
extern Boolean tilde_rule;
extern wchar_t wcs_buffer[];
extern Boolean working_on_targets;
extern Name virtual_root;
extern Boolean vpath_defined;
extern Name vpath_name;
extern Boolean make_state_locked;
extern Boolean out_err_same;
/*
* RFE 1257407: make does not use fine granularity time info available from stat.
* High resolution time comparison.
*/
inline int
}
inline int
}
inline int
}
}
inline int
}
}
inline int
}
}
inline int
}
}
#endif