Author Topic: Can I point as structure defined a name(in C) in slickedit?  (Read 2012 times)

kutay

  • Community Member
  • Posts: 10
  • Hero Points: 0
Can I point as structure defined a name(in C) in slickedit?
« on: February 11, 2013, 04:22:37 pm »
Hello,

I'm programming some microcontrollers in C. 
if possible, I want to point in slickedit as structure a defined name (in C programming)

for exemple:

MyTypedef is a structure and  it points an address

Code: [Select]
typedef struct{
    unsigned char lo;
    unsigned char hi;
}MyTypedef;

#define MyReg (((MyTypedef *)(0x12345678)))

Normally, I can access following
Myreg->lo=10;

But I want to see structure members after typing "Myreg->". 
 
Slickedit shows for pointer variables but I want to see defined names , is this possible?

Thx in advance.

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 285
Re: Can I point as structure defined a name(in C) in slickedit?
« Reply #1 on: February 11, 2013, 08:44:34 pm »
Try adding the MyReg macro to the 'C/C++ Preprocessing' settings. HS2

kutay

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Can I point as structure defined a name(in C) in slickedit?
« Reply #2 on: February 12, 2013, 10:50:09 am »
hello hs2,
 thx for your reply, Please you can say or show , How can I add in slickedit C/C++ preprocessing?
I tried adding in tools-> options-> app languages-> C/C++-> C/C++ preprocessing but  It didnt work as structure

Thx in advance
 

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 285
Re: Can I point as structure defined a name(in C) in slickedit?
« Reply #3 on: February 12, 2013, 01:04:23 pm »
In the C/C++ PreProc. dialog just enter/paste the macro code in the edit window:
Code: [Select]
#define MyReg ((MyTypedef *)(0x12345678)) and 'Apply' and say 'Yes' to retag your workspace.

Note that also macro args are supported ie.
Code: [Select]
#define RegPtr(p)  ((MyTypedef *)(p))HS2

kutay

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Can I point as structure defined a name(in C) in slickedit?
« Reply #4 on: February 16, 2013, 11:08:00 am »
thanks alot