libmongo-client 0.1.4
src/compat.h
00001 /* compat.h - Various compatibility functions
00002  * Copyright 2011 Gergely Nagy <algernon@balabit.hu>
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef LIBMONGO_COMPAT_H
00018 #define LIBMONGO_COMPAT_H 1
00019 
00020 #include "config.h"
00021 
00022 #if WITH_OPENSSL
00023 
00024 #include <openssl/md5.h>
00025 #include <sys/types.h>
00026 
00027 typedef enum {
00028   G_CHECKSUM_MD5,
00029   G_CHECKSUM_SHA1,
00030   G_CHECKSUM_SHA256
00031 } GChecksumType;
00032 
00033 typedef struct _GChecksum GChecksum;
00034 
00035 GChecksum *g_checksum_new (GChecksumType checksum_type);
00036 void g_checksum_free (GChecksum *checksum);
00037 void g_checksum_update (GChecksum *checksum,
00038                         const unsigned char *data,
00039                         ssize_t length);
00040 const char *g_checksum_get_string (GChecksum *checksum);
00041 
00042 #endif /* WITH_OPENSSL */
00043 
00044 #endif
 All Data Structures Files Functions Variables Enumerations Enumerator Defines