|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T o
Length: 3207 (0xc87)
Types: TextFile
Names: »objclass.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦e83f91978⟧ »EurOpenD22/isode/osimis-2.0.tar.Z«
└─⟦d846658bd⟧
└─⟦this⟧ »osimis/smap/objclass.c«
/*
* Copyright (c) 1988 University College London
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the Department of Computer Science, University College London.
* The name of the University may not be used to
* endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* Routines mapping managed object classes to object types */
/*
* By George Pavlou, October 1988
*/
#include <stdio.h>
#include "isode/rosap.h"
#include "msap.h"
#include "objectS.h"
OID objtype2class (type)
int type;
{
switch (type) {
case M_SYSTEM:
return (oid_cpy(str2oid("2.37.1.1")));
case T_SUBSYS:
return (oid_cpy(str2oid("2.37.1.2")));
case T_ENTITY:
return (oid_cpy(str2oid("2.37.1.3")));
case T_EINV:
return (oid_cpy(str2oid("2.37.1.4")));
case T_CEPT:
return (oid_cpy(str2oid("2.37.1.5")));
case C_THLD:
return (oid_cpy(str2oid("2.37.3.1")));
case G_THLD:
return (oid_cpy(str2oid("2.37.3.2")));
case RPCTL:
return (oid_cpy(str2oid("2.37.3.3")));
default:
advise(NULLCP, "objtype2class: unknown objtype %d", type);
return (NULLOID);
}
}
int objclass2type (class)
OID class;
{
if (oid_cmp(class, str2oid("2.37.1.1")) == 0)
return (M_SYSTEM);
else
if (oid_cmp(class, str2oid("2.37.1.2")) == 0)
return (T_SUBSYS);
else
if (oid_cmp(class, str2oid("2.37.1.3")) == 0)
return (T_ENTITY);
else
if (oid_cmp(class, str2oid("2.37.1.4")) == 0)
return (T_EINV);
else
if (oid_cmp(class, str2oid("2.37.1.5")) == 0)
return (T_CEPT);
else
if (oid_cmp(class, str2oid("2.37.3.1")) == 0)
return (C_THLD);
else
if (oid_cmp(class, str2oid("2.37.3.2")) == 0)
return (G_THLD);
else
if (oid_cmp(class, str2oid("2.37.3.3")) == 0)
return (RPCTL);
else {
advise(NULLCP, "objclass2type: unknown class %s", sprintoid(class));
return (NOTOK);
}
}
int rdn2type (rdn)
MO_ID *rdn;
{
OID type = &rdn->rdntype;
if (oid_cmp(type, str2oid("2.37.1.1.1")) == 0)
return (M_SYSTEM);
else
if (oid_cmp(type, str2oid("2.37.1.2.1")) == 0)
return (T_SUBSYS);
else
if (oid_cmp(type, str2oid("2.37.1.3.1")) == 0)
return (T_ENTITY);
else
if (oid_cmp(type, str2oid("2.37.1.4.1")) == 0)
return (T_EINV);
else
if (oid_cmp(type, str2oid("2.37.1.5.1")) == 0)
return (T_CEPT);
else
if (oid_cmp(type, str2oid("2.37.3.1.1")) == 0)
return (C_THLD);
else
if (oid_cmp(type, str2oid("2.37.3.2.1")) == 0)
return (G_THLD);
else
if (oid_cmp(type, str2oid("2.37.3.3.1")) == 0)
return (RPCTL);
else {
advise(NULLCP, "rdn2type: unknown rdntype %s", sprintoid(type));
return (NOTOK);
}
}