gattrib

s_rename.c File Reference

Functions to rename STRING_LIST contents. More...

#include <config.h>
#include <stdio.h>
#include <ctype.h>
#include <libgeda/libgeda.h>
#include "../include/struct.h"
#include "../include/prototype.h"
#include "../include/globals.h"
Include dependency graph for s_rename.c:

Go to the source code of this file.

Data Structures

struct  RENAME

Defines

#define MAX_RENAME   64
#define MAX_SETS   10

Functions

void s_rename_init (void)
 Initialize the renaming data space.
void s_rename_destroy_all (void)
 Free all data referred to by the rename pairs.
void s_rename_next_set (void)
void s_rename_print (void)
 Print all rename sets.
int s_rename_search (char *src, char *dest, int quiet_flag)
 Search the rename sets.
void s_rename_add (char *src, char *dest)
 Add to the rename pairs.
void s_rename_all_lowlevel (NETLIST *netlist_head, char *src, char *dest)
void s_rename_all (TOPLEVEL *toplevel, NETLIST *netlist_head)

Variables

static RENAME rename_pairs [10][64]
static int rename_counter = 0
static int cur_set = 0

Detailed Description

Functions to rename STRING_LIST contents

Definition in file s_rename.c.


Define Documentation

#define MAX_RENAME   64

Definition at line 59 of file s_rename.c.

#define MAX_SETS   10

Definition at line 60 of file s_rename.c.


Function Documentation

void s_rename_init ( void  )

Initialise the renaming data space by setting all the pair pointers to NULL.

Definition at line 75 of file s_rename.c.

void s_rename_destroy_all ( void  )

Runs through the rename pairs and calls g_free() on the non-NULL entries, then sets the entry to NULL.

Definition at line 94 of file s_rename.c.

void s_rename_next_set ( void  )

Definition at line 116 of file s_rename.c.

void s_rename_print ( void  )

Iterate through the array and print all the rename sets to stdout.

Definition at line 131 of file s_rename.c.

int s_rename_search ( char *  src,
char *  dest,
int  quiet_flag 
)

Search through the rename sets looking for src and dest. If quiet_flag is true than don't print anything.

Parameters:
srcSource to search for
destDestination to search for
quiet_flagSuppress printing if set to TRUE
Returns:
TRUE if the src is found. If the dest is found, also return true, but warn user

Definition at line 159 of file s_rename.c.

void s_rename_add ( char *  src,
char *  dest 
)

Add a source and destination to the rename pairs.

Parameters:
srcSource to add
destDestination to add

Definition at line 194 of file s_rename.c.

Here is the call graph for this function:

void s_rename_all_lowlevel ( NETLIST *  netlist_head,
char *  src,
char *  dest 
)

Definition at line 248 of file s_rename.c.

void s_rename_all ( TOPLEVEL *  toplevel,
NETLIST *  netlist_head 
)

Definition at line 282 of file s_rename.c.

Here is the call graph for this function:


Variable Documentation

RENAME rename_pairs[10][64] [static]

size is fixed...

Todo:
maybe make this dynamic

Definition at line 64 of file s_rename.c.

int rename_counter = 0 [static]

Definition at line 66 of file s_rename.c.

int cur_set = 0 [static]

Definition at line 67 of file s_rename.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines