pcb 4.1.1
An interactive printed circuit board layout editor.

layerflags.c File Reference

Functions for changing layer flags. More...

#include <stdio.h>
#include <ctype.h>
#include "globalconst.h"
#include "global.h"
#include "compat.h"
#include "data.h"
#include "error.h"
#include "hid.h"
#include "strflags.h"
#include "layerflags.h"
Include dependency graph for layerflags.c:

Go to the source code of this file.

Functions

LayertypeType string_to_layertype (const char *flagstring, int(*error)(const char *msg))
const char * layertype_to_string (LayertypeType type)
LayertypeType guess_layertype (const char *name, int layer_number, DataType *data)
 Given a layer without type, try to guess its type, mostly from its name.
static int ActionListLayertypes (int argc, char **argv, Coord x, Coord y)
int ActionSetLayertype (int argc, char **argv, Coord x, Coord y)

Variables

static char * layertype_name [LT_NUM_LAYERTYPES+1]
 These are the names of all the Layertypes defined in hid.h.
static const char listlayertypes_syntax []
static const char listlayertypes_help []
static const char setlayertype_syntax []
static const char setlayertype_help []
HID_Action layerflags_action_list []

Detailed Description

Functions for changing layer flags.


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 2007 DJ Delorie <dj@delorie.com>

Copyright (C) 2015 Markus "Traumflug" Hitter <mah@jump-ing.de>

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.

Definition in file layerflags.c.


Function Documentation

static int ActionListLayertypes ( int  argc,
char **  argv,
Coord  x,
Coord  y 
) [static]

Definition at line 155 of file layerflags.c.

References layertype_name, LT_NUM_LAYERTYPES, Message(), and N_.

Here is the call graph for this function:

int ActionSetLayertype ( int  argc,
char **  argv,
Coord  x,
Coord  y 
)

Definition at line 187 of file layerflags.c.

References AFAIL, PCBType::Data, DataType::Layer, LT_NUM_LAYERTYPES, max_copper_layer, Message(), N_, PCB, SILK_LAYER, string_to_layertype(), and LayerType::Type.

Here is the call graph for this function:

LayertypeType guess_layertype ( const char *  name,
int  layer_number,
DataType data 
)

Given a layer without type, try to guess its type, mostly from its name.

This is used by parse_y.y for compatibility with old file formats and _not_ used when such flags are already present in the file.

Definition at line 120 of file layerflags.c.

References layertype_name, LT_COPPER, LT_NUM_LAYERTYPES, and strcasestr().

Here is the call graph for this function:

const char* layertype_to_string ( LayertypeType  type)

Definition at line 102 of file layerflags.c.

References layertype_name, and LT_NUM_LAYERTYPES.

Referenced by Debug(), and WriteLayerData().

LayertypeType string_to_layertype ( const char *  flagstring,
int(*)(const char *msg)  error 
)

Definition at line 76 of file layerflags.c.

References layertype_name, and LT_NUM_LAYERTYPES.

Referenced by ActionSetLayertype().


Variable Documentation

Initial value:

Definition at line 221 of file layerflags.c.

char* layertype_name[LT_NUM_LAYERTYPES+1] [static]
Initial value:
 {
  "copper",       
  "silk",         
  "mask",         
  "paste",        
  "outline",      
  "route",        
  "keepout",      
  "fab",          
  "assy",         
  "notes",        
  "no_type"       
}

These are the names of all the Layertypes defined in hid.h.

Order here has to match the order of typedef enum LayertypeType there. They're used for parsing/writing layer types from/to the layout file.

Definition at line 60 of file layerflags.c.

Referenced by ActionListLayertypes(), guess_layertype(), layertype_to_string(), and string_to_layertype().

const char listlayertypes_help[] [static]
Initial value:
  N_("List all available layertypes.\n")

Definition at line 143 of file layerflags.c.

const char listlayertypes_syntax[] [static]
Initial value:
  N_("ListLayertypes()")

Definition at line 140 of file layerflags.c.

const char setlayertype_help[] [static]
Initial value:
  N_("Sets the type of a layer. Type can be given by name or by number.\n"
     "For a list of available types, run ListLayertypes().")

Definition at line 171 of file layerflags.c.

const char setlayertype_syntax[] [static]
Initial value:
  N_("SetLayertype(layer, type)")

Definition at line 168 of file layerflags.c.