Branch: Tag:


1995-08-09 10:21:55 by Fredrik Hübinette (Hubbe) <>

ulpc dist

Rev: bin/create_testsuite:
Rev: bin/hilfe.lpc:
Rev: bin/rsif:
Rev: bin/uhttpd.lpc:
Rev: doc/README:
Rev: doc/builtin/aggregate:
Rev: doc/builtin/aggregate_list:
Rev: doc/builtin/aggregate_mapping:
Rev: doc/builtin/all_efuns:
Rev: doc/builtin/allocate:
Rev: doc/builtin/arrayp:
Rev: doc/builtin/backtrace:
Rev: doc/builtin/call_function:
Rev: doc/builtin/call_out:
Rev: doc/builtin/call_out_info:
Rev: doc/builtin/catch:
Rev: doc/builtin/clone:
Rev: doc/builtin/combine_path:
Rev: doc/builtin/compile_file:
Rev: doc/builtin/compile_string:
Rev: doc/builtin/copy_value:
Rev: doc/builtin/crypt:
Rev: doc/builtin/ctime:
Rev: doc/builtin/destruct:
Rev: doc/builtin/equal:
Rev: doc/builtin/exit:
Rev: doc/builtin/explode:
Rev: doc/builtin/find_call_out:
Rev: doc/builtin/floatp:
Rev: doc/builtin/function_name:
Rev: doc/builtin/function_object:
Rev: doc/builtin/functionp:
Rev: doc/builtin/hash:
Rev: doc/builtin/implode:
Rev: doc/builtin/indices:
Rev: doc/builtin/intp:
Rev: doc/builtin/listp:
Rev: doc/builtin/lower_case:
Rev: doc/builtin/m_delete:
Rev: doc/builtin/mappingp:
Rev: doc/builtin/mkmapping:
Rev: doc/builtin/next_object:
Rev: doc/builtin/object_program:
Rev: doc/builtin/objectp:
Rev: doc/builtin/programp:
Rev: doc/builtin/query_host_name:
Rev: doc/builtin/query_num_arg:
Rev: doc/builtin/random:
Rev: doc/builtin/regexpp:
Rev: doc/builtin/remove_call_out:
Rev: doc/builtin/replace:
Rev: doc/builtin/reverse:
Rev: doc/builtin/rusage:
Rev: doc/builtin/search:
Rev: doc/builtin/sizeof:
Rev: doc/builtin/sscanf:
Rev: doc/builtin/stringp:
Rev: doc/builtin/sum:
Rev: doc/builtin/this_object:
Rev: doc/builtin/throw:
Rev: doc/builtin/time:
Rev: doc/builtin/trace:
Rev: doc/builtin/upper_case:
Rev: doc/builtin/values:
Rev: doc/builtin/zero_type:
Rev: doc/files/cd:
Rev: doc/files/exec:
Rev: doc/files/file:
Rev: doc/files/file_stat:
Rev: doc/files/fork:
Rev: doc/files/get_dir:
Rev: doc/files/getcwd:
Rev: doc/files/mkdir:
Rev: doc/files/mv:
Rev: doc/files/perror:
Rev: doc/files/port:
Rev: doc/files/rm:
Rev: doc/lpc/command_line_options:
Rev: doc/lpc/control_structures:
Rev: doc/lpc/hilfe.hilfe:
Rev: doc/lpc/how_to_make_modules:
Rev: doc/manual/i-overview.html:
Rev: doc/manual/index.html:
Rev: doc/manual/t-hello.html:
Rev: doc/manual/ulpc-inside3.gif:
Rev: doc/math/acos:
Rev: doc/math/asin:
Rev: doc/math/atan:
Rev: doc/math/ceil:
Rev: doc/math/cos:
Rev: doc/math/exp:
Rev: doc/math/floor:
Rev: doc/math/log:
Rev: doc/math/pow:
Rev: doc/math/sin:
Rev: doc/math/sqrt:
Rev: doc/math/tan:
Rev: doc/operators/addition:
Rev: doc/regexp/regexp:
Rev: doc/simulated/PI:
Rev: doc/simulated/capitalize:
Rev: doc/simulated/code_value:
Rev: doc/simulated/describe_backtrace:
Rev: doc/simulated/file_size:
Rev: doc/simulated/filter_array:
Rev: doc/simulated/get_function:
Rev: doc/simulated/getenv:
Rev: doc/simulated/l_sizeof:
Rev: doc/simulated/m_indices:
Rev: doc/simulated/m_sizeof:
Rev: doc/simulated/m_values:
Rev: doc/simulated/map_array:
Rev: doc/simulated/master:
Rev: doc/simulated/member_array:
Rev: doc/simulated/popen:
Rev: doc/simulated/previous_object:
Rev: doc/simulated/read_bytes:
Rev: doc/simulated/regexp:
Rev: doc/simulated/search_array:
Rev: doc/simulated/sort_array:
Rev: doc/simulated/spawn:
Rev: doc/simulated/strlen:
Rev: doc/simulated/strstr:
Rev: doc/simulated/sum_arrays:
Rev: doc/simulated/this_function:
Rev: doc/simulated/write:
Rev: doc/simulated/write_file:
Rev: doc/sprintf/sprintf:
Rev: doc/types/array:
Rev: doc/types/float:
Rev: doc/types/function:
Rev: doc/types/int:
Rev: doc/types/list:
Rev: doc/types/mapping:
Rev: doc/types/object:
Rev: doc/types/program:
Rev: doc/types/string:
Rev: lib/conftest.h:
Rev: lib/master.lpc:
Rev: lib/simulate.lpc:
Rev: lib/testsuite.lpc:
Rev: src/BUGS:
Rev: src/COPYING:
Rev: src/
Rev: src/README:
Rev: src/add_efun.c:
Rev: src/add_efun.h:
Rev: src/alloca.c:
Rev: src/array.c:
Rev: src/array.h:
Rev: src/backend.c:
Rev: src/backend.h:
Rev: src/builtin_efuns.c:
Rev: src/builtin_efuns.h:
Rev: src/call_out.c:
Rev: src/call_out.h:
Rev: src/callback.c:
Rev: src/callback.h:
Rev: src/config.h:
Rev: src/
Rev: src/debug.c:
Rev: src/debug.h:
Rev: src/docode.c:
Rev: src/docode.h:
Rev: src/dynamic_buffer.c:
Rev: src/dynamic_buffer.h:
Rev: src/efun.h:
Rev: src/error.c:
Rev: src/error.h:
Rev: src/fd_control.c:
Rev: src/fd_control.h:
Rev: src/fsort.c:
Rev: src/fsort.h:
Rev: src/global.h:
Rev: src/hashtable.c:
Rev: src/hashtable.h:
Rev: src/install-sh:
Rev: src/interpret.c:
Rev: src/interpret.h:
Rev: src/language.y:
Rev: src/las.c:
Rev: src/las.h:
Rev: src/lex.c:
Rev: src/lex.h:
Rev: src/list.c:
Rev: src/list.h:
Rev: src/lpc_types.c:
Rev: src/lpc_types.h:
Rev: src/
Rev: src/macros.h:
Rev: src/main.c:
Rev: src/main.h:
Rev: src/mapping.c:
Rev: src/mapping.h:
Rev: src/memory.c:
Rev: src/memory.h:
Rev: src/module.c:
Rev: src/module.h:
Rev: src/modules/efuns.c:
Rev: src/modules/files/
Rev: src/modules/files/
Rev: src/modules/files/datagram.c:
Rev: src/modules/files/efuns.c:
Rev: src/modules/files/file.c:
Rev: src/modules/files/file.h:
Rev: src/modules/files/
Rev: src/modules/files/socket.c:
Rev: src/modules/math/
Rev: src/modules/math/
Rev: src/modules/math/math.c:
Rev: src/modules/regexp/
Rev: src/modules/regexp/
Rev: src/modules/regexp/glue.c:
Rev: src/modules/regexp/regexp.c:
Rev: src/modules/regexp/regexp.h:
Rev: src/modules/sprintf/
Rev: src/modules/sprintf/
Rev: src/modules/sprintf/sprintf.c:
Rev: src/object.c:
Rev: src/object.h:
Rev: src/opcodes.c:
Rev: src/opcodes.h:
Rev: src/operators.c:
Rev: src/operators.h:
Rev: src/otable.h:
Rev: src/port.c:
Rev: src/port.h:
Rev: src/program.c:
Rev: src/program.h:
Rev: src/rusage.c:
Rev: src/rusage.h:
Rev: src/stralloc.c:
Rev: src/stralloc.h:
Rev: src/stuff.c:
Rev: src/stuff.h:
Rev: src/svalue.c:
Rev: src/svalue.h:
Rev: src/todo:
Rev: src/types.h:
Rev: src/ualarm.c:

1: + #ifndef ARRAY_H + #define ARRAY_H    -  + #include "las.h" +  + struct array + { +  INT32 refs; /* Reference count */ +  struct array *next; /* we need to keep track of all arrays */ +  struct array *prev; /* Another pointer, so we don't have to search +  * when freeing arrays */ +  INT32 size; /* number of items in this array */ +  INT32 malloced_size; /* number of elements that can fit in this array */ +  TYPE_FIELD type_field;/* A bitfield with one bit for each type. +  * Bits can be set that don't exist in the array +  * though. +  */ +  TYPE_T array_type; /* This is T_MIXED for a mixed array, or the type for +  * an array that can only contain one type. +  */ +  INT8 flags; /* flags, like gc_cycle */ + }; +  + struct array_of_svalues + { +  struct array array; +  struct svalue item[1]; + }; +  + struct array_of_short_svalues + { +  struct array array; +  union anything item[1]; + }; +  + #define ITEM(X) (((struct array_of_svalues *)(X))->item) + #define SHORT_ITEM(X) (((struct array_of_short_svalues *)(X))->item) +  +  + /* These are arguments for the function 'merge' which merges two sorted +  * set stored in arrays in the way you specify +  */ + #define OP_A 1 + #define OP_SKIP_A 2 + #define OP_TAKE_A 3 + #define OP_B 4 + #define OP_SKIP_B 8 + #define OP_TAKE_B 12 + #define MINTERM(X,Y,Z) (((X)<<8)+((Y)<<4)+(Z)) +  + #define OP_AND MINTERM(OP_SKIP_A,OP_SKIP_A | OP_TAKE_B,OP_SKIP_B) + #define OP_OR MINTERM(OP_TAKE_A,OP_SKIP_A | OP_TAKE_B,OP_TAKE_B) + #define OP_XOR MINTERM(OP_TAKE_A,OP_SKIP_A | OP_SKIP_B,OP_TAKE_B) + #define OP_ADD MINTERM(OP_TAKE_A,OP_TAKE_A | OP_TAKE_B ,OP_TAKE_B) + #define OP_SUB MINTERM(OP_TAKE_A,OP_SKIP_A ,OP_SKIP_B) +  +  + #define free_array(V) do{ struct array *v_=(V); if(!--v_->refs) really_free_array(v_); }while(0) +  +  + typedef int (*cmpfun)(struct svalue *,struct svalue *); + typedef int (*short_cmpfun)(union anything *, union anything *); + typedef short_cmpfun (*cmpfun_getter)(TYPE_T); +  +  + /* Prototypes begin here */ + struct array *allocate_array_no_init(INT32 size,INT32 extra_space,TYPE_T type); + struct array *allocate_array(INT32 size,TYPE_T type); + void really_free_array(struct array *v); + void array_index_no_free(struct svalue *s,struct array *v,INT32 index); + void array_index(struct svalue *s,struct array *v,INT32 index); + void simple_array_index(struct svalue *s,struct array *a,struct svalue *ind); + void simple_array_index_no_free(struct svalue *s,struct array *a,struct svalue *ind); + void array_free_index(struct array *v,INT32 index); + void array_set_index(struct array *v,INT32 index, struct svalue *s); + void simple_set_index(struct array *a,struct svalue *ind,struct svalue *s); + struct array *array_insert(struct array *v,struct svalue *s,INT32 index); + struct array *array_shrink(struct array *v,INT32 size); + struct array *array_remove(struct array *v,INT32 index); + INT32 array_search(struct array *v, struct svalue *s,INT32 start); + struct array *slice_array(struct array *v,INT32 start,INT32 end); + struct array *copy_array(struct array *v); + void check_array_for_destruct(struct array *v); + INT32 array_find_destructed_object(struct array *v); + INT32 *get_order(struct array *v, cmpfun fun,cmpfun_getter backfun); + INT32 *get_set_order(struct array *a); + INT32 *get_switch_order(struct array *a); + INT32 set_lookup(struct array *a, struct svalue *s); + INT32 switch_lookup(struct array *a, struct svalue *s); + struct array *order_array(struct array *v, INT32 *order); + struct array *reorder_and_copy_array(struct array *v, INT32 *order); + void array_fix_type_field(struct array *v); + struct array *compact_array(struct array *v); + union anything *low_array_get_item_ptr(struct array *a, +  INT32 ind, +  TYPE_T t); + union anything *array_get_item_ptr(struct array *a, +  struct svalue *ind, +  TYPE_T t); + INT32 * merge(struct array *a,struct array *b,INT32 opcode); + struct array *array_zip(struct array *a, struct array *b,INT32 *zipper); + struct array *add_arrays(struct svalue *argp, INT32 args); + int array_equal_p(struct array *a, struct array *b, struct processing *p); + struct array *merge_array_with_order(struct array *a, struct array *b,INT32 op); + struct array *merge_array_without_order(struct array *a, +  struct array *b, +  INT32 op); + struct array *subtract_arrays(struct array *a, struct array *b); + struct array *and_arrays(struct array *a, struct array *b); + int check_that_array_is_constant(struct array *a); + node *make_node_from_array(struct array *a); + void push_array_items(struct array *a); + void describe_array_low(struct array *a, struct processing *p, int indent); + void simple_describe_array(struct array *a); + void describe_index(struct array *a, +  int e, +  struct processing *p, +  int indent); + void describe_array(struct array *a,struct processing *p,int indent); + struct array *aggregate_array(INT32 args, TYPE_T type); + struct array *explode(struct lpc_string *str, +  struct lpc_string *del); + struct lpc_string *implode(struct array *a,struct lpc_string *del); + struct array *copy_array_recursively(struct array *a,struct processing *p); + void apply_array(struct array *a, INT32 args); + struct array *reverse_array(struct array *a); + void array_replace(struct array *a, +  struct svalue *from, +  struct svalue *to); + void check_all_arrays(); + /* Prototypes end here */ +  +  + #endif   Newline at end of file added.