ReactOS  0.4.14-dev-323-g6fe6a88
delete.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wine/debug.h"
#include "msi.h"
#include "msiquery.h"
#include "objbase.h"
#include "objidl.h"
#include "msipriv.h"
#include "winnls.h"
#include "query.h"
Include dependency graph for delete.c:

Go to the source code of this file.

Classes

struct  tagMSIDELETEVIEW
 

Typedefs

typedef struct tagMSIDELETEVIEW MSIDELETEVIEW
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msidb)
 
static UINT DELETE_fetch_int (struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
 
static UINT DELETE_fetch_stream (struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
 
static UINT DELETE_execute (struct tagMSIVIEW *view, MSIRECORD *record)
 
static UINT DELETE_close (struct tagMSIVIEW *view)
 
static UINT DELETE_get_dimensions (struct tagMSIVIEW *view, UINT *rows, UINT *cols)
 
static UINT DELETE_get_column_info (struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name)
 
static UINT DELETE_modify (struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
 
static UINT DELETE_delete (struct tagMSIVIEW *view)
 
static UINT DELETE_find_matching_rows (struct tagMSIVIEW *view, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle)
 
UINT DELETE_CreateView (MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table)
 

Variables

static const MSIVIEWOPS delete_ops
 

Typedef Documentation

◆ MSIDELETEVIEW

Function Documentation

◆ DELETE_close()

static UINT DELETE_close ( struct tagMSIVIEW view)
static

Definition at line 103 of file delete.c.

104 {
106 
107  TRACE("%p\n", dv );
108 
109  if( !dv->table )
110  return ERROR_FUNCTION_FAILED;
111 
112  return dv->table->ops->close( dv->table );
113 }
MSIVIEW * table
Definition: delete.c:55
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
const MSIVIEWOPS * ops
Definition: msipriv.h:348
UINT(* close)(struct tagMSIVIEW *view)
Definition: msipriv.h:273

◆ DELETE_CreateView()

UINT DELETE_CreateView ( MSIDATABASE db,
MSIVIEW **  view,
MSIVIEW table 
)

Definition at line 199 of file delete.c.

200 {
201  MSIDELETEVIEW *dv = NULL;
202 
203  TRACE("%p\n", dv );
204 
205  dv = msi_alloc_zero( sizeof *dv );
206  if( !dv )
207  return ERROR_FUNCTION_FAILED;
208 
209  /* fill the structure */
210  dv->view.ops = &delete_ops;
211  dv->db = db;
212  dv->table = table;
213 
214  *view = &dv->view;
215 
216  return ERROR_SUCCESS;
217 }
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIVIEW view
Definition: delete.c:53
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1210
MSIVIEW * table
Definition: delete.c:55
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
smooth NULL
Definition: ftsmooth.c:416
MSIDATABASE * db
Definition: delete.c:54
#define TRACE(s)
Definition: solgame.cpp:4
const MSIVIEWOPS * ops
Definition: msipriv.h:348
static const MSIVIEWOPS delete_ops
Definition: delete.c:176

Referenced by yyparse().

◆ DELETE_delete()

static UINT DELETE_delete ( struct tagMSIVIEW view)
static

Definition at line 153 of file delete.c.

154 {
156 
157  TRACE("%p\n", dv );
158 
159  if( dv->table )
160  dv->table->ops->delete( dv->table );
161 
162  msi_free( dv );
163 
164  return ERROR_SUCCESS;
165 }
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIVIEW * table
Definition: delete.c:55
#define TRACE(s)
Definition: solgame.cpp:4
const MSIVIEWOPS * ops
Definition: msipriv.h:348
UINT(* delete)(struct tagMSIVIEW *)
Definition: msipriv.h:299
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

◆ DELETE_execute()

static UINT DELETE_execute ( struct tagMSIVIEW view,
MSIRECORD record 
)
static

Definition at line 76 of file delete.c.

77 {
79  UINT r, i, rows = 0, cols = 0;
80 
81  TRACE("%p %p\n", dv, record);
82 
83  if( !dv->table )
84  return ERROR_FUNCTION_FAILED;
85 
86  r = dv->table->ops->execute( dv->table, record );
87  if( r != ERROR_SUCCESS )
88  return r;
89 
90  r = dv->table->ops->get_dimensions( dv->table, &rows, &cols );
91  if( r != ERROR_SUCCESS )
92  return r;
93 
94  TRACE("deleting %d rows\n", rows);
95 
96  /* blank out all the rows that match */
97  for ( i=0; i<rows; i++ )
98  dv->table->ops->delete_row( dv->table, i );
99 
100  return ERROR_SUCCESS;
101 }
UINT(* delete_row)(struct tagMSIVIEW *view, UINT row)
Definition: msipriv.h:263
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT(* get_dimensions)(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
Definition: msipriv.h:281
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT(* execute)(struct tagMSIVIEW *view, MSIRECORD *record)
Definition: msipriv.h:268
MSIVIEW * table
Definition: delete.c:55
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
const MSIVIEWOPS * ops
Definition: msipriv.h:348
unsigned int UINT
Definition: ndis.h:50

◆ DELETE_fetch_int()

static UINT DELETE_fetch_int ( struct tagMSIVIEW view,
UINT  row,
UINT  col,
UINT val 
)
static

Definition at line 58 of file delete.c.

59 {
61 
62  TRACE("%p %d %d %p\n", dv, row, col, val );
63 
64  return ERROR_FUNCTION_FAILED;
65 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

◆ DELETE_fetch_stream()

static UINT DELETE_fetch_stream ( struct tagMSIVIEW view,
UINT  row,
UINT  col,
IStream **  stm 
)
static

Definition at line 67 of file delete.c.

68 {
70 
71  TRACE("%p %d %d %p\n", dv, row, col, stm );
72 
73  return ERROR_FUNCTION_FAILED;
74 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

◆ DELETE_find_matching_rows()

static UINT DELETE_find_matching_rows ( struct tagMSIVIEW view,
UINT  col,
UINT  val,
UINT row,
MSIITERHANDLE handle 
)
static

Definition at line 167 of file delete.c.

169 {
170  TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
171 
172  return ERROR_FUNCTION_FAILED;
173 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4

◆ DELETE_get_column_info()

static UINT DELETE_get_column_info ( struct tagMSIVIEW view,
UINT  n,
LPCWSTR name,
UINT type,
BOOL temporary,
LPCWSTR table_name 
)
static

Definition at line 129 of file delete.c.

131 {
133 
134  TRACE("%p %d %p %p %p %p\n", dv, n, name, type, temporary, table_name );
135 
136  if( !dv->table )
137  return ERROR_FUNCTION_FAILED;
138 
139  return dv->table->ops->get_column_info( dv->table, n, name,
140  type, temporary, table_name);
141 }
GLdouble n
Definition: glext.h:7729
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
MSIVIEW * table
Definition: delete.c:55
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
const MSIVIEWOPS * ops
Definition: msipriv.h:348
UINT(* get_column_info)(struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name)
Definition: msipriv.h:288
Definition: name.c:36

◆ DELETE_get_dimensions()

static UINT DELETE_get_dimensions ( struct tagMSIVIEW view,
UINT rows,
UINT cols 
)
static

Definition at line 115 of file delete.c.

116 {
118 
119  TRACE("%p %p %p\n", dv, rows, cols );
120 
121  if( !dv->table )
122  return ERROR_FUNCTION_FAILED;
123 
124  *rows = 0;
125 
126  return dv->table->ops->get_dimensions( dv->table, NULL, cols );
127 }
UINT(* get_dimensions)(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
Definition: msipriv.h:281
MSIVIEW * table
Definition: delete.c:55
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const MSIVIEWOPS * ops
Definition: msipriv.h:348

◆ DELETE_modify()

static UINT DELETE_modify ( struct tagMSIVIEW view,
MSIMODIFY  eModifyMode,
MSIRECORD rec,
UINT  row 
)
static

Definition at line 143 of file delete.c.

145 {
147 
148  TRACE("%p %d %p\n", dv, eModifyMode, rec );
149 
150  return ERROR_FUNCTION_FAILED;
151 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msidb  )

Variable Documentation

◆ delete_ops

const MSIVIEWOPS delete_ops
static
Initial value:
=
{
}
static UINT DELETE_find_matching_rows(struct tagMSIVIEW *view, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle)
Definition: delete.c:167
static UINT DELETE_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
Definition: delete.c:67
static UINT DELETE_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
Definition: delete.c:115
smooth NULL
Definition: ftsmooth.c:416
static UINT DELETE_execute(struct tagMSIVIEW *view, MSIRECORD *record)
Definition: delete.c:76
static UINT DELETE_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
Definition: delete.c:143
static UINT DELETE_close(struct tagMSIVIEW *view)
Definition: delete.c:103
static UINT DELETE_delete(struct tagMSIVIEW *view)
Definition: delete.c:153
static UINT DELETE_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
Definition: delete.c:58
static UINT DELETE_get_column_info(struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name)
Definition: delete.c:129

Definition at line 176 of file delete.c.

Referenced by DELETE_CreateView().