\( % Arcus cosine. \def\acos{\cos^{-1}} % Vector projection. \def\projection#1#2{{proj_{#1}\left(#2\right)}} % Vector rejection. \def\rejection#1#2{{rej_{#1}\left(#2\right)}} % Norm. \def\norm#1{{\left\|#1\right\|}} % Cross product. \def\cross#1#2{\mathit{cross}\left(#1,#2\right)} % Dot product. \def\dot#1#2{{#1 \cdot #2}} % Magnitude. \def\mag#1{{\left|#1\right}} \def\group#1{\left(#1\right)}} \def\sbgrp#1{\left\{#1\right\}} \)

Ring1_GetHashCallback

The type of a "hash" callback function used by collections.

typedef Ring1_Result (Ring1_GetHashCallback)(int64_t *result, void* element);

A function of this type can be associated with certain collections. The function will be invoked by the associated collection when the hash value of an element needs to be computed. A pointer to the element is passed to the function as its 2nd argument, a pointer to the variable to assign the hash value to as its 1st argument. A "hash" callback function must not mutate the collection. One can safely define a "hash" callback with a more specialized pointer type than void.

Parameter variables

result
A pointer to the int64_t variable.
key
A pointer to the element.

Success

*result is assigned the hash value of the element.

Failure

result is not dereferenced.

Return value

Ring1_Result_Success on success. Ring1_Result_Failure on failure.