File: attr_impl.h

package info (click to toggle)
xview 3.2p1.4-4
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 20,068 kB
  • ctags: 24,304
  • sloc: ansic: 241,105; yacc: 1,392; sh: 1,140; makefile: 273; lex: 76; perl: 54; asm: 50; cpp: 15
file content (48 lines) | stat: -rw-r--r-- 1,241 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*      @(#)attr_impl.h 20.13 90/11/13 SMI      */

/*
 *	(c) Copyright 1989 Sun Microsystems, Inc. Sun design patents 
 *	pending in the U.S. and foreign countries. See LEGAL NOTICE 
 *	file for terms of the license.
 */

#ifndef _attr_impl_h_already_included
#define	_attr_impl_h_already_included

#include <xview/attr.h>
#include <xview_private/portable.h>

/* size of an attribute */
#define	ATTR_SIZE	(sizeof(Attr_attribute))

#define avlist_get(avlist)      *(avlist)++

/*
 * Copy count elements from list to dest. Advance both list and dest to the
 * next element after the last one copied.
 */
#define	avlist_copy(avlist, dest, count)	\
    { \
        XV_BCOPY((char *) avlist, (char *) dest, (int)(count * ATTR_SIZE)); \
        avlist += count; \
        dest += count; \
    }

/*
 * A macro to copy attribute values count is the number of Xv_opaque size
 * chunks to copy.
 */
#define	avlist_copy_values(avlist, dest, count) \
    if (count == 1) \
        *dest++ = avlist_get(avlist); \
    else { \
	avlist_copy(avlist, dest, count); \
    }


/* package private routines */
extern Attr_avlist	attr_copy_avlist();
extern int		attr_count_avlist();
extern Attr_avlist	attr_copy_valist();

#endif _attr_impl_h_already_included