-#ifdef DEBUGGING
-#define CASE_INLINE
-#else
-#define CASE_INLINE static
-#endif
-
-CASE_INLINE void case_nullify (struct ccase *);
-CASE_INLINE int case_is_null (const struct ccase *);
-
-void case_create (struct ccase *, size_t value_cnt);
-CASE_INLINE void case_clone (struct ccase *, const struct ccase *);
-CASE_INLINE void case_move (struct ccase *, struct ccase *);
-CASE_INLINE void case_destroy (struct ccase *);
+struct ccase *case_create (const struct caseproto *) MALLOC_LIKE;
+struct ccase *case_try_create (const struct caseproto *) MALLOC_LIKE;
+struct ccase *case_clone (const struct ccase *) MALLOC_LIKE;
+
+static inline struct ccase *case_unshare (struct ccase *) WARN_UNUSED_RESULT;
+struct ccase *case_ref (const struct ccase *) WARN_UNUSED_RESULT;
+static inline void case_unref (struct ccase *);
+static inline bool case_is_shared (const struct ccase *);
+
+static inline size_t case_get_value_cnt (const struct ccase *);
+static inline const struct caseproto *case_get_proto (const struct ccase *);
+
+size_t case_get_cost (const struct caseproto *);
+
+struct ccase *case_resize (struct ccase *, const struct caseproto *)
+ WARN_UNUSED_RESULT;
+struct ccase *case_unshare_and_resize (struct ccase *,
+ const struct caseproto *)
+ WARN_UNUSED_RESULT;
+
+void case_set_missing (struct ccase *);
+
+void case_copy (struct ccase *dst, size_t dst_idx,
+ const struct ccase *src, size_t src_idx,
+ size_t cnt);
+void case_copy_out (const struct ccase *,
+ size_t start_idx, union value *, size_t n_values);
+void case_copy_in (struct ccase *,
+ size_t start_idx, const union value *, size_t n_values);
+
+const union value *case_data (const struct ccase *, const struct variable *);
+const union value *case_data_idx (const struct ccase *, size_t idx);
+union value *case_data_rw (struct ccase *, const struct variable *);
+union value *case_data_rw_idx (struct ccase *, size_t idx);
+
+double case_num (const struct ccase *, const struct variable *);
+double case_num_idx (const struct ccase *, size_t idx);
+double *case_num_rw (struct ccase *, const struct variable *);
+double *case_num_rw_idx (struct ccase *, size_t idx);
+
+const uint8_t *case_str (const struct ccase *, const struct variable *);
+const uint8_t *case_str_idx (const struct ccase *, size_t idx);
+struct substring case_ss (const struct ccase *, const struct variable *);
+struct substring case_ss_idx (const struct ccase *, size_t width, size_t idx);
+uint8_t *case_str_rw (struct ccase *, const struct variable *);
+uint8_t *case_str_rw_idx (struct ccase *, size_t idx);