Exemple #1
0
int addLPB(int lpb_value,
           int line,int counter,int dividor,
           int blocknum)
{
  struct WBlocks *wblock=getWBlockFromNum(-1,blocknum);
  if(wblock==NULL) {
    RError("unknown block(%p)",blocknum);
    return -1;
  }

  Place *place = PlaceCreate(line,counter,dividor);

  struct LPBs *lpb = SetLPB(wblock->block,place,lpb_value);

  wblock->block->is_dirty = true;

  return ListFindElementPos3(&wblock->block->lpbs->l,&lpb->l);
}
Exemple #2
0
int addLPB(int lpb_value,
           Place place,
           int blocknum)
{
  struct Tracker_Windows *window;
  struct WBlocks *wblock=getWBlockFromNumA(-1,&window,blocknum);
  if(wblock==NULL)
    return -1;

  if (!PlaceLegal(wblock->block, &place)) {
    GFX_Message(NULL, "Place %s is not legal", PlaceToString(&place));
    return -1;
  }

  ADD_UNDO(LPBs_CurrPos(window));
  
  struct LPBs *lpb = SetLPB(wblock->block,&place,lpb_value);

  window->must_redraw=true;

  return ListFindElementPos3(&wblock->block->lpbs->l,&lpb->l);
}