Blame debuginfod/debuginfod.h.debuginfod-timeout-progress

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