/usr/include/gbtools/gbtoolsPfetch.hpp is in libgbtools-dev 4.44.1+dfsg-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | /* File: gbtoolsPfetch.hpp
* Author: Ed Griffiths (edgrif@sanger.ac.uk)
* Copyright (c) 2006-2015: Genome Research Ltd.
*-------------------------------------------------------------------
* ZMap is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see the on-line version at http://www.gnu.org/copyleft/gpl.txt
*-------------------------------------------------------------------
* This file is part of the ZMap genome database package
* originally written by:
*
* Ed Griffiths (Sanger Institute, UK) edgrif@sanger.ac.uk,
* Roy Storey (Sanger Institute, UK) rds@sanger.ac.uk
*
* Description: Object implementing fetching of sequence data via
* the pfetch server either through a pipe to the
* pfetch command line script or through http requests.
*
*-------------------------------------------------------------------
*/
#ifndef GBTOOLS_PFETCH_H
#define GBTOOLS_PFETCH_H
#include <glib.h>
#include <gbtools/gbtoolsCurl.hpp>
namespace gbtools
{
// Callback functions.
typedef bool (* ReaderFunc)(char *output, guint *output_size, char **error_msg,
void *user_data) ;
typedef bool (* ErrorFunc)(char *output, guint *output_size, char **error_msg,
void *user_data) ;
typedef void (* ClosedFunc)(void *user_data) ;
// Abstract base class.
class Pfetch
{
public:
void setEntryType(bool full_entry) ;
void setDebug(bool debug_on) ;
virtual bool fetch(const char *sequence, char **error_msg) = 0 ;
const char* getLocation() ;
virtual ~Pfetch() ;
protected:
Pfetch(const char *location,
ReaderFunc reader_func, ErrorFunc error_func, ClosedFunc closed_func,
void *user_data) ;
const char *location_ ;
struct
{
unsigned int full : 1 ; /* full pfetch entry (-F on command line) */
unsigned int debug : 1 ; /* internal debug */
} opts_ ;
// user callbacks
ReaderFunc reader_func_ ;
ErrorFunc error_func_ ;
ClosedFunc closed_func_ ;
void *user_data_ ;
private:
} ;
// Pipe interface
//
class PfetchPipe: public Pfetch
{
public:
// No default contstructor.
PfetchPipe() = delete ;
// No copy operations
PfetchPipe(const PfetchPipe&) = delete ;
PfetchPipe& operator=(const PfetchPipe&) = delete ;
// no move operations
PfetchPipe(PfetchPipe&&) = delete ;
PfetchPipe& operator=(PfetchPipe&&) = delete ;
PfetchPipe(const char *location,
ReaderFunc reader_func, ErrorFunc error_func, ClosedFunc closed_func,
void *user_data) ;
bool fetch(const char *sequence, char **error_msg) ;
~PfetchPipe() ;
private:
} ;
// http interface
//
class PfetchHttp: public Pfetch
{
public:
// No default contstructor.
PfetchHttp() = delete ;
// No copy operations
PfetchHttp(const PfetchHttp&) = delete ;
PfetchHttp& operator=(const PfetchHttp&) = delete ;
// no move operations
PfetchHttp(PfetchHttp&&) = delete ;
PfetchHttp& operator=(PfetchHttp&&) = delete ;
PfetchHttp(const char *location, unsigned int port,
const char* cookie_jar, long ipresolve, const char *cainfo, char *proxy,
ReaderFunc reader_func, ErrorFunc error_func, ClosedFunc closed_func,
void *user_data) ;
void setProxy(const char *proxy) ;
char* getError() ;
bool fetch(const char *sequence, char **error_msg) ;
~PfetchHttp() ;
private:
unsigned int http_port_;
const char *cookie_jar_location_;
long ipresolve_;
const char *cainfo_;
const char *proxy_ ;
CURLObject curl_object_;
unsigned int request_counter_;
} ;
} /* gbtools namespace */
#endif /* GBTOOLS_PFETCH_H */
|