Skip to content

Commit

Permalink
Added functions GetChar and CharValue to libgap api
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasguts committed Nov 14, 2018
1 parent 48047f3 commit b756d0c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/libgap-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,16 @@ char * GAP_CSTR_STRING(Obj string)
return 0;
return CSTR_STRING(string);
}

UChar GAP_CharValue(Obj obj)
{
if (TNUM_OBJ(obj) != T_CHAR) {
ErrorQuit("GAP_CharValue: argument is not a char", 0, 0);
}
return CHAR_VALUE(obj);
}

Obj GAP_GetChar(UChar obj)
{
return ObjsChar[obj];
}
6 changes: 6 additions & 0 deletions src/libgap-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,11 @@ extern Obj GAP_MakeString(const char * string);
// terminated C string.
extern Obj GAP_MakeImmString(const char * string);

// Returns the value of the GAP char <obj>.
// If <obj> is not a GAP char, an error is raised.
extern UChar GAP_CharValue(Obj obj);

// Returns the char Obj corresponding to <obj>
extern Obj GAP_GetChar(UChar obj);

#endif

0 comments on commit b756d0c

Please sign in to comment.