switch to Unix line endings

This commit is contained in:
Holger Vogt 2026-07-28 19:43:25 +02:00
parent 4ad9c8a70b
commit 2dbbb68e63
2 changed files with 82 additions and 82 deletions

View File

@ -1,71 +1,71 @@
/* ngspice file /* ngspice file
Copyright Holger Vogt 2021 Copyright Holger Vogt 2021
License: BSD 3-clause License: BSD 3-clause
*/ */
/* Print the current node status to a file with format /* Print the current node status to a file with format
.ic V(node) = value .ic V(node) = value
*/ */
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "ngspice/cpdefs.h" #include "ngspice/cpdefs.h"
#include "ngspice/ftedefs.h" #include "ngspice/ftedefs.h"
#include "ngspice/ftedev.h" #include "ngspice/ftedev.h"
#include "ngspice/ftedebug.h" #include "ngspice/ftedebug.h"
#include "ngspice/cktdefs.h" #include "ngspice/cktdefs.h"
void com_wric(wordlist* wl); void com_wric(wordlist* wl);
/* Print the current node status to a file with format /* Print the current node status to a file with format
.ic V(node) = value .ic V(node) = value
during a transient simulation which has been stopped, during a transient simulation which has been stopped,
by command 'stop' and which may continue by 'resume'. by command 'stop' and which may continue by 'resume'.
*/ */
void void
com_wric(wordlist* wl) { com_wric(wordlist* wl) {
CKTnode* node; CKTnode* node;
CKTcircuit* ckt = NULL; CKTcircuit* ckt = NULL;
FILE* fp; FILE* fp;
char* file; char* file;
if (wl) if (wl)
file = wl->wl_word; file = wl->wl_word;
else else
file = "dot_ic_out.txt"; file = "dot_ic_out.txt";
if (!ft_curckt) { if (!ft_curckt) {
fprintf(cp_err, "Error: there aren't any circuits loaded.\n"); fprintf(cp_err, "Error: there aren't any circuits loaded.\n");
return; return;
} }
else if (ft_curckt->ci_ckt == NULL) { /* Set noparse? */ else if (ft_curckt->ci_ckt == NULL) { /* Set noparse? */
fprintf(cp_err, "Error: circuit not parsed.\n"); fprintf(cp_err, "Error: circuit not parsed.\n");
return; return;
} }
ckt = ft_curckt->ci_ckt; ckt = ft_curckt->ci_ckt;
if (!ckt->CKTrhsOld) { if (!ckt->CKTrhsOld) {
fprintf(stderr, "\nWarning: Command wrnodev is ignored!\n"); fprintf(stderr, "\nWarning: Command wrnodev is ignored!\n");
fprintf(stderr, " You need to execute stop ... tran ... resume\n\n"); fprintf(stderr, " You need to execute stop ... tran ... resume\n\n");
return; return;
} }
if ((fp = fopen(file, "w")) == NULL) { if ((fp = fopen(file, "w")) == NULL) {
perror(file); perror(file);
return; return;
} }
fprintf(fp, "* Intermediate Transient Solution\n"); fprintf(fp, "* Intermediate Transient Solution\n");
fprintf(fp, "* Circuit: %s\n", ft_curckt->ci_name); fprintf(fp, "* Circuit: %s\n", ft_curckt->ci_name);
fprintf(fp, "* Recorded at simulation time: %g\n", ckt->CKTtime); fprintf(fp, "* Recorded at simulation time: %g\n", ckt->CKTtime);
for (node = ckt->CKTnodes->next; node; node = node->next) { for (node = ckt->CKTnodes->next; node; node = node->next) {
if (!strstr(node->name, "#branch") && !strchr(node->name, '#')) if (!strstr(node->name, "#branch") && !strchr(node->name, '#'))
fprintf(fp, ".ic v(%s) = %g\n", node->name, fprintf(fp, ".ic v(%s) = %g\n", node->name,
ckt->CKTrhsOld[node->number]); ckt->CKTrhsOld[node->number]);
} }
fprintf(stdout, "\nNode data saved to file %s\n", file); fprintf(stdout, "\nNode data saved to file %s\n", file);
fclose(fp); fclose(fp);
} }

View File

@ -1,11 +1,11 @@
/* ngspice file /* ngspice file
Copyright Holger Vogt 2021 Copyright Holger Vogt 2021
License: BSD 3-clause License: BSD 3-clause
*/ */
/* Print the current node status to a file with format /* Print the current node status to a file with format
.ic V(node) = value .ic V(node) = value
*/ */
extern void extern void
com_wric(wordlist* wl); com_wric(wordlist* wl);