1 /*
2  * dsp_none.c - Suppress all results from being displayed.
3  *
4  * Copyright (C) 1995, 1996 by Scott C. Gray
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, write to the Free Software
18  * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  * You may contact the author :
21  *   e-mail:  gray@voicenet.com
22  *            grays@xtend-tech.com
23  *            gray@xenotropic.com
24  */
25 #include <stdio.h>
26 #include <ctype.h>
27 #include "sqsh_config.h"
28 #include "sqsh_error.h"
29 #include "sqsh_global.h"
30 #include "sqsh_debug.h"
31 #include "dsp.h"
32 
33 /*-- Current Version --*/
34 #if !defined(lint) && !defined(__LINT__)
35 static char RCS_Id[] = "$Id: dsp_none.c,v 1.1.1.1 2004/04/07 12:35:03 chunkm0nkey Exp $";
36 USE(RCS_Id)
37 #endif /* !defined(lint) */
38 
39 /*
40  * dsp_none:
41  *
42  * Suck the result set in from the server, but don't bother to
43  * display anything.
44  */
45 int dsp_none( output, cmd, flags )
46 	dsp_out_t   *output;
47 	CS_COMMAND  *cmd;
48 	int          flags;
49 {
50 	CS_INT   nrows;
51 	CS_INT   result_type;
52 	CS_INT   return_code;
53 
54 	while ((return_code = ct_results( cmd, &result_type )) != CS_END_RESULTS)
55 	{
56 		if (g_dsp_interrupted)
57 			return DSP_INTERRUPTED;
58 
59 		switch (result_type)
60 		{
61 			case CS_COMPUTE_RESULT:
62 			case CS_PARAM_RESULT:
63 			case CS_ROW_RESULT:
64 			case CS_STATUS_RESULT:
65 				while (ct_fetch(cmd,             /* Command */
66 				                CS_UNUSED,       /* Type */
67 				                CS_UNUSED,       /* Offset */
68 				                CS_UNUSED,       /* Option */
69 				                &nrows) != CS_END_DATA)
70 				{
71 					if (g_dsp_interrupted)
72 						return DSP_INTERRUPTED;
73 				}
74 				break;
75 			default:
76 				break;
77 		}
78 	}
79 
80 	return DSP_SUCCEED;
81 }
82