/
bpdefinition.h
88 lines (79 loc) · 2.66 KB
/
bpdefinition.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
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
/**
* ***** BEGIN LICENSE BLOCK *****
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is BrowserPlus (tm).
*
* The Initial Developer of the Original Code is Yahoo!.
* Portions created by Yahoo! are Copyright (c) 2010 Yahoo! Inc.
* All rights reserved.
*
* Contributor(s):
* ***** END LICENSE BLOCK *****
*/
/**
* Written by Lloyd Hilaiel, on or around Fri May 18 17:06:54 MDT 2007
*
* A service is defined by a set if in-memory structures. These
* structures are hierarchical and can define a service containing
* any number of functions, which themselves accept any number of
* arguments.
*/
#ifndef __BPDEFINITION_H__
#define __BPDEFINITION_H__
#include <ServiceAPI/bptypes.h>
#include <ServiceAPI/bperror.h>
#ifdef __cplusplus
extern "C" {
#endif
/** The definition of an argument */
typedef struct {
/** The name of the agument, all arguments in BrowserPlus are named */
BPString name;
/** A human readable english documentation string */
BPString docString;
/** The expected type of the argument */
BPType type;
/** whether the argument is required or not */
BPBool required;
} BPArgumentDefinition;
/** The definition of a function */
typedef struct {
/** the name of the function */
BPString functionName;
/** A human readable english documentation string. */
BPString docString;
/** The number of arguements in the arguments array */
unsigned int numArguments;
/** An array of argument definitions */
BPArgumentDefinition * arguments;
} BPFunctionDefinition;
/** The definition of a service */
typedef struct BPServiceDefinition_t {
/** The name of the service */
BPString serviceName;
/** The major version of the service */
unsigned int majorVersion;
/** The minor version of the service */
unsigned int minorVersion;
/** The micro version (build number) of the service */
unsigned int microVersion;
/** A human readable english documentation string. */
BPString docString;
/** The number of functions in the functions array */
unsigned int numFunctions;
/** An array of function definitions */
BPFunctionDefinition * functions;
} BPServiceDefinition;
#ifdef __cplusplus
};
#endif
#endif