Indexes have type size_t, an unsigned integral type defined by your compiler, usually in <stddef.h>. Because size_t is unsigned, it allows indexes up to 64k minus one under 16-bit DOS.
Invalid indexes are signified by the special value RW_NPOS, defined in <rw/defs.h>.