"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "external-editor/neditmacro" of archive wipeout-Linux-x86-libc6-1.6.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 define printOut {
    2 #   t_print ($1 "\n")
    3     write_file ($1 "\n", "/tmp/pipe")
    4     }
    5     
    6 define changeDir {
    7     $current_dir = $1
    8     }
    9     
   10 define byteForLine {
   11     nlines = $1 - 1
   12     for (i=0; i<$text_length && nlines != 0; i++)
   13         if (get_character (i) == "\n")
   14             nlines--
   15     return i
   16     }
   17     
   18 define showByte {
   19     open ($1)
   20     set_cursor_pos ($2)
   21     }
   22 
   23 define showLine {
   24     open ($1)
   25     set_cursor_pos (byteForLine ($2))
   26     }
   27 
   28 define showMethod {
   29     open ($1)
   30     pos = search ($2, 0)
   31     set_cursor_pos (pos)
   32     }    
   33 
   34 define showSelection {
   35     open ($1)
   36     pos = search ($2, 0)
   37     set_cursor_pos (pos)
   38     select (pos, pos+length($2))
   39     }
   40     
   41 define insertText {
   42     replace_range ($cursor, $cursor, $1)
   43     }
   44 
   45 define newFile {
   46     new()
   47     insertText ($2)
   48     save_as ($1)
   49     printOut (0)
   50     }
   51     
   52 define reload {
   53     open ($file_path $file_name)
   54     }
   55 
   56 define setDebugPos {
   57     if ($1 != "") {
   58         open ($1)
   59         pos = byteForLine ($2)
   60         set_cursor_pos (pos)
   61         
   62         end = pos
   63         while (get_character (end) != "\n") 
   64             end++
   65             
   66         select (pos, end)
   67         }
   68     else
   69         set_cursor_pos (0)        
   70     }
   71     
   72 define addBreakpoint {
   73     setDebugPos ($1, $2)
   74     }
   75 
   76 define resetDebugging {
   77     select ($cursor, $cursor)
   78     }
   79     
   80 define clear {
   81     close()
   82     }
   83     
   84 define getLine {
   85     printOut ($line)    
   86     }
   87 
   88 define getFilename {
   89     printOut ($file_path $file_name)
   90     }
   91     
   92 define getSelection {
   93     printOut (get_selection())
   94     }