Skip to content
Snippets Groups Projects
Select Git revision
  • fb2c801df91d09e6736835edfa8585579aacf7b8
  • master default
  • wip-slh-dsa-sha2-128s
  • master-updates
  • release-3.10-fixes
  • getopt-prototype
  • fix-bcrypt-warning
  • refactor-hmac
  • wip-use-alignas
  • trim-sha3-context
  • fix-gitlab-ci
  • check-fat-emulate
  • delete-digest_func-size
  • slh-dsa-shake-128f-nettle
  • slh-dsa-shake-128s-nettle
  • slh-dsa-shake-128s
  • delete-openpgp
  • ppc64-sha512
  • delete-md5-compat
  • cleanup-hmac-tests
  • ppc64-sha256
  • nettle_3.10.2_release_20250626
  • nettle_3.10.1_release_20241230
  • nettle_3.10_release_20240616
  • nettle_3.10rc2
  • nettle_3.10rc1
  • nettle_3.9.1_release_20230601
  • nettle_3.9_release_20230514
  • nettle_3.8.1_release_20220727
  • nettle_3.8_release_20220602
  • nettle_3.7.3_release_20210606
  • nettle_3.7.2_release_20210321
  • nettle_3.7.1_release_20210217
  • nettle_3.7_release_20210104
  • nettle_3.7rc1
  • nettle_3.6_release_20200429
  • nettle_3.6rc3
  • nettle_3.6rc2
  • nettle_3.6rc1
  • nettle_3.5.1_release_20190627
  • nettle_3.5_release_20190626
41 results

testutils.h

Blame
  • Local.pmod 1.82 KiB
    #pike __REAL_VERSION__
    
    //! @[Local] gives a local module namespace used for locally
    //! installed pike modules. Modules are searched for in
    //! the directory @tt{pike_modules@} which can be located in
    //! the user's home directory or profile directory, or in any
    //! of the system directories @tt{/opt/share, /usr/local/share,
    //! /opt@} or @tt{/usr/local/@}. The user's home directory is
    //! determined by examining the environment variable HOME, and
    //! if that fails the environment variable USERPROFILE. If the 
    //! environment variable PIKE_LOCAL_PATH is set, the paths specified
    //! there will be searched first.
    //! @seealso
    //!   @[Local.add_path()], @[Local.remove_path()]
    //!
    
    inherit __joinnode;
    
    protected array(string) local_path;
    
    protected void create()
    {
      ::create(({}));
    
      // FIXME $prefix/pike_modules
      // FIXME All this should be controllable from .pikerc, when such a file is implemented...
    
      add_path("/usr/local/pike_modules");
      add_path("/opt/pike_modules");
      add_path("/opt/share/pike_modules");
      add_path("/usr/local/share/pike_modules");
    
      string tmp;
      if( (tmp=[string]getenv("HOME")) || (tmp=[string]getenv("USERPROFILE")) ) {
        tmp = (tmp[-1]=='/'?tmp:tmp+"/")+"pike_modules/";
        add_path(tmp);
      }
    
      if(tmp = [string]getenv("PIKE_LOCAL_PATH") ) {
        array to_add=reverse(tmp/":"); // preserve order
        add_path( to_add[*] ); 
      }
    }
    
    //! @decl int(0..1) add_path(string path)
    //!
    //! This function prepends @[path] to the @[Local] module
    //! searchpath.
    //!
    //! @param path
    //!   The path to the directory to be added.
    //!
    //! @returns
    //!   Returns 1 on success, otherwise 0.
    
    //! This function removes @[path] from the @[Local] module
    //! searchpath. If @[path] is not in the search path, this is
    //! a noop.
    //!
    //! @param path
    //!   The path to be removed.
    //!
    void remove_path(string path)
    {
      rem_path(path);
    }