Blame lib/boxed.c

Packit Service 407539
/* Copyright (C) 2011 Red Hat
Packit Service 407539
   This file is part of LibGTop 1.0.
Packit Service 407539
Packit Service 407539
   Contributed by Jasper St. Pierre <jstpierre@mecheye.net>, November 2011
Packit Service 407539
Packit Service 407539
   LibGTop is free software; you can redistribute it and/or modify it
Packit Service 407539
   under the terms of the GNU General Public License as published by
Packit Service 407539
   the Free Software Foundation; either version 2 of the License,
Packit Service 407539
   or (at your option) any later version.
Packit Service 407539
Packit Service 407539
   LibGTop is distributed in the hope that it will be useful, but WITHOUT
Packit Service 407539
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit Service 407539
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
Packit Service 407539
   for more details.
Packit Service 407539
Packit Service 407539
   You should have received a copy of the GNU General Public License
Packit Service 407539
   along with LibGTop; see the file COPYING. If not, write to the
Packit Service 407539
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service 407539
   Boston, MA 02111-1307, USA.
Packit Service 407539
*/
Packit Service 407539
Packit Service 407539
#include <glibtop.h>
Packit Service 407539
#include <glibtop/mountlist.h>
Packit Service 407539
#include <glibtop/procmap.h>
Packit Service 407539
#include <glibtop/procopenfiles.h>
Packit Service 407539
Packit Service 407539
#define DEFINE_BOXED(type)                              \
Packit Service 407539
    static type *                                       \
Packit Service 407539
    type##_copy (type *p)                               \
Packit Service 407539
    {                                                   \
Packit Service 407539
        type *n = g_new (type, 1);                      \
Packit Service 407539
        memcpy (n, p, sizeof (type));                   \
Packit Service 407539
        return n;                                       \
Packit Service 407539
    }                                                   \
Packit Service 407539
                                                        \
Packit Service 407539
    G_DEFINE_BOXED_TYPE (type,                          \
Packit Service 407539
                         type,                          \
Packit Service 407539
                         type##_copy,                   \
Packit Service 407539
                         g_free)
Packit Service 407539
Packit Service 407539
DEFINE_BOXED (glibtop);
Packit Service 407539
DEFINE_BOXED (glibtop_map_entry);
Packit Service 407539
DEFINE_BOXED (glibtop_proc_map);
Packit Service 407539
DEFINE_BOXED (glibtop_open_files_entry);
Packit Service 407539
DEFINE_BOXED (glibtop_proc_open_files);
Packit Service 407539
DEFINE_BOXED (glibtop_mountentry);
Packit Service 407539
DEFINE_BOXED (glibtop_mountlist);