MCPcopy Create free account
hub / github.com/Singular/Singular / typeSharedObject

Function typeSharedObject

Singular/dyn_modules/systhreads/shared.cc:888–917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888BOOLEAN typeSharedObject(leftv result, leftv arg) {
889 if (wrong_num_args("findSharedObject", arg, 1))
890 return TRUE;
891 if (not_a_uri("findSharedObject", arg))
892 return TRUE;
893 string uri = str(arg);
894 SharedObject *obj = findSharedObject(global_objects,
895 &global_objects_lock, uri);
896 int type = obj ? obj->get_type() : -1;
897 const char *type_name = "undefined";
898 if (type == type_channel)
899 type_name = "channel";
900 else if (type == type_atomic_table)
901 type_name = "atomic_table";
902 else if (type == type_shared_table)
903 type_name = "shared_table";
904 else if (type == type_atomic_list)
905 type_name = "atomic_list";
906 else if (type == type_shared_list)
907 type_name = "shared_list";
908 else if (type == type_syncvar)
909 type_name = "syncvar";
910 else if (type == type_region)
911 type_name = "region";
912 else if (type == type_regionlock)
913 type_name = "regionlock";
914 result->rtyp = STRING_CMD;
915 result->data = (char *)(omStrDup(type_name));
916 return FALSE;
917}
918
919BOOLEAN bindSharedObject(leftv result, leftv arg) {
920 if (wrong_num_args("bindSharedObject", arg, 1))

Callers

nothing calls this directly

Calls 5

wrong_num_argsFunction · 0.85
not_a_uriFunction · 0.85
strFunction · 0.85
findSharedObjectFunction · 0.85
get_typeMethod · 0.80

Tested by

no test coverage detected