pike.git
/
src
/
post_modules
/
Nettle
/
hash.H
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/Nettle/hash.H:9:
*! DOCEND() PIKECLASS PIKE_NAME { DOCSTART() @decl inherit Hash DOCEND() INHERIT Hash; INIT {
-
struct Hash_struct *
Hash = (struct Hash_struct *)
-
get
_
inherit
_
storage
(
Pike_fp->current_object
,
-
1
+
-
(Pike
_
fp->context -
-
Pike_fp->current_
program
->inherits
)
)
;
+
struct Hash_struct *
hash;
+
ASSIGN
_
CURRENT
_
STORAGE
(
hash
,
struct
Hash_struct,
1
,
Hash
_program);
werror(cmod_STRFY_EVAL(PIKE_NAME) "->INIT\n");
-
if (Hash && !Hash
->meta
)
-
Hash->meta
= &cmod_CONCAT_EVAL(nettle_, NETTLE_NAME);
-
else {
-
/* Can't call Pike_error here.
-
* Pike_error("Can't initialize this object.\n"); */
-
werror(cmod_STRFY_EVAL(PIKE_NAME) "->INIT failed\n");
+
hash
->meta = &cmod_CONCAT_EVAL(nettle_, NETTLE_NAME);
}
-
}
+
DOCSTART() @class State *! *! State for PIKE_NAME hashing. *! DOCEND() PIKECLASS State program_flags PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT; { DOCSTART() @decl inherit Hash::State
pike.git/src/post_modules/Nettle/hash.H:64:
parent_prog->inherits[1].identifier_level, 1 + 42, 0, NULL); } } } CVAR struct cmod_CONCAT_EVAL(NETTLE_NAME, _ctx) NETTLE_NAME; INIT {
-
/* FIXME: Ought to traverse the inherit graph for
-
* the current program.
-
*/
-
struct Hash_State_struct *instance
= (struct Hash_State_struct *)
-
get
_
inherit
_
storage
(
Pike
_
fp->current
_
object
,
-
1
+
-
(Pike_fp->context
-
-
Pike
_
fp->current
_program
->inherits
)
)
;
+
struct Hash_State_struct *instance
;
+
ASSIGN
_
CURRENT
_
STORAGE
(
instance, struct Hash
_
State
_
struct
, 1
,
+
Hash
_
State
_program);
+
werror(cmod_STRFY_EVAL(PIKE_NAME) ".State->INIT\n");
-
assert(instance);
-
+
cmod_CONCAT_EVAL(NETTLE_NAME, _init)(&THIS->NETTLE_NAME); instance->ctx = &THIS->NETTLE_NAME; } } DOCSTART() @endclass State DOCEND() } DOCSTART() @endclass PIKE_NAME DOCEND()