Blame debuginfod/debuginfod.h

Packit 032894
/* External declarations for the libdebuginfod client library.
Packit 032894
   Copyright (C) 2019 Red Hat, Inc.
Packit 032894
   This file is part of elfutils.
Packit 032894
Packit 032894
   This file is free software; you can redistribute it and/or modify
Packit 032894
   it under the terms of either
Packit 032894
Packit 032894
   * the GNU Lesser General Public License as published by the Free
Packit 032894
       Software Foundation; either version 3 of the License, or (at
Packit 032894
       your option) any later version
Packit 032894
Packit 032894
   or
Packit 032894
Packit 032894
   * the GNU General Public License as published by the Free
Packit 032894
       Software Foundation; either version 2 of the License, or (at
Packit 032894
       your option) any later version
Packit 032894
Packit 032894
   or both in parallel, as here.
Packit 032894
Packit 032894
   elfutils is distributed in the hope that it will be useful, but
Packit 032894
   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 032894
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 032894
   General Public License for more details.
Packit 032894
Packit 032894
   You should have received copies of the GNU General Public License and
Packit 032894
   the GNU Lesser General Public License along with this program.  If
Packit 032894
   not, see <http://www.gnu.org/licenses/>.  */
Packit 032894
Packit 032894
#ifndef _DEBUGINFOD_CLIENT_H
Packit 032894
#define _DEBUGINFOD_CLIENT_H 1
Packit 032894
Packit 032894
/* Names of environment variables that control the client logic. */
Packit 032894
#define DEBUGINFOD_URLS_ENV_VAR "DEBUGINFOD_URLS"
Packit 032894
#define DEBUGINFOD_CACHE_PATH_ENV_VAR "DEBUGINFOD_CACHE_PATH"
Packit 032894
#define DEBUGINFOD_TIMEOUT_ENV_VAR "DEBUGINFOD_TIMEOUT"
Packit 86a02d
#define DEBUGINFOD_PROGRESS_ENV_VAR "DEBUGINFOD_PROGRESS"
Packit 032894
Packit 032894
/* Handle for debuginfod-client connection.  */
Packit 032894
typedef struct debuginfod_client debuginfod_client;
Packit 032894
Packit 032894
#ifdef __cplusplus
Packit 032894
extern "C" {
Packit 032894
#endif
Packit 032894
Packit 032894
/* Create a handle for a new debuginfod-client session.  */
Packit 032894
debuginfod_client *debuginfod_begin (void);
Packit 032894
Packit 032894
/* Query the urls contained in $DEBUGINFOD_URLS for a file with
Packit 032894
   the specified type and build id.  If build_id_len == 0, the
Packit 032894
   build_id is supplied as a lowercase hexadecimal string; otherwise
Packit 032894
   it is a binary blob of given legnth.
Packit 032894
Packit 032894
   If successful, return a file descriptor to the target, otherwise
Packit 032894
   return a posix error code.  If successful, set *path to a
Packit 032894
   strdup'd copy of the name of the same file in the cache.
Packit 032894
   Caller must free() it later. */
Packit 032894
  
Packit 032894
int debuginfod_find_debuginfo (debuginfod_client *client,
Packit 032894
			       const unsigned char *build_id,
Packit 032894
                               int build_id_len,
Packit 032894
                               char **path);
Packit 032894
Packit 032894
int debuginfod_find_executable (debuginfod_client *client,
Packit 032894
				const unsigned char *build_id,
Packit 032894
                                int build_id_len,
Packit 032894
                                char **path);
Packit 032894
Packit 032894
int debuginfod_find_source (debuginfod_client *client,
Packit 032894
			    const unsigned char *build_id,
Packit 032894
                            int build_id_len,
Packit 032894
                            const char *filename,
Packit 032894
                            char **path);
Packit 032894
Packit 032894
typedef int (*debuginfod_progressfn_t)(debuginfod_client *c, long a, long b);
Packit 032894
void debuginfod_set_progressfn(debuginfod_client *c,
Packit 032894
			       debuginfod_progressfn_t fn);
Packit 032894
Packit 032894
/* Release debuginfod client connection context handle.  */
Packit 032894
void debuginfod_end (debuginfod_client *client);
Packit 032894
Packit 032894
#ifdef __cplusplus
Packit 032894
}
Packit 032894
#endif
Packit 032894
Packit 032894
Packit 032894
#endif /* _DEBUGINFOD_CLIENT_H */