static Handle new_handle (handle_state h_s) { Handle retval; switch (h_s) { case handle_nil: retval = 0; break; case handle_nil_master: retval = NewEmptyHandle (); break; case handle_zero_length: retval = NewHandle (0); break; case handle_valid_unlocked: case handle_valid_locked: retval = handle_from_c_string ("I don't repeat once. I say twice twice."); if (h_s == handle_valid_locked) HLock (retval); break; } return retval; }
Handle NewHandle(Size byteCount) { Handle h = NewEmptyHandle(); if (!h) return NULL; ReallocateHandle(h, byteCount); return h; }