summaryrefslogtreecommitdiff
path: root/php/src/IcePHP/Profile.h
blob: 85f7f170b6a932581013e01d51a0f90b029c3b92 (plain)
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
// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#ifndef ICE_PHP_PROFILE_H
#define ICE_PHP_PROFILE_H

#include <Config.h>

//
// Global functions.
//
extern "C"
{
ZEND_FUNCTION(Ice_stringVersion);
ZEND_FUNCTION(Ice_intVersion);
ZEND_FUNCTION(Ice_loadProfile);
ZEND_FUNCTION(Ice_loadProfileWithArgs);
ZEND_FUNCTION(Ice_dumpProfile);
}

#define ICE_PHP_PROFILE_FUNCTIONS \
    ZEND_FE(Ice_stringVersion,       NULL) \
    ZEND_FE(Ice_intVersion,          NULL) \
    ZEND_FE(Ice_loadProfile,         NULL) \
    ZEND_FE(Ice_loadProfileWithArgs, NULL) \
    ZEND_FE(Ice_dumpProfile,         NULL)

namespace IcePHP
{

bool profileInit(TSRMLS_D);
bool profileShutdown(TSRMLS_D);

//
// Profile contains information about an Ice configuration. A pointer to a Profile instance
// is stored in the PHP globals (see php_ice.h) when a script invokes Ice_loadProfile().
//
struct Profile
{
    typedef std::map<std::string, Slice::ClassDefPtr> ClassMap;

    std::string name;              // The profile name
    Slice::UnitPtr unit;           // The parsed Slice code
    std::string code;              // PHP code generated from Slice types
    ClassMap classes;              // Associates flattened type ids to their ClassDefs
    Ice::PropertiesPtr properties; // Configuration properties
};

} // End of namespace IcePHP

#endif