(MOD) Refined Var, Array, CatlogMsg, CatlogSender, Status

This is the very first version that pass the compiler.  Though it has lots things were made for testing, such as commenting problematic source code to avoid irrelevant errors.  For test.c, everything is working fine.  Congrats!
This commit is contained in:
William
2024-05-20 04:47:39 +08:00
parent e73f3af436
commit e2f8dceda7
23 changed files with 656 additions and 393 deletions

View File

@@ -21,23 +21,33 @@ static Status InvalidArrayLength = {
};
/* Elementary. */
Status Array_Create(Array *inst, int len);
Status Array_Create(Array *inst, int len, size_t size)
throws(InsufficientMemory InvalidArrayLength);
Status Array_CopyOf(Array *inst, Array *other);
Status Array_Delete(Array *inst);
Status Array_GetIdx(Array *inst, Var *store, int index);
throws(ArrayIndexOutOfBound);
Status Array_SetIdx(Array *inst, Var *source, int index);
bool Array_Equal(Array *arr1, Array *arr2);
throws(ArrayIndexOutOfBound);
bool Array_Equals(Array *arr1, Array *arr2);
/* Extensional. */
Status ArrayUtils_Insert(Array *inst, Var *item, int index);
throws(ArrayIndexOutOfBound);
Status ArrayUtils_InsertArray(Array *inst, Array *items, int index);
throws(ArrayIndexOutOfBound);
Status ArrayUtils_Remove(Array *inst, int index);
throws(ArrayIndexOutOfBound);
Status ArrayUtils_RemoveArray(Array *inst, int off, int len);
throws(ArrayIndexOutOfBound InvalidArrayLength);
Status ArrayUtils_Subarray(Array *inst, Array *store, int off, int len);
throws(ArrayIndexOutOfBound InvalidArrayLength);
Status ArrayUtils_Fill(Array *inst, Var *elem, int off, int len);
throws(ArrayIndexOutOfBound InvalidArrayLength);
Status ArrayUtils_Search(Array *inst, Var *item, int *store);
Status ArrayUtils_SearchArray(Array *inst, Array *items, int *store);
Status ArrayUtils_Split(Array *inst, Array *fore, Array *rear, int index);
throws(ArrayIndexOutOfBound);
Status ArrayUtils_Revert(Array *inst);
bool ArrayUtils_IsEmpty(Array *inst);
bool ArrayUtils_IsBlank(Array *inst);