Displaying C function names defined using a C macro

Displaying C function names defined using a C macro

10210
Power UserPower User
10210

    Mar 31, 2015#1

    I have code that for a set of operator command functions uses a macro to define the function, rather than having the function() declaration in each module. This is done to standardize and simplify the function declarations across quite a number of individual code modules. The following example shows the format of this.

    Code: Select all

    #undef CURR_FUNC
    #define CURR_FUNC FN_PROCESS_LIST_COMMAND
    OPC_PROTOTYPE(FN_PROCESS_LIST_COMMAND)
    {
    
    The problem with this is that FN_PROCESS_LIST_COMMAND does not appear in the function list for the module when UE parses it for syntax highlighting. The module is saved as a .c file so that UE does recognise it correctly for syntax highlighting.

    I've tried adding this line the c_cplusplus.uew word file in order to get the function identified for the function list but it is still not being displayed in the list.

    Code: Select all

    /TGFindStr = "%[^t ]+OPC_PROTOTYPE([A-Z0-9_]+^)"

    Any help appreciated.

    Thanks...

    Frank

    6,653559
    Grand MasterGrand Master
    6,653559

      Mar 31, 2015#2

      The wordfiles installed with UltraEdit use since UE v19.10 by default all the Perl regular expression engine. Therefore the regular expression search string added to c_cplusplus.uew must be in Perl or UltraEdit regexp syntax depending on used UE version.

      With a *.c file currently opened and active, right click into the function list and left click on context menu item Configuration.

      Double click on list item containing %[^t ]+OPC_PROTOTYPE([A-Z0-9_]+^) and change the expression to ^[\t ]*OPC_PROTOTYPE\(([A-Z0-9_]+)\) or (?-i)^[\t ]*OPC_PROTOTYPE\(([A-Z0-9_]+)\)

      With (?-i) the regular expression search becomes case-sensitive while by default all regular expression searches are executed case-insensitive.

      It would be perhaps better to add this regular expression into a separate group in case of using grouped instead of flat function list. For using a flat function list it does not really matter in which group this regexp search string is defined.
      Best regards from an UC/UE/UES for Windows user from Austria

      10210
      Power UserPower User
      10210

        Mar 31, 2015#3

        Mofi,
        Thanks very much for your reply. It's working perfectly now. I hope that you do get some recognition from IDM for the time you spend here helping may people. I'm sure that your detailed answers and knowledge take a load off their own support.

        Cheers...

        Frank

        6,653559
        Grand MasterGrand Master
        6,653559

          Apr 01, 2015#4

          fgeurts wrote:I'm sure that your detailed answers and knowledge take a load off their own support.
          Isn't that always the reason for hosting a user-to-user forum or another user-to-user communication platform by a software producing company? I think so.

          The reason why I wrote always very detailed replies is driven by my own experience when I need help on issues. It is so frustrating for me when I have to find and evaluate 10 and more pages with various suggestions for same problem/task until I could find the solution really working for the problem/task taking all found information into account. I want to avoid wasting time for questioner and for me by trying to write in first reply everything needed to solve problem/task. This is not always possible, especially if question is not detailed enough, but I attempt nevertheless always a "perfect" first reply.

          But I'm very grateful for help by other experienced UE, UES, UC, US, UF users as there are lots of areas where I have no experience at all. I'm not using UltraEdit/UltraCompare on Mac or Linux as well as UltraFinder on Windows and therefore any help here by other users are very welcome. Also FTP, SFTP, FTPS, SSH, Telnet is not used by me and therefore my knowledge on usage of those features is also poor. But any help by other forum members would be very welcome by me. The more other users contribute, the less I need to write.
          Best regards from an UC/UE/UES for Windows user from Austria