xa_ed_mem.c File Reference

ApplicationSpecific Textfunctions in Mem. APED_. More...

#include "MS_Def0.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_txt.h"
#include "../ut/ut_txfil.h"
#include "../ci/NC_apt.h"
#include "../xa/xa_mem.h"
#include "../ut/ut_memTab.h"
#include "../xa/xa_ed_mem.h"
#include "../db/ut_DB.h"

Functions

char * APED_lNr_objNam (long *lNr, long *lLen, char **oNam, char *wTab[], long lSta)
int APED_search_objID (char *ps, long lLen, char *otx)
char * APED_search_name (char *ps, char *pe)
int APED_cut_name (char *cbuf)
int APED_src_chg (long lNr, char *sNew)
int APED_update__ (long lNr)
int APED_VcTra_reset (long lNr)
int APED_dec_defLn (char **p2, int *typ, long *ind, char *p1)
int APED_ck_defLn (char *p1)
int APED_dec_txt (char *txLn)
int APED_decAdd (char *cPos)
int APED_search_dbLimits (long *lTab)
int APED_nxt_def_typ (char **lSta, int *lNr, int *lLen, int typ)
int APED_find_dbo (long *dli, long *lNr, int typ, long dbi)
int APED_search_defLn (char **lSta, int *lNr, int *lLen, char *otx, int lNEnd, int src)
int APED_find_depLn_nxt (char **lSta, long *lNr, long *lLen, char *otx)
int APED_find_depLn_last (char **lSta, long *lNr, long *lLen, char *otx)
int APED_find_dep__ (MemTab(ObjSRC)*oa, int typ, long dbi)
int APED_find_dep_nxt (MemTab(ObjSRC)*oa, int typ, long dbi, long lnr, int iPar)
int APED_find_depRef (MemTab(ObjSRC)*oa, long dbi, long lnr, int iPar)
int APED_find_depLn_ck (MemTab(ObjSRC)*oa, int *typ, long *dbi)
int APED_pt_find (char **cpPt, int *sLen, char **cpNxt, char *cps)
char * APED_nxt_obj (char *cps)
int APED_pt_chg (int *lsn, long ipt, char *cps, int lso)

Variables

char AP_ED_oNam [64]
 objectName of active Line
char * UTF_FilBuf0
long UTF_FilBuf0Len
char * UTF_FilBuf1
long UTF_FilBuf1Len
char * ObjCodTab []

Detailed Description

ApplicationSpecific Textfunctions in Mem. APED_.

*/
#ifdef globTag
 void APED(){}
#endif
/*


ApplicationSpecific Textfunctions im Memory.
  StandardFunctions in Memory: UTF_.. in ../ut/ut_txfil.c
=====================================================
Liste_Funktionen_Beginn:

APED_find_dbo              Search last DefinitionLine for DB-obj
APED_search_defLn          Search last DefinitionLine for obj
APED_nxt_def_typ           Search next DefinitionLine of objectTyp

APED_ck_defLn              check if Line cBuf is a Definitionline
APED_dec_defLn             check if Line cBuf is a Definitionline; decode ..
APED_dec_txt               decode textLine, add all objs to group (oTab)
APED_decAdd                decode textLine, add all objs to group (oTab)

APED_lNr_objNam            get sourcelineNr from ObjName
APED_search_name           search objName between ps and pe
APED_search_objID          search objID otx in line ps[lLen]
APED_cut_name              cut/copy objName

APED_src_chg               deactivate line, insert modified line
// APED_undo_do               undo/redo (Delete/restore) line   UNUSED !
APED_update__              update display after APED_undo_redo

APED_find_dep__            find all depending sourceObjs
APED_find_dep_nxt          search & add all depending objects
APED_find_depLn_nxt        Search next depending Line 
APED_find_depLn_last       Search last depending Line 
APED_find_depRef           delete all lines for active constrPlane

APED_pt_find               find position of next point in string
APED_pt_chg                change point from dbi in string
APED_nxt_obj               find next obj in string; skip brackets.
APED_search_dbLimits       search highest indices

APED_VcTra_reset           delete Vec's&Tra's after progLine x in DB

Liste_Funktionen_Ende:
=====================================================

see also:
//   AP_search_obj / UTF_GetLinNr
//   AP_obj_delCk1 UTF_GetLinNr
APT_decode_objTx
IE_decode_Ln
AP_search_obj
UTF_GetLinNr
AP_SMD_prv
UTF_
APT_decode_obj
APT_decode_ausdr
APT_decode_inp

Function Documentation

char* APED_lNr_objNam ( long *  lNr,
long *  lLen,
char **  oNam,
char *  wTab[],
long  lSta 
)

    get next line with objName containing all filterwords (OR)
    if wTab is empty, next srcline is returned.
    Input:
      wTab    filtertext (a list of words, terminated with NULL)
      lSta    first sourcelinNr where to search; 
    Output:
      lNr     sourcelinNr found
      lLen    length of sourceline (incl name)
      oNam    pointer to found objName
    RetCod:
      NULL    no (more) line found
      != NULL OK, startpos of sourceline found
   
    wTab: use UTX_wTab_str

int APED_search_objID ( char *  ps,
long  lLen,
char *  otx 
)

    search objID otx in line ps[lLen]
    Input:
      ps      startpos of line, including line header
      lLen    lineLength
      otx     what to search; objID; eg "P1"
    RetCod:    1   line is definition of otx
               0   line contains otx as depending obj
              -1   line does not contain otx
              -2   line is a commentline
              -3   line is not active

char* APED_search_name ( char *  ps,
char *  pe 
)

    APED_search_name           search objName between ps and pe
    returns position of 1.char after " #"  or NULL

int APED_cut_name ( char *  cbuf  ) 

    APED_cut_name              cut/copy objName
    cut cbuf at " #"  and copy the following text -> AP_ED_oNam
    MODIFIES cbuf !

int APED_src_chg ( long  lNr,
char *  sNew 
)

    APED_src_chg               deactivate line, insert modified line
    and report change -> UNDO.
   
    RetCod:   0   Ok, line changed ...
              1   Error; newLine == activeLine;
   
    creates a additional line !     Update: APED_update__

int APED_update__ ( long  lNr  ) 

    APED_update__              update display starting from lineNr
    set back to <lNr>, update to end of model.
    lNr -1: start from current lineNr (eg after UTF_insert1)

int APED_VcTra_reset ( long  lNr  ) 

APED_VcTra_reset delete Vec's&Tra's after progLine x in DB

int APED_dec_defLn ( char **  p2,
int *  typ,
long *  ind,
char *  p1 
)

    APED_dec_defLn             check if Line p1 is a Definitionline;
      if yes: decode its objID, return positon of objCode
    lines "V=NEW()" sofort auswerten, nicht via WC_Work__;
    Output:
      p2          position of 1 char after '='
      typ, ind    typ and DB-index of outputvar.
      RetCod = 0: yes, p1 is a Definitionline.
              -1: No.

int APED_ck_defLn ( char *  p1  ) 

    check if Line cBuf is a Definitionline;
    find 1. delimiter; it must be '='.
    RetCod = 0: yes, p1 is a Definitionline.
            -1: No.
   
    see also APED_search_defLn PRG_ck_defLn APED_dec_defLn

int APED_dec_txt ( char *  txLn  ) 

    decode textLine, add all objs to group (oTab)
    see IE_decode_Ln 

int APED_decAdd ( char *  cPos  ) 

    decode textLine, add all objs to group (oTab)
    Line is \n terminated !

int APED_search_dbLimits ( long *  lTab  ) 

    APED_search_dbLimits       search highest indices
    Output:
      lTab[0]  nr of curves   (S)
      lTab[1]  nr of surfaces (A)
      lTab[2]  nr of bodies   (B)
      lTab[3]  nr of notes    (N)
      lTab[4]  nr of circles  (C)
      lTab[5]  nr of lines    (L)
      lTab[6]  nr of points   (P)
      lTab[7]  nr of mdRefs   (M)
    see also AP_stru_2_txt (NULL,,1);

int APED_nxt_def_typ ( char **  lSta,
int *  lNr,
int *  lLen,
int  typ 
)

    Search next DefinitionLine of objectTyp
    In:
      lSta   NULL=start search from beginning of model (first call).
             DO NOT MODIFY lSta,lNr,lLen for incremental search !
      typ    typ of obj to find; eg Typ_PT
    Out:
      lSta   startpos of line found
      lNr    nr of line found
      lLen   length of line incl \n (MS-Win incl \r)
   
    RetCodes:
       >=0   OK; DB-Index of obj; lSta, lNr, lLen set.
       -1    no (more) line found
    
    see also:
      AP_search_def
      AP_search_obj / UTF_GetLinNr
      AP_obj_delCk1 UTF_GetLinNr
      UTF_del_rest
      UTF_find_tx1

int APED_find_dbo ( long *  dli,
long *  lNr,
int  typ,
long  dbi 
)

    Search last DefinitionLine for DB-obj
    Input:
      typ,dbi    DB-object
    Output:
      dli   dispListIndex (-1 for Vecs, Vars)
      lNr   Source-LineNr
    RetCod: 0=OK; obj found;   -1=Err, obj not found

int APED_search_defLn ( char **  lSta,
int *  lNr,
int *  lLen,
char *  otx,
int  lNEnd,
int  src 
)

    Search last DefinitionLine
    Out:
     lSta   Posi, wo spaeter weitergesucht wird ..
              ist Pointer auf den beginn der gefundenen Zeile ..
     lNr    gefundene zeilenNummer; erste Zeile == 1.
     lLen   Laenge der Zeile incl \n (und bei MS-Win \r)
    In:
      otx   zu suchendes Obj; zB "L20"
      lNEnd ab (incl) dieser Zeile nicht mehr suchen. -1: bis zum Ende.
      src   0=UTF_FilBuf0; 1=UTF_FilBuf1
    RetCod:
      0     OK, def.line found
     -1     Error, def.line does not exist.
    
    see also:
      AP_search_def
      AP_search_obj / UTF_GetLinNr
      APED_nxt_def_typ
      AP_obj_delCk1 UTF_GetLinNr 
      UTF_del_rest
      UTF_find_tx1

int APED_find_depLn_nxt ( char **  lSta,
long *  lNr,
long *  lLen,
char *  otx 
)

    Search next dependant Line;
    lNr mit Startpos *lSta is a Definitionline (z.B. "L22=...")
    search begins in next Line !
    Input:
      lNr   LineNr of Definitionline (where to start search ..)
      lSta  Startposition of lNr; NULL == not known.
      otx   what to search
    Output:
      lNr   LineNr of found depLn
      lSta  Startposition of found depLn
      lLen  length of found depLn
    
    RetCod:  0   Ok, found ..
            -1   no depending line exists for obj otx

int APED_find_depLn_last ( char **  lSta,
long *  lNr,
long *  lLen,
char *  otx 
)

    Search last dependant Line;
    lNr mit Startpos *lSta ist eine Definitionline (z.B. "L22=...")
    search begins in next Line !
    Input:
      lNr   LineNr of Definitionline (where to start search ..)
      lSta  Startposition of lNr; NULL == not known.
      otx   what to search
    Output:
      lNr   LineNr of found depLn
      lSta  Startposition of found depLn
      lLen  length of found depLn
    
    RetCod:  0   Ok, found ..
            -1   es existiert keine depending line zu obj otx

int APED_find_dep__ ( MemTab(ObjSRC)*  oa,
int  typ,
long  dbi 
)

    APED_find_dep__            find all depending sourceObjs
     Example:
    #include "../ut/ut_memTab.h"           // MemTab
    MemTab(ObjSRC) delTab = MemTab_empty;
    APED_find_dep__ (&delTab, typ, dbi);
      printf(" nr of dep.objs = %d\n",delTab.rNr);
    MemTab_free (&delTab);

int APED_find_dep_nxt ( MemTab(ObjSRC)*  oa,
int  typ,
long  dbi,
long  lnr,
int  iPar 
)

    APED_find_dep_nxt          search & add all depending objects
    Del_find       search & add all depending objects
    see also AP_SMD_nxt Del_find

int APED_find_depRef ( MemTab(ObjSRC)*  oa,
long  dbi,
long  lnr,
int  iPar 
)
int APED_find_depLn_ck ( MemTab(ObjSRC)*  oa,
int *  typ,
long *  dbi 
)
int APED_pt_find ( char **  cpPt,
int *  sLen,
char **  cpNxt,
char *  cps 
)
char* APED_nxt_obj ( char *  cps  ) 
int APED_pt_chg ( int *  lsn,
long  ipt,
char *  cps,
int  lso 
)

Variable Documentation

char AP_ED_oNam[64]

objectName of active Line

char* UTF_FilBuf0
char* UTF_FilBuf1
char* ObjCodTab[]
Generated on Fri Apr 6 09:40:10 2012 for gCAD3D by  doxygen 1.6.3