MagickCore  6.9.10
Convert, Edit, Or Compose Bitmap Images
distribute-cache.h
Go to the documentation of this file.
1 /*
2  Copyright 1999 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License. You may
6  obtain a copy of the License at
7 
8  https://imagemagick.org/license/
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  MagickCore distributed cache methods.
17 */
18 #ifndef MAGICKCORE_DISTRIBUTE_CACHE_H
19 #define MAGICKCORE_DISTRIBUTE_CACHE_H
20 
21 #include "magick/exception.h"
22 
23 #if defined(__cplusplus) || defined(c_plusplus)
24 extern "C" {
25 #endif
26 
27 extern MagickExport void
29 
30 #if defined(__cplusplus) || defined(c_plusplus)
31 }
32 #endif
33 
34 #endif
_Image::colorspace
ColorspaceType colorspace
Definition: image.h:158
distribute-cache-private.h
WriteDistributePixelCacheIndexes
MagickPrivate MagickOffsetType WriteDistributePixelCacheIndexes(DistributeCacheInfo *server_info, const RectangleInfo *region, const MagickSizeType length, const unsigned char *indexes)
Definition: distribute-cache.c:1644
LockSemaphoreInfo
MagickExport void LockSemaphoreInfo(SemaphoreInfo *semaphore_info)
Definition: semaphore.c:345
MagickExport
#define MagickExport
Definition: method-attribute.h:80
policy.h
_RectangleInfo::x
ssize_t x
Definition: geometry.h:129
SyncImagePixelCache
MagickPrivate MagickBooleanType SyncImagePixelCache(Image *, ExceptionInfo *)
Definition: cache.c:5671
CLOSE_SOCKET
#define CLOSE_SOCKET(socket)
Definition: distribute-cache.c:101
WriteDistributeCachePixels
static MagickBooleanType WriteDistributeCachePixels(SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
Definition: distribute-cache.c:913
MissingDelegateError
@ MissingDelegateError
Definition: exception.h:59
NewSplayTree
MagickExport SplayTreeInfo * NewSplayTree(int(*compare)(const void *, const void *), void *(*relinquish_key)(void *), void *(*relinquish_value)(void *))
Definition: splay-tree.c:1140
magick_unreferenced
#define magick_unreferenced(x)
Definition: method-attribute.h:106
GetMagickModule
#define GetMagickModule()
Definition: log.h:29
HeapOverflowSanityCheck
MagickExport MagickBooleanType HeapOverflowSanityCheck(const size_t, const size_t) magick_alloc_sizes(1
nt-base-private.h
PixelPacket
struct _PixelPacket PixelPacket
_SplayTreeInfo
Definition: splay-tree.c:83
geometry.h
MagickCoreSignature
#define MagickCoreSignature
Definition: method-attribute.h:86
WriteDistributePixelCachePixels
MagickPrivate MagickOffsetType WriteDistributePixelCachePixels(DistributeCacheInfo *server_info, const RectangleInfo *region, const MagickSizeType length, const unsigned char *magick_restrict pixels)
Definition: distribute-cache.c:1718
FormatLocaleString
MagickExport ssize_t FormatLocaleString(char *magick_restrict string, const size_t length, const char *magick_restrict format,...)
Definition: locale.c:502
_RectangleInfo::height
size_t height
Definition: geometry.h:126
MagickMaxBufferExtent
#define MagickMaxBufferExtent
Definition: blob.h:28
DistributePixelCacheClient
static HANDLER_RETURN_TYPE DistributePixelCacheClient(void *socket_arg)
Definition: distribute-cache.c:976
memory-private.h
magick_restrict
#define magick_restrict
Definition: MagickCore.h:41
_RectangleInfo
Definition: geometry.h:123
U8TO64_LE
static uint64_t U8TO64_LE(const uint8_t *p)
Definition: distribute-cache.c:217
SIPHash24
static uint64_t SIPHash24(const uint8_t key[16], const uint8_t *message, const size_t length)
Definition: distribute-cache.c:225
image-private.h
_Image::columns
size_t columns
Definition: image.h:174
MagickSizeType
size_t MagickSizeType
Definition: magick-type.h:136
IndexPacket
Quantum IndexPacket
Definition: pixel.h:129
_Image::channels
size_t channels
Definition: image.h:346
recv
#define recv(file, buffer, length, flags)
Definition: distribute-cache.c:110
DestroySplayTree
MagickExport SplayTreeInfo * DestroySplayTree(SplayTreeInfo *splay_tree)
Definition: splay-tree.c:681
HANDLER_RETURN_VALUE
#define HANDLER_RETURN_VALUE
Definition: distribute-cache.c:104
GetAuthenticIndexQueue
MagickExport IndexPacket * GetAuthenticIndexQueue(const Image *image)
Definition: cache.c:1325
MAGICK_SSIZE_MAX
#define MAGICK_SSIZE_MAX
Definition: image-private.h:43
pthread_attr_init
#define pthread_attr_init
Definition: vms.h:776
DistributePixelCacheServer
MagickExport void DistributePixelCacheServer(const int port, ExceptionInfo *exception)
Definition: distribute-cache.c:1118
CacheError
@ CacheError
Definition: exception.h:64
version.h
random_.h
string_.h
DestroyString
MagickExport char * DestroyString(char *string)
Definition: string.c:820
RelinquishDistributePixelCache
MagickPrivate MagickBooleanType RelinquishDistributePixelCache(DistributeCacheInfo *server_info)
Definition: distribute-cache.c:1579
MagickTrue
@ MagickTrue
Definition: magick-type.h:194
_RectangleInfo::y
ssize_t y
Definition: geometry.h:130
DestroyRandomInfo
MagickExport RandomInfo * DestroyRandomInfo(RandomInfo *random_info)
Definition: random.c:272
CopyMagickString
MagickExport size_t CopyMagickString(char *destination, const char *source, const size_t length)
Definition: string.c:752
GetDistributeCacheFile
MagickPrivate int GetDistributeCacheFile(const DistributeCacheInfo *server_info)
Definition: distribute-cache.c:1268
AcquireImage
MagickExport Image * AcquireImage(const ImageInfo *image_info)
Definition: image.c:152
AcquireMagickMemory
MagickExport void * AcquireMagickMemory(const size_t size)
Definition: memory.c:473
cache-private.h
GetImageRegistry
MagickExport void * GetImageRegistry(const RegistryType type, const char *key, ExceptionInfo *exception)
Definition: registry.c:186
_DistributeCacheInfo::session_key
uint64_t session_key
Definition: distribute-cache-private.h:34
SemaphoreInfo
Definition: semaphore.c:60
registry
static SplayTreeInfo * registry
Definition: registry.c:74
GetVirtualPixels
MagickExport const PixelPacket * GetVirtualPixels(const Image *image, const ssize_t x, const ssize_t y, const size_t columns, const size_t rows, ExceptionInfo *exception)
Definition: cache.c:3454
GetAuthenticPixels
MagickExport PixelPacket * GetAuthenticPixels(Image *image, const ssize_t x, const ssize_t y, const size_t columns, const size_t rows, ExceptionInfo *exception)
Definition: cache.c:1614
SubstituteString
MagickExport MagickBooleanType SubstituteString(char **string, const char *search, const char *replace)
Definition: string.c:2593
_Image
Definition: image.h:153
CacheFatalError
@ CacheFatalError
Definition: exception.h:87
dpc_read
static MagickOffsetType dpc_read(int file, const MagickSizeType length, unsigned char *magick_restrict message)
Definition: distribute-cache.c:164
MSG_NOSIGNAL
#define MSG_NOSIGNAL
Definition: distribute-cache.c:121
ReadDistributeCacheIndexes
static MagickBooleanType ReadDistributeCacheIndexes(SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
Definition: distribute-cache.c:711
DPCPendingConnections
#define DPCPendingConnections
Definition: distribute-cache.c:117
OpenDistributeCache
static MagickBooleanType OpenDistributeCache(SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
Definition: distribute-cache.c:630
version-private.h
_DistributeCacheInfo
Definition: distribute-cache-private.h:29
DestroyExceptionInfo
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *exception)
Definition: exception.c:441
_DistributeCacheInfo::hostname
char hostname[MaxTextExtent]
Definition: distribute-cache-private.h:37
ROTL
static uint64_t ROTL(uint64_t x, int b)
Definition: distribute-cache.c:212
splay-tree.h
DPCHostname
#define DPCHostname
Definition: distribute-cache.c:116
locale_.h
MagickPrivate
#define MagickPrivate
Definition: method-attribute.h:81
GetHostname
static char * GetHostname(int *port, ExceptionInfo *exception)
Definition: distribute-cache.c:429
_ImageInfo
Definition: image.h:362
dpc_send
static MagickOffsetType dpc_send(int file, const MagickSizeType length, const void *magick_restrict message)
Definition: distribute-cache.c:598
StringToArgv
MagickExport char ** StringToArgv(const char *text, int *argc)
Definition: string.c:2081
pthread_attr_setdetachstate
#define pthread_attr_setdetachstate
Definition: vms.h:778
MagickFalse
@ MagickFalse
Definition: magick-type.h:193
SyncAuthenticPixels
MagickExport MagickBooleanType SyncAuthenticPixels(Image *image, ExceptionInfo *exception)
Definition: cache.c:5618
IsEventLogging
MagickExport MagickBooleanType IsEventLogging(void)
Definition: log.c:716
GetValueFromSplayTree
MagickExport const void * GetValueFromSplayTree(SplayTreeInfo *splay_tree, const void *key)
Definition: splay-tree.c:920
DestroyDistributeCacheInfo
MagickPrivate DistributeCacheInfo * DestroyDistributeCacheInfo(DistributeCacheInfo *server_info)
Definition: distribute-cache.c:548
image.h
GetExceptionMessage
MagickExport char * GetExceptionMessage(const int error)
Definition: exception.c:471
AcquireRandomInfo
MagickExport RandomInfo * AcquireRandomInfo(void)
Definition: random.c:160
DistributePixelCacheServer
MagickExport void DistributePixelCacheServer(const int, ExceptionInfo *)
Definition: distribute-cache.c:1118
ReadDistributePixelCachePixels
MagickPrivate MagickOffsetType ReadDistributePixelCachePixels(DistributeCacheInfo *server_info, const RectangleInfo *region, const MagickSizeType length, unsigned char *magick_restrict pixels)
Definition: distribute-cache.c:1515
pthread_create
#define pthread_create
Definition: vms.h:799
ConnectPixelCacheServer
static int ConnectPixelCacheServer(const char *hostname, const int port, uint64_t *session_key, ExceptionInfo *exception)
Definition: distribute-cache.c:324
registry.h
ActivateSemaphoreInfo
MagickExport void ActivateSemaphoreInfo(SemaphoreInfo **semaphore_info)
Definition: semaphore.c:97
AddValueToSplayTree
MagickExport MagickBooleanType AddValueToSplayTree(SplayTreeInfo *splay_tree, const void *key, const void *value)
Definition: splay-tree.c:153
StringRegistryType
@ StringRegistryType
Definition: registry.h:30
GetVirtualIndexQueue
MagickExport const IndexPacket * GetVirtualIndexQueue(const Image *image)
Definition: cache.c:2809
DeriveSipKeyFromSecret
static void DeriveSipKeyFromSecret(const char *shared_secret, uint8_t key[16])
Definition: distribute-cache.c:288
_Image::rows
size_t rows
Definition: image.h:175
ReadDistributeCachePixels
static MagickBooleanType ReadDistributeCachePixels(SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
Definition: distribute-cache.c:778
cache.h
WriteDistributeCacheIndexes
static MagickBooleanType WriteDistributeCacheIndexes(SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
Definition: distribute-cache.c:846
_ExceptionInfo::signature
size_t signature
Definition: exception.h:124
log.h
LENGTH_TYPE
#define LENGTH_TYPE
Definition: distribute-cache.c:106
_Image::signature
size_t signature
Definition: image.h:307
MagickBooleanType
MagickBooleanType
Definition: magick-type.h:192
RelinquishMagickMemory
MagickExport void * RelinquishMagickMemory(void *memory)
Definition: memory.c:1077
random_info
static RandomInfo * random_info
Definition: resource.c:110
OpenDistributePixelCache
MagickPrivate MagickBooleanType OpenDistributePixelCache(DistributeCacheInfo *server_info, Image *image)
Definition: distribute-cache.c:1362
GetDistributeCacheHostname
MagickPrivate const char * GetDistributeCacheHostname(const DistributeCacheInfo *server_info)
Definition: distribute-cache.c:1299
_ExceptionInfo
Definition: exception.h:103
_RectangleInfo::width
size_t width
Definition: geometry.h:125
studio.h
_Image::storage_class
ClassType storage_class
Definition: image.h:155
StringToLong
static long StringToLong(const char *magick_restrict value)
Definition: string-private.h:68
SOCKET_TYPE
#define SOCKET_TYPE
Definition: distribute-cache.c:105
distribute-cache.h
DestroyImage
MagickExport Image * DestroyImage(Image *image)
Definition: image.c:1187
HANDLER_RETURN_TYPE
#define HANDLER_RETURN_TYPE
Definition: distribute-cache.c:103
DPCPort
#define DPCPort
Definition: distribute-cache.c:118
_DistributeCacheInfo::port
int port
Definition: distribute-cache-private.h:40
DPCSessionKeyLength
#define DPCSessionKeyLength
Definition: distribute-cache.c:119
memory_.h
GetStringInfoDatum
MagickExport unsigned char * GetStringInfoDatum(const StringInfo *string_info)
Definition: string.c:1275
AcquireDistributeCacheInfo
MagickPrivate DistributeCacheInfo * AcquireDistributeCacheInfo(ExceptionInfo *exception)
Definition: distribute-cache.c:488
ReadDistributePixelCacheIndexes
MagickPrivate MagickOffsetType ReadDistributePixelCacheIndexes(DistributeCacheInfo *server_info, const RectangleInfo *region, const MagickSizeType length, unsigned char *indexes)
Definition: distribute-cache.c:1442
exception-private.h
ThrowMagickException
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *tag, const char *format,...)
Definition: exception.c:1068
ThrowFatalException
#define ThrowFatalException(severity, tag)
Definition: exception-private.h:42
UnlockSemaphoreInfo
MagickExport void UnlockSemaphoreInfo(SemaphoreInfo *semaphore_info)
Definition: semaphore.c:450
DestroyDistributeCache
static MagickBooleanType DestroyDistributeCache(SplayTreeInfo *registry, const uint64_t session_key)
Definition: distribute-cache.c:586
GetRandomKey
MagickExport StringInfo * GetRandomKey(RandomInfo *random_info, const size_t length)
Definition: random.c:712
exception.h
_DistributeCacheInfo::debug
MagickBooleanType debug
Definition: distribute-cache-private.h:46
DPCHeapOverflowSanityCheckGetSize
static MagickBooleanType DPCHeapOverflowSanityCheckGetSize(const size_t count, const size_t quantum, size_t *extent)
Definition: distribute-cache.c:132
send
#define send(file, buffer, length, flags)
Definition: distribute-cache.c:109
AcquireCriticalMemory
static void * AcquireCriticalMemory(const size_t size)
Definition: memory-private.h:52
DestroyStringInfo
MagickExport StringInfo * DestroyStringInfo(StringInfo *string_info)
Definition: string.c:847
GenerateSessionKey
static uint64_t GenerateSessionKey(const char *shared_secret, const unsigned char *nonce, size_t length)
Definition: distribute-cache.c:314
GetPolicyValue
MagickExport char * GetPolicyValue(const char *name)
Definition: policy.c:523
list.h
ValidateDistributedPixelCache
static MagickBooleanType ValidateDistributedPixelCache(const RectangleInfo *region, const size_t per_pixel, const MagickSizeType length)
Definition: distribute-cache.c:694
AcquireExceptionInfo
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
Definition: exception.c:106
DestroyImageList
MagickExport Image * DestroyImageList(Image *images)
Definition: list.c:462
string-private.h
RelinquishImageRegistry
static void * RelinquishImageRegistry(void *image)
Definition: distribute-cache.c:841
AcquireString
MagickExport char * AcquireString(const char *source)
Definition: string.c:125
MagickMin
#define MagickMin(x, y)
Definition: image-private.h:34
_DistributeCacheInfo::file
int file
Definition: distribute-cache-private.h:31
_DistributeCacheInfo::signature
size_t signature
Definition: distribute-cache-private.h:43
_StringInfo
Definition: string_.h:30
_PixelPacket
Definition: pixel.h:132
_RandomInfo
Definition: random.c:77
MagickOffsetType
ssize_t MagickOffsetType
Definition: magick-type.h:135
GetDistributeCachePort
MagickPrivate int GetDistributeCachePort(const DistributeCacheInfo *server_info)
Definition: distribute-cache.c:1330
MagickPathExtent
#define MagickPathExtent
Definition: magick-type.h:31
DeleteNodeFromSplayTree
MagickExport MagickBooleanType DeleteNodeFromSplayTree(SplayTreeInfo *splay_tree, const void *key)
Definition: splay-tree.c:602