|
|
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 m
Length: 1560 (0x618)
Types: TextFile
Names: »moidalloc.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦e83f91978⟧ »EurOpenD22/isode/osimis-2.0.tar.Z«
└─⟦d846658bd⟧
└─⟦this⟧ »osimis/sma/moidalloc.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.
*/
/* moidalloc.c - malloc and fill a MO_ID */
/*
* By Simon Walton, October 1988
*/
#include <stdio.h>
#include "isode/rosap.h"
#include "msap.h"
extern char * malloc();
extern OID oid_copy();
/* VARARGS2 */
MO_ID * moid_alloc(o, s, i)
char * o, * s;
int i;
{
MO_ID * n;
if ( (n = (MO_ID*) malloc(sizeof (*n))) == NULL) return (NULL);
n -> Next = NULL;
if (oid_copy(str2oid(o), &n -> rdntype) == NULL) return (NULL);
if (s)
{
n -> rdnval[0] = 1;
(void) strncpy(n -> rdnval+1, s, 9);
n -> rdnlen = strlen(s) + 1;
return (n);
}
if (i == -1)
{
n -> rdnlen = 0;
return (n);
}
n -> rdnval[0] = 0;
bcopy((char*) &i, n -> rdnval+1, sizeof(int));
n -> rdnlen = sizeof(int) + 1;
return (n);
}