This file is indexed.

/usr/include/synthesis/blobs.h is in libsynthesis-dev 3.4.0.16.6-1.

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
/*
 *  File:    blobs.h
 *
 *  Author:  Beat Forster (bfo@synthesis.ch)
 *
 *
 *  DBApi database adapter
 *  BLOB (Binary Large Object) access
 *
 *  Copyright (c) 2005-2011 by Synthesis AG + plan44.ch
 *
 *
 *  E X A M P L E    C O D E
 *
 */

#ifndef BLOBS_H
#define BLOBS_H

#include "synthesis/sync_dbapidef.h" // get some definitions
#ifdef PLATFORM_FILE
  #include "synthesis/platform_file.h"
#endif

#include <string>

namespace sysync {



/* NOTE: A BLOB object can be used for different BLOBs,
 *       but only for one BLOB simultaneously.
 *       If a new BLOB will be opened, the old one will
 *       be closed automatically, if still opened.
 *       read/write with <aFirst> = true  will open a new one
 *         "    "     "      "    = false will ignore <aBlobName>
 */
class TBlob {
  public:
    TBlob();
   ~TBlob();

    void     Init( void* aCB, cAppCharP aDBName, string aBlobPath,
                                                 string aContextName,
                                                 string sDevKey,
                                                 string sUsrKey );

    string   BlobName  ( cItemID  aID, cAppCharP aBlobID );

    size_t   BlobSize  (  string  aBlobName ); // allowed also for open BLOBs

    TSyError ReadBlob  (  string  aBlobName,
                      appPointer *blkPtr, memSize *blkSize, memSize *totSize,
                            bool  aFirst,    bool *aLast );
    TSyError ReadBlob  ( cItemID  aID,  cAppCharP  aBlobID,
                      appPointer *blkPtr, memSize *blkSize, memSize *totSize,
                            bool  aFirst,    bool *aLast );

    TSyError WriteBlob (  string  aBlobName,
                      appPointer  blkPtr, memSize  blkSize, memSize  totSize,
                            bool  aFirst,    bool  aLast );
    TSyError WriteBlob ( cItemID  aID,  cAppCharP  aBlobID,
                      appPointer  blkPtr, memSize  blkSize, memSize  totSize,
                            bool  aFirst,    bool  aLast );

    TSyError DeleteBlob(  string  aBlobName );
    TSyError DeleteBlob( cItemID  aID, cAppCharP  aBlobID );

    #ifdef PLATFORM_FILE
      TSyError GetAttr ( string  aBlobName, TAttr  &aAttr, bool &isFolder ); // get BLOB's file attributes
      TSyError SetAttr                    ( TAttr   aAttr );                 // set  "      "      "

      TSyError GetDates( string  aBlobName, TDates &aDate );                 // get BLOB's file dates
      TSyError SetDates( string  aBlobName, TDates  aDate );                 // set  "      "      "
    #endif

    string getDBName() const { return fDBName; }
    string getBlobPath() const { return fBlobPath; }
    string getContextName() const { return fContextName; }
    string getDevKey() const { return fDevKey; }
    string getUsrKey() const { return fUsrKey; }

  private:
    void*  fCB;       // callback structure, for debug logs
    string fDBName;   // database name,      for debug logs

    string fBlobPath; // params for creating BLOB's name
    string fContextName;
    string fDevKey;
    string fUsrKey;

    FILE*   fFile;     // assigned file
    bool    fOpened;   // Is it currently opened ?
    memSize fCurPos;   // current position
    memSize fSize;     // BLOB's size

    string fName;     // BLOB's file name

    #ifdef PLATFORM_FILE
      TAttr  fAttr;   // BLOB's file attributes
      bool   fAttrActive;

      TDates fDate;   // BLOB's file dates
      bool   fDateActive;
    #endif

    TSyError  OpenBlob( const char* mode );
    TSyError CloseBlob();
}; // TBlob


} /* namespace */
#endif /* BLOBS_H */
/* eof */