Add an internal-representation no-op function.
[u/mdw/catacomb] / field.c
CommitLineData
2685767a 1/* -*-c-*-
2 *
3 * $Id: field.c,v 1.1 2001/05/07 17:30:13 mdw Exp $
4 *
5 * [Abstract field operations *
6 * (c) 2001 Straylight/Edgeware
7 */
8
9/*----- Licensing notice --------------------------------------------------*
10 *
11 * This file is part of Catacomb.
12 *
13 * Catacomb is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU Library General Public License as
15 * published by the Free Software Foundation; either version 2 of the
16 * License, or (at your option) any later version.
17 *
18 * Catacomb is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Library General Public License for more details.
22 *
23 * You should have received a copy of the GNU Library General Public
24 * License along with Catacomb; if not, write to the Free
25 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26 * MA 02111-1307, USA.
27 */
28
29/*----- Revision history --------------------------------------------------*
30 *
31 * $Log: field.c,v $
32 * Revision 1.1 2001/05/07 17:30:13 mdw
33 * Add an internal-representation no-op function.
34 *
35 */
36
37/*----- Header files ------------------------------------------------------*/
38
39#include "field.h"
40#include "mp.h"
41
42/*----- Main code ---------------------------------------------------------*/
43
44/* --- @field_id@ --- *
45 *
46 * Arguments: @field *f@ = pointer to a field
47 * @mp *d@ = a destination element
48 * @mp *x@ = a source element
49 *
50 * Returns: The result element.
51 *
52 * Use: An identity operation which can be used if your field has no
53 * internal representation.
54 */
55
56mp *field_id(field *f, mp *d, mp *x)
57{
58 x = MP_COPY(x);
59 if (d) MP_DROP(d);
60 return (x);
61}
62
63/*----- That's all, folks -------------------------------------------------*/