Skip to content
Snippets Groups Projects
Select Git revision
  • 1ba498dc00ab0e15ea9b91adb2b0144d465f77a1
  • master default protected
  • 9.0
  • 8.0
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • nt-tools
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
  • v8.0.1982
  • v8.0.1980
  • v8.0.1978
  • v8.0.1976
  • v8.0.1974
  • v8.0.1972
  • v8.0.1970
  • v8.0.1968
  • v8.0.1966
41 results

fdlib.c

Blame
  • Program.pmod 1.16 KiB
    #pike __REAL_VERSION__
    #pragma strict_types
    
    constant inherit_list = __builtin.inherit_list;
    constant inherits = __builtin.program_inherits;
    constant implements = __builtin.program_implements;
    constant defined = __builtin.program_defined;
    
    //! @fixme
    //!   Document this function.
    array(program) all_inherits(program p)
    {
      array(program) ret = inherit_list(p);
      for(int e=0;e<sizeof(ret);e++) ret+=inherit_list(ret[e]);
      return ret;
    }
    
    //! Recursively builds a inheritance tree by
    //! fetching programs inheritance lists.
    //!
    //! @returns
    //!  Returns an array with programs or arrays
    //!  as elements.
    //!
    //! @example
    //!  > class a{}
    //!  > class b{}
    //!  > class c{ inherit a; }
    //!  > class d{ inherit b; inherit c; }
    //!  > Program.inherit_tree(d);
    //!  Result: ({ /* 3 elements */
    //!              d,
    //!              ({ /* 1 element */
    //!                  program
    //!              }),
    //!              ({ /* 2 elements */
    //!                  c,
    //!                  ({ /* 1 element */
    //!                      program
    //!                  })
    //!              })
    //!          })
    array inherit_tree(program p)
    {
      return ({ p })+
        Array.map(inherit_list(p),inherit_tree);
    }