2003-08-13 01:27:48 +00:00
|
|
|
/*
|
|
|
|
* Implementation of the Microsoft Installer (msi.dll)
|
|
|
|
*
|
2003-09-08 19:38:45 +00:00
|
|
|
* Copyright 2002 Mike McCormack for CodeWeavers
|
2003-08-13 01:27:48 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_MSI_QUERY_H
|
|
|
|
#define __WINE_MSI_QUERY_H
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
2003-08-13 01:27:48 +00:00
|
|
|
#include "winbase.h"
|
2004-08-22 21:38:46 +00:00
|
|
|
#include "objbase.h"
|
2003-08-13 01:27:48 +00:00
|
|
|
#include "objidl.h"
|
|
|
|
#include "msi.h"
|
|
|
|
#include "msiquery.h"
|
|
|
|
#include "msipriv.h"
|
|
|
|
|
|
|
|
|
|
|
|
#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
|
2004-06-26 00:11:08 +00:00
|
|
|
#define EXPR_STRCMP 7
|
|
|
|
#define EXPR_UTF8 8
|
2004-06-30 18:18:27 +00:00
|
|
|
#define EXPR_WILDCARD 9
|
2004-12-22 15:22:12 +00:00
|
|
|
#define EXPR_COL_NUMBER_STRING 10
|
2004-06-26 00:11:08 +00:00
|
|
|
|
|
|
|
struct sql_str {
|
|
|
|
LPCWSTR data;
|
|
|
|
INT len;
|
|
|
|
};
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2004-03-20 19:18:46 +00:00
|
|
|
typedef struct _string_list
|
|
|
|
{
|
|
|
|
LPWSTR string;
|
|
|
|
struct _string_list *next;
|
|
|
|
} string_list;
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
struct complex_expr
|
|
|
|
{
|
|
|
|
UINT op;
|
|
|
|
struct expr *left;
|
|
|
|
struct expr *right;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct expr
|
|
|
|
{
|
|
|
|
int type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct complex_expr expr;
|
|
|
|
INT ival;
|
|
|
|
UINT uval;
|
|
|
|
LPWSTR sval;
|
|
|
|
LPWSTR column;
|
|
|
|
UINT col_number;
|
2004-06-26 00:11:08 +00:00
|
|
|
char *utf8;
|
2003-08-13 01:27:48 +00:00
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2004-03-16 19:18:22 +00:00
|
|
|
typedef struct _create_col_info
|
|
|
|
{
|
|
|
|
LPWSTR colname;
|
|
|
|
UINT type;
|
|
|
|
struct _create_col_info *next;
|
|
|
|
} create_col_info;
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2004-03-20 19:18:46 +00:00
|
|
|
typedef struct _value_list
|
|
|
|
{
|
|
|
|
struct expr *val;
|
|
|
|
struct _value_list *next;
|
|
|
|
} value_list;
|
|
|
|
|
2004-07-04 00:30:02 +00:00
|
|
|
typedef struct _column_assignment
|
|
|
|
{
|
|
|
|
string_list *col_list;
|
|
|
|
value_list *val_list;
|
|
|
|
} column_assignment;
|
|
|
|
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phView);
|
|
|
|
|
2004-03-19 01:16:36 +00:00
|
|
|
UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view );
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2004-06-30 18:18:27 +00:00
|
|
|
UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
|
|
|
|
string_list *columns );
|
2003-08-13 01:27:48 +00:00
|
|
|
|
|
|
|
UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table );
|
|
|
|
|
|
|
|
UINT ORDER_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table );
|
|
|
|
UINT ORDER_AddColumn( MSIVIEW *group, LPWSTR name );
|
|
|
|
|
2004-07-04 00:27:48 +00:00
|
|
|
UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
|
|
|
|
struct expr *cond );
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2004-03-16 19:18:22 +00:00
|
|
|
UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
|
|
|
|
create_col_info *col_info, BOOL temp );
|
|
|
|
|
2004-03-20 19:18:46 +00:00
|
|
|
UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
|
|
|
|
string_list *columns, value_list *values, BOOL temp );
|
|
|
|
|
2004-07-04 00:30:02 +00:00
|
|
|
UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **, LPWSTR table,
|
|
|
|
column_assignment *list, struct expr *expr );
|
|
|
|
|
2004-03-20 19:18:46 +00:00
|
|
|
void delete_expr( struct expr *e );
|
|
|
|
void delete_string_list( string_list *sl );
|
|
|
|
void delete_value_list( value_list *vl );
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
int sqliteGetToken(const WCHAR *z, int *tokenType);
|
|
|
|
|
|
|
|
#endif /* __WINE_MSI_QUERY_H */
|