dd10eb1997-03-04Niels Möller /* Crypto.pmod * */
a580e12000-09-27Fredrik Hübinette (Hubbe) #pike __REAL_VERSION__
a20af62000-09-26Fredrik Hübinette (Hubbe) 
bc57c12002-06-07Martin Nilsson private mixed crypto_module;
dd10eb1997-03-04Niels Möller 
bc57c12002-06-07Martin Nilsson static mixed `[](string name)
dd10eb1997-03-04Niels Möller {
1ee6941997-05-30Henrik Grubbström (Grubba)  catch {
e424aa1997-11-19Fredrik Hübinette (Hubbe)  return (crypto_module[name]
1ee6941997-05-30Henrik Grubbström (Grubba)  || ((program) ("Crypto/" + name)) || ((object) ("Crypto/" + name + ".pmod"))); };
5519b22002-02-14Martin Nilsson  return UNDEFINED;
dd10eb1997-03-04Niels Möller }
bc57c12002-06-07Martin Nilsson private array(string) crypto_indices;
5519b22002-02-14Martin Nilsson 
bc57c12002-06-07Martin Nilsson static array(string) _indices() {
5519b22002-02-14Martin Nilsson  if(crypto_indices) return crypto_indices + ({});
cf5d562001-11-05Martin Nilsson  array tmp = ( __FILE__ / "/"); tmp[-1] = "Crypto"; tmp = get_dir(tmp*"/");
5519b22002-02-14Martin Nilsson  crypto_indices = map(glob("*.pike",tmp)+glob("*.pmod",tmp), lambda(string in){ return in[..sizeof(in)-6]; }) +
cf5d562001-11-05Martin Nilsson  indices(crypto_module);
5519b22002-02-14Martin Nilsson  return crypto_indices + ({});
cf5d562001-11-05Martin Nilsson }
bc57c12002-06-07Martin Nilsson static void create()
e424aa1997-11-19Fredrik Hübinette (Hubbe) {
5519b22002-02-14Martin Nilsson #if constant(_Crypto) crypto_module=master()->resolv("_Crypto"); #else crypto_module=master()->resolv("_Lobotomized_Crypto"); #endif
e424aa1997-11-19Fredrik Hübinette (Hubbe) }