query.h 4.05 KB
Newer Older
1 2 3
/*
 * Implementation of the Microsoft Installer (msi.dll)
 *
4
 * Copyright 2002 Mike McCormack for CodeWeavers
5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 20 21 22 23
 */

#ifndef __WINE_MSI_QUERY_H
#define __WINE_MSI_QUERY_H

24 25 26
#include <stdarg.h>

#include "windef.h"
27
#include "winbase.h"
28
#include "objbase.h"
29 30 31 32
#include "objidl.h"
#include "msi.h"
#include "msiquery.h"
#include "msipriv.h"
33
#include "wine/list.h"
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52


#define OP_EQ       1
#define OP_AND      2
#define OP_OR       3
#define OP_GT       4
#define OP_LT       5
#define OP_LE       6
#define OP_GE       7
#define OP_NE       8
#define OP_ISNULL   9
#define OP_NOTNULL  10

#define EXPR_COMPLEX  1
#define EXPR_COLUMN   2
#define EXPR_COL_NUMBER 3
#define EXPR_IVAL     4
#define EXPR_SVAL     5
#define EXPR_UVAL     6
53
#define EXPR_STRCMP   7
54
#define EXPR_WILDCARD 9
55
#define EXPR_COL_NUMBER_STRING 10
56
#define EXPR_COL_NUMBER32 11
57
#define EXPR_UNARY    12
58 59 60 61 62

struct sql_str {
    LPCWSTR data;
    INT len;
};
63 64 65 66 67 68 69 70

struct complex_expr
{
    UINT op;
    struct expr *left;
    struct expr *right;
};

71 72
struct tagJOINTABLE;
union ext_column
73
{
74 75 76 77 78 79 80 81 82 83
    struct
    {
        LPCWSTR column;
        LPCWSTR table;
    } unparsed;
    struct
    {
        UINT column;
        struct tagJOINTABLE *table;
    } parsed;
84 85
};

86 87 88 89 90 91 92 93
struct expr
{
    int type;
    union
    {
        struct complex_expr expr;
        INT   ival;
        UINT  uval;
94
        LPCWSTR sval;
95
        union ext_column column;
96 97 98
    } u;
};

99
UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview,
100
                   struct list *mem ) DECLSPEC_HIDDEN;
101

102
UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) DECLSPEC_HIDDEN;
103

104
UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
105
                        const column_info *columns ) DECLSPEC_HIDDEN;
106

107
UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) DECLSPEC_HIDDEN;
108

109
UINT ORDER_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
110
                       column_info *columns ) DECLSPEC_HIDDEN;
111

112
UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables,
113
                       struct expr *cond ) DECLSPEC_HIDDEN;
114

115
UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
116
                        column_info *col_info, BOOL hold ) DECLSPEC_HIDDEN;
117

118
UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
119
                        column_info *columns, column_info *values, BOOL temp ) DECLSPEC_HIDDEN;
120

121
UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
122
                        column_info *list, struct expr *expr ) DECLSPEC_HIDDEN;
123

124
UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) DECLSPEC_HIDDEN;
125

126
UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold ) DECLSPEC_HIDDEN;
127

128
UINT STREAMS_CreateView( MSIDATABASE *db, MSIVIEW **view ) DECLSPEC_HIDDEN;
129

130
UINT STORAGES_CreateView( MSIDATABASE *db, MSIVIEW **view ) DECLSPEC_HIDDEN;
131

132
UINT DROP_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name ) DECLSPEC_HIDDEN;
133

134
int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip) DECLSPEC_HIDDEN;
135

136
MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD *rec ) DECLSPEC_HIDDEN;
137

138
UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
139
                       MSICONDITION persistent ) DECLSPEC_HIDDEN;
140

141
#endif /* __WINE_MSI_QUERY_H */