-
Notifications
You must be signed in to change notification settings - Fork 9
/
prowl.h
63 lines (51 loc) · 1.24 KB
/
prowl.h
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
/*
* prowl.h
* prowl
*
* Created by J. Dijkstra ([email protected]) on 29-04-10.
* Copyright 2010 Digitalise.NET. All rights reserved.
*
*/
#ifndef PROWL_H_
#define PROWL_H_
#define STRICT
#define SSL_PORT 443
#define HOSTNAME "prowl.weks.net"
#define MESSAGESIZE 11400
#define BUFFERSIZE 512
/* priorities */
#define PROWL_PRIORITY_VERY_LOW -2
#define PROWL_PRIORITY_MODERATE -1
#define PROWL_PRIORITY_NORMAL 0
#define PROWL_PRIORITY_HIGH 1
#define PROWL_PRIORITY_EMERGENCY 2
#ifdef _WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "ssleay32MT.lib")
#pragma comment(lib, "libeay32MT.lib")
#else
#define SOCKET int
#define SOCKET_ERROR -1
#define closesocket(socket) close(socket)
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#endif
#include <string.h>
#include <stdio.h>
#include <ctype.h>
/* openssl headers */
#include <openssl/ssl.h>
#include <openssl/err.h>
/* ssl/connection structure */
typedef struct {
SOCKET socket;
SSL* ssl_handle;
SSL_CTX* ssl_context;
} prowl_connection;
int prowl_push_msg(char* api_key, int priority, char* application_name, char* event_name, char* description);
#endif