~ubuntu-branches/ubuntu/saucy/texmacs/saucy-proposed

« back to all changes in this revision

Viewing changes to TeXmacs/progs/utils/misc/doxygen.scm

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-01-27 15:09:22 UTC
  • mfrom: (4.1.19 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130127150922-j3s80pjnmdcy0jxo
Tags: 1:1.0.7.16-1ubuntu1
* Make debian/fixsh operate on debian/texmacs instead of debian/tmp,
  and move it to binary-post-install/texmacs:: to keep consistency
  when not building arch-indep packages, as on the Dbeian buildds.
* Remove maxima_filter in clean to fix FTBFS on on non-i386 arches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
;;
4
4
;; MODULE      : doxygen.scm
5
5
;; DESCRIPTION : 'doxygen' support for C++
6
 
;; COPYRIGHT   : (C) 2007  Gregoire Lecerf
 
6
;; COPYRIGHT   : (C) 2007--2012  Gregoire Lecerf
7
7
;;
8
8
;; This software falls under the GNU general public license version 3 or later.
9
9
;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
34
34
; refresh them when needed.
35
35
(define file->stamp (make-ahash-table))
36
36
 
 
37
; Web tag files are only loaded once
 
38
(define web->loaded? (make-ahash-table))
 
39
 
37
40
;; Parsing
38
41
 
39
42
(define (tagged? x l)
110
113
            (display x)
111
114
            (newline))))
112
115
      (set! l (cdr l)))
113
 
    (let ((url (string-append current-dir "/" anchorfile "#" anchor)))
 
116
    (let ((u (string-append current-dir "/" anchorfile "#" anchor)))
114
117
      (cond
115
118
        ((== kind "define")
116
119
         (let ((tag (string-append current-source-file ":" name arglist))) 
117
 
           (ahash-set! tag->url tag url)
 
120
           (ahash-set! tag->url tag u)
118
121
           (ahash-set! key->tag name
119
122
                       (cons tag (ahash-ref* key->tag name '())))))
120
123
        ((== kind "function")
121
124
         (let ((tag (string-append type " " current-namespace name arglist)))
122
 
           (ahash-set! tag->url tag url)
 
125
           (ahash-set! tag->url tag u)
123
126
           (ahash-set! key->tag (cpp_basename name)
124
127
                       (cons tag (ahash-ref* key->tag name '())))))
125
128
        ((or (== kind "variable")
127
130
             (== kind "enumeration")
128
131
             (== kind "enumvalue"))
129
132
         (let ((tag (string-append current-namespace name)))
130
 
           (ahash-set! tag->url tag url)
 
133
           (ahash-set! tag->url tag u)
131
134
           (ahash-set! key->tag (cpp_basename name)
132
135
                       (cons tag (ahash-ref* key->tag name '())))))
133
136
        ((== kind "friend"))
267
270
 
268
271
(define (load-tag-file relative_filename)
269
272
  (let ((filename (string-append
270
 
                   (dirname (url->string (get-name-buffer)))
 
273
                   (dirname (url->unix (current-buffer)))
271
274
                   "/" relative_filename)))
272
275
    (if (access? filename R_OK)
273
276
        (let ((nst (stat:mtime (stat filename)))
281
284
                (parse-main s))))
282
285
        (texmacs-error "Doxygen: file not found" filename))))
283
286
 
 
287
(define (load-tag-web relative_filename)
 
288
  (let* ((filename (url-append (url-head (current-buffer)) relative_filename))
 
289
         (loaded? (ahash-ref* web->loaded? filename #f)))
 
290
    (if (not loaded?)
 
291
        (if (url-exists? filename)
 
292
            (let ((s (string-load filename)))
 
293
              (set! current-dir (dirname relative_filename))
 
294
              (parse-main s)
 
295
              (ahash-set! web->loaded? filename #t))
 
296
            (texmacs-error "Doxygen: file not found" filename)))))
 
297
 
284
298
;; TeXmacs exports
285
299
 
286
300
(tm-define (doxygen-load l)
287
301
  (:secure #t)
288
302
  (:synopsis "Load Doxygen tag file.")
289
 
  (load-tag-file (tree-as-string l))
 
303
  (if (url-rooted-web? (current-buffer))
 
304
      (load-tag-web  (tree-as-string l))
 
305
      (load-tag-file (tree-as-string l)))
290
306
  "")
291
307
 
292
308
(tm-define (doxygen-ref x)