pcb 4.1.1
An interactive printed circuit board layout editor.

macro.h File Reference

Some commonly used macros not related to a special C-file. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SWAP_IDENT   Settings.ShowBottomSide
#define SWAP_SIGN_X(x)   (x)
#define SWAP_SIGN_Y(y)   (-(y))
#define SWAP_ANGLE(a)   (-(a))
#define SWAP_DELTA(d)   (-(d))
#define SWAP_X(x)   (SWAP_SIGN_X(x))
#define SWAP_Y(y)   (PCB->MaxHeight +SWAP_SIGN_Y(y))
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
#define SGN(a)   ((a) >0 ? 1 : ((a) == 0 ? 0 : -1))
#define SGNZ(a)   ((a) >=0 ? 1 : -1)
#define MAKEMIN(a, b)   if ((b) < (a)) (a) = (b)
#define MAKEMAX(a, b)   if ((b) > (a)) (a) = (b)
#define ENTRIES(x)   (sizeof((x))/sizeof((x)[0]))
#define UNKNOWN(a)   ((a) && *(a) ? (a) : "(unknown)")
#define UNKNOWN_NAME(a, n)   ((a) && *(a) ? (a) : (n))
#define NSTRCMP(a, b)   ((a) ? ((b) ? strcmp((a),(b)) : 1) : -1)
#define EMPTY(a)   ((a) ? (a) : "")
#define EMPTY_STRING_P(a)   ((a) ? (a)[0]==0 : 1)
#define XOR(a, b)   (((a) && !(b)) || (!(a) && (b)))
#define SQUARE(x)   ((float) (x) * (float) (x))
#define TO_RADIANS(degrees)   (M180 * (degrees))
#define DOUBLE_TO_COORD(x)   ((x) >= 0 ? (Coord)((x) + 0.5) : (Coord)((x) - 0.5))
#define LAYER_ON_STACK(n)   (&PCB->Data->Layer[LayerStack[(n)]])
#define LAYER_PTR(n)   (&PCB->Data->Layer[(n)])
#define CURRENT
#define INDEXOFCURRENT
#define SILKLAYER
#define BACKSILKLAYER
#define TEST_SILK_LAYER(layer)   (GetLayerNumber (PCB->Data, layer) >= max_copper_layer)
#define OBJECT_ID(p)   (((AnyObjectType *) p)->ID)
#define PASTEBUFFER   (&Buffers[Settings.BufferNumber])
#define SET_FLAG(F, P)   ((P)->Flags.f |= (F))
#define CLEAR_FLAG(F, P)   ((P)->Flags.f &= (~(F)))
#define TEST_FLAG(F, P)   ((P)->Flags.f & (F) ? 1 : 0)
#define TOGGLE_FLAG(F, P)   ((P)->Flags.f ^= (F))
#define ASSIGN_FLAG(F, V, P)   ((P)->Flags.f = ((P)->Flags.f & (~(F))) | ((V) ? (F) : 0))
#define TEST_FLAGS(F, P)   (((P)->Flags.f & (F)) == (F) ? 1 : 0)
#define FLAGS_EQUAL(F1, F2)   pcb_flag_eq(&(F1), &(F2))
#define THERMFLAG(L)   (0xf << (4 *((L) % 2)))
#define TEST_THERM(L, P)   ((P)->Flags.t[(L)/2] & THERMFLAG(L) ? 1 : 0)
#define GET_THERM(L, P)   (((P)->Flags.t[(L)/2] >> (4 * ((L) % 2))) & 0xf)
#define CLEAR_THERM(L, P)   (P)->Flags.t[(L)/2] &= ~THERMFLAG(L)
#define ASSIGN_THERM(L, V, P)   (P)->Flags.t[(L)/2] = ((P)->Flags.t[(L)/2] & ~THERMFLAG(L)) | ((V) << (4 * ((L) % 2)))
#define TEST_ANY_THERMS(P)   mem_any_set((P)->Flags.t, sizeof((P)->Flags.t))
#define DESCRIPTION_INDEX   0
#define NAMEONPCB_INDEX   1
#define VALUE_INDEX   2
#define NAME_INDEX(p)
#define ELEMENT_NAME(p, e)   ((e)->Name[NAME_INDEX((p))].TextString)
#define DESCRIPTION_NAME(e)   ((e)->Name[DESCRIPTION_INDEX].TextString)
#define NAMEONPCB_NAME(e)   ((e)->Name[NAMEONPCB_INDEX].TextString)
#define VALUE_NAME(e)   ((e)->Name[VALUE_INDEX].TextString)
#define ELEMENT_TEXT(p, e)   ((e)->Name[NAME_INDEX((p))])
#define DESCRIPTION_TEXT(e)   ((e)->Name[DESCRIPTION_INDEX])
#define NAMEONPCB_TEXT(e)   ((e)->Name[NAMEONPCB_INDEX])
#define VALUE_TEXT(e)   ((e)->Name[VALUE_INDEX])
#define TEXT_IS_VISIBLE(b, l, t)   ((l)->On)
#define FRONT(o)   ((TEST_FLAG(ONSOLDERFLAG, (o)) != 0) == SWAP_IDENT)
#define ON_SIDE(element, side)   (TEST_FLAG (ONSOLDERFLAG, element) == (side == BOTTOM_SIDE))
#define END_LOOP   }} while (0)
#define STYLE_LOOP(top)
#define VIA_LOOP(top)
#define DRILL_LOOP(top)
#define NETLIST_LOOP(top)
#define NET_LOOP(top)
#define CONNECTION_LOOP(net)
#define ELEMENT_LOOP(top)
#define RAT_LOOP(top)
#define ELEMENTTEXT_LOOP(element)
#define ELEMENTNAME_LOOP(element)
#define PIN_LOOP(element)
#define PAD_LOOP(element)
#define ARC_LOOP(element)
#define ELEMENTLINE_LOOP(element)
#define ELEMENTARC_LOOP(element)
#define LINE_LOOP(layer)
#define TEXT_LOOP(layer)
#define POLYGON_LOOP(layer)
#define POLYGONPOINT_LOOP(polygon)
#define ENDALL_LOOP   }} while (0); }} while(0)
#define ALLPIN_LOOP(top)
#define ALLPAD_LOOP(top)
#define ALLLINE_LOOP(top)
#define ALLARC_LOOP(top)
#define ALLPOLYGON_LOOP(top)
#define COPPERLINE_LOOP(top)
#define COPPERARC_LOOP(top)
#define COPPERPOLYGON_LOOP(top)
#define SILKLINE_LOOP(top)
#define SILKARC_LOOP(top)
#define SILKPOLYGON_LOOP(top)
#define ALLTEXT_LOOP(top)
#define VISIBLELINE_LOOP(top)
#define VISIBLEARC_LOOP(top)
#define VISIBLETEXT_LOOP(board)
#define VISIBLEPOLYGON_LOOP(top)
#define POINTER_LOOP(top)
#define MENU_LOOP(top)
#define ENTRY_LOOP(top)
#define GROUP_LOOP(data, group)
#define LAYER_LOOP(data, ml)
#define LAYER_TYPE_LOOP(data, ml, type)
#define VIA_IS_BURIED(via)   (via->BuriedFrom != 0 || via->BuriedTo != 0)
#define VIA_ON_LAYER(via, layer)   (layer >= via->BuriedFrom && layer <= via->BuriedTo )

Functions

int mem_any_set (unsigned char *, int)

Detailed Description

Some commonly used macros not related to a special C-file.

The file is included by global.h after const.h


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 macro.h.


Define Documentation

#define ALLARC_LOOP (   top)
Value:
do {            \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        for (l =0; l < max_copper_layer + SILK_LAYER; l++, layer++)             \
        { \
                ARC_LOOP(layer)

Definition at line 341 of file macro.h.

Referenced by ActionMinClearGap(), ActionRipUp(), FreeRotateBuffer(), GetDataBoundingBox(), MirrorBuffer(), RotateBuffer(), SearchObjectByID(), SwapBuffer(), and XYtoNetLength().

#define ALLLINE_LOOP (   top)
#define ALLPOLYGON_LOOP (   top)
#define ALLTEXT_LOOP (   top)
Value:
do {            \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        for (l = 0; l < max_copper_layer + SILK_LAYER; l++, layer++)    \
        { \
                TEXT_LOOP(layer)

Definition at line 400 of file macro.h.

Referenced by GetDataBoundingBox(), RotateBuffer(), SearchObjectByID(), SelectedOperation(), and SwapBuffer().

#define ARC_LOOP (   element)
#define ASSIGN_FLAG (   F,
  V,
 
)    ((P)->Flags.f = ((P)->Flags.f & (~(F))) | ((V) ? (F) : 0))

Definition at line 116 of file macro.h.

Referenced by AutoRoute(), SelectBlock(), SelectBuriedVias(), and SelectByFlag().

#define ASSIGN_THERM (   L,
  V,
 
)    (P)->Flags.t[(L)/2] = ((P)->Flags.t[(L)/2] & ~THERMFLAG(L)) | ((V) << (4 * ((L) % 2)))
#define BACKSILKLAYER
Value:

Definition at line 93 of file macro.h.

#define CLEAR_THERM (   L,
 
)    (P)->Flags.t[(L)/2] &= ~THERMFLAG(L)

Definition at line 125 of file macro.h.

Referenced by ChangePinThermal(), ChangeViaThermal(), and mptl_pin_callback().

#define CONNECTION_LOOP (   net)
Value:
do {                         \
        Cardinal        n;                                      \
        ConnectionType *connection;                             \
        for (n = (net)->ConnectionN-1; n != -1; n--)            \
        {                                                       \
                connection = & (net)->Connection[n]

Definition at line 215 of file macro.h.

Referenced by AddAllRats(), CollectSubnets(), CreateRouteData(), import_clusters(), smartdisperse(), and TransferNet().

#define COPPERARC_LOOP (   top)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        for (l =0; l < max_copper_layer; l++, layer++)          \
        { \
                ARC_LOOP(layer)

Definition at line 362 of file macro.h.

Referenced by ClearFlagOnLinesAndPolygons(), DRCAll(), and gsvit_build_net_from_selected().

#define COPPERLINE_LOOP (   top)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        for (l = 0; l < max_copper_layer; l++, layer++) \
        { \
                LINE_LOOP(layer)

Definition at line 355 of file macro.h.

Referenced by ClearFlagOnLinesAndPolygons(), DRCAll(), and gsvit_build_net_from_selected().

#define COPPERPOLYGON_LOOP (   top)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        for (l = 0; l < max_copper_layer; l++, layer++) \
        { \
                POLYGON_LOOP(layer)

Definition at line 369 of file macro.h.

Referenced by ClearFlagOnLinesAndPolygons(), and gsvit_build_net_from_selected().

#define DESCRIPTION_INDEX   0

Definition at line 134 of file macro.h.

#define DESCRIPTION_NAME (   e)    ((e)->Name[DESCRIPTION_INDEX].TextString)
#define DESCRIPTION_TEXT (   e)    ((e)->Name[DESCRIPTION_INDEX])
#define DOUBLE_TO_COORD (   x)    ((x) >= 0 ? (Coord)((x) + 0.5) : (Coord)((x) - 0.5))

Definition at line 78 of file macro.h.

Referenced by unit_to_coord().

#define DRILL_LOOP (   top)
Value:
do             {               \
        Cardinal        n;                                      \
        DrillType *drill;                                       \
        for (n = 0; (top)->DrillN > 0 && n < (top)->DrillN; n++)                        \
        {                                                       \
                drill = &(top)->Drill[n]

Definition at line 194 of file macro.h.

Referenced by FreeDrillInfo(), and GetDrillInfo().

#define ELEMENT_NAME (   p,
 
)    ((e)->Name[NAME_INDEX((p))].TextString)

Definition at line 140 of file macro.h.

Referenced by QueryInputAndChangeObjectName().

#define ELEMENT_TEXT (   p,
 
)    ((e)->Name[NAME_INDEX((p))])
#define ELEMENTARC_LOOP (   element)
Value:
do {                               \
  GList *__iter, *__next;                                           \
  Cardinal n = 0;                                                   \
  for (__iter = (element)->Arc, __next = g_list_next (__iter);      \
       __iter != NULL;                                              \
       __iter = __next, __next = g_list_next (__iter), n++) {       \
    ArcType *arc = __iter->data;

Definition at line 285 of file macro.h.

#define ELEMENTLINE_LOOP (   element)
Value:
do {                              \
  GList *__iter, *__next;                                           \
  Cardinal n = 0;                                                   \
  for (__iter = (element)->Line, __next = g_list_next (__iter);     \
       __iter != NULL;                                              \
       __iter = __next, __next = g_list_next (__iter), n++) {       \
    LineType *line = __iter->data;

Definition at line 277 of file macro.h.

Referenced by ChangeElementSize(), CopyElementLowLevel(), draw_element_package(), DrawElementPackage(), DRCAll(), EraseElement(), FreeRotateElementLowLevel(), MirrorElementCoordinates(), MoveElementLowLevel(), pinout_set_data(), RotateElementLowLevel(), SearchObjectByID(), SetElementBoundingBox(), SmashBufferElement(), and XORDrawElement().

#define ELEMENTNAME_LOOP (   element)
Value:
do      {                       \
        Cardinal        n;                                      \
        char            *textstring;                            \
        for (n = MAX_ELEMENTNAMES-1; n != -1; n--)              \
        {                                                       \
                textstring = (element)->Name[n].TextString

Definition at line 246 of file macro.h.

Referenced by FreeElementMemory().

#define ELEMENTTEXT_LOOP (   element)
#define EMPTY_STRING_P (   a)    ((a) ? (a)[0]==0 : 1)
#define END_LOOP   }} while (0)

Definition at line 177 of file macro.h.

Referenced by acquire_twonets(), ActionAddRats(), ActionAttributes(), ActionChangePinName(), ActionDisperseElements(), ActionDisplay(), ActionDJopt(), ActionElementList(), ActionElementSetAttr(), ActionListRotations(), ActionMinClearGap(), ActionMinMaskGap(), ActionRenumber(), ActionRipUp(), ActionToggleHideName(), AddAllRats(), apply_vendor_map(), AssignDefaultLayerTypes(), AutoRoute(), ChangeBuriedViasAfterLayerCreate(), ChangeBuriedViasAfterLayerDelete(), ChangeBuriedViasAfterLayerMove(), ChangeElement2ndSize(), ChangeElementNameSize(), ChangeElementOctagon(), ChangeElementSize(), ChangeElementSquare(), ChangeSelectedElementSide(), ChangeSelectedHole(), ChangeSelectedViaLayers(), CheckArcPointForRubberbandConnection(), CheckLinePointForRubberbandConnection(), CheckPadForRubberbandConnection(), CheckPolygonForRubberbandConnection(), CheckShorts(), ClearFlagOnLinesAndPolygons(), ClearFlagOnPinsViasAndPads(), clearPoly(), ClrElementOctagon(), ClrElementSquare(), collectSelectedElements(), CollectSubnets(), ComputeCost(), ConvertBufferToElement(), CopyElementLowLevel(), CopyPastebufferToLayout(), create_lib_tree_model(), CreateNewArcOnLayer(), CreateNewPCB(), CreateNewVia(), CreateRouteData(), DeleteRats(), describe_location(), DestroyElement(), draw_element_package(), draw_element_pins_and_pads(), DrawElementPackage(), DrawElementPinsAndPads(), drc_lines(), DRCAll(), element_name_for(), ElementOrientation(), EraseElement(), EraseElementPinsAndPads(), escape(), find_element_by_refdes(), find_pairs(), FitCrosshairIntoGrid(), FlagCurrentStyle(), FreeDataMemory(), FreeDrillInfo(), FreeElementMemory(), FreeLibraryMemory(), FreeNetListListMemory(), FreeNetListMemory(), FreeRotateBuffer(), FreeRotateElementLowLevel(), GatherSubnets(), GetDataBoundingBox(), GetDrillInfo(), GlobalPuller(), gsvit_build_net_from_selected(), gsvit_lookup_net_from_arc(), gsvit_lookup_net_from_line(), gsvit_lookup_net_from_pad(), gsvit_lookup_net_from_polygon(), gsvit_lookup_net_from_pv(), gsvit_write_xcentroids(), import_clusters(), import_geometry(), IPCD356_Netlist(), IPCD356_SanityCheck(), IPCD356_WriteNet(), IronDownAllUnfixedPaths(), lookup_keepaway(), lookup_thickness(), LookupConnectionsToAllElements(), LookupRatLines(), LookupRubberbandLines(), LookupUnusedPins(), MirrorBuffer(), MirrorElementCoordinates(), move_all_thermals(), MoveElementLowLevel(), MoveElementName(), MoveElementToBuffer(), MovePolygonLowLevel(), nbcb_ripup(), net_model_create(), netlist_rip_up_cb(), netnode_browse(), node_model_create(), NotifyMode(), PCBFileVersionNeeded(), pinout_set_data(), PlowsPolygon(), PrintAndSelectUnusedPinsAndPadsOfElement(), PrintBOM(), PrintElementConnections(), PrintFab(), ProcNetlist(), r_delete_element(), rat_used(), read_lines(), read_pads(), read_points(), relocate(), RemoveDegradedVias(), renumber_block(), renumber_buffer(), ReportAllNetLengths(), ReportDialog(), ReportFoundPins(), ReportNetLength(), ResetSubnet(), ResetVisitPinsViasAndPads(), RotateBuffer(), RotateElementLowLevel(), RotateElementName(), RotatePolygonLowLevel(), RouteAll(), RouteOne(), SearchElementByName(), SearchLayerByName(), SearchObjectByID(), SearchPointByLocation(), SelectBlock(), SelectBuriedVias(), SelectByFlag(), SelectedOperation(), SelectObject(), SetElementBoundingBox(), SetElementOctagon(), SetElementSquare(), SetPolygonBoundingBox(), SetRouteStyle(), smartdisperse(), SmashBufferElement(), SwapBuffer(), teardrops(), touch_conflicts(), TransferNet(), UniqueElementName(), XORDrawBuffer(), and XORDrawElement().

#define ENTRIES (   x)    (sizeof((x))/sizeof((x)[0]))
#define ENTRY_LOOP (   top)
Value:
do      {       \
        Cardinal        n;                      \
        LibraryEntryType *entry;                \
        for (n = (top)->EntryN-1; n != -1; n--) \
        {                                       \
                entry = &(top)->Entry[n]

Definition at line 453 of file macro.h.

Referenced by create_lib_tree_model(), describe_location(), FreeLibraryMemory(), node_model_create(), and ProcNetlist().

#define FLAGS_EQUAL (   F1,
  F2 
)    pcb_flag_eq(&(F1), &(F2))

Definition at line 119 of file macro.h.

Referenced by UndoFlag().

#define GET_THERM (   L,
 
)    (((P)->Flags.t[(L)/2] >> (4 * ((L) % 2))) & 0xf)
#define GROUP_LOOP (   data,
  group 
)
Value:
do {    \
        Cardinal entry; \
        for (entry = 0; entry < ((PCBType *)(data->pcb))->LayerGroups.Number[(group)]; entry++) \
        { \
                LayerType *layer;               \
                Cardinal number;                \
                number = ((PCBType *)(data->pcb))->LayerGroups.Entries[(group)][entry]; \
                if (number >= max_copper_layer) \
                  continue;                     \
                layer = &data->Layer[number];

Definition at line 460 of file macro.h.

Referenced by CheckArcPointForRubberbandConnection(), CheckLinePointForRubberbandConnection(), CheckPadForRubberbandConnection(), CheckPolygonForRubberbandConnection(), clearPoly(), ConvertBufferToElement(), CreateRouteData(), drc_lines(), FitCrosshairIntoGrid(), import_geometry(), and PlowsPolygon().

#define LAYER_LOOP (   data,
  ml 
)
Value:
do { \
        Cardinal n; \
        for (n = 0; n < ml; n++) \
        { \
           LayerType *layer = (&data->Layer[(n)]);

Definition at line 471 of file macro.h.

Referenced by PlowsPolygon(), SearchLayerByName(), and SelectBlock().

#define LAYER_ON_STACK (   n)    (&PCB->Data->Layer[LayerStack[(n)]])

Definition at line 83 of file macro.h.

Referenced by DrawEverything(), and SearchObjectByLocation().

#define LAYER_TYPE_LOOP (   data,
  ml,
  type 
)
Value:
do { \
        Cardinal n; \
        for (n = 0; n < ml; n++) { \
          LayerType *layer = (&data->Layer[(n)]); \
          if (layer->Type != (type)) \
            continue;

Definition at line 477 of file macro.h.

Referenced by AssignDefaultLayerTypes().

#define LINE_LOOP (   layer)
Value:
do {                                       \
  GList *__iter, *__next;                                           \
  Cardinal n = 0;                                                   \
  for (__iter = (layer)->Line, __next = g_list_next (__iter);       \
       __iter != NULL;                                              \
       __iter = __next, __next = g_list_next (__iter), n++) {       \
    LineType *line = __iter->data;

Definition at line 293 of file macro.h.

Referenced by ActionDJopt(), CheckPolygonForRubberbandConnection(), ConvertBufferToElement(), CopyPastebufferToLayout(), CreateRouteData(), find_pairs(), FreeDataMemory(), GlobalPuller(), gsvit_lookup_net_from_line(), PrintFab(), read_lines(), SelectBlock(), and XORDrawBuffer().

#define MAKEMAX (   a,
 
)    if ((b) > (a)) (a) = (b)
#define MAKEMIN (   a,
 
)    if ((b) < (a)) (a) = (b)
#define MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

Definition at line 58 of file macro.h.

Referenced by ActionSelect(), ActionUnselect(), AddLine(), AddPad(), AddPart(), AddPin(), ArcPolyNoIntersect(), AutoPlaceSelected(), bloat_routebox(), break_box_edge(), BreakManyEdges(), ChangeArcClearSize(), ChangeLineClearSize(), ChangePadMaskSize(), ChangePinMaskSize(), ChangeViaMaskSize(), check_point_in_pad(), CheckArcPointForRubberbandConnection(), CheckLinePointForRubberbandConnection(), CheckPadForRubberbandConnection(), clip_box(), ComputeCost(), CreateDrawnLineOnLayer(), CreateNewElement(), createPerturbation(), CreateRouteData(), crosshair_update_range(), draw_dozen_cross(), draw_pad_name(), draw_slanted_cross(), expand_box(), fill_polyarea(), find_pairs(), flow_from_edge_to_edge(), FortyFiveLine(), GatherPadName(), GetDataBoundingBox(), ghid_cell_renderer_visibility_get_size(), ghid_drawing_area_expose_cb(), ghid_invalidate_lr(), ghid_render_pixmap(), ghid_violation_renderer_get_size(), ghid_zoom_view_abs(), ghid_zoom_view_fit(), gp_pad_cb(), hidgl_draw_grid(), InitAutoRouteParameters(), intersection_of_linesegs(), IsLineInPolygon(), LineArcIntersect(), LineLineIntersect(), LOCtoPVpoly_callback(), min_net_net_spacing(), min_oproute_net_spacing(), min_oproute_vertex_spacing(), min_spacing(), min_vertex_net_spacing(), oproute_min_spacing(), pan_common(), ParseGroupString(), penalty(), PinLineIntersect(), PV_TOUCH_PV(), RD_DrawLine(), redraw_region(), ReleaseMode(), RotateBoxLowLevel(), RouteOne(), SetArcBoundingBox(), SetCrosshairRange(), SetElementBoundingBox(), SetFontInfo(), SetLineBoundingBox(), SetPadBoundingBox(), SetPinBoundingBox(), SetTextBoundingBox(), should_compute_no_holes(), triangle_interior_capacity(), vector_insert_many(), and vertex_line_normal_intersection().

#define MENU_LOOP (   top)
Value:
do {    \
        Cardinal        l;                      \
        LibraryMenuType *menu;                  \
        for (l = (top)->MenuN-1; l != -1; l--)  \
        {                                       \
                menu = &(top)->Menu[l]

Definition at line 446 of file macro.h.

Referenced by create_lib_tree_model(), describe_location(), FreeLibraryMemory(), net_model_create(), ProcNetlist(), and rat_used().

#define NAME_INDEX (   p)
Value:
(TEST_FLAG(NAMEONPCBFLAG,(p)) ? NAMEONPCB_INDEX :\
                                (TEST_FLAG(DESCRIPTIONFLAG, (p)) ?              \
                                DESCRIPTION_INDEX : VALUE_INDEX))

Definition at line 137 of file macro.h.

Referenced by ChangeElementName(), ChangeElementText(), DrawEverything(), DrawSilk(), NotifyMode(), ReportDialog(), and SearchElementNameByLocation().

#define NAMEONPCB_INDEX   1
#define NAMEONPCB_TEXT (   e)    ((e)->Name[NAMEONPCB_INDEX])

Definition at line 146 of file macro.h.

Referenced by ActionToggleHideName(), CreateNewElement(), and GetDataBoundingBox().

#define NET_LOOP (   top)
Value:
do   {                             \
        Cardinal        n;                                      \
        NetType *net;                                           \
        for (n = (top)->NetN-1; n != -1; n--)                   \
        {                                                       \
                net = &(top)->Net[n]

Definition at line 208 of file macro.h.

Referenced by AddAllRats(), CollectSubnets(), CreateRouteData(), FreeNetListMemory(), import_clusters(), and smartdisperse().

#define NETLIST_LOOP (   top)
Value:
do   {                         \
        Cardinal        n;                                      \
        NetListType *netlist;                                   \
        for (n = (top)->NetListN-1; n != -1; n--)               \
        {                                                       \
                netlist = &(top)->NetList[n]

Definition at line 201 of file macro.h.

Referenced by CreateRouteData(), FreeNetListListMemory(), and import_clusters().

#define ON_SIDE (   element,
  side 
)    (TEST_FLAG (ONSOLDERFLAG, element) == (side == BOTTOM_SIDE))
#define PIN_LOOP (   element)
#define POINTER_LOOP (   top)
Value:
do      {       \
        Cardinal        n;                      \
        void    **ptr;                          \
        for (n = (top)->PtrN-1; n != -1; n--)   \
        {                                       \
                ptr = &(top)->Ptr[n]

Definition at line 439 of file macro.h.

Referenced by CheckShorts(), and CreateRouteData().

#define POLYGON_LOOP (   layer)
Value:
do {                                    \
  GList *__iter, *__next;                                           \
  Cardinal n = 0;                                                   \
  for (__iter = (layer)->Polygon, __next = g_list_next (__iter);    \
       __iter != NULL;                                              \
       __iter = __next, __next = g_list_next (__iter), n++) {       \
    PolygonType *polygon = __iter->data;

Definition at line 309 of file macro.h.

Referenced by ConvertBufferToElement(), CopyPastebufferToLayout(), CreateRouteData(), FreeDataMemory(), gsvit_lookup_net_from_polygon(), SearchPointByLocation(), SelectBlock(), and XORDrawBuffer().

#define POLYGONPOINT_LOOP (   polygon)
Value:
do      {       \
        Cardinal                        n;              \
        PointType *point;                               \
        for (n = (polygon)->PointN-1; n != -1; n--)     \
        {                                               \
                point = &(polygon)->Points[n]

Definition at line 317 of file macro.h.

Referenced by FreeRotateBuffer(), MirrorBuffer(), MovePolygonLowLevel(), RotatePolygonLowLevel(), SearchObjectByID(), SearchPointByLocation(), SetPolygonBoundingBox(), and SwapBuffer().

#define RAT_LOOP (   top)
Value:
do {                                          \
  GList *__iter, *__next;                                           \
  Cardinal n = 0;                                                   \
  for (__iter = (top)->Rat, __next = g_list_next (__iter);          \
       __iter != NULL;                                              \
       __iter = __next, __next = g_list_next (__iter), n++) {       \
    RatType *line = __iter->data;

Definition at line 230 of file macro.h.

Referenced by acquire_twonets(), ActionAddRats(), AutoRoute(), ClearFlagOnLinesAndPolygons(), DeleteRats(), SearchObjectByID(), SelectBlock(), SelectByFlag(), and SelectedOperation().

#define SGN (   a)    ((a) >0 ? 1 : ((a) == 0 ? 0 : -1))
#define SGNZ (   a)    ((a) >=0 ? 1 : -1)

Definition at line 63 of file macro.h.

Referenced by NotifyMode(), and XORDrawAttachedArc().

#define SILKARC_LOOP (   top)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        layer += max_copper_layer + BOTTOM_SILK_LAYER;                  \
        for (l = 0; l < 2; l++, layer++)                \
        { \
                ARC_LOOP(layer)

Definition at line 384 of file macro.h.

#define SILKLAYER
Value:

Definition at line 91 of file macro.h.

#define SILKLINE_LOOP (   top)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        layer += max_copper_layer + BOTTOM_SILK_LAYER;                  \
        for (l = 0; l < 2; l++, layer++)                \
        { \
                LINE_LOOP(layer)

Definition at line 376 of file macro.h.

Referenced by DRCAll().

#define SILKPOLYGON_LOOP (   top)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        layer += max_copper_layer + BOTTOM_SILK_LAYER;                  \
        for (l = 0; l < 2; l++, layer++)                \
        { \
                POLYGON_LOOP(layer)

Definition at line 392 of file macro.h.

#define SQUARE (   x)    ((float) (x) * (float) (x))

Definition at line 74 of file macro.h.

#define STYLE_LOOP (   top)
Value:
do {                                       \
        Cardinal n;                                                 \
        RouteStyleType *style;                                      \
        for (n = 0; n < NUM_STYLES; n++)                            \
        {                                                           \
                style = &(top)->RouteStyle[n]

Definition at line 179 of file macro.h.

Referenced by CreateNewPCB(), FlagCurrentStyle(), lookup_keepaway(), lookup_thickness(), ProcNetlist(), and SetRouteStyle().

#define SWAP_ANGLE (   a)    (-(a))

Definition at line 48 of file macro.h.

Referenced by MirrorBuffer(), MirrorElementCoordinates(), and SwapBuffer().

#define SWAP_DELTA (   d)    (-(d))

Definition at line 49 of file macro.h.

Referenced by MirrorBuffer(), MirrorElementCoordinates(), and SwapBuffer().

#define SWAP_IDENT   Settings.ShowBottomSide
#define SWAP_SIGN_X (   x)    (x)

Definition at line 46 of file macro.h.

Referenced by common_draw_pcb_text().

#define SWAP_SIGN_Y (   y)    (-(y))

Definition at line 47 of file macro.h.

Referenced by common_draw_pcb_text().

#define SWAP_X (   x)    (SWAP_SIGN_X(x))

Definition at line 50 of file macro.h.

Referenced by MirrorBuffer(), MirrorElementCoordinates(), and SwapBuffer().

#define SWAP_Y (   y)    (PCB->MaxHeight +SWAP_SIGN_Y(y))

Definition at line 51 of file macro.h.

Referenced by MirrorBuffer(), MirrorElementCoordinates(), and SwapBuffer().

#define TEST_ANY_THERMS (   P)    mem_any_set((P)->Flags.t, sizeof((P)->Flags.t))

Definition at line 129 of file macro.h.

Referenced by common_flags_to_string(), and simple_optimize_corner().

#define TEST_FLAG (   F,
 
)    ((P)->Flags.f & (F) ? 1 : 0)

Definition at line 114 of file macro.h.

Referenced by _draw_pad(), _draw_pv(), _draw_pv_name(), acquire_twonets(), ActionAddRats(), ActionAttributes(), ActionChangeSize(), ActionDisperseElements(), ActionDisplay(), ActionDJopt(), ActionElementList(), ActionMorphPolygon(), ActionMoveObject(), ActionRenumber(), ActionRipUp(), ActionSetViaLayers(), ActionToggleHideName(), ActionUndo(), add_object_to_list(), AddAllRats(), AddNet(), AddPad(), AddPin(), AddPolygon(), AdjustAttachedLine(), AdjustInsertPoint(), AdjustTwoLine(), apply_vendor_map(), arc_callback(), arc_sub_callback(), arcpoint_callback(), AttachForCopy(), AutoRoute(), ChangeArcClearSize(), ChangeArcJoin(), ChangeArcSize(), ChangeElement2ndSize(), ChangeElementName(), ChangeElementNameSize(), ChangeElementOctagon(), ChangeElementSide(), ChangeElementSize(), ChangeElementSquare(), ChangeFlag(), ChangeHole(), ChangeLineClearSize(), ChangeLineJoin(), ChangeLineSize(), ChangeObjectClearSize(), ChangeObjectViaLayers(), ChangePadClearSize(), ChangePadName(), ChangePadSize(), ChangePadSquare(), ChangePaste(), ChangePin2ndSize(), ChangePinClearSize(), ChangePinName(), ChangePinOctagon(), ChangePinSize(), ChangePinSquare(), ChangePolyClear(), ChangeSelectedClearSize(), ChangeSelectedElementSide(), ChangeSelectedHole(), ChangeSelectedPaste(), ChangeSelectedViaLayers(), ChangeTextJoin(), ChangeTextName(), ChangeTextSize(), ChangeVia2ndSize(), ChangeViaClearSize(), ChangeViaName(), ChangeViaOctagon(), ChangeViaSize(), check_point_in_pad(), check_point_in_pin(), check_snap_offgrid_line(), CheckPadForRat(), CheckPadForRubberbandConnection(), CheckPinForRubberbandConnection(), CheckPolygonForRubberbandConnection(), CheckShorts(), ClearFlagOnLinesAndPolygons(), ClearFlagOnPinsViasAndPads(), clearPin_callback(), clearPoly(), ClearWarnings(), ClosePolygon(), ClrArcJoin(), ClrElementOctagon(), ClrElementSquare(), ClrLineJoin(), ClrPadSquare(), ClrPinOctagon(), ClrPinSquare(), ClrTextJoin(), ClrViaOctagon(), collectSelectedElements(), CollectSubnets(), common_draw_pcb_arc(), common_draw_pcb_line(), common_draw_pcb_text(), common_fill_pcb_pad(), common_fill_pcb_polygon(), common_fill_pcb_pv(), common_flags_to_string(), common_gui_draw_pcb_polygon(), common_thindraw_pcb_pad(), common_thindraw_pcb_polygon(), common_thindraw_pcb_pv(), ComputeCost(), CopyAttachedPolygonToLayer(), CopyElement(), CreateNewPin(), CreateNewVia(), createPerturbation(), CreateRouteData(), cur_clip(), DeleteRats(), doPerturb(), draw_element_name(), draw_element_package(), draw_pad(), draw_pad_name(), DrawAttached(), DrawElementName(), DrawEMark(), DrawEverything(), DrawLayer(), DrawMask(), DrawNewConnections(), DrawPad(), DrawPaste(), DrawPin(), DrawRat(), DrawVia(), DRCAll(), drcArc_callback(), drcLine_callback(), drcPad_callback(), drcVia_callback(), element_callback(), EraseElementName(), ErasePad(), ErasePin(), EraseRat(), EraseVia(), escape(), export_pcb_drawarc(), export_pcb_drawline(), FillDrill(), find_pair_padarc_callback(), find_pair_padline_callback(), FindPad(), FitCrosshairIntoGrid(), FlagElementName(), FlagLayerShown(), FlagTESTFLAG(), GatherPVName(), GatherSubnets(), ghid_set_layer(), ghid_set_status_line_label(), gp_pad_cb(), gp_pin_cb(), gsvit_build_net_from_selected(), hidgl_fill_pcb_polygon(), hole_callback(), hole_counting_callback(), InitClip(), InitComponentLookup(), InitializeDrill(), IPCD356_Netlist(), IPCD356_WriteNet(), IronDownAllUnfixedPaths(), IsArcInPolygon(), IsLineInPolygon(), IsPasteEmpty(), IsPointInPad(), IsPointOnPin(), layer_button_callback(), layer_process(), LayersChanged(), lesstif_draw_arc(), lesstif_draw_line(), lesstif_draw_rect(), lesstif_fill_circle(), lesstif_fill_rect(), lesstif_set_layer(), lesstif_use_mask(), line_callback(), line_sub_callback(), LineLineIntersect(), linepoint_callback(), LinePoly(), ListStart(), LOCtoArcArc_callback(), LOCtoArcLine_callback(), LOCtoArcPad_callback(), LOCtoLineArc_callback(), LOCtoLineLine_callback(), LOCtoLinePad_callback(), LOCtoLineRat_callback(), LOCtoPad_callback(), LOCtoPadArc_callback(), LOCtoPadLine_callback(), LOCtoPadPad_callback(), LOCtoPadPoly_callback(), LOCtoPadRat_callback(), LOCtoPolyArc_callback(), LOCtoPolyLine_callback(), LOCtoPolyPad_callback(), LOCtoPolyRat_callback(), LOCtoPVarc_callback(), LOCtoPVline_callback(), LOCtoPVpad_callback(), LOCtoPVpoly_callback(), LOCtoPVrat_callback(), LOCtoRat_callback(), LookupLOConnectionsToArc(), LookupLOConnectionsToLine(), LookupLOConnectionsToPad(), LookupLOConnectionsToPolygon(), MorphPolygon(), MoveArcToLayer(), MoveLineToLayer(), MovePolygonToLayer(), MoveRatToLayer(), MoveTextToLayer(), name_callback(), nbcb_ripup(), netlist_rip_up_cb(), NotifyLine(), NotifyMode(), pad_callback(), pad_sub_callback(), padcleaner(), PinLineIntersect(), pinorvia_callback(), PinPoly(), plow_callback(), PlowsPolygon(), png_set_layer(), polygon_callback(), PolygonToRat_callback(), PrintAndSelectUnusedPinsAndPadsOfElement(), PrintElementConnections(), PrintFab(), ProcNetlist(), ps_draw_pcb_polygon(), pv_arc_callback(), pv_line_callback(), pv_pad_callback(), pv_poly_callback(), pv_pv_callback(), pv_rat_callback(), PV_TOUCH_PV(), rat_callback(), RD_DrawLine(), RD_DrawVia(), read_pads(), read_points(), relocate(), renumber_block(), ReportDialog(), ReportFoundPins(), ReportNetLength(), RotateScreenObject(), RotateTextLowLevel(), RouteAll(), rubber_callback(), SearchObjectByLocation(), SelectBlock(), SelectBuriedVias(), SelectByFlag(), SelectedOperation(), SelectObject(), set_object_color(), SetArcJoin(), SetElementOctagon(), SetElementSquare(), SetLineJoin(), SetLineSize(), SetMode(), SetPadBoundingBox(), SetPadSquare(), SetPinOctagon(), SetPinSquare(), SetTextBoundingBox(), SetTextJoin(), SetViaOctagon(), smartdisperse(), SmashBufferElement(), SubtractArc(), SubtractLine(), SubtractPad(), SubtractText(), text_callback(), text_sub_callback(), ThermPoly(), TracePath(), Undo(), UnsubtractArc(), UnsubtractLine(), UnsubtractText(), UpdateXY(), vendorIsElementMappable(), vertex_net_thickness(), XORDrawElement(), XORDrawMoveOrCopyObject(), and XYtoNetLength().

#define TEST_FLAGS (   F,
 
)    (((P)->Flags.f & (F)) == (F) ? 1 : 0)

Definition at line 117 of file macro.h.

Referenced by ActionMinClearGap(), ActionMinMaskGap(), ActionRipUp(), and mark_ends_pending().

#define TEST_SILK_LAYER (   layer)    (GetLayerNumber (PCB->Data, layer) >= max_copper_layer)

Definition at line 96 of file macro.h.

Referenced by MoveLineToLayer(), and NotifyMode().

#define TEST_THERM (   L,
 
)    ((P)->Flags.t[(L)/2] & THERMFLAG(L) ? 1 : 0)
#define TEXT_IS_VISIBLE (   b,
  l,
 
)    ((l)->On)

Definition at line 152 of file macro.h.

Referenced by SelectBlock(), and SelectedOperation().

#define TEXT_LOOP (   layer)
Value:
do {                                       \
  GList *__iter, *__next;                                           \
  Cardinal n = 0;                                                   \
  for (__iter = (layer)->Text, __next = g_list_next (__iter);       \
       __iter != NULL;                                              \
       __iter = __next, __next = g_list_next (__iter), n++) {       \
    TextType *text = __iter->data;

Definition at line 301 of file macro.h.

Referenced by CopyPastebufferToLayout(), CreateRouteData(), FreeDataMemory(), PrintFab(), SelectBlock(), and XORDrawBuffer().

#define THERMFLAG (   L)    (0xf << (4 *((L) % 2)))

Definition at line 121 of file macro.h.

#define TO_RADIANS (   degrees)    (M180 * (degrees))

Definition at line 75 of file macro.h.

Referenced by gerber_draw_arc().

#define UNKNOWN_NAME (   a,
  n 
)    ((a) && *(a) ? (a) : (n))

Definition at line 69 of file macro.h.

Referenced by describe_location().

#define VALUE_INDEX   2

Definition at line 136 of file macro.h.

Referenced by ActionElementList().

#define VALUE_NAME (   e)    ((e)->Name[VALUE_INDEX].TextString)
#define VALUE_TEXT (   e)    ((e)->Name[VALUE_INDEX])

Definition at line 147 of file macro.h.

Referenced by CreateNewElement().

#define VIA_ON_LAYER (   via,
  layer 
)    (layer >= via->BuriedFrom && layer <= via->BuriedTo )

Definition at line 487 of file macro.h.

Referenced by add_plow(), ChangeBuriedViasAfterLayerMove(), pin_sub_callback(), and subtract_plow().

#define VISIBLEARC_LOOP (   top)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        for (l = 0; l < max_copper_layer + SILK_LAYER; l++, layer++)    \
        { \
                if (layer->On)                          \
                        ARC_LOOP(layer)

Definition at line 415 of file macro.h.

Referenced by nbcb_ripup(), netlist_rip_up_cb(), SelectByFlag(), and SelectedOperation().

#define VISIBLELINE_LOOP (   top)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        for (l = 0; l < max_copper_layer + SILK_LAYER; l++, layer++)    \
        { \
                if (layer->On)                          \
                        LINE_LOOP(layer)

Definition at line 407 of file macro.h.

Referenced by ActionRipUp(), nbcb_ripup(), netlist_rip_up_cb(), SelectByFlag(), and SelectedOperation().

#define VISIBLEPOLYGON_LOOP (   top)
Value:
do      {       \
        Cardinal                l;                      \
        LayerType *layer = (top)->Layer;                \
        for (l = 0; l < max_copper_layer + SILK_LAYER; l++, layer++)    \
        { \
                if (layer->On)                          \
                        POLYGON_LOOP(layer)

Definition at line 431 of file macro.h.

Referenced by SelectByFlag(), and SelectedOperation().

#define VISIBLETEXT_LOOP (   board)
Value:
do      {               \
        Cardinal                l;                      \
        LayerType *layer = (board)->Data->Layer;                \
        for (l = 0; l < max_copper_layer + SILK_LAYER; l++, layer++)    \
        { \
                TEXT_LOOP(layer);                                      \
                  if (TEXT_IS_VISIBLE((board), layer, text))

Definition at line 423 of file macro.h.

#define XOR (   a,
 
)    (((a) && !(b)) || (!(a) && (b)))

Definition at line 73 of file macro.h.

Referenced by EnforceLineDRC(), NotifyMode(), pad_sub_callback(), and XORDrawAttachedArc().


Function Documentation

int mem_any_set ( unsigned char *  ,
int   
)

Definition at line 2100 of file src/misc.c.