2003-08-13 03:27:48 +02:00
|
|
|
/*
|
|
|
|
* Implementation of the Microsoft Installer (msi.dll)
|
|
|
|
*
|
2003-09-08 21:38:45 +02:00
|
|
|
* Copyright 2002 Mike McCormack for CodeWeavers
|
2003-08-13 03:27:48 +02: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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-08-13 03:27:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_MSI_QUERY_H
|
|
|
|
#define __WINE_MSI_QUERY_H
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
2003-08-13 03:27:48 +02:00
|
|
|
#include "winbase.h"
|
2004-08-22 23:38:46 +02:00
|
|
|
#include "objbase.h"
|
2003-08-13 03:27:48 +02:00
|
|
|
#include "objidl.h"
|
|
|
|
#include "msi.h"
|
|
|
|
#include "msiquery.h"
|
|
|
|
#include "msipriv.h"
|
2005-05-23 14:08:17 +02:00
|
|
|
#include "wine/list.h"
|
2003-08-13 03:27:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
#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 02:11:08 +02:00
|
|
|
#define EXPR_STRCMP 7
|
2004-06-30 20:18:27 +02:00
|
|
|
#define EXPR_WILDCARD 9
|
2004-12-22 16:22:12 +01:00
|
|
|
#define EXPR_COL_NUMBER_STRING 10
|
2006-07-25 04:17:56 +02:00
|
|
|
#define EXPR_COL_NUMBER32 11
|
2004-06-26 02:11:08 +02:00
|
|
|
|
|
|
|
struct sql_str {
|
|
|
|
LPCWSTR data;
|
|
|
|
INT len;
|
|
|
|
};
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2005-05-29 22:17:16 +02:00
|
|
|
typedef struct _column_info
|
2004-03-20 20:18:46 +01:00
|
|
|
{
|
2005-05-29 22:17:16 +02:00
|
|
|
LPCWSTR table;
|
|
|
|
LPCWSTR column;
|
|
|
|
UINT type;
|
|
|
|
struct expr *val;
|
|
|
|
struct _column_info *next;
|
|
|
|
} column_info;
|
2004-03-20 20:18:46 +01:00
|
|
|
|
2003-08-13 03:27:48 +02: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;
|
2005-05-29 22:17:16 +02:00
|
|
|
LPCWSTR sval;
|
|
|
|
LPCWSTR column;
|
2003-08-13 03:27:48 +02:00
|
|
|
UINT col_number;
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2005-05-23 14:08:17 +02:00
|
|
|
UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview,
|
|
|
|
struct list *mem );
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2004-03-19 02:16:36 +01:00
|
|
|
UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view );
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2004-06-30 20:18:27 +02:00
|
|
|
UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
|
2005-05-29 22:17:16 +02:00
|
|
|
column_info *columns );
|
2003-08-13 03:27:48 +02:00
|
|
|
|
|
|
|
UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table );
|
|
|
|
|
2005-05-23 12:27:00 +02:00
|
|
|
UINT ORDER_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
|
2005-05-29 22:17:16 +02:00
|
|
|
column_info *columns );
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2004-07-04 02:27:48 +02:00
|
|
|
UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
|
|
|
|
struct expr *cond );
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2004-03-16 20:18:22 +01:00
|
|
|
UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
|
2005-05-29 22:17:16 +02:00
|
|
|
column_info *col_info, BOOL temp );
|
2004-03-16 20:18:22 +01:00
|
|
|
|
2004-03-20 20:18:46 +01:00
|
|
|
UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
|
2005-05-30 13:32:18 +02:00
|
|
|
column_info *columns, column_info *values, BOOL temp );
|
2004-03-20 20:18:46 +01:00
|
|
|
|
2004-07-04 02:30:02 +02:00
|
|
|
UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **, LPWSTR table,
|
2005-05-29 22:17:16 +02:00
|
|
|
column_info *list, struct expr *expr );
|
2004-07-04 02:30:02 +02:00
|
|
|
|
2005-02-14 12:07:13 +01:00
|
|
|
UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table );
|
|
|
|
|
2006-07-26 09:27:15 +02:00
|
|
|
UINT JOIN_CreateView( MSIDATABASE *db, MSIVIEW **view,
|
|
|
|
LPCWSTR left, LPCWSTR right,
|
|
|
|
struct expr *cond );
|
|
|
|
|
2006-08-18 07:09:03 +02:00
|
|
|
UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, int hold );
|
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
int sqliteGetToken(const WCHAR *z, int *tokenType);
|
|
|
|
|
2006-10-26 07:08:38 +02:00
|
|
|
MSIRECORD *msi_query_merge_record( UINT fields, column_info *vl, MSIRECORD *rec );
|
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
#endif /* __WINE_MSI_QUERY_H */
|