[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference clt::smg

Title:Screen ManaGement Discussions
Moderator:SSPADE::HIDER
Created:Fri Jan 24 1986
Last Modified:Mon Jun 02 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1567
Total number of notes:4697

1567.0. "SMG$PUT_CHARS problem on AXP." by AUBER::COSTEUX () Mon Jun 02 1997 08:13

T.RTitleUserPersonal
Name
DateLines
1567.1exitSSPADE::GRECOMon Jun 02 1997 12:323
    Can you supply the include file fenetre.h?
    
    Frank
1567.2Here are the included files. Thanks.PADKOA::COSTEUXMon Jun 02 1997 12:47211
    Thanks for help.
    
    Here are the files:
    
    - fenetre.h <******************************
    

/*fenetre*********************************************************************
 * header du gestionnaire d'ecran C-VMS (SMG$)                               *
 *****************************************************************************/

# include <stdio.h>

/*
# include <car.h>
*/

# include descrip
# include smgdef

# define S_MAX_FENETRE	300

# define NETWORK	1
# define BATCH		2
# define INTERACTIF	3

# define OK		1
# define NOK		0

# define S_OUI		1
# define S_NON		2

# define S_VISIBLE	1
# define S_INVISIBLE	2

# define S_HORI		1
# define S_VERT		2

# define S_NORMAL 	0
# define S_INVERSE	SMG$M_REVERSE
# define S_SOULIGNE 	SMG$M_UNDERLINE
# define S_INTENSE 	SMG$M_BOLD
# define S_CLIGNOTE	SMG$M_BLINK

# define S_DOWN		SMG$M_DOWN
# define S_UP  		SMG$M_UP
# define S_RIGHT	SMG$M_RIGHT
# define S_LEFT		SMG$M_LEFT

# define S_LIGNE	1
# define S_PAGE		2
# define S_DEMIPAGE     3
# define S_PAGE_1	4


# define REMPLACEMENT	1
# define INSERTION	2

# define SAI_STR	1
# define SAI_NBR	2
# define SAI_DEC	3
# define SAI_HR		4
# define SAI_JMA	5
# define SAI_JMAA	6

char	s_user[30];
char	s_application[30];
int	s_num_pid;
int	s_num_clavier;
int	s_num_ecran_physique;

struct fenetre {
	short	etat;
	int	num_fenetre;
	short	lig;
	short	col;
} fenetre[S_MAX_FENETRE];

# define	MAX_NIVEAU	5
# define	MAX_CHOIX	20

struct menu0 {
	char	lib_sup[30];
	char	lib_inf[30];
	short	col;
	short	lg;
	short	action;
} menu0[9];	    

struct ss_menu {
	short	max_menu;
	struct menu {    
		int    	num_fenetre;
		short	max_lib;
		short	max_lg;
		char   	lib[MAX_CHOIX+1][70];
		short  	type[MAX_CHOIX+1];
		short  	action[MAX_CHOIX+1];
	} menu[100];
} ss_menu[MAX_NIVEAU+1];

struct param_menu {
	short	premier_passage;
	short	nb_menu0;
	int	num_menu0;
	int	num_pied;
	short	menu0_val;
	short	menu_val[MAX_NIVEAU+1];
	short	menu_lig[MAX_NIVEAU+1];
	short	niveau;
};

struct param_menu param_menu = {S_OUI,0,0,0,0};

struct	def_sai_code {
	char	choix[300][60];
	short	nb;
} def_sai_code;


struct	param_saisie {
	short	mode;
        short	num_pied;
	short	lg;
	char	ch_initiale[256];
	double	bmin;
	double	bmax;
} param_saisie;

    
    
    	- appli.h  <***********************************
    
    
# define	OUI		1
# define	NON		2

# define	OK		1
# define	NOK		0

# define	AUTRE		0
# define	RESEAU		1
# define	BATCH		2
# define	INTERACTIF	3

# define	DIRECTE		1
# define	DIFFERE		2

# define	NORMAL		1
# define	NOR_VIDEO	1
# define	INVERSE	 	2
# define	INV_VIDEO       2
# define	CLIGNOTE	3
# define	SOULIGNE	4
# define	INTENSE		5
# define	SLSH		6
# define	DLSH		7
# define	DLDH		8

# define	PHYSIQUE	1
# define	VIRTUEL		2

# define	J     		0 /* JOUR pour stdrt */
# define	M     		1 /* MOIS pour strdt */
# define	A     		2 /* AN   pour strdt */

# define	JJMMAA		1
# define	JJMM		2
# define	MMAA		3
# define	SRT		4
# define	SHORT		5
# define	LONG		6
# define	CODE		7
# define	JJMMAAAA	8

# define	BS		127
# define	VALIDER		270
# define	RETN		13
# define	HOME		7
# define	KEY_RIGHT	277
# define	KEY_LEFT	276
# define	KEY_UP		274
# define	KEY_DOWN	275
# define	NEXT_PAGE	316
# define	PREV_PAGE	315
# define	INSRT_CHAR	11
# define	DEL_CHAR	12
# define	INSRT_LINE	13
# define	DEL_LINE	14
# define	RECH		311
# define	SELECTION	314
# define	DEL		127
# define	BELL		'\007'

# define	F1		291
# define	F2		292
# define	F3		293
# define	F4		294
# define	F5		295
# define	F6		296
# define	F7		297
# define	F8		298
# define	F9		299
# define	F10		300
# define	PF1		256
# define	PF2		257
# define	PF3		258
# define	PF4		259


    
1567.3Crossposted in the VAXC conference (note #5611)PADKOA::COSTEUXMon Jun 02 1997 14:564
    I crossposted a similar note in the VAXC conference as the problem
    seams more a DECC problem than anything else ...
    
    Jean-Pierre
1567.4SPECXN::DERAMODan D'EramoMon Jun 02 1997 15:2236
	You just can't do this...it isn't legal C.  It doesn't work.
        
>	s_pr( fen, 4, 5, S_NORMAL, "Montant    : %9.02lf  mt2:%8.02lf", 
>						mt, mt2);
        
>s_pr(num,lig,col,type,cmd,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
>
>char	*cmd;
>int	num, lig, col, type;
>
>{           
[...]
>	sprintf(data,cmd,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
        
        The only way to write s_pr is to prototype it with the "..."
        before calling it and then define it using <stdarg.h>.
        
        Dan
        
#include <stdarg.h>
void s_pr(int num, int lig, int col, int type, const char *cmd, ...);
        
/* Now that the above prototype has been seen it is okay to call s_pr. */
        
/* Here's how the definition calls sprintf... */
void s_pr(int num, int lig, int col, int type, const char *cmd, ...)
{
    va_list ap;
    char data[80];
        
    va_start(ap, cmd);
    vsprintf(data, cmd, ap);
    va_end(ap);
        
    /* ... */
}