Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / tt / bin / dbck / prop.C
1 //%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                  
2 //%%  (c) Copyright 1993, 1994 International Business Machines Corp.    
3 //%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                   
4 //%%  (c) Copyright 1993, 1994 Novell, Inc.                             
5 //%%  $XConsortium: prop.C /main/3 1995/10/20 16:26:03 rswiston $                                                       
6 /*
7  *
8  * prop.cc
9  *
10  * Copyright (c) 1990 by Sun Microsystems, Inc.
11  */
12
13 #include <stddef.h>
14 #include <stdio.h>
15 #include <errno.h>
16 #if defined(ultrix)
17 #include <sys/types.h>
18 #endif
19 #include <sys/stat.h>     
20 #include "prop.h"
21 #include "ttdbck.h"
22
23 // A Prop just holds the name and its list of values.
24 // We probably have 600 classes that do this by now.
25
26 Prop::
27 Prop(_Tt_string propname)
28 {
29         _name = propname;
30         _values = new _Tt_string_list();
31 }
32
33 void Prop::
34 print(FILE *f) const
35 {
36         fprintf(f,"Prop<");
37         _name->print(f);
38         fprintf(f,"=<");
39         _values->print(_tt_string_print,f);
40         fprintf(f,">>\n");
41 }
42
43 _Tt_string
44 _tt_prop_name(_Tt_object_ptr &o)
45 {
46         return(((Prop *)o.c_pointer())->name());
47 }