pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.c:1:
/* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: program.c,v 1.
726
2008/06/28
11
:
01
:
53
mast Exp $
+
|| $Id: program.c,v 1.
727
2008/06/28
21
:
50
:
10
mast Exp $
*/ #include "global.h" #include "program.h" #include "object.h" #include "dynamic_buffer.h" #include "pike_types.h" #include "stralloc.h" #include "las.h" #include "lex.h"
pike.git/src/program.c:271:
*! @[`->=()], @[`+=()], @[`()()] *! *! @item *! Overloading of other builtin functions. *! *! @[_is_type()], @[_sprintf()], @[_m_delete()], *! @[_get_iterator()], @[_search()] *! @endul *! *! @note
-
*! Although these functions are called from outside the object
-
*!
they
exist in, they will still be used even if they are
-
*!
declared @expr{static@}
. It is in fact recommended to declare
-
*!
them @expr{static@}
, since that will hinder them being used
-
*!
for
other purposes.
+
*! Although these functions are called from outside the object
they
+
*! exist in, they will still be used even if they are
declared
+
*!
@expr{protected@}
. It is in fact recommended to declare
them
+
*!
@expr{protected@}
, since that will hinder them being used
for
+
*! other purposes.
*! *! @seealso *! @[::] */ /*! @decl void lfun::__INIT() *! *! Inherit and variable initialization. *! *! This function is generated automatically by the compiler. It's
pike.git/src/program.c:323:
*! class Foo(int foo) { *! int bar; *! } *! @endcode *! In the above case an implicit @[lfun::create()] is created, and *! it's equvivalent to: *! @code *! class Foo { *! int foo; *! int bar;
-
*!
static
void create(int foo)
+
*!
protected
void create(int foo)
*! { *! local::foo = foo; *! } *! } *! @endcode *! *! @seealso *! @[lfun::__INIT()], @[lfun::destroy()] */
pike.git/src/program.c:416:
*! destructs a parent object before all children have been *! destructed.) *! @endul *! *! An example with well defined destruct order due to strong *! references: *! *! @code *! class Super { *! class Sub {
-
*!
static
void destroy() {
+
*!
protected
void destroy() {
*! if (!Super::this) *! error ("My parent has been destructed!\n"); *! } *! } *! Sub sub = Sub();
-
*!
static
void destroy() {
+
*!
protected
void destroy() {
*! if (!sub) *! werror ("sub already destructed.\n"); *! } *! } *! @endcode *! *! The garbage collector ensures that these objects are destructed in *! an order so that @expr{werror@} in @expr{Super@} is called and not *! @expr{error@} in @expr{Sub@}. *!
pike.git/src/program.c:10337:
/* returns 1 if a implements b */ static int low_implements(struct program *a, struct program *b) { int e; struct pike_string *s=findstring("__INIT"); for(e=0;e<b->num_identifier_references;e++) { struct identifier *bid; int i; if (b->identifier_references[e].id_flags & (ID_STATIC|ID_HIDDEN))
-
continue; /* Skip
static
& hidden */
+
continue; /* Skip
protected
& hidden */
bid = ID_FROM_INT(b,e); if(s == bid->name) continue; /* Skip __INIT */ i = find_shared_string_identifier(bid->name,a); if (i == -1) { if (b->identifier_references[e].id_flags & (ID_OPTIONAL)) continue; /* It's ok... */ #if 0 fprintf(stderr, "Missing identifier \"%s\"\n", bid->name->str); #endif /* 0 */ return 0;
pike.git/src/program.c:10418:
struct program *tmp = a; a = b; b = tmp; } for(e=0;e<b->num_identifier_references;e++) { struct identifier *bid; int i; if (b->identifier_references[e].id_flags & (ID_STATIC|ID_HIDDEN))
-
continue; /* Skip
static
& hidden */
+
continue; /* Skip
protected
& hidden */
-
/* FIXME: What if they aren't
static
& hidden in a? */
+
/* FIXME: What if they aren't
protected
& hidden in a? */
bid = ID_FROM_INT(b,e); if(s == bid->name) continue; /* Skip __INIT */ i = find_shared_string_identifier(bid->name,a); if (i == -1) { continue; /* It's ok... */ } /* Note: Uses weaker check for constant integers. */ if(((bid->run_time_type != PIKE_T_INT) ||
pike.git/src/program.c:10540:
SET_CYCLIC_RET(1); a_file = get_program_line(a, &a_line); b_file = get_program_line(b, &b_line); for(e=0;e<b->num_identifier_references;e++) { struct identifier *bid; int i; if (b->identifier_references[e].id_flags & (ID_STATIC|ID_HIDDEN))
-
continue; /* Skip
static
& hidden */
+
continue; /* Skip
protected
& hidden */
-
/* FIXME: What if they aren't
static
& hidden in a? */
+
/* FIXME: What if they aren't
protected
& hidden in a? */
bid = ID_FROM_INT(b,e); if(s == bid->name) continue; /* Skip __INIT */ i = find_shared_string_identifier(bid->name,a); if (i == -1) { continue; /* It's ok... */ } /* Note: Uses weaker check for constant integers. */ if(((bid->run_time_type != PIKE_T_INT) ||
pike.git/src/program.c:10602:
SET_CYCLIC_RET(1); a_file = get_program_line(a, &a_line); b_file = get_program_line(b, &b_line); for(e=0;e<b->num_identifier_references;e++) { struct identifier *bid; int i; if (b->identifier_references[e].id_flags & (ID_STATIC|ID_HIDDEN))
-
continue; /* Skip
static
& hidden */
+
continue; /* Skip
protected
& hidden */
bid = ID_FROM_INT(b,e); if(s == bid->name) continue; /* Skip __INIT */ i = find_shared_string_identifier(bid->name,a); if (i == -1) { INT32 bid_line = b_line; struct pike_string *bid_file; if (b->identifier_references[e].id_flags & (ID_OPTIONAL)) continue; /* It's ok... */ bid_file = get_identifier_line(b, i, &bid_line); if (!bid_file) bid_file = b_file;