blob: e7130a4ab1c2dce62df00ace369b027299dc925c [file] [log] [blame]
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00001/* Set up a session using libdwfl.
2 Copyright (C) 2005 Red Hat, Inc.
3
4 This program is Open Source software; you can redistribute it and/or
5 modify it under the terms of the Open Software License version 1.0 as
6 published by the Open Source Initiative.
7
8 You should have received a copy of the Open Software License along
9 with this program; if not, you may obtain a copy of the Open Software
10 License version 1.0 from http://www.opensource.org/licenses/osl.php or
11 by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
12 3001 King Ranch Road, Ukiah, CA 95482. */
13
14#include "libdwflP.h"
15
16Dwfl *
17dwfl_begin (const Dwfl_Callbacks *callbacks)
18{
19 if (elf_version (EV_CURRENT) == EV_NONE)
20 {
21 __libdwfl_seterrno (DWFL_E_LIBELF);
22 return NULL;
23 }
24
25 Dwfl *dwfl = calloc (1, sizeof *dwfl);
26 if (dwfl == NULL)
27 __libdwfl_seterrno (DWFL_E_NOMEM);
28 else
29 dwfl->callbacks = callbacks;
30
31 return dwfl;
32}
33INTDEF (dwfl_begin)