patches by R. Larice
This commit is contained in:
parent
f721fdf782
commit
d7d5a38583
|
|
@ -1,5 +1,7 @@
|
||||||
2010-02-08 Holger Vogt
|
2010-02-08 Holger Vogt
|
||||||
* com_sysinfo.c: 64 bit support enabled
|
* com_sysinfo.c: 64 bit support enabled
|
||||||
|
* terminal.c, terminal.h, cpextern.h, ngsconvert.c, inpgmod.c, ipcsockets.c: patches by
|
||||||
|
R. Larice from Feb. 8th, 2010
|
||||||
|
|
||||||
2010-02-07 Dietmar Warning
|
2010-02-07 Dietmar Warning
|
||||||
* cpl/cplload.c, cplsetup.c, /txl/txlload.c, txlsetup.c, include/swec.h, multi_line.h,
|
* cpl/cplload.c, cplsetup.c, /txl/txlload.c, txlsetup.c, include/swec.h, multi_line.h,
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,11 @@ $Id$
|
||||||
* dependencies in here, and it isn't clear that versions of this stuff
|
* dependencies in here, and it isn't clear that versions of this stuff
|
||||||
* can be written for every possible machine...
|
* can be written for every possible machine...
|
||||||
*/
|
*/
|
||||||
|
#include "ngspice.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
#ifdef HAVE_SGTTY_H
|
#ifdef HAVE_SGTTY_H
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -248,18 +251,27 @@ out_send(char *string)
|
||||||
/* Printf some stuff using more mode. */
|
/* Printf some stuff using more mode. */
|
||||||
|
|
||||||
void
|
void
|
||||||
out_printf(char *fmt, char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8, char *s9, char *s10)
|
out_printf(char *fmt, ...)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_ASPRINTF) /* seems the best solution */
|
#if defined(HAVE_ASPRINTF) /* seems the best solution */
|
||||||
char * tbuf;
|
char * tbuf;
|
||||||
asprintf(&tbuf, fmt, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10);
|
va_list ap;
|
||||||
|
va_start (ap, fmt);
|
||||||
|
vasprintf(&tbuf, fmt, ap);
|
||||||
|
va_end (ap);
|
||||||
out_send(tbuf);
|
out_send(tbuf);
|
||||||
FREE(tbuf);
|
FREE(tbuf);
|
||||||
#elif defined(HAVE_SNPRINTF) /* the second best */
|
#elif defined(HAVE_SNPRINTF) /* the second best */
|
||||||
snprintf(out_pbuf, sizeof(out_pbuf), fmt, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10);
|
va_list ap;
|
||||||
|
va_start (ap, fmt);
|
||||||
|
vsnprintf(out_pbuf, sizeof(out_pbuf), fmt, ap);
|
||||||
|
va_end (ap);
|
||||||
out_send(out_pbuf);
|
out_send(out_pbuf);
|
||||||
#else /* guaranteed a bug for long messages */
|
#else /* guaranteed a bug for long messages */
|
||||||
sprintf(out_pbuf, fmt, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10);
|
va_list ap;
|
||||||
|
va_start (ap, fmt);
|
||||||
|
vsprintf(out_pbuf, fmt, ap);
|
||||||
|
va_end (ap);
|
||||||
out_send(out_pbuf);
|
out_send(out_pbuf);
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
|
|
@ -363,9 +375,12 @@ void tcap_init(void) {}
|
||||||
void out_send(char *string) {fprintf(cp_out,string);}
|
void out_send(char *string) {fprintf(cp_out,string);}
|
||||||
|
|
||||||
void
|
void
|
||||||
out_printf(char *fmt, char *s1, char *s2, char *s3, char *s4, char *s5,
|
out_printf(char *fmt, ...)
|
||||||
char *s6, char *s7, char *s8, char *s9, char *s10) {
|
{
|
||||||
fprintf(cp_out,fmt, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10);
|
va_list ap;
|
||||||
|
va_start (ap, fmt);
|
||||||
|
vfprintf(cp_out, fmt, ap);
|
||||||
|
va_end (ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TCL_MODULE */
|
#endif /* TCL_MODULE */
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,13 @@ void out_init(void);
|
||||||
void outbufputc(void);
|
void outbufputc(void);
|
||||||
void promptreturn(void);
|
void promptreturn(void);
|
||||||
void out_send(char *string);
|
void out_send(char *string);
|
||||||
void out_printf(char *fmt, char *s1, char *s2, char *s3,
|
|
||||||
char *s4, char *s5, char *s6,
|
#ifdef __GNUC__
|
||||||
char *s7, char *s8, char *s9, char *s10);
|
extern void out_printf(char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
|
#else
|
||||||
|
extern void out_printf(char *fmt, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
void term_clear(void);
|
void term_clear(void);
|
||||||
void term_home(void);
|
void term_home(void);
|
||||||
void term_cleol(void);
|
void term_cleol(void);
|
||||||
|
|
|
||||||
|
|
@ -133,8 +133,18 @@ extern bool out_isatty;
|
||||||
extern void out_init();
|
extern void out_init();
|
||||||
#ifndef out_printf
|
#ifndef out_printf
|
||||||
/* don't want to declare it if we have #define'ed it */
|
/* don't want to declare it if we have #define'ed it */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#ifdef HAS_WINDOWS
|
||||||
|
#undef printf
|
||||||
|
#endif
|
||||||
|
extern void out_printf(char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
|
#ifdef HAS_WINDOWS
|
||||||
|
#define printf p_r_i_n_t_f
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
extern void out_printf(char *fmt, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void out_printf();
|
|
||||||
#endif
|
#endif
|
||||||
extern void out_send();
|
extern void out_send();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ int cp_evloop(char *s) { return (0); }
|
||||||
void cp_ccon(bool o) { }
|
void cp_ccon(bool o) { }
|
||||||
char *if_errstring(int c) { return ("error"); }
|
char *if_errstring(int c) { return ("error"); }
|
||||||
#ifndef out_printf
|
#ifndef out_printf
|
||||||
void out_printf(char *fmt, int args) { }
|
void out_printf(char *fmt, ...) { }
|
||||||
#endif
|
#endif
|
||||||
void out_send(char *string) {}
|
void out_send(char *string) {}
|
||||||
struct variable * cp_enqvar(char *word) { return (NULL); }
|
struct variable * cp_enqvar(char *word) { return (NULL); }
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,7 @@ INPparseNumMod( void* ckt, INPmodel *model, INPtables *tab, char **errMessage )
|
||||||
if (cardType >= 0) {
|
if (cardType >= 0) {
|
||||||
/* Add card structure to model */
|
/* Add card structure to model */
|
||||||
info = INPcardTab[cardType];
|
info = INPcardTab[cardType];
|
||||||
error = (*(info->newCard))( (void *)&tmpCard,
|
error = (*(info->newCard))( (void **)&tmpCard,
|
||||||
model->INPmodfast );
|
model->INPmodfast );
|
||||||
if (error) return(error);
|
if (error) return(error);
|
||||||
/* Handle parameter-less cards */
|
/* Handle parameter-less cards */
|
||||||
|
|
|
||||||
|
|
@ -576,7 +576,7 @@ Ipc_Status_t ipc_transport_get_line (str, len, wait)
|
||||||
/* we must get the body. */
|
/* we must get the body. */
|
||||||
|
|
||||||
*len = message_length;
|
*len = message_length;
|
||||||
count = read_sock (msg_stream, str, message_length);
|
count = read_sock (msg_stream, str, message_length, IPC_WAIT, 0);
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
/* EOF, will this ever happen? */
|
/* EOF, will this ever happen? */
|
||||||
/* fprintf (stderr, */
|
/* fprintf (stderr, */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue