pcb 4.1.1
An interactive printed circuit board layout editor.

file.h File Reference

Prototypes for file routines. More...

#include <stdio.h>
#include "global.h"
Include dependency graph for file.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define PCB_FILE_VERSION   20170218
 This is the version we support.

Functions

FILE * CheckAndOpenFile (char *, bool, bool, bool *, bool *)
 Opens a file and check if it exists.
FILE * OpenConnectionDataFile (void)
 Opens a file for saving connection data.
int SavePCB (char *)
 Save PCB.
int LoadPCB (char *)
 Load PCB.
int RevertPCB (void)
 Revert PCB.
void EnableAutosave (void)
void Backup (void)
 Creates a backup file.
void SaveInTMP (void)
 Saves the layout in a temporary file.
void EmergencySave (void)
void DisableEmergencySave (void)
int ReadLibraryContents (void)
 Read contents of the library description file (for M4) and then read in M4 libs.
int ImportNetlist (char *)
int SaveBufferElements (char *)
 Save elements in the current buffer.
void sort_netlist (void)
int PCBFileVersionNeeded (void)
void SaveTMPData (void)
 Makes a temporary copy of the data.
void RemoveTMPData (void)
 Removes the temporary copy of the data file.

Detailed Description

Prototypes for file routines.


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 1994,1995,1996 Thomas Nau

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Contact addresses for paper mail and Email: Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany Thomas.Nau@rz.uni-ulm.de

Definition in file file.h.


Define Documentation

#define PCB_FILE_VERSION   20170218

This is the version we support.

Whenever the pcb file format is modified, this version number should be updated to the date when the new code is committed. It will be written out to the file and also used by pcb to give guidance to the user as to what the minimum version of pcb required is.

Definition at line 57 of file file.h.

Referenced by check_file_version().


Function Documentation

void Backup ( void  )

Creates a backup file.

The default is to use the pcb file name with a "~" appended (like "foo.pcb~") and if we don't have a pcb file name then use the template in BACKUP_NAME.

Definition at line 1084 of file file.c.

References PCBType::Filename, filename, malloc(), PCB, and WritePCBFile().

Referenced by backup_cb().

Here is the call graph for this function:

FILE* CheckAndOpenFile ( char *  ,
bool  ,
bool  ,
bool *  ,
bool *   
)

Opens a file and check if it exists.

Definition at line 262 of file file.c.

References _, hid_st::confirm_dialog, fp, gui, and OpenErrorMessage().

Referenced by ActionSaveTo(), and OpenConnectionDataFile().

Here is the call graph for this function:

void DisableEmergencySave ( void  )

Definition at line 1032 of file file.c.

References dont_save_any_more.

Referenced by QuitApplication().

void EmergencySave ( void  )

Definition at line 1021 of file file.c.

References dont_save_any_more, and SaveInTMP().

Referenced by main(), MyFatal(), and QuitApplication().

Here is the call graph for this function:

void EnableAutosave ( void  )

Definition at line 1058 of file file.c.

References hid_st::add_timer, backup_cb(), SettingType::BackupInterval, gui, hidval::ptr, Settings, hid_st::stop_timer, and x.

Referenced by config_backup_spin_button_cb(), and main().

Here is the call graph for this function:

int ImportNetlist ( char *  )

Definition at line 1659 of file file.c.

References fp, ReadEdifNetlist(), and ReadNetlist().

Referenced by ActionLoadFrom().

Here is the call graph for this function:

int LoadPCB ( char *  )

Load PCB.

Definition at line 498 of file file.c.

References real_load_pcb().

Referenced by ActionLoadFrom(), and main().

Here is the call graph for this function:

FILE* OpenConnectionDataFile ( void  )

Opens a file for saving connection data.

Definition at line 308 of file file.c.

References _, CheckAndOpenFile(), hid_st::fileselect, fp, and gui.

Here is the call graph for this function:

int PCBFileVersionNeeded ( void  )

This is the version needed by the file we're saving.

Definition at line 167 of file file.c.

References ALLPOLYGON_LOOP, PCBType::Data, END_LOOP, ENDALL_LOOP, PCB, PCB_FILE_VERSION_BASELINE, PCB_FILE_VERSION_BURIED_VIAS, PCB_FILE_VERSION_HOLES, and VIA_LOOP.

Referenced by WritePCBDataHeader().

void RemoveTMPData ( void  )

Removes the temporary copy of the data file.

Definition at line 1134 of file file.c.

References TMPFilename.

Referenced by Parse().

int RevertPCB ( void  )

Revert PCB.

Definition at line 507 of file file.c.

References PCBType::Filename, PCB, and real_load_pcb().

Referenced by ActionLoadFrom(), and info_bar_response_cb().

Here is the call graph for this function:

int SaveBufferElements ( char *  )

Save elements in the current buffer.

Definition at line 342 of file file.c.

References SWAP_IDENT, SwapBuffers(), and WritePipe().

Referenced by ActionPasteBuffer(), and ActionSaveTo().

Here is the call graph for this function:

void SaveInTMP ( void  )

Saves the layout in a temporary file.

This is used for fatal errors and does not call the program specified in 'saveCommand' for safety reasons.

Definition at line 1001 of file file.c.

References _, PCBType::Changed, filename, Message(), PCB, and WritePCBFile().

Referenced by ActionNew(), and EmergencySave().

Here is the call graph for this function:

int SavePCB ( char *  )

Save PCB.

Definition at line 358 of file file.c.

References gui, hid_st::notify_save_pcb, and WritePipe().

Referenced by ActionSaveTo().

Here is the call graph for this function:

void SaveTMPData ( void  )

Makes a temporary copy of the data.

This is useful for systems which doesn't support calling functions on exit.
We use this to save the data before LEX and YACC functions are called because they are able to abort the program.

Definition at line 1124 of file file.c.

References TMPFilename, and WritePCBFile().

Referenced by Parse().

Here is the call graph for this function:

void sort_netlist ( void  )

Definition at line 251 of file file.c.

References netlist_sort_offset, PCBType::NetlistLib, PCB, and sort_library().

Referenced by Netlist(), ReadNetlist(), and real_load_pcb().

Here is the call graph for this function: