+/* For lval_computed values, this structure holds functions used to
+ retrieve and set the value (or portions of the value).
+
+ For each function, 'V' is the 'this' pointer: an lval_funcs
+ function F may always assume that the V it receives is an
+ lval_computed value, and has F in the appropriate slot of its
+ lval_funcs structure. */
+
+struct lval_funcs
+{
+ /* Fill in VALUE's contents. This is used to "un-lazy" values. If
+ a problem arises in obtaining VALUE's bits, this function should
+ call 'error'. If it is NULL value_fetch_lazy on "un-lazy"
+ non-optimized-out value is an internal error. */
+ void (*read) (struct value *v);
+
+ /* Handle an assignment TOVAL = FROMVAL by writing the value of
+ FROMVAL to TOVAL's location. The contents of TOVAL have not yet
+ been updated. If a problem arises in doing so, this function
+ should call 'error'. If it is NULL such TOVAL assignment is an error as
+ TOVAL is not considered as an lvalue. */
+ void (*write) (struct value *toval, struct value *fromval);
+
+ /* Check the validity of some bits in VALUE. This should return 1
+ if all the bits starting at OFFSET and extending for LENGTH bits
+ are valid, or 0 if any bit is invalid. */
+ int (*check_validity) (const struct value *value, int offset, int length);
+
+ /* Return 1 if any bit in VALUE is valid, 0 if they are all invalid. */
+ int (*check_any_valid) (const struct value *value);
+
+ /* If non-NULL, this is used to implement pointer indirection for
+ this value. This method may return NULL, in which case value_ind
+ will fall back to ordinary indirection. */
+ struct value *(*indirect) (struct value *value);
+
+ /* If non-NULL, this is used to implement reference resolving for
+ this value. This method may return NULL, in which case coerce_ref
+ will fall back to ordinary references resolving. */
+ struct value *(*coerce_ref) (const struct value *value);
+
+ /* If non-NULL, this is used to determine whether the indicated bits
+ of VALUE are a synthetic pointer. */
+ int (*check_synthetic_pointer) (const struct value *value,
+ int offset, int length);
+
+ /* Return a duplicate of VALUE's closure, for use in a new value.
+ This may simply return the same closure, if VALUE's is
+ reference-counted or statically allocated.
+
+ This may be NULL, in which case VALUE's closure is re-used in the
+ new value. */
+ void *(*copy_closure) (const struct value *v);
+
+ /* Drop VALUE's reference to its closure. Maybe this frees the
+ closure; maybe this decrements a reference count; maybe the
+ closure is statically allocated and this does nothing.
+
+ This may be NULL, in which case no action is taken to free
+ VALUE's closure. */
+ void (*free_closure) (struct value *v);
+};
+
+/* Create a computed lvalue, with type TYPE, function pointers FUNCS,
+ and closure CLOSURE. */
+
+extern struct value *allocate_computed_value (struct type *type,
+ const struct lval_funcs *funcs,
+ void *closure);
+
+/* Helper function to check the validity of some bits of a value.
+
+ If TYPE represents some aggregate type (e.g., a structure), return 1.
+
+ Otherwise, any of the bytes starting at OFFSET and extending for
+ TYPE_LENGTH(TYPE) bytes are invalid, print a message to STREAM and
+ return 0. The checking is done using FUNCS.
+
+ Otherwise, return 1. */
+
+extern int valprint_check_validity (struct ui_file *stream, struct type *type,
+ int embedded_offset,
+ const struct value *val);
+
+extern struct value *allocate_optimized_out_value (struct type *type);
+
+/* If VALUE is lval_computed, return its lval_funcs structure. */
+
+extern const struct lval_funcs *value_computed_funcs (const struct value *);
+
+/* If VALUE is lval_computed, return its closure. The meaning of the
+ returned value depends on the functions VALUE uses. */
+
+extern void *value_computed_closure (const struct value *value);
+