diff options
author | gbrandl <devnull@localhost> | 2007-05-30 16:52:49 +0200 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2007-05-30 16:52:49 +0200 |
commit | 0667c49b0965506d8d82f33c073a15b301bd04c7 (patch) | |
tree | f1517cbd1fcb809756da659ef35a860e056ccd65 /tests | |
parent | fdbb25adcd1caccf7dfcfb1300be597d363f2a28 (diff) | |
download | pygments-0667c49b0965506d8d82f33c073a15b301bd04c7.tar.gz |
[svn] Reduce example file size.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examplefiles/boot-9.scm | 1548 | ||||
-rw-r--r-- | tests/examplefiles/example.c | 2429 | ||||
-rw-r--r-- | tests/examplefiles/example.xml | 5789 | ||||
-rw-r--r-- | tests/examplefiles/perl5db.pl | 8430 | ||||
-rw-r--r-- | tests/examplefiles/perlfunc.1 | 2514 | ||||
-rw-r--r-- | tests/examplefiles/phpcomplete.vim | 4581 | ||||
-rw-r--r-- | tests/examplefiles/test.html | 770 |
7 files changed, 0 insertions, 26061 deletions
diff --git a/tests/examplefiles/boot-9.scm b/tests/examplefiles/boot-9.scm index 35fc8d14..1f6ae246 100644 --- a/tests/examplefiles/boot-9.scm +++ b/tests/examplefiles/boot-9.scm @@ -1554,1552 +1554,4 @@ (define (local-set! names val) (nested-set! (current-module) names val)) (define (local-define names val) (nested-define! (current-module) names val)) (define (local-remove names) (nested-remove! (current-module) names)) - - - -;;; {The (app) module} -;;; -;;; The root of conventionally named objects not directly in the top level. -;;; -;;; (app modules) -;;; (app modules guile) -;;; -;;; The directory of all modules and the standard root module. -;;; - -(define (module-public-interface m) - (module-ref m '%module-public-interface #f)) -(define (set-module-public-interface! m i) - (module-define! m '%module-public-interface i)) -(define (set-system-module! m s) - (set-procedure-property! (module-eval-closure m) 'system-module s)) -(define the-root-module (make-root-module)) -(define the-scm-module (make-scm-module)) -(set-module-public-interface! the-root-module the-scm-module) -(set-module-name! the-root-module '(guile)) -(set-module-name! the-scm-module '(guile)) -(set-module-kind! the-scm-module 'interface) -(for-each set-system-module! (list the-root-module the-scm-module) '(#t #t)) - -;; NOTE: This binding is used in libguile/modules.c. -;; -(define (make-modules-in module name) - (if (null? name) - module - (cond - ((module-ref module (car name) #f) - => (lambda (m) (make-modules-in m (cdr name)))) - (else (let ((m (make-module 31))) - (set-module-kind! m 'directory) - (set-module-name! m (append (or (module-name module) - '()) - (list (car name)))) - (module-define! module (car name) m) - (make-modules-in m (cdr name))))))) - -(define (beautify-user-module! module) - (let ((interface (module-public-interface module))) - (if (or (not interface) - (eq? interface module)) - (let ((interface (make-module 31))) - (set-module-name! interface (module-name module)) - (set-module-kind! interface 'interface) - (set-module-public-interface! module interface)))) - (if (and (not (memq the-scm-module (module-uses module))) - (not (eq? module the-root-module))) - (set-module-uses! module (append (module-uses module) (list the-scm-module))))) - -;; NOTE: This binding is used in libguile/modules.c. -;; -(define (resolve-module name . maybe-autoload) - (let ((full-name (append '(app modules) name))) - (let ((already (local-ref full-name))) - (if already - ;; The module already exists... - (if (and (or (null? maybe-autoload) (car maybe-autoload)) - (not (module-public-interface already))) - ;; ...but we are told to load and it doesn't contain source, so - (begin - (try-load-module name) - already) - ;; simply return it. - already) - (begin - ;; Try to autoload it if we are told so - (if (or (null? maybe-autoload) (car maybe-autoload)) - (try-load-module name)) - ;; Get/create it. - (make-modules-in (current-module) full-name)))))) - -;; Cheat. These bindings are needed by modules.c, but we don't want -;; to move their real definition here because that would be unnatural. -;; -(define try-module-autoload #f) -(define process-define-module #f) -(define process-use-modules #f) -(define module-export! #f) - -;; This boots the module system. All bindings needed by modules.c -;; must have been defined by now. -;; -(set-current-module the-root-module) - -(define app (make-module 31)) -(local-define '(app modules) (make-module 31)) -(local-define '(app modules guile) the-root-module) - -;; (define-special-value '(app modules new-ws) (lambda () (make-scm-module))) - -(define (try-load-module name) - (or (begin-deprecated (try-module-linked name)) - (try-module-autoload name) - (begin-deprecated (try-module-dynamic-link name)))) - -(define (purify-module! module) - "Removes bindings in MODULE which are inherited from the (guile) module." - (let ((use-list (module-uses module))) - (if (and (pair? use-list) - (eq? (car (last-pair use-list)) the-scm-module)) - (set-module-uses! module (reverse (cdr (reverse use-list))))))) - -;; Return a module that is an interface to the module designated by -;; NAME. -;; -;; `resolve-interface' takes two keyword arguments: -;; -;; #:select SELECTION -;; -;; SELECTION is a list of binding-specs to be imported; A binding-spec -;; is either a symbol or a pair of symbols (ORIG . SEEN), where ORIG -;; is the name in the used module and SEEN is the name in the using -;; module. Note that SEEN is also passed through RENAMER, below. The -;; default is to select all bindings. If you specify no selection but -;; a renamer, only the bindings that already exist in the used module -;; are made available in the interface. Bindings that are added later -;; are not picked up. -;; -;; #:renamer RENAMER -;; -;; RENAMER is a procedure that takes a symbol and returns its new -;; name. The default is to not perform any renaming. -;; -;; Signal "no code for module" error if module name is not resolvable -;; or its public interface is not available. Signal "no binding" -;; error if selected binding does not exist in the used module. -;; -(define (resolve-interface name . args) - - (define (get-keyword-arg args kw def) - (cond ((memq kw args) - => (lambda (kw-arg) - (if (null? (cdr kw-arg)) - (error "keyword without value: " kw)) - (cadr kw-arg))) - (else - def))) - - (let* ((select (get-keyword-arg args #:select #f)) - (renamer (get-keyword-arg args #:renamer identity)) - (module (resolve-module name)) - (public-i (and module (module-public-interface module)))) - (and (or (not module) (not public-i)) - (error "no code for module" name)) - (if (and (not select) (eq? renamer identity)) - public-i - (let ((selection (or select (module-map (lambda (sym var) sym) - public-i))) - (custom-i (make-module 31))) - (set-module-kind! custom-i 'interface) - ;; XXX - should use a lazy binder so that changes to the - ;; used module are picked up automatically. - (for-each (lambda (bspec) - (let* ((direct? (symbol? bspec)) - (orig (if direct? bspec (car bspec))) - (seen (if direct? bspec (cdr bspec)))) - (module-add! custom-i (renamer seen) - (or (module-local-variable public-i orig) - (module-local-variable module orig) - (error - ;; fixme: format manually for now - (simple-format - #f "no binding `~A' in module ~A" - orig name)))))) - selection) - custom-i)))) - -(define (symbol-prefix-proc prefix) - (lambda (symbol) - (symbol-append prefix symbol))) - -;; This function is called from "modules.c". If you change it, be -;; sure to update "modules.c" as well. - -(define (process-define-module args) - (let* ((module-id (car args)) - (module (resolve-module module-id #f)) - (kws (cdr args)) - (unrecognized (lambda (arg) - (error "unrecognized define-module argument" arg)))) - (beautify-user-module! module) - (let loop ((kws kws) - (reversed-interfaces '()) - (exports '()) - (re-exports '())) - (if (null? kws) - (begin - (for-each (lambda (interface) - (module-use! module interface)) - (reverse reversed-interfaces)) - (module-export! module exports) - (module-re-export! module re-exports)) - (case (car kws) - ((#:use-module #:use-syntax) - (or (pair? (cdr kws)) - (unrecognized kws)) - (let* ((interface-args (cadr kws)) - (interface (apply resolve-interface interface-args))) - (and (eq? (car kws) 'use-syntax) - (or (symbol? (car spec)) - (error "invalid module name for use-syntax" - spec)) - (set-module-transformer! - module - (module-ref interface (car - (last-pair (car interface-args))) - #f))) - (loop (cddr kws) - (cons interface reversed-interfaces) - exports - re-exports))) - ((#:autoload) - (or (and (pair? (cdr kws)) (pair? (cddr kws))) - (unrecognized kws)) - (loop (cdddr kws) - (cons (make-autoload-interface module - (cadr kws) - (caddr kws)) - reversed-interfaces) - exports - re-exports)) - ((#:no-backtrace) - (set-system-module! module #t) - (loop (cdr kws) reversed-interfaces exports re-exports)) - ((#:pure) - (purify-module! module) - (loop (cdr kws) reversed-interfaces exports re-exports)) - ((#:export #:export-syntax) - (or (pair? (cdr kws)) - (unrecognized kws)) - (loop (cddr kws) - reversed-interfaces - (append (cadr kws) exports) - re-exports)) - ((#:re-export #:re-export-syntax) - (or (pair? (cdr kws)) - (unrecognized kws)) - (loop (cddr kws) - reversed-interfaces - exports - (append (cadr kws) re-exports))) - (else - (unrecognized kws))))) - module)) - -;;; {Autoload} - -(define (make-autoload-interface module name bindings) - (let ((b (lambda (a sym definep) - (and (memq sym bindings) - (let ((i (module-public-interface (resolve-module name)))) - (if (not i) - (error "missing interface for module" name)) - ;; Replace autoload-interface with interface - (set-car! (memq a (module-uses module)) i) - (module-local-variable i sym)))))) - (module-constructor #() '() b #f #f name 'autoload - '() (make-weak-value-hash-table 31) 0))) - -;;; {Compiled module} - -(define load-compiled #f) - - -;;; {Autoloading modules} - -(define autoloads-in-progress '()) - -;; This function is called from "modules.c". If you change it, be -;; sure to update "modules.c" as well. - -(define (try-module-autoload module-name) - (let* ((reverse-name (reverse module-name)) - (name (symbol->string (car reverse-name))) - (dir-hint-module-name (reverse (cdr reverse-name))) - (dir-hint (apply string-append - (map (lambda (elt) - (string-append (symbol->string elt) "/")) - dir-hint-module-name)))) - (resolve-module dir-hint-module-name #f) - (and (not (autoload-done-or-in-progress? dir-hint name)) - (let ((didit #f)) - (define (load-file proc file) - (save-module-excursion (lambda () (proc file))) - (set! didit #t)) - (dynamic-wind - (lambda () (autoload-in-progress! dir-hint name)) - (lambda () - (let ((file (in-vicinity dir-hint name))) - (cond ((and load-compiled - (%search-load-path (string-append file ".go"))) - => (lambda (full) - (load-file load-compiled full))) - ((%search-load-path file) - => (lambda (full) - (load-file primitive-load full)))))) - (lambda () (set-autoloaded! dir-hint name didit))) - didit)))) - - -;;; Dynamic linking of modules - -;; This method of dynamically linking Guile Extensions is deprecated. -;; Use `load-extension' explicitely from Scheme code instead. - -(begin-deprecated - - (define (split-c-module-name str) - (let loop ((rev '()) - (start 0) - (pos 0) - (end (string-length str))) - (cond - ((= pos end) - (reverse (cons (string->symbol (substring str start pos)) rev))) - ((eq? (string-ref str pos) #\space) - (loop (cons (string->symbol (substring str start pos)) rev) - (+ pos 1) - (+ pos 1) - end)) - (else - (loop rev start (+ pos 1) end))))) - - (define (convert-c-registered-modules dynobj) - (let ((res (map (lambda (c) - (list (split-c-module-name (car c)) (cdr c) dynobj)) - (c-registered-modules)))) - (c-clear-registered-modules) - res)) - - (define registered-modules '()) - - (define (register-modules dynobj) - (set! registered-modules - (append! (convert-c-registered-modules dynobj) - registered-modules))) - - (define (warn-autoload-deprecation modname) - (issue-deprecation-warning - "Autoloading of compiled code modules is deprecated." - "Write a Scheme file instead that uses `load-extension'.") - (issue-deprecation-warning - (simple-format #f "(You just autoloaded module ~S.)" modname))) - - (define (init-dynamic-module modname) - ;; Register any linked modules which have been registered on the C level - (register-modules #f) - (or-map (lambda (modinfo) - (if (equal? (car modinfo) modname) - (begin - (warn-autoload-deprecation modname) - (set! registered-modules (delq! modinfo registered-modules)) - (let ((mod (resolve-module modname #f))) - (save-module-excursion - (lambda () - (set-current-module mod) - (set-module-public-interface! mod mod) - (dynamic-call (cadr modinfo) (caddr modinfo)) - )) - #t)) - #f)) - registered-modules)) - - (define (dynamic-maybe-call name dynobj) - (catch #t ; could use false-if-exception here - (lambda () - (dynamic-call name dynobj)) - (lambda args - #f))) - - (define (dynamic-maybe-link filename) - (catch #t ; could use false-if-exception here - (lambda () - (dynamic-link filename)) - (lambda args - #f))) - - (define (find-and-link-dynamic-module module-name) - (define (make-init-name mod-name) - (string-append "scm_init" - (list->string (map (lambda (c) - (if (or (char-alphabetic? c) - (char-numeric? c)) - c - #\_)) - (string->list mod-name))) - "_module")) - - ;; Put the subdirectory for this module in the car of SUBDIR-AND-LIBNAME, - ;; and the `libname' (the name of the module prepended by `lib') in the cdr - ;; field. For example, if MODULE-NAME is the list (inet tcp-ip udp), then - ;; SUBDIR-AND-LIBNAME will be the pair ("inet/tcp-ip" . "libudp"). - (let ((subdir-and-libname - (let loop ((dirs "") - (syms module-name)) - (if (null? (cdr syms)) - (cons dirs (string-append "lib" (symbol->string (car syms)))) - (loop (string-append dirs (symbol->string (car syms)) "/") - (cdr syms))))) - (init (make-init-name (apply string-append - (map (lambda (s) - (string-append "_" - (symbol->string s))) - module-name))))) - (let ((subdir (car subdir-and-libname)) - (libname (cdr subdir-and-libname))) - - ;; Now look in each dir in %LOAD-PATH for `subdir/libfoo.la'. If that - ;; file exists, fetch the dlname from that file and attempt to link - ;; against it. If `subdir/libfoo.la' does not exist, or does not seem - ;; to name any shared library, look for `subdir/libfoo.so' instead and - ;; link against that. - (let check-dirs ((dir-list %load-path)) - (if (null? dir-list) - #f - (let* ((dir (in-vicinity (car dir-list) subdir)) - (sharlib-full - (or (try-using-libtool-name dir libname) - (try-using-sharlib-name dir libname)))) - (if (and sharlib-full (file-exists? sharlib-full)) - (link-dynamic-module sharlib-full init) - (check-dirs (cdr dir-list))))))))) - - (define (try-using-libtool-name libdir libname) - (let ((libtool-filename (in-vicinity libdir - (string-append libname ".la")))) - (and (file-exists? libtool-filename) - libtool-filename))) - - (define (try-using-sharlib-name libdir libname) - (in-vicinity libdir (string-append libname ".so"))) - - (define (link-dynamic-module filename initname) - ;; Register any linked modules which have been registered on the C level - (register-modules #f) - (let ((dynobj (dynamic-link filename))) - (dynamic-call initname dynobj) - (register-modules dynobj))) - - (define (try-module-linked module-name) - (init-dynamic-module module-name)) - - (define (try-module-dynamic-link module-name) - (and (find-and-link-dynamic-module module-name) - (init-dynamic-module module-name)))) -;; end of deprecated section - - -(define autoloads-done '((guile . guile))) - -(define (autoload-done-or-in-progress? p m) - (let ((n (cons p m))) - (->bool (or (member n autoloads-done) - (member n autoloads-in-progress))))) - -(define (autoload-done! p m) - (let ((n (cons p m))) - (set! autoloads-in-progress - (delete! n autoloads-in-progress)) - (or (member n autoloads-done) - (set! autoloads-done (cons n autoloads-done))))) - -(define (autoload-in-progress! p m) - (let ((n (cons p m))) - (set! autoloads-done - (delete! n autoloads-done)) - (set! autoloads-in-progress (cons n autoloads-in-progress)))) - -(define (set-autoloaded! p m done?) - (if done? - (autoload-done! p m) - (let ((n (cons p m))) - (set! autoloads-done (delete! n autoloads-done)) - (set! autoloads-in-progress (delete! n autoloads-in-progress))))) - - - - -;; {EVAL-CASE} -;; -;; (eval-case ((situation*) forms)* (else forms)?) -;; -;; Evaluate certain code based on the situation that eval-case is used -;; in. The only defined situation right now is `load-toplevel' which -;; triggers for code evaluated at the top-level, for example from the -;; REPL or when loading a file. - -(define eval-case - (procedure->memoizing-macro - (lambda (exp env) - (define (toplevel-env? env) - (or (not (pair? env)) (not (pair? (car env))))) - (define (syntax) - (error "syntax error in eval-case")) - (let loop ((clauses (cdr exp))) - (cond - ((null? clauses) - #f) - ((not (list? (car clauses))) - (syntax)) - ((eq? 'else (caar clauses)) - (or (null? (cdr clauses)) - (syntax)) - (cons 'begin (cdar clauses))) - ((not (list? (caar clauses))) - (syntax)) - ((and (toplevel-env? env) - (memq 'load-toplevel (caar clauses))) - (cons 'begin (cdar clauses))) - (else - (loop (cdr clauses)))))))) - - -;;; {Macros} -;;; - -(define (primitive-macro? m) - (and (macro? m) - (not (macro-transformer m)))) - -;;; {Defmacros} -;;; -(define macro-table (make-weak-key-hash-table 523)) -(define xformer-table (make-weak-key-hash-table 523)) - -(define (defmacro? m) (hashq-ref macro-table m)) -(define (assert-defmacro?! m) (hashq-set! macro-table m #t)) -(define (defmacro-transformer m) (hashq-ref xformer-table m)) -(define (set-defmacro-transformer! m t) (hashq-set! xformer-table m t)) - -(define defmacro:transformer - (lambda (f) - (let* ((xform (lambda (exp env) - (copy-tree (apply f (cdr exp))))) - (a (procedure->memoizing-macro xform))) - (assert-defmacro?! a) - (set-defmacro-transformer! a f) - a))) - - -(define defmacro - (let ((defmacro-transformer - (lambda (name parms . body) - (let ((transformer `(lambda ,parms ,@body))) - `(eval-case - ((load-toplevel) - (define ,name (defmacro:transformer ,transformer))) - (else - (error "defmacro can only be used at the top level"))))))) - (defmacro:transformer defmacro-transformer))) - -(define defmacro:syntax-transformer - (lambda (f) - (procedure->syntax - (lambda (exp env) - (copy-tree (apply f (cdr exp))))))) - - -;; XXX - should the definition of the car really be looked up in the -;; current module? - -(define (macroexpand-1 e) - (cond - ((pair? e) (let* ((a (car e)) - (val (and (symbol? a) (local-ref (list a))))) - (if (defmacro? val) - (apply (defmacro-transformer val) (cdr e)) - e))) - (#t e))) - -(define (macroexpand e) - (cond - ((pair? e) (let* ((a (car e)) - (val (and (symbol? a) (local-ref (list a))))) - (if (defmacro? val) - (macroexpand (apply (defmacro-transformer val) (cdr e))) - e))) - (#t e))) - -(provide 'defmacro) - - - -;;; {Run-time options} - -(define define-option-interface - (let* ((option-name car) - (option-value cadr) - (option-documentation caddr) - - (print-option (lambda (option) - (display (option-name option)) - (if (< (string-length - (symbol->string (option-name option))) - 8) - (display #\tab)) - (display #\tab) - (display (option-value option)) - (display #\tab) - (display (option-documentation option)) - (newline))) - - ;; Below follow the macros defining the run-time option interfaces. - - (make-options (lambda (interface) - `(lambda args - (cond ((null? args) (,interface)) - ((list? (car args)) - (,interface (car args)) (,interface)) - (else (for-each ,print-option - (,interface #t))))))) - - (make-enable (lambda (interface) - `(lambda flags - (,interface (append flags (,interface))) - (,interface)))) - - (make-disable (lambda (interface) - `(lambda flags - (let ((options (,interface))) - (for-each (lambda (flag) - (set! options (delq! flag options))) - flags) - (,interface options) - (,interface))))) - - (make-set! (lambda (interface) - `((name exp) - (,'quasiquote - (begin (,interface (append (,interface) - (list '(,'unquote name) - (,'unquote exp)))) - (,interface))))))) - (procedure->macro - (lambda (exp env) - (cons 'begin - (let* ((option-group (cadr exp)) - (interface (car option-group))) - (append (map (lambda (name constructor) - `(define ,name - ,(constructor interface))) - (cadr option-group) - (list make-options - make-enable - make-disable)) - (map (lambda (name constructor) - `(defmacro ,name - ,@(constructor interface))) - (caddr option-group) - (list make-set!))))))))) - -(define-option-interface - (eval-options-interface - (eval-options eval-enable eval-disable) - (eval-set!))) - -(define-option-interface - (debug-options-interface - (debug-options debug-enable debug-disable) - (debug-set!))) - -(define-option-interface - (evaluator-traps-interface - (traps trap-enable trap-disable) - (trap-set!))) - -(define-option-interface - (read-options-interface - (read-options read-enable read-disable) - (read-set!))) - -(define-option-interface - (print-options-interface - (print-options print-enable print-disable) - (print-set!))) - - - -;;; {Running Repls} -;;; - -(define (repl read evaler print) - (let loop ((source (read (current-input-port)))) - (print (evaler source)) - (loop (read (current-input-port))))) - -;; A provisional repl that acts like the SCM repl: -;; -(define scm-repl-silent #f) -(define (assert-repl-silence v) (set! scm-repl-silent v)) - -(define *unspecified* (if #f #f)) -(define (unspecified? v) (eq? v *unspecified*)) - -(define scm-repl-print-unspecified #f) -(define (assert-repl-print-unspecified v) (set! scm-repl-print-unspecified v)) - -(define scm-repl-verbose #f) -(define (assert-repl-verbosity v) (set! scm-repl-verbose v)) - -(define scm-repl-prompt "guile> ") - -(define (set-repl-prompt! v) (set! scm-repl-prompt v)) - -(define (default-lazy-handler key . args) - (save-stack lazy-handler-dispatch) - (apply throw key args)) - -(define (lazy-handler-dispatch key . args) - (apply default-lazy-handler key args)) - -(define abort-hook (make-hook)) - -;; these definitions are used if running a script. -;; otherwise redefined in error-catching-loop. -(define (set-batch-mode?! arg) #t) -(define (batch-mode?) #t) - -(define (error-catching-loop thunk) - (let ((status #f) - (interactive #t)) - (define (loop first) - (let ((next - (catch #t - - (lambda () - (lazy-catch #t - (lambda () - (dynamic-wind - (lambda () (unmask-signals)) - (lambda () - (with-traps - (lambda () - (first) - - ;; This line is needed because mark - ;; doesn't do closures quite right. - ;; Unreferenced locals should be - ;; collected. - ;; - (set! first #f) - (let loop ((v (thunk))) - (loop (thunk))) - #f))) - (lambda () (mask-signals)))) - - lazy-handler-dispatch)) - - (lambda (key . args) - (case key - ((quit) - (set! status args) - #f) - - ((switch-repl) - (apply throw 'switch-repl args)) - - ((abort) - ;; This is one of the closures that require - ;; (set! first #f) above - ;; - (lambda () - (run-hook abort-hook) - (force-output (current-output-port)) - (display "ABORT: " (current-error-port)) - (write args (current-error-port)) - (newline (current-error-port)) - (if interactive - (begin - (if (and - (not has-shown-debugger-hint?) - (not (memq 'backtrace - (debug-options-interface))) - (stack? (fluid-ref the-last-stack))) - (begin - (newline (current-error-port)) - (display - "Type \"(backtrace)\" to get more information or \"(debug)\" to enter the debugger.\n" - (current-error-port)) - (set! has-shown-debugger-hint? #t))) - (force-output (current-error-port))) - (begin - (primitive-exit 1))) - (set! stack-saved? #f))) - - (else - ;; This is the other cons-leak closure... - (lambda () - (cond ((= (length args) 4) - (apply handle-system-error key args)) - (else - (apply bad-throw key args)))))))))) - (if next (loop next) status))) - (set! set-batch-mode?! (lambda (arg) - (cond (arg - (set! interactive #f) - (restore-signals)) - (#t - (error "sorry, not implemented"))))) - (set! batch-mode? (lambda () (not interactive))) - (loop (lambda () #t)))) - -;;(define the-last-stack (make-fluid)) Defined by scm_init_backtrace () -(define before-signal-stack (make-fluid)) -(define stack-saved? #f) - -(define (save-stack . narrowing) - (or stack-saved? - (cond ((not (memq 'debug (debug-options-interface))) - (fluid-set! the-last-stack #f) - (set! stack-saved? #t)) - (else - (fluid-set! - the-last-stack - (case (stack-id #t) - ((repl-stack) - (apply make-stack #t save-stack primitive-eval #t 0 narrowing)) - ((load-stack) - (apply make-stack #t save-stack 0 #t 0 narrowing)) - ((tk-stack) - (apply make-stack #t save-stack tk-stack-mark #t 0 narrowing)) - ((#t) - (apply make-stack #t save-stack 0 1 narrowing)) - (else - (let ((id (stack-id #t))) - (and (procedure? id) - (apply make-stack #t save-stack id #t 0 narrowing)))))) - (set! stack-saved? #t))))) - -(define before-error-hook (make-hook)) -(define after-error-hook (make-hook)) -(define before-backtrace-hook (make-hook)) -(define after-backtrace-hook (make-hook)) - -(define has-shown-debugger-hint? #f) - -(define (handle-system-error key . args) - (let ((cep (current-error-port))) - (cond ((not (stack? (fluid-ref the-last-stack)))) - ((memq 'backtrace (debug-options-interface)) - (run-hook before-backtrace-hook) - (newline cep) - (display "Backtrace:\n") - (display-backtrace (fluid-ref the-last-stack) cep) - (newline cep) - (run-hook after-backtrace-hook))) - (run-hook before-error-hook) - (apply display-error (fluid-ref the-last-stack) cep args) - (run-hook after-error-hook) - (force-output cep) - (throw 'abort key))) - -(define (quit . args) - (apply throw 'quit args)) - -(define exit quit) - -;;(define has-shown-backtrace-hint? #f) Defined by scm_init_backtrace () - -;; Replaced by C code: -;;(define (backtrace) -;; (if (fluid-ref the-last-stack) -;; (begin -;; (newline) -;; (display-backtrace (fluid-ref the-last-stack) (current-output-port)) -;; (newline) -;; (if (and (not has-shown-backtrace-hint?) -;; (not (memq 'backtrace (debug-options-interface)))) -;; (begin -;; (display -;;"Type \"(debug-enable 'backtrace)\" if you would like a backtrace -;;automatically if an error occurs in the future.\n") -;; (set! has-shown-backtrace-hint? #t)))) -;; (display "No backtrace available.\n"))) - -(define (error-catching-repl r e p) - (error-catching-loop - (lambda () - (call-with-values (lambda () (e (r))) - (lambda the-values (for-each p the-values)))))) - -(define (gc-run-time) - (cdr (assq 'gc-time-taken (gc-stats)))) - -(define before-read-hook (make-hook)) -(define after-read-hook (make-hook)) -(define before-eval-hook (make-hook 1)) -(define after-eval-hook (make-hook 1)) -(define before-print-hook (make-hook 1)) -(define after-print-hook (make-hook 1)) - -;;; The default repl-reader function. We may override this if we've -;;; the readline library. -(define repl-reader - (lambda (prompt) - (display prompt) - (force-output) - (run-hook before-read-hook) - (read (current-input-port)))) - -(define (scm-style-repl) - - (letrec ( - (start-gc-rt #f) - (start-rt #f) - (repl-report-start-timing (lambda () - (set! start-gc-rt (gc-run-time)) - (set! start-rt (get-internal-run-time)))) - (repl-report (lambda () - (display ";;; ") - (display (inexact->exact - (* 1000 (/ (- (get-internal-run-time) start-rt) - internal-time-units-per-second)))) - (display " msec (") - (display (inexact->exact - (* 1000 (/ (- (gc-run-time) start-gc-rt) - internal-time-units-per-second)))) - (display " msec in gc)\n"))) - - (consume-trailing-whitespace - (lambda () - (let ((ch (peek-char))) - (cond - ((eof-object? ch)) - ((or (char=? ch #\space) (char=? ch #\tab)) - (read-char) - (consume-trailing-whitespace)) - ((char=? ch #\newline) - (read-char)))))) - (-read (lambda () - (let ((val - (let ((prompt (cond ((string? scm-repl-prompt) - scm-repl-prompt) - ((thunk? scm-repl-prompt) - (scm-repl-prompt)) - (scm-repl-prompt "> ") - (else "")))) - (repl-reader prompt)))) - - ;; As described in R4RS, the READ procedure updates the - ;; port to point to the first character past the end of - ;; the external representation of the object. This - ;; means that it doesn't consume the newline typically - ;; found after an expression. This means that, when - ;; debugging Guile with GDB, GDB gets the newline, which - ;; it often interprets as a "continue" command, making - ;; breakpoints kind of useless. So, consume any - ;; trailing newline here, as well as any whitespace - ;; before it. - ;; But not if EOF, for control-D. - (if (not (eof-object? val)) - (consume-trailing-whitespace)) - (run-hook after-read-hook) - (if (eof-object? val) - (begin - (repl-report-start-timing) - (if scm-repl-verbose - (begin - (newline) - (display ";;; EOF -- quitting") - (newline))) - (quit 0))) - val))) - - (-eval (lambda (sourc) - (repl-report-start-timing) - (run-hook before-eval-hook sourc) - (let ((val (start-stack 'repl-stack - ;; If you change this procedure - ;; (primitive-eval), please also - ;; modify the repl-stack case in - ;; save-stack so that stack cutting - ;; continues to work. - (primitive-eval sourc)))) - (run-hook after-eval-hook sourc) - val))) - - - (-print (let ((maybe-print (lambda (result) - (if (or scm-repl-print-unspecified - (not (unspecified? result))) - (begin - (write result) - (newline)))))) - (lambda (result) - (if (not scm-repl-silent) - (begin - (run-hook before-print-hook result) - (maybe-print result) - (run-hook after-print-hook result) - (if scm-repl-verbose - (repl-report)) - (force-output)))))) - - (-quit (lambda (args) - (if scm-repl-verbose - (begin - (display ";;; QUIT executed, repl exitting") - (newline) - (repl-report))) - args)) - - (-abort (lambda () - (if scm-repl-verbose - (begin - (display ";;; ABORT executed.") - (newline) - (repl-report))) - (repl -read -eval -print)))) - - (let ((status (error-catching-repl -read - -eval - -print))) - (-quit status)))) - - - -;;; {IOTA functions: generating lists of numbers} - -(define (iota n) - (let loop ((count (1- n)) (result '())) - (if (< count 0) result - (loop (1- count) (cons count result))))) - - -;;; {While} -;;; -;;; with `continue' and `break'. -;;; - -(defmacro while (cond . body) - `(letrec ((continue (lambda () (or (not ,cond) (begin (begin ,@ body) (continue))))) - (break (lambda val (apply throw 'break val)))) - (catch 'break - (lambda () (continue)) - (lambda v (cadr v))))) - -;;; {collect} -;;; -;;; Similar to `begin' but returns a list of the results of all constituent -;;; forms instead of the result of the last form. -;;; (The definition relies on the current left-to-right -;;; order of evaluation of operands in applications.) - -(defmacro collect forms - (cons 'list forms)) - -;;; {with-fluids} - -;; with-fluids is a convenience wrapper for the builtin procedure -;; `with-fluids*'. The syntax is just like `let': -;; -;; (with-fluids ((fluid val) -;; ...) -;; body) - -(defmacro with-fluids (bindings . body) - `(with-fluids* (list ,@(map car bindings)) (list ,@(map cadr bindings)) - (lambda () ,@body))) - - - -;;; {Macros} -;;; - -;; actually....hobbit might be able to hack these with a little -;; coaxing -;; - -(defmacro define-macro (first . rest) - (let ((name (if (symbol? first) first (car first))) - (transformer - (if (symbol? first) - (car rest) - `(lambda ,(cdr first) ,@rest)))) - `(eval-case - ((load-toplevel) - (define ,name (defmacro:transformer ,transformer))) - (else - (error "define-macro can only be used at the top level"))))) - - -(defmacro define-syntax-macro (first . rest) - (let ((name (if (symbol? first) first (car first))) - (transformer - (if (symbol? first) - (car rest) - `(lambda ,(cdr first) ,@rest)))) - `(eval-case - ((load-toplevel) - (define ,name (defmacro:syntax-transformer ,transformer))) - (else - (error "define-syntax-macro can only be used at the top level"))))) - - -;;; {Module System Macros} -;;; - -;; Return a list of expressions that evaluate to the appropriate -;; arguments for resolve-interface according to SPEC. - -(define (compile-interface-spec spec) - (define (make-keyarg sym key quote?) - (cond ((or (memq sym spec) - (memq key spec)) - => (lambda (rest) - (if quote? - (list key (list 'quote (cadr rest))) - (list key (cadr rest))))) - (else - '()))) - (define (map-apply func list) - (map (lambda (args) (apply func args)) list)) - (define keys - ;; sym key quote? - '((:select #:select #t) - (:renamer #:renamer #f))) - (if (not (pair? (car spec))) - `(',spec) - `(',(car spec) - ,@(apply append (map-apply make-keyarg keys))))) - -(define (keyword-like-symbol->keyword sym) - (symbol->keyword (string->symbol (substring (symbol->string sym) 1)))) - -(define (compile-define-module-args args) - ;; Just quote everything except #:use-module and #:use-syntax. We - ;; need to know about all arguments regardless since we want to turn - ;; symbols that look like keywords into real keywords, and the - ;; keyword args in a define-module form are not regular - ;; (i.e. no-backtrace doesn't take a value). - (let loop ((compiled-args `((quote ,(car args)))) - (args (cdr args))) - (cond ((null? args) - (reverse! compiled-args)) - ;; symbol in keyword position - ((symbol? (car args)) - (loop compiled-args - (cons (keyword-like-symbol->keyword (car args)) (cdr args)))) - ((memq (car args) '(#:no-backtrace #:pure)) - (loop (cons (car args) compiled-args) - (cdr args))) - ((null? (cdr args)) - (error "keyword without value:" (car args))) - ((memq (car args) '(#:use-module #:use-syntax)) - (loop (cons* `(list ,@(compile-interface-spec (cadr args))) - (car args) - compiled-args) - (cddr args))) - ((eq? (car args) #:autoload) - (loop (cons* `(quote ,(caddr args)) - `(quote ,(cadr args)) - (car args) - compiled-args) - (cdddr args))) - (else - (loop (cons* `(quote ,(cadr args)) - (car args) - compiled-args) - (cddr args)))))) - -(defmacro define-module args - `(eval-case - ((load-toplevel) - (let ((m (process-define-module - (list ,@(compile-define-module-args args))))) - (set-current-module m) - m)) - (else - (error "define-module can only be used at the top level")))) - -;; The guts of the use-modules macro. Add the interfaces of the named -;; modules to the use-list of the current module, in order. - -(define (process-use-modules module-interface-args) - (for-each (lambda (mif-args) - (let ((mod-iface (apply resolve-interface mif-args))) - (or mod-iface - (error "no such module" mif-args)) - (module-use! (current-module) mod-iface))) - module-interface-args)) - -(defmacro use-modules modules - `(eval-case - ((load-toplevel) - (process-use-modules - (list ,@(map (lambda (m) - `(list ,@(compile-interface-spec m))) - modules)))) - (else - (error "use-modules can only be used at the top level")))) - -(defmacro use-syntax (spec) - `(eval-case - ((load-toplevel) - ,@(if (pair? spec) - `((process-use-modules (list - (list ,@(compile-interface-spec spec)))) - (set-module-transformer! (current-module) - ,(car (last-pair spec)))) - `((set-module-transformer! (current-module) ,spec))) - (fluid-set! scm:eval-transformer (module-transformer (current-module))) - *unspecified*) - (else - (error "use-syntax can only be used at the top level")))) - -(define define-private define) - -(defmacro define-public args - (define (syntax) - (error "bad syntax" (list 'define-public args))) - (define (defined-name n) - (cond - ((symbol? n) n) - ((pair? n) (defined-name (car n))) - (else (syntax)))) - (cond - ((null? args) - (syntax)) - (#t - (let ((name (defined-name (car args)))) - `(begin - (define-private ,@args) - (eval-case ((load-toplevel) (export ,name)))))))) - -(defmacro defmacro-public args - (define (syntax) - (error "bad syntax" (list 'defmacro-public args))) - (define (defined-name n) - (cond - ((symbol? n) n) - (else (syntax)))) - (cond - ((null? args) - (syntax)) - (#t - (let ((name (defined-name (car args)))) - `(begin - (eval-case ((load-toplevel) (export ,name))) - (defmacro ,@args)))))) - -;; Export a local variable - -;; This function is called from "modules.c". If you change it, be -;; sure to update "modules.c" as well. - -(define (module-export! m names) - (let ((public-i (module-public-interface m))) - (for-each (lambda (name) - (begin-deprecated - (if (not (module-local-variable m name)) - (let ((v (module-variable m name))) - (cond - (v - (issue-deprecation-warning - "Using `export' to re-export imported bindings is deprecated. Use `re-export' instead.") - (issue-deprecation-warning - (simple-format #f "(You just re-exported `~a' from `~a'.)" - name (module-name m))) - (module-define! m name (variable-ref v))))))) - (let ((var (module-ensure-local-variable! m name))) - (module-add! public-i name var))) - names))) - -;; Re-export a imported variable -;; -(define (module-re-export! m names) - (let ((public-i (module-public-interface m))) - (for-each (lambda (name) - (let ((var (module-variable m name))) - (cond ((not var) - (error "Undefined variable:" name)) - ((eq? var (module-local-variable m name)) - (error "re-exporting local variable:" name)) - (else - (module-add! public-i name var))))) - names))) - -(defmacro export names - `(eval-case - ((load-toplevel) - (module-export! (current-module) ',names)) - (else - (error "export can only be used at the top level")))) - -(defmacro re-export names - `(eval-case - ((load-toplevel) - (module-re-export! (current-module) ',names)) - (else - (error "re-export can only be used at the top level")))) - -(define export-syntax export) -(define re-export-syntax re-export) - - -(define load load-module) - - - -;;; {`cond-expand' for SRFI-0 support.} -;;; -;;; This syntactic form expands into different commands or -;;; definitions, depending on the features provided by the Scheme -;;; implementation. -;;; -;;; Syntax: -;;; -;;; <cond-expand> -;;; --> (cond-expand <cond-expand-clause>+) -;;; | (cond-expand <cond-expand-clause>* (else <command-or-definition>)) -;;; <cond-expand-clause> -;;; --> (<feature-requirement> <command-or-definition>*) -;;; <feature-requirement> -;;; --> <feature-identifier> -;;; | (and <feature-requirement>*) -;;; | (or <feature-requirement>*) -;;; | (not <feature-requirement>) -;;; <feature-identifier> -;;; --> <a symbol which is the name or alias of a SRFI> -;;; -;;; Additionally, this implementation provides the -;;; <feature-identifier>s `guile' and `r5rs', so that programs can -;;; determine the implementation type and the supported standard. -;;; -;;; Currently, the following feature identifiers are supported: -;;; -;;; guile r5rs srfi-0 srfi-6 -;;; -;;; Remember to update the features list when adding more SRFIs. - -(define %cond-expand-features - ;; Adjust the above comment when changing this. - '(guile - r5rs - srfi-0 ;; cond-expand itself - srfi-6 ;; open-input-string etc, in the guile core - )) - -;; This table maps module public interfaces to the list of features. -;; -(define %cond-expand-table (make-hash-table 31)) - -;; Add one or more features to the `cond-expand' feature list of the -;; module `module'. -;; -(define (cond-expand-provide module features) - (let ((mod (module-public-interface module))) - (and mod - (hashq-set! %cond-expand-table mod - (append (hashq-ref %cond-expand-table mod '()) - features))))) - -(define cond-expand - (procedure->memoizing-macro - (lambda (exp env) - (let ((clauses (cdr exp)) - (syntax-error (lambda (cl) - (error "invalid clause in `cond-expand'" cl)))) - (letrec - ((test-clause - (lambda (clause) - (cond - ((symbol? clause) - (or (memq clause %cond-expand-features) - (let lp ((uses (module-uses (env-module env)))) - (if (pair? uses) - (or (memq clause - (hashq-ref %cond-expand-table - (car uses) '())) - (lp (cdr uses))) - #f)))) - ((pair? clause) - (cond - ((eq? 'and (car clause)) - (let lp ((l (cdr clause))) - (cond ((null? l) - #t) - ((pair? l) - (and (test-clause (car l)) (lp (cdr l)))) - (else - (syntax-error clause))))) - ((eq? 'or (car clause)) - (let lp ((l (cdr clause))) - (cond ((null? l) - #f) - ((pair? l) - (or (test-clause (car l)) (lp (cdr l)))) - (else - (syntax-error clause))))) - ((eq? 'not (car clause)) - (cond ((not (pair? (cdr clause))) - (syntax-error clause)) - ((pair? (cddr clause)) - ((syntax-error clause)))) - (not (test-clause (cadr clause)))) - (else - (syntax-error clause)))) - (else - (syntax-error clause)))))) - (let lp ((c clauses)) - (cond - ((null? c) - (error "Unfulfilled `cond-expand'")) - ((not (pair? c)) - (syntax-error c)) - ((not (pair? (car c))) - (syntax-error (car c))) - ((test-clause (caar c)) - `(begin ,@(cdar c))) - ((eq? (caar c) 'else) - (if (pair? (cdr c)) - (syntax-error c)) - `(begin ,@(cdar c))) - (else - (lp (cdr c)))))))))) - -;; This procedure gets called from the startup code with a list of -;; numbers, which are the numbers of the SRFIs to be loaded on startup. -;; -(define (use-srfis srfis) - (let lp ((s srfis)) - (if (pair? s) - (let* ((srfi (string->symbol - (string-append "srfi-" (number->string (car s))))) - (mod-i (resolve-interface (list 'srfi srfi)))) - (module-use! (current-module) mod-i) - (lp (cdr s)))))) - - - -;;; {Load emacs interface support if emacs option is given.} - -(define (named-module-use! user usee) - (module-use! (resolve-module user) (resolve-interface usee))) - -(define (load-emacs-interface) - (and (provided? 'debug-extensions) - (debug-enable 'backtrace)) - (named-module-use! '(guile-user) '(ice-9 emacs))) - - - -(define using-readline? - (let ((using-readline? (make-fluid))) - (make-procedure-with-setter - (lambda () (fluid-ref using-readline?)) - (lambda (v) (fluid-set! using-readline? v))))) - -(define (top-repl) - (let ((guile-user-module (resolve-module '(guile-user)))) - - ;; Load emacs interface support if emacs option is given. - (if (and (module-defined? guile-user-module 'use-emacs-interface) - (module-ref guile-user-module 'use-emacs-interface)) - (load-emacs-interface)) - - ;; Use some convenient modules (in reverse order) - - (if (provided? 'regex) - (module-use! guile-user-module (resolve-interface '(ice-9 regex)))) - (if (provided? 'threads) - (module-use! guile-user-module (resolve-interface '(ice-9 threads)))) - ;; load debugger on demand - (module-use! guile-user-module - (make-autoload-interface guile-user-module - '(ice-9 debugger) '(debug))) - (module-use! guile-user-module (resolve-interface '(ice-9 session))) - (module-use! guile-user-module (resolve-interface '(ice-9 debug))) - ;; so that builtin bindings will be checked first - (module-use! guile-user-module (resolve-interface '(guile))) - - (set-current-module guile-user-module) - - (let ((old-handlers #f) - (signals (if (provided? 'posix) - `((,SIGINT . "User interrupt") - (,SIGFPE . "Arithmetic error") - (,SIGBUS . "Bad memory access (bus error)") - (,SIGSEGV - . "Bad memory access (Segmentation violation)")) - '()))) - - (dynamic-wind - - ;; call at entry - (lambda () - (let ((make-handler (lambda (msg) - (lambda (sig) - ;; Make a backup copy of the stack - (fluid-set! before-signal-stack - (fluid-ref the-last-stack)) - (save-stack %deliver-signals) - (scm-error 'signal - #f - msg - #f - (list sig)))))) - (set! old-handlers - (map (lambda (sig-msg) - (sigaction (car sig-msg) - (make-handler (cdr sig-msg)))) - signals)))) - - ;; the protected thunk. - (lambda () - (let ((status (scm-style-repl))) - (run-hook exit-hook) - status)) - - ;; call at exit. - (lambda () - (map (lambda (sig-msg old-handler) - (if (not (car old-handler)) - ;; restore original C handler. - (sigaction (car sig-msg) #f) - ;; restore Scheme handler, SIG_IGN or SIG_DFL. - (sigaction (car sig-msg) - (car old-handler) - (cdr old-handler)))) - signals old-handlers)))))) - -(defmacro false-if-exception (expr) - `(catch #t (lambda () ,expr) - (lambda args #f))) - -;;; This hook is run at the very end of an interactive session. -;;; -(define exit-hook (make-hook)) - - -(append! %load-path (list ".")) - -;; Place the user in the guile-user module. -;; - -(define-module (guile-user)) - -(begin-deprecated - ;; automatic availability of this module is deprecated. - (use-modules (ice-9 rdelim))) - ;;; boot-9.scm ends here diff --git a/tests/examplefiles/example.c b/tests/examplefiles/example.c index 67b8d17d..a7f546d1 100644 --- a/tests/examplefiles/example.c +++ b/tests/examplefiles/example.c @@ -2078,2432 +2078,3 @@ rb_ary_select(ary) return result; } -/* - * call-seq: - * array.delete(obj) -> obj or nil - * array.delete(obj) { block } -> obj or nil - * - * Deletes items from <i>self</i> that are equal to <i>obj</i>. If - * the item is not found, returns <code>nil</code>. If the optional - * code block is given, returns the result of <i>block</i> if the item - * is not found. - * - * a = [ "a", "b", "b", "b", "c" ] - * a.delete("b") #=> "b" - * a #=> ["a", "c"] - * a.delete("z") #=> nil - * a.delete("z") { "not found" } #=> "not found" - */ - -VALUE -rb_ary_delete(ary, item) - VALUE ary; - VALUE item; -{ - long i1, i2; - - for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) { - VALUE e = RARRAY(ary)->ptr[i1]; - - if (rb_equal(e, item)) continue; - if (i1 != i2) { - rb_ary_store(ary, i2, e); - } - i2++; - } - if (RARRAY(ary)->len == i2) { - if (rb_block_given_p()) { - return rb_yield(item); - } - return Qnil; - } - - rb_ary_modify(ary); - if (RARRAY(ary)->len > i2) { - RARRAY(ary)->len = i2; - if (i2 * 2 < RARRAY(ary)->aux.capa && - RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, i2 * 2); - RARRAY(ary)->aux.capa = i2 * 2; - } - } - - return item; -} - -VALUE -rb_ary_delete_at(ary, pos) - VALUE ary; - long pos; -{ - long i, len = RARRAY(ary)->len; - VALUE del; - - if (pos >= len) return Qnil; - if (pos < 0) { - pos += len; - if (pos < 0) return Qnil; - } - - rb_ary_modify(ary); - del = RARRAY(ary)->ptr[pos]; - for (i = pos + 1; i < len; i++, pos++) { - RARRAY(ary)->ptr[pos] = RARRAY(ary)->ptr[i]; - } - RARRAY(ary)->len = pos; - - return del; -} - -/* - * call-seq: - * array.delete_at(index) -> obj or nil - * - * Deletes the element at the specified index, returning that element, - * or <code>nil</code> if the index is out of range. See also - * <code>Array#slice!</code>. - * - * a = %w( ant bat cat dog ) - * a.delete_at(2) #=> "cat" - * a #=> ["ant", "bat", "dog"] - * a.delete_at(99) #=> nil - */ - -static VALUE -rb_ary_delete_at_m(ary, pos) - VALUE ary, pos; -{ - return rb_ary_delete_at(ary, NUM2LONG(pos)); -} - -/* - * call-seq: - * array.slice!(index) -> obj or nil - * array.slice!(start, length) -> sub_array or nil - * array.slice!(range) -> sub_array or nil - * - * Deletes the element(s) given by an index (optionally with a length) - * or by a range. Returns the deleted object, subarray, or - * <code>nil</code> if the index is out of range. Equivalent to: - * - * def slice!(*args) - * result = self[*args] - * self[*args] = nil - * result - * end - * - * a = [ "a", "b", "c" ] - * a.slice!(1) #=> "b" - * a #=> ["a", "c"] - * a.slice!(-1) #=> "c" - * a #=> ["a"] - * a.slice!(100) #=> nil - * a #=> ["a"] - */ - -static VALUE -rb_ary_slice_bang(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - VALUE arg1, arg2; - long pos, len; - - if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) { - pos = NUM2LONG(arg1); - len = NUM2LONG(arg2); - delete_pos_len: - if (pos < 0) { - pos = RARRAY(ary)->len + pos; - } - arg2 = rb_ary_subseq(ary, pos, len); - rb_ary_splice(ary, pos, len, Qundef); /* Qnil/rb_ary_new2(0) */ - return arg2; - } - - if (!FIXNUM_P(arg1) && rb_range_beg_len(arg1, &pos, &len, RARRAY(ary)->len, 1)) { - goto delete_pos_len; - } - - return rb_ary_delete_at(ary, NUM2LONG(arg1)); -} - -/* - * call-seq: - * array.reject! {|item| block } -> array or nil - * - * Equivalent to <code>Array#delete_if</code>, deleting elements from - * _self_ for which the block evaluates to true, but returns - * <code>nil</code> if no changes were made. Also see - * <code>Enumerable#reject</code>. - */ - -static VALUE -rb_ary_reject_bang(ary) - VALUE ary; -{ - long i1, i2; - - rb_ary_modify(ary); - for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) { - VALUE v = RARRAY(ary)->ptr[i1]; - if (RTEST(rb_yield(v))) continue; - if (i1 != i2) { - rb_ary_store(ary, i2, v); - } - i2++; - } - if (RARRAY(ary)->len == i2) return Qnil; - if (i2 < RARRAY(ary)->len) - RARRAY(ary)->len = i2; - - return ary; -} - -/* - * call-seq: - * array.reject {|item| block } -> an_array - * - * Returns a new array containing the items in _self_ - * for which the block is not true. - */ - -static VALUE -rb_ary_reject(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_reject_bang(ary); - return ary; -} - -/* - * call-seq: - * array.delete_if {|item| block } -> array - * - * Deletes every element of <i>self</i> for which <i>block</i> evaluates - * to <code>true</code>. - * - * a = [ "a", "b", "c" ] - * a.delete_if {|x| x >= "b" } #=> ["a"] - */ - -static VALUE -rb_ary_delete_if(ary) - VALUE ary; -{ - rb_ary_reject_bang(ary); - return ary; -} - -/* - * call-seq: - * array.zip(arg, ...) -> an_array - * array.zip(arg, ...) {| arr | block } -> nil - * - * Converts any arguments to arrays, then merges elements of - * <i>self</i> with corresponding elements from each argument. This - * generates a sequence of <code>self.size</code> <em>n</em>-element - * arrays, where <em>n</em> is one more that the count of arguments. If - * the size of any argument is less than <code>enumObj.size</code>, - * <code>nil</code> values are supplied. If a block given, it is - * invoked for each output array, otherwise an array of arrays is - * returned. - * - * a = [ 4, 5, 6 ] - * b = [ 7, 8, 9 ] - * - * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] - * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]] - * a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]] - */ - -static VALUE -rb_ary_zip(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - int i, j; - long len; - VALUE result; - - for (i=0; i<argc; i++) { - argv[i] = to_a(argv[i]); - } - if (rb_block_given_p()) { - for (i=0; i<RARRAY(ary)->len; i++) { - VALUE tmp = rb_ary_new2(argc+1); - - rb_ary_push(tmp, rb_ary_elt(ary, i)); - for (j=0; j<argc; j++) { - rb_ary_push(tmp, rb_ary_elt(argv[j], i)); - } - rb_yield(tmp); - } - return Qnil; - } - len = RARRAY(ary)->len; - result = rb_ary_new2(len); - for (i=0; i<len; i++) { - VALUE tmp = rb_ary_new2(argc+1); - - rb_ary_push(tmp, rb_ary_elt(ary, i)); - for (j=0; j<argc; j++) { - rb_ary_push(tmp, rb_ary_elt(argv[j], i)); - } - rb_ary_push(result, tmp); - } - return result; -} - -/* - * call-seq: - * array.transpose -> an_array - * - * Assumes that <i>self</i> is an array of arrays and transposes the - * rows and columns. - * - * a = [[1,2], [3,4], [5,6]] - * a.transpose #=> [[1, 3, 5], [2, 4, 6]] - */ - -static VALUE -rb_ary_transpose(ary) - VALUE ary; -{ - long elen = -1, alen, i, j; - VALUE tmp, result = 0; - - alen = RARRAY(ary)->len; - if (alen == 0) return rb_ary_dup(ary); - for (i=0; i<alen; i++) { - tmp = to_ary(rb_ary_elt(ary, i)); - if (elen < 0) { /* first element */ - elen = RARRAY(tmp)->len; - result = rb_ary_new2(elen); - for (j=0; j<elen; j++) { - rb_ary_store(result, j, rb_ary_new2(alen)); - } - } - else if (elen != RARRAY(tmp)->len) { - rb_raise(rb_eIndexError, "element size differs (%d should be %d)", - RARRAY(tmp)->len, elen); - } - for (j=0; j<elen; j++) { - rb_ary_store(rb_ary_elt(result, j), i, rb_ary_elt(tmp, j)); - } - } - return result; -} - -/* - * call-seq: - * array.replace(other_array) -> array - * - * Replaces the contents of <i>self</i> with the contents of - * <i>other_array</i>, truncating or expanding if necessary. - * - * a = [ "a", "b", "c", "d", "e" ] - * a.replace([ "x", "y", "z" ]) #=> ["x", "y", "z"] - * a #=> ["x", "y", "z"] - */ - -static VALUE -rb_ary_replace(copy, orig) - VALUE copy, orig; -{ - VALUE shared; - - rb_ary_modify(copy); - orig = to_ary(orig); - if (copy == orig) return copy; - shared = ary_make_shared(orig); - if (RARRAY(copy)->ptr && !FL_TEST(copy, ELTS_SHARED)) - free(RARRAY(copy)->ptr); - RARRAY(copy)->ptr = RARRAY(orig)->ptr; - RARRAY(copy)->len = RARRAY(orig)->len; - RARRAY(copy)->aux.shared = shared; - FL_SET(copy, ELTS_SHARED); - - return copy; -} - -/* - * call-seq: - * array.clear -> array - * - * Removes all elements from _self_. - * - * a = [ "a", "b", "c", "d", "e" ] - * a.clear #=> [ ] - */ - -VALUE -rb_ary_clear(ary) - VALUE ary; -{ - rb_ary_modify(ary); - RARRAY(ary)->len = 0; - if (ARY_DEFAULT_SIZE * 2 < RARRAY(ary)->aux.capa) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, ARY_DEFAULT_SIZE * 2); - RARRAY(ary)->aux.capa = ARY_DEFAULT_SIZE * 2; - } - return ary; -} - -/* - * call-seq: - * array.fill(obj) -> array - * array.fill(obj, start [, length]) -> array - * array.fill(obj, range ) -> array - * array.fill {|index| block } -> array - * array.fill(start [, length] ) {|index| block } -> array - * array.fill(range) {|index| block } -> array - * - * The first three forms set the selected elements of <i>self</i> (which - * may be the entire array) to <i>obj</i>. A <i>start</i> of - * <code>nil</code> is equivalent to zero. A <i>length</i> of - * <code>nil</code> is equivalent to <i>self.length</i>. The last three - * forms fill the array with the value of the block. The block is - * passed the absolute index of each element to be filled. - * - * a = [ "a", "b", "c", "d" ] - * a.fill("x") #=> ["x", "x", "x", "x"] - * a.fill("z", 2, 2) #=> ["x", "x", "z", "z"] - * a.fill("y", 0..1) #=> ["y", "y", "z", "z"] - * a.fill {|i| i*i} #=> [0, 1, 4, 9] - * a.fill(-2) {|i| i*i*i} #=> [0, 1, 8, 27] - */ - -static VALUE -rb_ary_fill(argc, argv, ary) - int argc; - VALUE *argv; - VALUE ary; -{ - VALUE item, arg1, arg2; - long beg, end, len; - VALUE *p, *pend; - int block_p = Qfalse; - - if (rb_block_given_p()) { - block_p = Qtrue; - rb_scan_args(argc, argv, "02", &arg1, &arg2); - argc += 1; /* hackish */ - } - else { - rb_scan_args(argc, argv, "12", &item, &arg1, &arg2); - } - switch (argc) { - case 1: - beg = 0; - len = RARRAY(ary)->len; - break; - case 2: - if (rb_range_beg_len(arg1, &beg, &len, RARRAY(ary)->len, 1)) { - break; - } - /* fall through */ - case 3: - beg = NIL_P(arg1) ? 0 : NUM2LONG(arg1); - if (beg < 0) { - beg = RARRAY(ary)->len + beg; - if (beg < 0) beg = 0; - } - len = NIL_P(arg2) ? RARRAY(ary)->len - beg : NUM2LONG(arg2); - break; - } - rb_ary_modify(ary); - end = beg + len; - if (end > RARRAY(ary)->len) { - if (end >= RARRAY(ary)->aux.capa) { - REALLOC_N(RARRAY(ary)->ptr, VALUE, end); - RARRAY(ary)->aux.capa = end; - } - if (beg > RARRAY(ary)->len) { - rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, end - RARRAY(ary)->len); - } - RARRAY(ary)->len = end; - } - - if (block_p) { - VALUE v; - long i; - - for (i=beg; i<end; i++) { - v = rb_yield(LONG2NUM(i)); - if (i>=RARRAY(ary)->len) break; - RARRAY(ary)->ptr[i] = v; - } - } - else { - p = RARRAY(ary)->ptr + beg; - pend = p + len; - while (p < pend) { - *p++ = item; - } - } - return ary; -} - -/* - * call-seq: - * array + other_array -> an_array - * - * Concatenation---Returns a new array built by concatenating the - * two arrays together to produce a third array. - * - * [ 1, 2, 3 ] + [ 4, 5 ] #=> [ 1, 2, 3, 4, 5 ] - */ - -VALUE -rb_ary_plus(x, y) - VALUE x, y; -{ - VALUE z; - long len; - - y = to_ary(y); - len = RARRAY(x)->len + RARRAY(y)->len; - z = rb_ary_new2(len); - MEMCPY(RARRAY(z)->ptr, RARRAY(x)->ptr, VALUE, RARRAY(x)->len); - MEMCPY(RARRAY(z)->ptr + RARRAY(x)->len, RARRAY(y)->ptr, VALUE, RARRAY(y)->len); - RARRAY(z)->len = len; - return z; -} - -/* - * call-seq: - * array.concat(other_array) -> array - * - * Appends the elements in other_array to _self_. - * - * [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ] - */ - - -VALUE -rb_ary_concat(x, y) - VALUE x, y; -{ - y = to_ary(y); - if (RARRAY(y)->len > 0) { - rb_ary_splice(x, RARRAY(x)->len, 0, y); - } - return x; -} - - -/* - * call-seq: - * array * int -> an_array - * array * str -> a_string - * - * Repetition---With a String argument, equivalent to - * self.join(str). Otherwise, returns a new array - * built by concatenating the _int_ copies of _self_. - * - * - * [ 1, 2, 3 ] * 3 #=> [ 1, 2, 3, 1, 2, 3, 1, 2, 3 ] - * [ 1, 2, 3 ] * "," #=> "1,2,3" - * - */ - -static VALUE -rb_ary_times(ary, times) - VALUE ary, times; -{ - VALUE ary2, tmp; - long i, len; - - tmp = rb_check_string_type(times); - if (!NIL_P(tmp)) { - return rb_ary_join(ary, tmp); - } - - len = NUM2LONG(times); - if (len == 0) return ary_new(rb_obj_class(ary), 0); - if (len < 0) { - rb_raise(rb_eArgError, "negative argument"); - } - if (LONG_MAX/len < RARRAY(ary)->len) { - rb_raise(rb_eArgError, "argument too big"); - } - len *= RARRAY(ary)->len; - - ary2 = ary_new(rb_obj_class(ary), len); - RARRAY(ary2)->len = len; - - for (i=0; i<len; i+=RARRAY(ary)->len) { - MEMCPY(RARRAY(ary2)->ptr+i, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); - } - OBJ_INFECT(ary2, ary); - - return ary2; -} - -/* - * call-seq: - * array.assoc(obj) -> an_array or nil - * - * Searches through an array whose elements are also arrays - * comparing _obj_ with the first element of each contained array - * using obj.==. - * Returns the first contained array that matches (that - * is, the first associated array), - * or +nil+ if no match is found. - * See also <code>Array#rassoc</code>. - * - * s1 = [ "colors", "red", "blue", "green" ] - * s2 = [ "letters", "a", "b", "c" ] - * s3 = "foo" - * a = [ s1, s2, s3 ] - * a.assoc("letters") #=> [ "letters", "a", "b", "c" ] - * a.assoc("foo") #=> nil - */ - -VALUE -rb_ary_assoc(ary, key) - VALUE ary, key; -{ - long i; - VALUE v; - - for (i = 0; i < RARRAY(ary)->len; ++i) { - v = RARRAY(ary)->ptr[i]; - if (TYPE(v) == T_ARRAY && - RARRAY(v)->len > 0 && - rb_equal(RARRAY(v)->ptr[0], key)) - return v; - } - return Qnil; -} - -/* - * call-seq: - * array.rassoc(key) -> an_array or nil - * - * Searches through the array whose elements are also arrays. Compares - * <em>key</em> with the second element of each contained array using - * <code>==</code>. Returns the first contained array that matches. See - * also <code>Array#assoc</code>. - * - * a = [ [ 1, "one"], [2, "two"], [3, "three"], ["ii", "two"] ] - * a.rassoc("two") #=> [2, "two"] - * a.rassoc("four") #=> nil - */ - -VALUE -rb_ary_rassoc(ary, value) - VALUE ary, value; -{ - long i; - VALUE v; - - for (i = 0; i < RARRAY(ary)->len; ++i) { - v = RARRAY(ary)->ptr[i]; - if (TYPE(v) == T_ARRAY && - RARRAY(v)->len > 1 && - rb_equal(RARRAY(v)->ptr[1], value)) - return v; - } - return Qnil; -} - -/* - * call-seq: - * array == other_array -> bool - * - * Equality---Two arrays are equal if they contain the same number - * of elements and if each element is equal to (according to - * Object.==) the corresponding element in the other array. - * - * [ "a", "c" ] == [ "a", "c", 7 ] #=> false - * [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true - * [ "a", "c", 7 ] == [ "a", "d", "f" ] #=> false - * - */ - -static VALUE -rb_ary_equal(ary1, ary2) - VALUE ary1, ary2; -{ - long i; - - if (ary1 == ary2) return Qtrue; - if (TYPE(ary2) != T_ARRAY) { - if (!rb_respond_to(ary2, rb_intern("to_ary"))) { - return Qfalse; - } - return rb_equal(ary2, ary1); - } - if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse; - for (i=0; i<RARRAY(ary1)->len; i++) { - if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i))) - return Qfalse; - } - return Qtrue; -} - -/* - * call-seq: - * array.eql?(other) -> true or false - * - * Returns <code>true</code> if _array_ and _other_ are the same object, - * or are both arrays with the same content. - */ - -static VALUE -rb_ary_eql(ary1, ary2) - VALUE ary1, ary2; -{ - long i; - - if (ary1 == ary2) return Qtrue; - if (TYPE(ary2) != T_ARRAY) return Qfalse; - if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse; - for (i=0; i<RARRAY(ary1)->len; i++) { - if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i))) - return Qfalse; - } - return Qtrue; -} - -static VALUE -recursive_hash(ary, dummy, recur) - VALUE ary, dummy; - int recur; -{ - long i, h; - VALUE n; - - if (recur) { - return LONG2FIX(0); - } - h = RARRAY(ary)->len; - for (i=0; i<RARRAY(ary)->len; i++) { - h = (h << 1) | (h<0 ? 1 : 0); - n = rb_hash(RARRAY(ary)->ptr[i]); - h ^= NUM2LONG(n); - } - return LONG2FIX(h); -} - -/* - * call-seq: - * array.hash -> fixnum - * - * Compute a hash-code for this array. Two arrays with the same content - * will have the same hash code (and will compare using <code>eql?</code>). - */ - -static VALUE -rb_ary_hash(ary) - VALUE ary; -{ - return rb_exec_recursive(recursive_hash, ary, 0); -} - -/* - * call-seq: - * array.include?(obj) -> true or false - * - * Returns <code>true</code> if the given object is present in - * <i>self</i> (that is, if any object <code>==</code> <i>anObject</i>), - * <code>false</code> otherwise. - * - * a = [ "a", "b", "c" ] - * a.include?("b") #=> true - * a.include?("z") #=> false - */ - -VALUE -rb_ary_includes(ary, item) - VALUE ary; - VALUE item; -{ - long i; - - for (i=0; i<RARRAY(ary)->len; i++) { - if (rb_equal(RARRAY(ary)->ptr[i], item)) { - return Qtrue; - } - } - return Qfalse; -} - - -/* - * call-seq: - * array <=> other_array -> -1, 0, +1 - * - * Comparison---Returns an integer (-1, 0, - * or +1) if this array is less than, equal to, or greater than - * other_array. Each object in each array is compared - * (using <=>). If any value isn't - * equal, then that inequality is the return value. If all the - * values found are equal, then the return is based on a - * comparison of the array lengths. Thus, two arrays are - * ``equal'' according to <code>Array#<=></code> if and only if they have - * the same length and the value of each element is equal to the - * value of the corresponding element in the other array. - * - * [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1 - * [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1 - * - */ - -VALUE -rb_ary_cmp(ary1, ary2) - VALUE ary1, ary2; -{ - long i, len; - - ary2 = to_ary(ary2); - len = RARRAY(ary1)->len; - if (len > RARRAY(ary2)->len) { - len = RARRAY(ary2)->len; - } - for (i=0; i<len; i++) { - VALUE v = rb_funcall(rb_ary_elt(ary1, i), id_cmp, 1, rb_ary_elt(ary2, i)); - if (v != INT2FIX(0)) { - return v; - } - } - len = RARRAY(ary1)->len - RARRAY(ary2)->len; - if (len == 0) return INT2FIX(0); - if (len > 0) return INT2FIX(1); - return INT2FIX(-1); -} - -static VALUE -ary_make_hash(ary1, ary2) - VALUE ary1, ary2; -{ - VALUE hash = rb_hash_new(); - long i; - - for (i=0; i<RARRAY(ary1)->len; i++) { - rb_hash_aset(hash, RARRAY(ary1)->ptr[i], Qtrue); - } - if (ary2) { - for (i=0; i<RARRAY(ary2)->len; i++) { - rb_hash_aset(hash, RARRAY(ary2)->ptr[i], Qtrue); - } - } - return hash; -} - -/* - * call-seq: - * array - other_array -> an_array - * - * Array Difference---Returns a new array that is a copy of - * the original array, removing any items that also appear in - * other_array. (If you need set-like behavior, see the - * library class Set.) - * - * [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ] - */ - -static VALUE -rb_ary_diff(ary1, ary2) - VALUE ary1, ary2; -{ - VALUE ary3, hash; - long i; - - hash = ary_make_hash(to_ary(ary2), 0); - ary3 = rb_ary_new(); - - for (i=0; i<RARRAY(ary1)->len; i++) { - if (st_lookup(RHASH(hash)->tbl, RARRAY(ary1)->ptr[i], 0)) continue; - rb_ary_push(ary3, rb_ary_elt(ary1, i)); - } - return ary3; -} - -/* - * call-seq: - * array & other_array - * - * Set Intersection---Returns a new array - * containing elements common to the two arrays, with no duplicates. - * - * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ] - */ - - -static VALUE -rb_ary_and(ary1, ary2) - VALUE ary1, ary2; -{ - VALUE hash, ary3, v, vv; - long i; - - ary2 = to_ary(ary2); - ary3 = rb_ary_new2(RARRAY(ary1)->len < RARRAY(ary2)->len ? - RARRAY(ary1)->len : RARRAY(ary2)->len); - hash = ary_make_hash(ary2, 0); - - for (i=0; i<RARRAY(ary1)->len; i++) { - v = vv = rb_ary_elt(ary1, i); - if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) { - rb_ary_push(ary3, v); - } - } - - return ary3; -} - -/* - * call-seq: - * array | other_array -> an_array - * - * Set Union---Returns a new array by joining this array with - * other_array, removing duplicates. - * - * [ "a", "b", "c" ] | [ "c", "d", "a" ] - * #=> [ "a", "b", "c", "d" ] - */ - -static VALUE -rb_ary_or(ary1, ary2) - VALUE ary1, ary2; -{ - VALUE hash, ary3; - VALUE v, vv; - long i; - - ary2 = to_ary(ary2); - ary3 = rb_ary_new2(RARRAY(ary1)->len+RARRAY(ary2)->len); - hash = ary_make_hash(ary1, ary2); - - for (i=0; i<RARRAY(ary1)->len; i++) { - v = vv = rb_ary_elt(ary1, i); - if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) { - rb_ary_push(ary3, v); - } - } - for (i=0; i<RARRAY(ary2)->len; i++) { - v = vv = rb_ary_elt(ary2, i); - if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) { - rb_ary_push(ary3, v); - } - } - return ary3; -} - -/* - * call-seq: - * array.uniq! -> array or nil - * - * Removes duplicate elements from _self_. - * Returns <code>nil</code> if no changes are made (that is, no - * duplicates are found). - * - * a = [ "a", "a", "b", "b", "c" ] - * a.uniq! #=> ["a", "b", "c"] - * b = [ "a", "b", "c" ] - * b.uniq! #=> nil - */ - -static VALUE -rb_ary_uniq_bang(ary) - VALUE ary; -{ - VALUE hash, v, vv; - long i, j; - - hash = ary_make_hash(ary, 0); - - if (RARRAY(ary)->len == RHASH(hash)->tbl->num_entries) { - return Qnil; - } - for (i=j=0; i<RARRAY(ary)->len; i++) { - v = vv = rb_ary_elt(ary, i); - if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) { - rb_ary_store(ary, j++, v); - } - } - RARRAY(ary)->len = j; - - return ary; -} - -/* - * call-seq: - * array.uniq -> an_array - * - * Returns a new array by removing duplicate values in <i>self</i>. - * - * a = [ "a", "a", "b", "b", "c" ] - * a.uniq #=> ["a", "b", "c"] - */ - -static VALUE -rb_ary_uniq(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_uniq_bang(ary); - return ary; -} - -/* - * call-seq: - * array.compact! -> array or nil - * - * Removes +nil+ elements from array. - * Returns +nil+ if no changes were made. - * - * [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ] - * [ "a", "b", "c" ].compact! #=> nil - */ - -static VALUE -rb_ary_compact_bang(ary) - VALUE ary; -{ - VALUE *p, *t, *end; - - rb_ary_modify(ary); - p = t = RARRAY(ary)->ptr; - end = p + RARRAY(ary)->len; - - while (t < end) { - if (NIL_P(*t)) t++; - else *p++ = *t++; - } - if (RARRAY(ary)->len == (p - RARRAY(ary)->ptr)) { - return Qnil; - } - RARRAY(ary)->len = RARRAY(ary)->aux.capa = (p - RARRAY(ary)->ptr); - REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len); - - return ary; -} - -/* - * call-seq: - * array.compact -> an_array - * - * Returns a copy of _self_ with all +nil+ elements removed. - * - * [ "a", nil, "b", nil, "c", nil ].compact - * #=> [ "a", "b", "c" ] - */ - -static VALUE -rb_ary_compact(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_compact_bang(ary); - return ary; -} - -/* - * call-seq: - * array.nitems -> int - * - * Returns the number of non-<code>nil</code> elements in _self_. - * May be zero. - * - * [ 1, nil, 3, nil, 5 ].nitems #=> 3 - */ - -static VALUE -rb_ary_nitems(ary) - VALUE ary; -{ - long n = 0; - VALUE *p, *pend; - - p = RARRAY(ary)->ptr; - pend = p + RARRAY(ary)->len; - - while (p < pend) { - if (!NIL_P(*p)) n++; - p++; - } - return LONG2NUM(n); -} - -static long -flatten(ary, idx, ary2, memo) - VALUE ary; - long idx; - VALUE ary2, memo; -{ - VALUE id; - long i = idx; - long n, lim = idx + RARRAY(ary2)->len; - - id = rb_obj_id(ary2); - if (rb_ary_includes(memo, id)) { - rb_raise(rb_eArgError, "tried to flatten recursive array"); - } - rb_ary_push(memo, id); - rb_ary_splice(ary, idx, 1, ary2); - while (i < lim) { - VALUE tmp; - - tmp = rb_check_array_type(rb_ary_elt(ary, i)); - if (!NIL_P(tmp)) { - n = flatten(ary, i, tmp, memo); - i += n; lim += n; - } - i++; - } - rb_ary_pop(memo); - - return lim - idx - 1; /* returns number of increased items */ -} - -/* - * call-seq: - * array.flatten! -> array or nil - * - * Flattens _self_ in place. - * Returns <code>nil</code> if no modifications were made (i.e., - * <i>array</i> contains no subarrays.) - * - * a = [ 1, 2, [3, [4, 5] ] ] - * a.flatten! #=> [1, 2, 3, 4, 5] - * a.flatten! #=> nil - * a #=> [1, 2, 3, 4, 5] - */ - -static VALUE -rb_ary_flatten_bang(ary) - VALUE ary; -{ - long i = 0; - int mod = 0; - VALUE memo = Qnil; - - while (i<RARRAY(ary)->len) { - VALUE ary2 = RARRAY(ary)->ptr[i]; - VALUE tmp; - - tmp = rb_check_array_type(ary2); - if (!NIL_P(tmp)) { - if (NIL_P(memo)) { - memo = rb_ary_new(); - } - i += flatten(ary, i, tmp, memo); - mod = 1; - } - i++; - } - if (mod == 0) return Qnil; - return ary; -} - -/* - * call-seq: - * array.flatten -> an_array - * - * Returns a new array that is a one-dimensional flattening of this - * array (recursively). That is, for every element that is an array, - * extract its elements into the new array. - * - * s = [ 1, 2, 3 ] #=> [1, 2, 3] - * t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]] - * a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10] - * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - */ - -static VALUE -rb_ary_flatten(ary) - VALUE ary; -{ - ary = rb_ary_dup(ary); - rb_ary_flatten_bang(ary); - return ary; -} - - -/* Arrays are ordered, integer-indexed collections of any object. - * Array indexing starts at 0, as in C or Java. A negative index is - * assumed to be relative to the end of the array---that is, an index of -1 - * indicates the last element of the array, -2 is the next to last - * element in the array, and so on. - */ - -void -Init_Array() -{ - rb_cArray = rb_define_class("Array", rb_cObject); - rb_include_module(rb_cArray, rb_mEnumerable); - - rb_define_alloc_func(rb_cArray, ary_alloc); - rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1); - rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1); - rb_define_method(rb_cArray, "initialize_copy", rb_ary_replace, 1); - - rb_define_method(rb_cArray, "to_s", rb_ary_to_s, 0); - rb_define_method(rb_cArray, "inspect", rb_ary_inspect, 0); - rb_define_method(rb_cArray, "to_a", rb_ary_to_a, 0); - rb_define_method(rb_cArray, "to_ary", rb_ary_to_ary_m, 0); - rb_define_method(rb_cArray, "frozen?", rb_ary_frozen_p, 0); - - rb_define_method(rb_cArray, "==", rb_ary_equal, 1); - rb_define_method(rb_cArray, "eql?", rb_ary_eql, 1); - rb_define_method(rb_cArray, "hash", rb_ary_hash, 0); - - rb_define_method(rb_cArray, "[]", rb_ary_aref, -1); - rb_define_method(rb_cArray, "[]=", rb_ary_aset, -1); - rb_define_method(rb_cArray, "at", rb_ary_at, 1); - rb_define_method(rb_cArray, "fetch", rb_ary_fetch, -1); - rb_define_method(rb_cArray, "first", rb_ary_first, -1); - rb_define_method(rb_cArray, "last", rb_ary_last, -1); - rb_define_method(rb_cArray, "concat", rb_ary_concat, 1); - rb_define_method(rb_cArray, "<<", rb_ary_push, 1); - rb_define_method(rb_cArray, "push", rb_ary_push_m, -1); - rb_define_method(rb_cArray, "pop", rb_ary_pop_m, -1); - rb_define_method(rb_cArray, "shift", rb_ary_shift_m, -1); - rb_define_method(rb_cArray, "unshift", rb_ary_unshift_m, -1); - rb_define_method(rb_cArray, "insert", rb_ary_insert, -1); - rb_define_method(rb_cArray, "each", rb_ary_each, 0); - rb_define_method(rb_cArray, "each_index", rb_ary_each_index, 0); - rb_define_method(rb_cArray, "reverse_each", rb_ary_reverse_each, 0); - rb_define_method(rb_cArray, "length", rb_ary_length, 0); - rb_define_alias(rb_cArray, "size", "length"); - rb_define_method(rb_cArray, "empty?", rb_ary_empty_p, 0); - rb_define_method(rb_cArray, "index", rb_ary_index, -1); - rb_define_method(rb_cArray, "rindex", rb_ary_rindex, -1); - rb_define_method(rb_cArray, "join", rb_ary_join_m, -1); - rb_define_method(rb_cArray, "reverse", rb_ary_reverse_m, 0); - rb_define_method(rb_cArray, "reverse!", rb_ary_reverse_bang, 0); - rb_define_method(rb_cArray, "sort", rb_ary_sort, 0); - rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0); - rb_define_method(rb_cArray, "collect", rb_ary_collect, 0); - rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0); - rb_define_method(rb_cArray, "map", rb_ary_collect, 0); - rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0); - rb_define_method(rb_cArray, "select", rb_ary_select, 0); - rb_define_method(rb_cArray, "values_at", rb_ary_values_at, -1); - rb_define_method(rb_cArray, "delete", rb_ary_delete, 1); - rb_define_method(rb_cArray, "delete_at", rb_ary_delete_at_m, 1); - rb_define_method(rb_cArray, "delete_if", rb_ary_delete_if, 0); - rb_define_method(rb_cArray, "reject", rb_ary_reject, 0); - rb_define_method(rb_cArray, "reject!", rb_ary_reject_bang, 0); - rb_define_method(rb_cArray, "zip", rb_ary_zip, -1); - rb_define_method(rb_cArray, "transpose", rb_ary_transpose, 0); - rb_define_method(rb_cArray, "replace", rb_ary_replace, 1); - rb_define_method(rb_cArray, "clear", rb_ary_clear, 0); - rb_define_method(rb_cArray, "fill", rb_ary_fill, -1); - rb_define_method(rb_cArray, "include?", rb_ary_includes, 1); - rb_define_method(rb_cArray, "<=>", rb_ary_cmp, 1); - - rb_define_method(rb_cArray, "slice", rb_ary_aref, -1); - rb_define_method(rb_cArray, "slice!", rb_ary_slice_bang, -1); - - rb_define_method(rb_cArray, "assoc", rb_ary_assoc, 1); - rb_define_method(rb_cArray, "rassoc", rb_ary_rassoc, 1); - - rb_define_method(rb_cArray, "+", rb_ary_plus, 1); - rb_define_method(rb_cArray, "*", rb_ary_times, 1); - - rb_define_method(rb_cArray, "-", rb_ary_diff, 1); - rb_define_method(rb_cArray, "&", rb_ary_and, 1); - rb_define_method(rb_cArray, "|", rb_ary_or, 1); - - rb_define_method(rb_cArray, "uniq", rb_ary_uniq, 0); - rb_define_method(rb_cArray, "uniq!", rb_ary_uniq_bang, 0); - rb_define_method(rb_cArray, "compact", rb_ary_compact, 0); - rb_define_method(rb_cArray, "compact!", rb_ary_compact_bang, 0); - rb_define_method(rb_cArray, "flatten", rb_ary_flatten, 0); - rb_define_method(rb_cArray, "flatten!", rb_ary_flatten_bang, 0); - rb_define_method(rb_cArray, "nitems", rb_ary_nitems, 0); - - id_cmp = rb_intern("<=>"); - - rb_cValues = rb_define_class("Values", rb_cArray); -} -/********************************************************************** - ascii.c - Oniguruma (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2004 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "regenc.h" - -static int -ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype) -{ - if (code < 128) - return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); - else - return FALSE; -} - -OnigEncodingType OnigEncodingASCII = { - onigenc_single_byte_mbc_enc_len, - "US-ASCII", /* name */ - 1, /* max byte length */ - 1, /* min byte length */ - ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE, - { - (OnigCodePoint )'\\' /* esc */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ - , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ - }, - onigenc_is_mbc_newline_0x0a, - onigenc_single_byte_mbc_to_code, - onigenc_single_byte_code_to_mbclen, - onigenc_single_byte_code_to_mbc, - onigenc_ascii_mbc_to_normalize, - onigenc_ascii_is_mbc_ambiguous, - onigenc_ascii_get_all_pair_ambig_codes, - onigenc_nothing_get_all_comp_ambig_codes, - ascii_is_code_ctype, - onigenc_not_support_get_ctype_code_range, - onigenc_single_byte_left_adjust_char_head, - onigenc_always_true_is_allowed_reverse_match -}; -/********************************************************************** - - bignum.c - - - $Author: murphy $ - $Date: 2005-11-05 04:33:55 +0100 (Sa, 05 Nov 2005) $ - created at: Fri Jun 10 00:48:55 JST 1994 - - Copyright (C) 1993-2003 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby.h" - -#include <math.h> -#include <ctype.h> -#ifdef HAVE_IEEEFP_H -#include <ieeefp.h> -#endif - -VALUE rb_cBignum; - -#if defined __MINGW32__ -#define USHORT _USHORT -#endif - -#define BDIGITS(x) ((BDIGIT*)RBIGNUM(x)->digits) -#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT) -#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG) -#define DIGSPERLONG ((unsigned int)(SIZEOF_LONG/SIZEOF_BDIGITS)) -#if HAVE_LONG_LONG -# define DIGSPERLL ((unsigned int)(SIZEOF_LONG_LONG/SIZEOF_BDIGITS)) -#endif -#define BIGUP(x) ((BDIGIT_DBL)(x) << BITSPERDIG) -#define BIGDN(x) RSHIFT(x,BITSPERDIG) -#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1))) -#define BDIGMAX ((BDIGIT)-1) - -#define BIGZEROP(x) (RBIGNUM(x)->len == 0 || (RBIGNUM(x)->len == 1 && BDIGITS(x)[0] == 0)) - -static VALUE -bignew_1(klass, len, sign) - VALUE klass; - long len; - char sign; -{ - NEWOBJ(big, struct RBignum); - OBJSETUP(big, klass, T_BIGNUM); - big->sign = sign; - big->len = len; - big->digits = ALLOC_N(BDIGIT, len); - - return (VALUE)big; -} - -#define bignew(len,sign) bignew_1(rb_cBignum,len,sign) - -VALUE -rb_big_clone(x) - VALUE x; -{ - VALUE z = bignew_1(CLASS_OF(x), RBIGNUM(x)->len, RBIGNUM(x)->sign); - - MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, RBIGNUM(x)->len); - return z; -} - -static void -get2comp(x, carry) /* get 2's complement */ - VALUE x; - int carry; -{ - long i = RBIGNUM(x)->len; - BDIGIT *ds = BDIGITS(x); - BDIGIT_DBL num; - - while (i--) ds[i] = ~ds[i]; - i = 0; num = 1; - do { - num += ds[i]; - ds[i++] = BIGLO(num); - num = BIGDN(num); - } while (i < RBIGNUM(x)->len); - if (!carry) return; - if ((ds[RBIGNUM(x)->len-1] & (1<<(BITSPERDIG-1))) == 0) { - REALLOC_N(RBIGNUM(x)->digits, BDIGIT, ++RBIGNUM(x)->len); - ds = BDIGITS(x); - ds[RBIGNUM(x)->len-1] = ~0; - } -} - -void -rb_big_2comp(x) /* get 2's complement */ - VALUE x; -{ - get2comp(x, Qtrue); -} - -static VALUE -bignorm(x) - VALUE x; -{ - if (!FIXNUM_P(x)) { - long len = RBIGNUM(x)->len; - BDIGIT *ds = BDIGITS(x); - - while (len-- && !ds[len]) ; - RBIGNUM(x)->len = ++len; - - if (len*SIZEOF_BDIGITS <= sizeof(VALUE)) { - long num = 0; - while (len--) { - num = BIGUP(num) + ds[len]; - } - if (num >= 0) { - if (RBIGNUM(x)->sign) { - if (POSFIXABLE(num)) return LONG2FIX(num); - } - else if (NEGFIXABLE(-(long)num)) return LONG2FIX(-(long)num); - } - } - } - return x; -} - -VALUE -rb_big_norm(x) - VALUE x; -{ - return bignorm(x); -} - -VALUE -rb_uint2big(n) - unsigned long n; -{ - BDIGIT_DBL num = n; - long i = 0; - BDIGIT *digits; - VALUE big; - - big = bignew(DIGSPERLONG, 1); - digits = BDIGITS(big); - while (i < DIGSPERLONG) { - digits[i++] = BIGLO(num); - num = BIGDN(num); - } - - i = DIGSPERLONG; - while (--i && !digits[i]) ; - RBIGNUM(big)->len = i+1; - return big; -} - -VALUE -rb_int2big(n) - long n; -{ - long neg = 0; - VALUE big; - - if (n < 0) { - n = -n; - neg = 1; - } - big = rb_uint2big(n); - if (neg) { - RBIGNUM(big)->sign = 0; - } - return big; -} - -VALUE -rb_uint2inum(n) - unsigned long n; -{ - if (POSFIXABLE(n)) return LONG2FIX(n); - return rb_uint2big(n); -} - -VALUE -rb_int2inum(n) - long n; -{ - if (FIXABLE(n)) return LONG2FIX(n); - return rb_int2big(n); -} - -#ifdef HAVE_LONG_LONG - -void -rb_quad_pack(buf, val) - char *buf; - VALUE val; -{ - LONG_LONG q; - - val = rb_to_int(val); - if (FIXNUM_P(val)) { - q = FIX2LONG(val); - } - else { - long len = RBIGNUM(val)->len; - BDIGIT *ds; - - if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS) { - len = SIZEOF_LONG/SIZEOF_BDIGITS; - } - ds = BDIGITS(val); - q = 0; - while (len--) { - q = BIGUP(q); - q += ds[len]; - } - if (!RBIGNUM(val)->sign) q = -q; - } - memcpy(buf, (char*)&q, SIZEOF_LONG_LONG); -} - -VALUE -rb_quad_unpack(buf, sign) - const char *buf; - int sign; -{ - unsigned LONG_LONG q; - long neg = 0; - long i; - BDIGIT *digits; - VALUE big; - - memcpy(&q, buf, SIZEOF_LONG_LONG); - if (sign) { - if (FIXABLE((LONG_LONG)q)) return LONG2FIX((LONG_LONG)q); - if ((LONG_LONG)q < 0) { - q = -(LONG_LONG)q; - neg = 1; - } - } - else { - if (POSFIXABLE(q)) return LONG2FIX(q); - } - - i = 0; - big = bignew(DIGSPERLL, 1); - digits = BDIGITS(big); - while (i < DIGSPERLL) { - digits[i++] = BIGLO(q); - q = BIGDN(q); - } - - i = DIGSPERLL; - while (i-- && !digits[i]) ; - RBIGNUM(big)->len = i+1; - - if (neg) { - RBIGNUM(big)->sign = 0; - } - return bignorm(big); -} - -#else - -#define QUAD_SIZE 8 - -void -rb_quad_pack(buf, val) - char *buf; - VALUE val; -{ - long len; - - memset(buf, 0, QUAD_SIZE); - val = rb_to_int(val); - if (FIXNUM_P(val)) { - val = rb_int2big(FIX2LONG(val)); - } - len = RBIGNUM(val)->len * SIZEOF_BDIGITS; - if (len > QUAD_SIZE) { - rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'"); - } - memcpy(buf, (char*)BDIGITS(val), len); - if (!RBIGNUM(val)->sign) { - len = QUAD_SIZE; - while (len--) { - *buf = ~*buf; - buf++; - } - } -} - -#define BNEG(b) (RSHIFT(((BDIGIT*)b)[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0) - -VALUE -rb_quad_unpack(buf, sign) - const char *buf; - int sign; -{ - VALUE big = bignew(QUAD_SIZE/SIZEOF_BDIGITS, 1); - - memcpy((char*)BDIGITS(big), buf, QUAD_SIZE); - if (sign && BNEG(buf)) { - long len = QUAD_SIZE; - char *tmp = (char*)BDIGITS(big); - - RBIGNUM(big)->sign = 0; - while (len--) { - *tmp = ~*tmp; - tmp++; - } - } - - return bignorm(big); -} - -#endif - -VALUE -rb_cstr_to_inum(str, base, badcheck) - const char *str; - int base; - int badcheck; -{ - const char *s = str; - char *end; - char sign = 1, nondigit = 0; - int c; - BDIGIT_DBL num; - long len, blen = 1; - long i; - VALUE z; - BDIGIT *zds; - - if (!str) { - if (badcheck) goto bad; - return INT2FIX(0); - } - if (badcheck) { - while (ISSPACE(*str)) str++; - } - else { - while (ISSPACE(*str) || *str == '_') str++; - } - - if (str[0] == '+') { - str++; - } - else if (str[0] == '-') { - str++; - sign = 0; - } - if (str[0] == '+' || str[0] == '-') { - if (badcheck) goto bad; - return INT2FIX(0); - } - if (base <= 0) { - if (str[0] == '0') { - switch (str[1]) { - case 'x': case 'X': - base = 16; - break; - case 'b': case 'B': - base = 2; - break; - case 'o': case 'O': - base = 8; - break; - case 'd': case 'D': - base = 10; - break; - default: - base = 8; - } - } - else if (base < -1) { - base = -base; - } - else { - base = 10; - } - } - switch (base) { - case 2: - len = 1; - if (str[0] == '0' && (str[1] == 'b'||str[1] == 'B')) { - str += 2; - } - break; - case 3: - len = 2; - break; - case 8: - if (str[0] == '0' && (str[1] == 'o'||str[1] == 'O')) { - str += 2; - } - case 4: case 5: case 6: case 7: - len = 3; - break; - case 10: - if (str[0] == '0' && (str[1] == 'd'||str[1] == 'D')) { - str += 2; - } - case 9: case 11: case 12: case 13: case 14: case 15: - len = 4; - break; - case 16: - len = 4; - if (str[0] == '0' && (str[1] == 'x'||str[1] == 'X')) { - str += 2; - } - break; - default: - if (base < 2 || 36 < base) { - rb_raise(rb_eArgError, "illegal radix %d", base); - } - if (base <= 32) { - len = 5; - } - else { - len = 6; - } - break; - } - if (*str == '0') { /* squeeze preceeding 0s */ - while (*++str == '0'); - --str; - } - len *= strlen(str)*sizeof(char); - - if (len <= (sizeof(VALUE)*CHAR_BIT)) { - unsigned long val = strtoul((char*)str, &end, base); - - if (*end == '_') goto bigparse; - if (badcheck) { - if (end == str) goto bad; /* no number */ - while (*end && ISSPACE(*end)) end++; - if (*end) goto bad; /* trailing garbage */ - } - - if (POSFIXABLE(val)) { - if (sign) return LONG2FIX(val); - else { - long result = -(long)val; - return LONG2FIX(result); - } - } - else { - VALUE big = rb_uint2big(val); - RBIGNUM(big)->sign = sign; - return bignorm(big); - } - } - bigparse: - len = (len/BITSPERDIG)+1; - if (badcheck && *str == '_') goto bad; - - z = bignew(len, sign); - zds = BDIGITS(z); - for (i=len;i--;) zds[i]=0; - while (c = *str++) { - if (c == '_') { - if (badcheck) { - if (nondigit) goto bad; - nondigit = c; - } - continue; - } - else if (!ISASCII(c)) { - break; - } - else if (isdigit(c)) { - c -= '0'; - } - else if (islower(c)) { - c -= 'a' - 10; - } - else if (isupper(c)) { - c -= 'A' - 10; - } - else { - break; - } - if (c >= base) break; - nondigit = 0; - i = 0; - num = c; - for (;;) { - while (i<blen) { - num += (BDIGIT_DBL)zds[i]*base; - zds[i++] = BIGLO(num); - num = BIGDN(num); - } - if (num) { - blen++; - continue; - } - break; - } - } - if (badcheck) { - str--; - if (s+1 < str && str[-1] == '_') goto bad; - while (*str && ISSPACE(*str)) str++; - if (*str) { - bad: - rb_invalid_str(s, "Integer"); - } - } - - return bignorm(z); -} - -VALUE -rb_str_to_inum(str, base, badcheck) - VALUE str; - int base; - int badcheck; -{ - char *s; - long len; - - StringValue(str); - if (badcheck) { - s = StringValueCStr(str); - } - else { - s = RSTRING(str)->ptr; - } - if (s) { - len = RSTRING(str)->len; - if (s[len]) { /* no sentinel somehow */ - char *p = ALLOCA_N(char, len+1); - - MEMCPY(p, s, char, len); - p[len] = '\0'; - s = p; - } - } - return rb_cstr_to_inum(s, base, badcheck); -} - -#if HAVE_LONG_LONG - -VALUE -rb_ull2big(n) - unsigned LONG_LONG n; -{ - BDIGIT_DBL num = n; - long i = 0; - BDIGIT *digits; - VALUE big; - - big = bignew(DIGSPERLL, 1); - digits = BDIGITS(big); - while (i < DIGSPERLL) { - digits[i++] = BIGLO(num); - num = BIGDN(num); - } - - i = DIGSPERLL; - while (i-- && !digits[i]) ; - RBIGNUM(big)->len = i+1; - return big; -} - -VALUE -rb_ll2big(n) - LONG_LONG n; -{ - long neg = 0; - VALUE big; - - if (n < 0) { - n = -n; - neg = 1; - } - big = rb_ull2big(n); - if (neg) { - RBIGNUM(big)->sign = 0; - } - return big; -} - -VALUE -rb_ull2inum(n) - unsigned LONG_LONG n; -{ - if (POSFIXABLE(n)) return LONG2FIX(n); - return rb_ull2big(n); -} - -VALUE -rb_ll2inum(n) - LONG_LONG n; -{ - if (FIXABLE(n)) return LONG2FIX(n); - return rb_ll2big(n); -} - -#endif /* HAVE_LONG_LONG */ - -VALUE -rb_cstr2inum(str, base) - const char *str; - int base; -{ - return rb_cstr_to_inum(str, base, base==0); -} - -VALUE -rb_str2inum(str, base) - VALUE str; - int base; -{ - return rb_str_to_inum(str, base, base==0); -} - -const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz"; -VALUE -rb_big2str(x, base) - VALUE x; - int base; -{ - volatile VALUE t; - BDIGIT *ds; - long i, j, hbase; - VALUE ss; - char *s, c; - - if (FIXNUM_P(x)) { - return rb_fix2str(x, base); - } - i = RBIGNUM(x)->len; - if (BIGZEROP(x)) { - return rb_str_new2("0"); - } - j = SIZEOF_BDIGITS*CHAR_BIT*i; - switch (base) { - case 2: break; - case 3: - j = j * 647L / 1024; - break; - case 4: case 5: case 6: case 7: - j /= 2; - break; - case 8: case 9: - j /= 3; - break; - case 10: case 11: case 12: case 13: case 14: case 15: - j = j * 241L / 800; - break; - case 16: case 17: case 18: case 19: case 20: case 21: - case 22: case 23: case 24: case 25: case 26: case 27: - case 28: case 29: case 30: case 31: - j /= 4; - break; - case 32: case 33: case 34: case 35: case 36: - j /= 5; - break; - default: - rb_raise(rb_eArgError, "illegal radix %d", base); - break; - } - j += 2; - - hbase = base * base; -#if SIZEOF_BDIGITS > 2 - hbase *= hbase; -#endif - - t = rb_big_clone(x); - ds = BDIGITS(t); - ss = rb_str_new(0, j); - s = RSTRING(ss)->ptr; - - s[0] = RBIGNUM(x)->sign ? '+' : '-'; - while (i && j) { - long k = i; - BDIGIT_DBL num = 0; - - while (k--) { - num = BIGUP(num) + ds[k]; - ds[k] = (BDIGIT)(num / hbase); - num %= hbase; - } - if (ds[i-1] == 0) i--; - k = SIZEOF_BDIGITS; - while (k--) { - c = (char)(num % base); - s[--j] = ruby_digitmap[(int)c]; - num /= base; - if (i == 0 && num == 0) break; - } - } - while (s[j] == '0') j++; - RSTRING(ss)->len -= RBIGNUM(x)->sign?j:j-1; - memmove(RBIGNUM(x)->sign?s:s+1, s+j, RSTRING(ss)->len); - s[RSTRING(ss)->len] = '\0'; - - return ss; -} - -/* - * call-seq: - * big.to_s(base=10) => string - * - * Returns a string containing the representation of <i>big</i> radix - * <i>base</i> (2 through 36). - * - * 12345654321.to_s #=> "12345654321" - * 12345654321.to_s(2) #=> "1011011111110110111011110000110001" - * 12345654321.to_s(8) #=> "133766736061" - * 12345654321.to_s(16) #=> "2dfdbbc31" - * 78546939656932.to_s(36) #=> "rubyrules" - */ - -static VALUE -rb_big_to_s(argc, argv, x) - int argc; - VALUE *argv; - VALUE x; -{ - VALUE b; - int base; - - rb_scan_args(argc, argv, "01", &b); - if (argc == 0) base = 10; - else base = NUM2INT(b); - return rb_big2str(x, base); -} - -static unsigned long -big2ulong(x, type, check) - VALUE x; - char *type; - int check; -{ - long len = RBIGNUM(x)->len; - BDIGIT_DBL num; - BDIGIT *ds; - - if (len > SIZEOF_LONG/SIZEOF_BDIGITS) { - if (check) - rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type); - len = SIZEOF_LONG/SIZEOF_BDIGITS; - } - ds = BDIGITS(x); - num = 0; - while (len--) { - num = BIGUP(num); - num += ds[len]; - } - return num; -} - -unsigned long -rb_big2ulong_pack(x) - VALUE x; -{ - unsigned long num = big2ulong(x, "unsigned long", Qfalse); - if (!RBIGNUM(x)->sign) { - return -num; - } - return num; -} - -unsigned long -rb_big2ulong(x) - VALUE x; -{ - unsigned long num = big2ulong(x, "unsigned long", Qtrue); - - if (!RBIGNUM(x)->sign) { - if ((long)num < 0) { - rb_raise(rb_eRangeError, "bignum out of range of unsigned long"); - } - return -num; - } - return num; -} - -long -rb_big2long(x) - VALUE x; -{ - unsigned long num = big2ulong(x, "long", Qtrue); - - if ((long)num < 0 && (RBIGNUM(x)->sign || (long)num != LONG_MIN)) { - rb_raise(rb_eRangeError, "bignum too big to convert into `long'"); - } - if (!RBIGNUM(x)->sign) return -(long)num; - return num; -} - -#if HAVE_LONG_LONG - -static unsigned LONG_LONG -big2ull(x, type) - VALUE x; - char *type; -{ - long len = RBIGNUM(x)->len; - BDIGIT_DBL num; - BDIGIT *ds; - - if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS) - rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type); - ds = BDIGITS(x); - num = 0; - while (len--) { - num = BIGUP(num); - num += ds[len]; - } - return num; -} - -unsigned LONG_LONG -rb_big2ull(x) - VALUE x; -{ - unsigned LONG_LONG num = big2ull(x, "unsigned long long"); - - if (!RBIGNUM(x)->sign) return -num; - return num; -} - -LONG_LONG -rb_big2ll(x) - VALUE x; -{ - unsigned LONG_LONG num = big2ull(x, "long long"); - - if ((LONG_LONG)num < 0 && (RBIGNUM(x)->sign - || (LONG_LONG)num != LLONG_MIN)) { - rb_raise(rb_eRangeError, "bignum too big to convert into `long long'"); - } - if (!RBIGNUM(x)->sign) return -(LONG_LONG)num; - return num; -} - -#endif /* HAVE_LONG_LONG */ - -static VALUE -dbl2big(d) - double d; -{ - long i = 0; - BDIGIT c; - BDIGIT *digits; - VALUE z; - double u = (d < 0)?-d:d; - - if (isinf(d)) { - rb_raise(rb_eFloatDomainError, d < 0 ? "-Infinity" : "Infinity"); - } - if (isnan(d)) { - rb_raise(rb_eFloatDomainError, "NaN"); - } - - while (!POSFIXABLE(u) || 0 != (long)u) { - u /= (double)(BIGRAD); - i++; - } - z = bignew(i, d>=0); - digits = BDIGITS(z); - while (i--) { - u *= BIGRAD; - c = (BDIGIT)u; - u -= c; - digits[i] = c; - } - - return z; -} - -VALUE -rb_dbl2big(d) - double d; -{ - return bignorm(dbl2big(d)); -} - -double -rb_big2dbl(x) - VALUE x; -{ - double d = 0.0; - long i = RBIGNUM(x)->len; - BDIGIT *ds = BDIGITS(x); - - while (i--) { - d = ds[i] + BIGRAD*d; - } - if (isinf(d)) { - rb_warn("Bignum out of Float range"); - d = HUGE_VAL; - } - if (!RBIGNUM(x)->sign) d = -d; - return d; -} - -/* - * call-seq: - * big.to_f -> float - * - * Converts <i>big</i> to a <code>Float</code>. If <i>big</i> doesn't - * fit in a <code>Float</code>, the result is infinity. - * - */ - -static VALUE -rb_big_to_f(x) - VALUE x; -{ - return rb_float_new(rb_big2dbl(x)); -} - -/* - * call-seq: - * big <=> numeric => -1, 0, +1 - * - * Comparison---Returns -1, 0, or +1 depending on whether <i>big</i> is - * less than, equal to, or greater than <i>numeric</i>. This is the - * basis for the tests in <code>Comparable</code>. - * - */ - -static VALUE -rb_big_cmp(x, y) - VALUE x, y; -{ - long xlen = RBIGNUM(x)->len; - - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - - case T_BIGNUM: - break; - - case T_FLOAT: - return rb_dbl_cmp(rb_big2dbl(x), RFLOAT(y)->value); - - default: - return rb_num_coerce_cmp(x, y); - } - - if (RBIGNUM(x)->sign > RBIGNUM(y)->sign) return INT2FIX(1); - if (RBIGNUM(x)->sign < RBIGNUM(y)->sign) return INT2FIX(-1); - if (xlen < RBIGNUM(y)->len) - return (RBIGNUM(x)->sign) ? INT2FIX(-1) : INT2FIX(1); - if (xlen > RBIGNUM(y)->len) - return (RBIGNUM(x)->sign) ? INT2FIX(1) : INT2FIX(-1); - - while(xlen-- && (BDIGITS(x)[xlen]==BDIGITS(y)[xlen])); - if (-1 == xlen) return INT2FIX(0); - return (BDIGITS(x)[xlen] > BDIGITS(y)[xlen]) ? - (RBIGNUM(x)->sign ? INT2FIX(1) : INT2FIX(-1)) : - (RBIGNUM(x)->sign ? INT2FIX(-1) : INT2FIX(1)); -} - -/* - * call-seq: - * big == obj => true or false - * - * Returns <code>true</code> only if <i>obj</i> has the same value - * as <i>big</i>. Contrast this with <code>Bignum#eql?</code>, which - * requires <i>obj</i> to be a <code>Bignum</code>. - * - * 68719476736 == 68719476736.0 #=> true - */ - -static VALUE -rb_big_eq(x, y) - VALUE x, y; -{ - switch (TYPE(y)) { - case T_FIXNUM: - y = rb_int2big(FIX2LONG(y)); - break; - case T_BIGNUM: - break; - case T_FLOAT: - { - volatile double a, b; - - a = RFLOAT(y)->value; - b = rb_big2dbl(x); - if (isnan(a) || isnan(b)) return Qfalse; - return (a == b)?Qtrue:Qfalse; - } - default: - return rb_equal(y, x); - } - if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse; - if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse; - if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * big.eql?(obj) => true or false - * - * Returns <code>true</code> only if <i>obj</i> is a - * <code>Bignum</code> with the same value as <i>big</i>. Contrast this - * with <code>Bignum#==</code>, which performs type conversions. - * - * 68719476736.eql?(68719476736.0) #=> false - */ - -static VALUE -rb_big_eql(x, y) - VALUE x, y; -{ - if (TYPE(y) != T_BIGNUM) return Qfalse; - if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse; - if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse; - if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse; - return Qtrue; -} - -/* - * call-seq: - * -big => other_big - * - * Unary minus (returns a new Bignum whose value is 0-big) - */ - -static VALUE -rb_big_uminus(x) - VALUE x; -{ - VALUE z = rb_big_clone(x); - - RBIGNUM(z)->sign = !RBIGNUM(x)->sign; - - return bignorm(z); -} - -/* - * call-seq: - * ~big => integer - * - * Inverts the bits in big. As Bignums are conceptually infinite - * length, the result acts as if it had an infinite number of one - * bits to the left. In hex representations, this is displayed - * as two periods to the left of the digits. - * - * sprintf("%X", ~0x1122334455) #=> "..FEEDDCCBBAA" - */ - -static VALUE -rb_big_neg(x) - VALUE x; -{ - VALUE z = rb_big_clone(x); - long i = RBIGNUM(x)->len; - BDIGIT *ds = BDIGITS(z); - - if (!RBIGNUM(x)->sign) get2comp(z, Qtrue); - while (i--) ds[i] = ~ds[i]; - if (RBIGNUM(x)->sign) get2comp(z, Qfalse); - RBIGNUM(z)->sign = !RBIGNUM(z)->sign; - - return bignorm(z); -} - -static VALUE -bigsub(x, y) - VALUE x, y; -{ - VALUE z = 0; - BDIGIT *zds; - BDIGIT_DBL_SIGNED num; - long i = RBIGNUM(x)->len; - - /* if x is larger than y, swap */ - if (RBIGNUM(x)->len < RBIGNUM(y)->len) { - z = x; x = y; y = z; /* swap x y */ - } - else if (RBIGNUM(x)->len == RBIGNUM(y)->len) { - while (i > 0) { - i--; - if (BDIGITS(x)[i] > BDIGITS(y)[i]) { - break; - } - if (BDIGITS(x)[i] < BDIGITS(y)[i]) { - z = x; x = y; y = z; /* swap x y */ - break; - } - } - } - - z = bignew(RBIGNUM(x)->len, (z == 0)?1:0); - zds = BDIGITS(z); - - for (i = 0, num = 0; i < RBIGNUM(y)->len; i++) { - num += (BDIGIT_DBL_SIGNED)BDIGITS(x)[i] - BDIGITS(y)[i]; - zds[i] = BIGLO(num); - num = BIGDN(num); - } - while (num && i < RBIGNUM(x)->len) { - num += BDIGITS(x)[i]; - zds[i++] = BIGLO(num); - num = BIGDN(num); - } - while (i < RBIGNUM(x)->len) { - zds[i] = BDIGITS(x)[i]; - i++; - } - - return z; -} - diff --git a/tests/examplefiles/example.xml b/tests/examplefiles/example.xml index 61d7ad97..e657e564 100644 --- a/tests/examplefiles/example.xml +++ b/tests/examplefiles/example.xml @@ -1894,5793 +1894,4 @@ </comments>
</general>
</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="C++" version="1.15" kateversion="2.1" section="Sources" extensions="*.cxx;*.cpp;*.cc;*.C;*.h;*.hxx;*.hpp;*.hcc;*.moc" mimetype="text/x-c++src;text/x-c++hdr;text/x-chdr" priority="9">
- <highlighting>
- <list name="keywords">
- <item> asm </item>
- <item> break </item>
- <item> case </item>
- <item> catch </item>
- <item> class </item>
- <item> const_cast </item>
- <item> continue </item>
- <item> default </item>
- <item> delete </item>
- <item> do </item>
- <item> dynamic_cast</item>
- <item> else </item>
- <item> enum </item>
- <item> explicit </item>
- <item> export </item>
- <item> extern </item>
- <item> false </item>
- <item> friend </item>
- <item> for </item>
- <item> goto </item>
- <item> if </item>
- <item> inline </item>
- <item> namespace </item>
- <item> new </item>
- <item> operator </item>
- <item> private </item>
- <item> protected </item>
- <item> public </item>
- <item> reinterpret_cast </item>
- <item> return </item>
- <item> sizeof </item>
- <item> static_cast </item>
- <item> struct </item>
- <item> switch </item>
- <item> template </item>
- <item> this </item>
- <item> throw </item>
- <item> true </item>
- <item> try </item>
- <item> typedef </item>
- <item> typeid </item>
- <item> type_info </item>
- <item> typename </item>
- <item> union </item>
- <item> using </item>
- <item> virtual </item>
- <item> while </item>
-
- <item> and </item>
- <item> and_eq </item>
- <item> bad_cast </item>
- <item> bad_typeid </item>
- <item> bitand </item>
- <item> bitor </item>
- <item> compl </item>
- <item> not </item>
- <item> not_eq </item>
- <item> or </item>
- <item> or_eq </item>
- <item> xor </item>
- <item> xor_eq </item>
- <item> except </item>
- <item> finally </item>
- <item> xalloc </item>
- </list>
- <list name="extensions">
- <item> K_DCOP </item>
- <item> SLOT </item>
- <item> SIGNAL </item>
- <item> Q_CLASSINFO </item>
- <item> Q_ENUMS </item>
- <item> Q_EXPORT </item>
- <item> Q_OBJECT </item>
- <item> Q_OVERRIDE </item>
- <item> Q_PROPERTY </item>
- <item> Q_SETS </item>
- <item> TRUE </item>
- <item> FALSE </item>
- <item> connect </item>
- <item> disconnect </item>
- <item> emit </item>
- <item> signals </item>
- <item> slots </item>
- </list>
- <list name="types">
- <item> auto </item>
- <item> bool </item>
- <item> char </item>
- <item> const </item>
- <item> double </item>
- <item> float </item>
- <item> int </item>
- <item> long </item>
- <item> mutable </item>
- <item> register </item>
- <item> short </item>
- <item> signed </item>
- <item> static </item>
- <item> unsigned </item>
- <item> void </item>
- <item> volatile </item>
- <item> uchar </item>
- <item> uint </item>
- <item> int8_t </item>
- <item> int16_t </item>
- <item> int32_t </item>
- <item> int64_t </item>
- <item> uint8_t </item>
- <item> uint16_t </item>
- <item> uint32_t </item>
- <item> uint64_t </item>
- <item> wchar_t </item>
- </list>
- <list name="attention">
- <item> FIXME </item>
- <item> TODO </item>
- <item> ### </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <RegExpr attribute="Decimal" context="#stay" String="//\s*BEGIN.*$" beginRegion="Region1"/>
- <RegExpr attribute="Decimal" context="#stay" String="//\s*END.*$" endRegion="Region1"/>
- <keyword attribute="Keyword" context="#stay" String="keywords" />
- <keyword attribute="Extensions" context="#stay" String="extensions" />
- <keyword attribute="Data Type" context="#stay" String="types" />
- <Float attribute="Float" context="#stay">
- <AnyChar String="fF" attribute="Float" context="#stay"/>
- </Float>
- <HlCOct attribute="Octal" context="#stay"/>
- <HlCHex attribute="Hex" context="#stay"/>
- <Int attribute="Decimal" context="#stay">
- <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
- </Int>
- <HlCChar attribute="Char" context="#stay"/>
- <DetectChar attribute="String" context="String" char="""/>
- <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
- <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
- <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
- <StringDetect attribute="Preprocessor" context="Outscoped" String="#if 0"/>
- <DetectChar attribute="Preprocessor" context="Preprocessor" char="#"/>
- <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\d\w]*(?=[\s]*[(])" />
- <RegExpr attribute="Symbol" context="Member" String="([.]{1,1}|[:]{2,2})" />
- <AnyChar attribute="Symbol" context="#stay" String=":!%&()+,-/.*<=>?[]{|}~^;"/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="String">
- <LineContinue attribute="String" context="#stay"/>
- <HlCStringChar attribute="String Char" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Member">
- <RegExpr attribute="Function" context="#pop" String="\b[_\w][_\w\d]*(?=[\s]*)" />
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
- <keyword attribute="Decimal" context="#stay" String="attention" />
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
- <keyword attribute="Decimal" context="#stay" String="attention" />
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
- </context>
- <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
- <LineContinue attribute="Preprocessor" context="#stay"/>
- <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>
- <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>
- <RangeDetect attribute="Prep. Lib" context="#stay" char=""" char1="""/>
- <RangeDetect attribute="Prep. Lib" context="#stay" char="<" char1=">"/>
- <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*"/>
- </context>
- <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
- <LineContinue attribute="Preprocessor" context="#stay"/>
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
- </context>
- <context attribute="Normal Text" lineEndContext="String" name="Some Context"/>
- <context attribute="Normal Text" lineEndContext="Preprocessor" name="Some Context2"/>
- <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
- <keyword attribute="Decimal" context="#stay" String="attention" />
- <RegExpr attribute="Comment" context="Outscoped intern" String="^#if" />
- <RegExpr attribute="Preprocessor" context="#pop" String="#endif" />
- <RegExpr attribute="Preprocessor" context="#pop" String="#else" />
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
- <RegExpr attribute="Comment" context="Outscoped intern" String="#if" />
- <RegExpr attribute="Comment" context="#pop" String="#endif" />
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Extensions" defStyleNum="dsKeyword" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/>
- <itemData name="Function" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Octal" defStyleNum="dsBaseN"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Char" defStyleNum="dsChar"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="String Char" defStyleNum="dsChar"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Symbol" defStyleNum="dsNormal"/>
- <itemData name="Preprocessor" defStyleNum="dsOthers"/>
- <itemData name="Prep. Lib" defStyleNum="dsOthers"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="//" />
- <comment name="multiLine" start="/*" end="*/" />
- </comments>
- <keywords casesensitive="1" />
- </general>
-</language>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="C#" version="1.08" kateversion="2.1" section="Sources" extensions="*.cs" mimetype="text/x-csharp-src;text/x-csharp-hde">
- <highlighting>
- <list name="keywords">
- <item> abstract</item>
- <item> as</item>
- <item> base</item>
- <item> break</item>
- <item> case</item>
- <item> catch</item>
- <item> class</item>
- <item> checked</item>
- <item> continue</item>
- <item> default</item>
- <item> delegate</item>
- <item> do</item>
- <item> else</item>
- <item> enum</item>
- <item> event</item>
- <item> explicit</item>
- <item> extern</item>
- <item> false</item>
- <item> for</item>
- <item> foreach</item>
- <item> finally</item>
- <item> fixed</item>
- <item> goto</item>
- <item> if</item>
- <item> implicit</item>
- <item> in</item>
- <item> interface</item>
- <item> internal</item>
- <item> is</item>
- <item> lock</item>
- <item> namespace</item>
- <item> new</item>
- <item> null</item>
- <item> operator</item>
- <item> out</item>
- <item> override</item>
- <item> params</item>
- <item> private</item>
- <item> protected</item>
- <item> public</item>
- <item> readonly</item>
- <item> ref</item>
- <item> return</item>
- <item> sealed</item>
- <item> sizeof</item>
- <item> stackalloc</item>
- <item> static</item>
- <item> struct</item>
- <item> switch</item>
- <item> this</item>
- <item> throw</item>
- <item> true</item>
- <item> try</item>
- <item> typeof</item>
- <item> unchecked</item>
- <item> unsafe</item>
- <item> using</item>
- <item> virtual</item>
- <item> while</item>
- <item> #if</item>
- <item> #else</item>
- <item> #elif</item>
- <item> #endif</item>
- <item> #define</item>
- <item> #undef</item>
- <item> #warning</item>
- <item> #error</item>
- <item> #line</item>
- </list>
- <list name="types">
- <item> bool</item>
- <item> byte</item>
- <item> char</item>
- <item> const</item>
- <item> decimal</item>
- <item> double</item>
- <item> float</item>
- <item> int</item>
- <item> long</item>
- <item> object</item>
- <item> uint</item>
- <item> ushort</item>
- <item> ulong</item>
- <item> sbyte</item>
- <item> short</item>
- <item> string</item>
- <item> void</item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <keyword attribute="Data Type" context="#stay" String="types" />
- <Float attribute="Float" context="#stay">
- <AnyChar String="fF" attribute="Float" context="#stay"/>
- </Float>
- <HlCOct attribute="Octal" context="#stay"/>
- <HlCHex attribute="Hex" context="#stay"/>
- <Int attribute="Decimal" context="#stay" >
- <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
- </Int>
- <HlCChar attribute="Char" context="#stay"/>
- <DetectChar attribute="String" context="String" char="""/>
- <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*"/>
- <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="block1"/>
- <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="block1"/>
- <RegExpr attribute="Decimal" context="#stay" String="#region.*$" beginRegion="Region1"/>
- <RegExpr attribute="Decimal" context="#stay" String="#endregion.*$" endRegion="Region1"/>
- <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*[(])" />
- <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
- <AnyChar attribute="Symbol" context="#stay" String=":!%&()+,-/.*<=>?[]|~^;"/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="String">
- <LineContinue attribute="String" context="#pop"/>
- <HlCStringChar attribute="String Char" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Member">
- <RegExpr attribute="Function" context="#pop" String="\b[_\w][_\w\d]*(?=[\s]*)" />
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Function" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Octal" defStyleNum="dsBaseN"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Char" defStyleNum="dsChar"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="String Char" defStyleNum="dsChar"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Symbol" defStyleNum="dsNormal"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="//" />
- <comment name="multiLine" start="/*" end="*/" />
- </comments>
- <keywords casesensitive="1" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="CSS" version="1.02" kateversion="2.1" section="Markup" extensions="*.css" mimetype="text/css">
- <highlighting>
- <list name="keywords">
- <item> azimuth </item>
- <item> background-attachment </item>
- <item> background-color </item>
- <item> background-image </item>
- <item> background-position </item>
- <item> background-repeat </item>
- <item> border-collapse </item>
- <item> border-spacing </item>
- <item> border-top-color </item>
- <item> border-right-color </item>
- <item> border-bottom-color </item>
- <item> border-left-color </item>
- <item> border-top-style </item>
- <item> border-right-style </item>
- <item> border-bottom-style </item>
- <item> border-left-style </item>
- <item> border-top-width </item>
- <item> border-right-width </item>
- <item> border-bottom-width </item>
- <item> border-left-width </item>
- <item> bottom </item>
- <item> caption-side </item>
- <item> clear </item>
- <item> clip </item>
- <item> color </item>
- <item> content </item>
- <item> counter-increment </item>
- <item> counter-reset </item>
- <item> cue-after </item>
- <item> cue-before </item>
- <item> cursor </item>
- <item> direction </item>
- <item> display </item>
- <item> elevation </item>
- <item> empty-cells </item>
- <item> float </item>
- <item> font-family </item>
- <item> font-size </item>
- <item> font-size-adjust </item>
- <item> font-stretch </item>
- <item> font-style </item>
- <item> font-variant </item>
- <item> font-weight </item>
- <item> height </item>
- <item> left </item>
- <item> letter-spacing </item>
- <item> line-height </item>
- <item> list-style-image </item>
- <item> list-style-position </item>
- <item> list-style-keyword </item>
- <item> list-style-type </item>
- <item> margin-top </item>
- <item> margin-right </item>
- <item> margin-bottom </item>
- <item> margin-left </item>
- <item> marker-offset </item>
- <item> max-height </item>
- <item> max-width </item>
- <item> min-height </item>
- <item> min-width </item>
- <item> orphans </item>
- <item> outline-color </item>
- <item> outline-style </item>
- <item> outline-width </item>
- <item> overflow </item>
- <item> padding-top </item>
- <item> padding-right </item>
- <item> padding-bottom </item>
- <item> padding-left </item>
- <item> page </item>
- <item> page-break-after </item>
- <item> page-break-before </item>
- <item> page-break-inside </item>
- <item> pause-after </item>
- <item> pause-before </item>
- <item> pitch </item>
- <item> pitch-range </item>
- <item> play-during </item>
- <item> position </item>
- <item> quotes </item>
- <item> richness </item>
- <item> right </item>
- <item> size </item>
- <item> speak </item>
- <item> speak-header </item>
- <item> speak-numeral </item>
- <item> speak-punctuation </item>
- <item> speech-rate </item>
- <item> stress </item>
- <item> table-layout </item>
- <item> text-align </item>
- <item> text-decoration </item>
- <item> text-decoration-color </item>
- <item> text-indent </item>
- <item> text-shadow </item>
- <item> text-transform </item>
- <item> top </item>
- <item> unicode-bidi </item>
- <item> vertical-align </item>
- <item> visibility </item>
- <item> voice-family </item>
- <item> volume </item>
- <item> white-space </item>
- <item> widows </item>
- <item> width </item>
- <item> word-spacing </item>
- <item> z-index </item>
- <item> background </item>
- <item> border </item>
- <item> border-color </item>
- <item> border-style </item>
- <item> border-top </item>
- <item> border-right </item>
- <item> border-bottom </item>
- <item> border-left </item>
- <item> border-width </item>
- <item> cue </item>
- <item> font </item>
- <item> list-style </item>
- <item> margin </item>
- <item> outline </item>
- <item> padding </item>
- <item> pause </item>
- <item> konq_bgpos_x </item>
- <item> konq_bgpos_y </item>
- </list>
- <list name="types">
- <item> inherit </item>
- <item> none </item>
- <item> hidden </item>
- <item> dotted </item>
- <item> dashed </item>
- <item> solid </item>
- <item> double </item>
- <item> groove </item>
- <item> ridge </item>
- <item> inset </item>
- <item> outset </item>
- <item> xx-small </item>
- <item> x-small </item>
- <item> small </item>
- <item> medium </item>
- <item> large </item>
- <item> x-large </item>
- <item> xx-large </item>
- <item> smaller </item>
- <item> larger </item>
- <item> italic </item>
- <item> oblique </item>
- <item> small-caps </item>
- <item> normal </item>
- <item> bold </item>
- <item> bolder </item>
- <item> lighter </item>
- <item> light </item>
- <item> 100 </item>
- <item> 200 </item>
- <item> 300 </item>
- <item> 400 </item>
- <item> 500 </item>
- <item> 600 </item>
- <item> 700 </item>
- <item> 800 </item>
- <item> 900 </item>
- <item> transparent </item>
- <item> repeat </item>
- <item> repeat-x </item>
- <item> repeat-y </item>
- <item> no-repeat </item>
- <item> baseline </item>
- <item> sub </item>
- <item> super </item>
- <item> top </item>
- <item> text-top </item>
- <item> middle </item>
- <item> bottom </item>
- <item> text-bottom </item>
- <item> left </item>
- <item> right </item>
- <item> center </item>
- <item> justify </item>
- <item> konq-center </item>
- <item> disc </item>
- <item> circle </item>
- <item> square </item>
- <item> decimal </item>
- <item> decimal-leading-zero </item>
- <item> lower-roman </item>
- <item> upper-roman </item>
- <item> lower-greek </item>
- <item> lower-alpha </item>
- <item> lower-latin </item>
- <item> upper-alpha </item>
- <item> upper-latin </item>
- <item> hebrew </item>
- <item> armenian </item>
- <item> georgian </item>
- <item> cjk-ideographic </item>
- <item> hiragana </item>
- <item> katakana </item>
- <item> hiragana-iroha </item>
- <item> katakana-iroha </item>
- <item> inline </item>
- <item> block </item>
- <item> list-item </item>
- <item> run-in </item>
- <item> compact </item>
- <item> marker </item>
- <item> table </item>
- <item> inline-table </item>
- <item> table-row-group </item>
- <item> table-header-group </item>
- <item> table-footer-group </item>
- <item> table-row </item>
- <item> table-column-group </item>
- <item> table-column </item>
- <item> table-cell </item>
- <item> table-caption </item>
- <item> auto </item>
- <item> crosshair </item>
- <item> default </item>
- <item> pointer </item>
- <item> move </item>
- <item> e-resize </item>
- <item> ne-resize </item>
- <item> nw-resize </item>
- <item> n-resize </item>
- <item> se-resize </item>
- <item> sw-resize </item>
- <item> s-resize </item>
- <item> w-resize </item>
- <item> text </item>
- <item> wait </item>
- <item> help </item>
- <item> above </item>
- <item> absolute </item>
- <item> always </item>
- <item> avoid </item>
- <item> below </item>
- <item> bidi-override </item>
- <item> blink </item>
- <item> both </item>
- <item> capitalize </item>
- <item> caption </item>
- <item> close-quote </item>
- <item> collapse </item>
- <item> condensed </item>
- <item> crop </item>
- <item> cross </item>
- <item> embed </item>
- <item> expanded </item>
- <item> extra-condensed </item>
- <item> extra-expanded </item>
- <item> fixed </item>
- <item> hand </item>
- <item> hide </item>
- <item> higher </item>
- <item> icon </item>
- <item> inside </item>
- <item> invert </item>
- <item> landscape </item>
- <item> level </item>
- <item> line-through </item>
- <item> loud </item>
- <item> lower </item>
- <item> lowercase </item>
- <item> ltr </item>
- <item> menu </item>
- <item> message-box </item>
- <item> mix </item>
- <item> narrower </item>
- <item> no-close-quote </item>
- <item> no-open-quote </item>
- <item> nowrap </item>
- <item> open-quote </item>
- <item> outside </item>
- <item> overline </item>
- <item> portrait </item>
- <item> pre </item>
- <item> relative </item>
- <item> rtl </item>
- <item> scroll </item>
- <item> semi-condensed </item>
- <item> semi-expanded </item>
- <item> separate </item>
- <item> show </item>
- <item> small-caption </item>
- <item> static </item>
- <item> static-position </item>
- <item> status-bar </item>
- <item> thick </item>
- <item> thin </item>
- <item> ultra-condensed </item>
- <item> ultra-expanded </item>
- <item> underline </item>
- <item> uppercase </item>
- <item> visible </item>
- <item> wider </item>
- <item> break </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <RegExpr attribute="Notice" context="#stay" String="/\*BEGIN.*\*/" beginRegion="UserDefined" />
- <RegExpr attribute="Notice" context="#stay" String="/\*END.*\*/" endRegion="UserDefined" />
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="*" beginRegion="Comment" />
- <DetectChar attribute="Normal Text" context="Rules" char="{" beginRegion="RuleSet" />
- </context>
- <context attribute="Normal Text" lineEndContext="#stay" name="Rules">
- <DetectChar attribute="Normal Text" context="#pop" char="}" endRegion="RuleSet" />
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="*" beginRegion="Comment" />
- <keyword attribute="Keyword" context="#stay" String="keywords" />
- <keyword attribute="Data Type" context="#stay" String="types" />
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Comment">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment" />
- <RegExpr attribute="Notice" context= "#stay" String="(FIXME|TODO|NOTE)" />
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Comment" defStyleNum="dsComment" />
- <itemData name="Notice" defStyleNum="dsString" bold="1"/>
- </itemDatas>
- </highlighting>
- <general>
- <keywords casesensitive="1" weakDeliminator="-"/>
- <comments>
- <comment name="multiLine" start="/*" end="*/" />
- </comments>
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="CUE Sheet" version="0.9" kateversion="2.1" section="Other" extensions="*.cue" mimetype="application/x-cue">
- <highlighting>
- <list name="keywords">
- <item> CATALOG </item>
- <item> CDTEXTFILE </item>
- <item> FILE </item>
- <item> FLAGS </item>
- <item> INDEX </item>
- <item> ISRC </item>
- <item> PERFORMER </item>
- <item> PREGAP </item>
- <item> POSTGAP </item>
- <item> REM </item>
- <item> SONGWRITER </item>
- <item> TITLE </item>
- <item> TRACK </item>
- </list>
- <list name="format">
- <item> AIFF </item>
- <item> WAVE </item>
- <item> MP3 </item>
- <item> BINARY </item>
- <item> MOTOTOLA </item>
- </list>
- <list name="mode">
- <item> AUDIO </item>
- <item> CDG </item>
- <item> CDI </item>
- <item> MODE1 </item>
- <item> MODE2 </item>
- <item> RAW </item>
- </list>
- <list name="flags">
- <item> 4CH </item>
- <item> DCP </item>
- <item> PRE </item>
- <item> SCMS </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <keyword attribute="Keyword" context="#stay" String="keywords" />
- <keyword attribute="Format" context="#stay" String="format" />
- <keyword attribute="Mode" context="#stay" String="mode" />
- <keyword attribute="Flags" context="#stay" String="flags" />
- <Int attribute="Decimal" context="#stay" />
- <DetectChar attribute="String" context="String" char="""/>
- <DetectChar attribute="Comment" context="Comment" char=";"/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="String">
- <LineContinue attribute="String" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="Comment" />
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Format" defStyleNum="dsNormal" color="#800000"/>
- <itemData name="Mode" defStyleNum="dsNormal" color="#000080"/>
- <itemData name="Flags" defStyleNum="dsNormal" color="#008000"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start=";" />
- </comments>
- <keywords casesensitive="0" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="D" version="1.1" kateversion="2.1" section="Sources" extensions="*.d;*.D" mimetype="text/x-dsrc">
- <highlighting>
- <list name="keywords">
- <item> abstract </item>
- <item> alias </item>
- <item> align </item>
- <item> asm </item>
- <item> auto </item>
-
- <item> body </item>
- <item> break </item>
-
- <item> case </item>
- <item> cast </item>
- <item> catch </item>
- <item> class </item>
- <item> const </item>
- <item> continue </item>
-
- <item> default </item>
- <item> delegate </item>
- <item> delete </item>
- <item> deprecated </item>
- <item> do </item>
-
- <item> else </item>
- <item> enum </item>
- <item> export </item>
-
- <item> false </item>
- <item> final </item>
- <item> finally </item>
- <item> for </item>
- <item> foreach </item>
- <item> function </item>
-
- <item> goto </item>
-
- <item> if </item>
- <item> in </item>
- <item> inout </item>
- <item> interface </item>
- <item> invariant </item>
-
- <item> new </item>
- <item> null </item>
-
- <item> override </item>
- <item> out </item>
-
- <item> private </item>
- <item> protected </item>
- <item> public </item>
-
- <item> return </item>
-
- <item> static </item>
- <item> struct </item>
- <item> super </item>
- <item> switch </item>
- <item> synchronized </item>
-
- <item> this </item>
- <item> throw </item>
- <item> true </item>
- <item> try </item>
- <item> typedef </item>
-
- <item> union </item>
-
- <item> volatile </item>
-
- <item> while </item>
- <item> with </item>
- </list>
- <list name="modules">
- <item> module </item>
- <item> import </item>
- </list>
- <list name="types">
- <item> void </item>
- <item> bit </item>
- <item> byte </item>
- <item> ubyte </item>
- <item> short </item>
- <item> ushort </item>
- <item> int </item>
- <item> uint </item>
- <item> long </item>
- <item> ulong </item>
- <item> cent </item>
- <item> ucent </item>
- <item> float </item>
- <item> double </item>
- <item> real </item>
- <item> ireal </item>
- <item> ifloat </item>
- <item> idouble </item>
- <item> creal </item>
- <item> cfloat </item>
- <item> cdouble </item>
- <item> char </item>
- <item> wchar </item>
- <item> dchar </item>
- </list>
- <list name="phobos">
- <item> printf </item>
- </list>
- <list name="linkage">
- <item> extern </item>
- </list>
- <list name="ltypes">
- <item> C </item>
- <item> D </item>
- <item> Windows </item>
- <item> Pascal </item>
- </list>
- <list name="debug">
- <item> debug </item>
- </list>
- <list name="assert">
- <item> assert </item>
- </list>
- <list name="version">
- <item> version </item>
- </list>
- <list name="vtypes">
- <item> DigitalMars </item>
- <item> X86 </item>
- <item> Win32 </item>
- <item> linux </item>
- <item> LittleEndian </item>
- <item> BigEndian </item>
- <item> D_InlineAsm </item>
- <item> none </item>
- </list>
- <list name="unittest">
- <item> unittest </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="normal">
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <keyword attribute="Module" context="ModuleName" String="modules"/>
- <keyword attribute="Type" context="#stay" String="types"/>
- <keyword attribute="Phobos Library" context="#stay" String="phobos"/>
- <keyword attribute="Linkage" context="Linkage" String="linkage"/>
- <keyword attribute="Debug" context="#stay" String="debug"/>
- <keyword attribute="Assert" context="#stay" String="assert"/>
- <keyword attribute="Version" context="Version" String="version"/>
- <keyword attribute="Unit Test" context="#stay" String="unittest"/>
-
- <Detect2Chars attribute="Wysiwyg" context="Wysiwyg" char="r" char1="""/>
- <Detect2Chars attribute="Hex" context="Hex" char="x" char1="""/>
-
- <RegExpr attribute="Normal Text" context="#pop" String="[_a-z][\w]*" insensitive="TRUE"/>
-
- <RegExpr attribute="Pragmas" context="#pop" String="\#[ ]*line"/>
-
- <RegExpr attribute="Escape String" context="#pop" String="\\[n|t|"]"/>
- <RegExpr attribute="Escape String" context="#pop" String="(\\r\\n)"/>
- <RegExpr attribute="Escape String" context="#pop" String="\\0[0-7]+"/>
- <RegExpr attribute="Escape String" context="#pop" String="\\u[\d]+" insensitive="TRUE"/>
- <RegExpr attribute="Escape String" context="#pop" String="\\x[\da-fA-F]+"/>
-
- <RegExpr attribute="Binary" context="#pop" String="0b[01]+[_01]*[ ]*\.\.[ ]*0b[01]+[_01]*(UL|LU|U|L)?" insensitive="TRUE"/>
- <RegExpr attribute="Octal" context="#pop" String="0[0-7]+[_0-7]*[ ]*\.\.[ ]*0[0-7]+[_0-7]*(UL|LU|U|L)?" insensitive="TRUE"/>
- <RegExpr attribute="Hex" context="#pop" String="0x[\da-f]+[_\da-f]*[ ]*\.\.[ ]*0x[\da-f]+[_\da-f]*(UL|LU|U|L)?" insensitive="TRUE"/>
- <RegExpr attribute="Integer" context="#pop" String="[\d]+[_\d]*(UL|LU|U|L)?[ ]*\.\.[ ]*[\d]+[_\d]*(UL|LU|U|L)?" insensitive="TRUE"/>
-
- <RegExpr attribute="Float" context="#pop" String="[\d]*[_\d]*\.[_\d]*(e-|e|e\+)?[\d]+[_\d]*(F|L|I|FI|LI|)?" insensitive="TRUE"/>
- <RegExpr attribute="Float" context="#pop" String="[\d]*[_\d]*\.?[_\d]*(e-|e|e\+)[\d]+[_\d]*(F|L|I|FI|LI|)?" insensitive="TRUE"/>
- <RegExpr attribute="Float" context="#pop" String="0x[\da-f]+[_\da-f]*\.[_\da-f]*(p-|p|p\+)?[\da-f]+[_\da-f]*(F|L|I|FI|LI)?" insensitive="TRUE"/>
- <RegExpr attribute="Float" context="#pop" String="0x[\da-f]+[_\da-f]*\.?[_\da-f]*(p-|p|p\+)[\da-f]+[_\da-f]*(F|L|I|FI|LI)?" insensitive="TRUE"/>
-
- <RegExpr attribute="Binary" context="#pop" String="0B[01]+[_01]*(UL|LU|U|L)?" insensitive="TRUE"/>
- <RegExpr attribute="Octal" context="#pop" String="0[0-7]+[_0-7]*(UL|LU|U|L)?" insensitive="TRUE"/>
- <RegExpr attribute="Hex" context="#pop" String="0x[\da-f]+[_\da-f]*(UL|LU|U|L)?" insensitive="TRUE"/>
- <RegExpr attribute="Integer" context="#pop" String="[\d]+[_\d]*(UL|LU|U|L)?" insensitive="TRUE"/>
-
- <DetectChar attribute="Char" context="Char" char="'"/>
- <DetectChar attribute="String" context="String" char="""/>
- <DetectChar attribute="Wysiwyg" context="Wysiwyg" char="`"/>
-
- <Detect2Chars attribute="Comment" context="CommentLine" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="CommentBlockA" char="/" char1="*" beginRegion="CommentA"/>
- <Detect2Chars attribute="Comment" context="CommentBlockB" char="/" char1="+" beginRegion="CommentB"/>
-
- <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="BraceA" />
- <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="BraceA" />
- </context>
-
- <context attribute="Module Name" lineEndContext="#stay" name="ModuleName">
- <DetectChar attribute="Normal Text" context="#stay" char=","/>
- <DetectChar attribute="Normal Text" context="#pop" char=";"/>
- <Detect2Chars attribute="Comment" context="CommentLine" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="CommentBlockA" char="/" char1="*" beginRegion="CommentA"/>
- <Detect2Chars attribute="Comment" context="CommentBlockB" char="/" char1="+" beginRegion="CommentB"/>
- </context>
-
- <context attribute="Linkage" lineEndContext="#pop" name="Linkage">
- <keyword attribute="Type" context="#pop" String="types"/>
- <DetectChar attribute="Normal Text" context="#stay" char="("/>
- <keyword attribute="Linkage Type" context="#stay" String="ltypes"/>
- <DetectChar attribute="Normal Text" context="#pop" char=")"/>
- <DetectChar attribute="Normal Text" context="#pop" char=";"/>
- </context>
- <context attribute="Version" lineEndContext="#pop" name="Version">
- <DetectChar attribute="Normal Text" context="#pop" char="="/>
- <DetectChar attribute="Normal Text" context="#stay" char="("/>
- <keyword attribute="Version Type" context="#stay" String="vtypes"/>
- <RegExpr attribute="Normal Text" context="#pop" String="\w" insensitive="TRUE"/>
- <DetectChar attribute="Normal Text" context="#pop" char=")"/>
- </context>
-
- <context attribute="Wysiwyg" lineEndContext="#stay" name="Wysiwyg">
- <DetectChar attribute="Wysiwyg" context="#pop" char="""/>
- <DetectChar attribute="Wysiwyg" context="#pop" char="`"/>
- </context>
- <context attribute="Hex" lineEndContext="#stay" name="Hex">
- <DetectChar attribute="Hex" context="#pop" char="""/>
- </context>
- <context attribute="Char" lineEndContext="#stay" name="Char">
- <Detect2Chars attribute="Char" context="#stay" char="\" char1="'"/>
- <Detect2Chars attribute="Char" context="#stay" char="\" char1="\"/>
- <DetectChar attribute="Char" context="#pop" char="'"/>
- </context>
- <context attribute="String" lineEndContext="#stay" name="String">
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
-
- <context attribute="Comment" lineEndContext="#pop" name="CommentLine">
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="CommentBlockA">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="CommentA"/>
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="CommentBlockB">
- <Detect2Chars attribute="Comment" context="#pop" char="+" char1="/" endRegion="CommentB"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyWord" color="#000000" selColor="#ffffff" bold="1" italic="0"/>
- <itemData name="Module" defStyleNum="dsKeyWord" color="#0000ff" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Module Name" defStyleNum="dsKeyWord" color="#0000ff" selColor="#ffffff" bold="1" italic="1"/>
- <itemData name="Type" defStyleNum="dsDataType"/>
- <itemData name="Phobos Library" defStyleNum="dsKeyWord" color="#000000" selColor="#ffffff" bold="1" italic="1"/>
- <itemData name="Linkage" defStyleNum="dsKeyWord" color="#ff0000" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Linkage Type" defStyleNum="dsDataType" color="#ff0000" selColor="#ffffff" bold="1" italic="1"/>
- <itemData name="Debug" defStyleNum="dsKeyWord" color="#ff00ff" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Assert" defStyleNum="dsKeyWord" color="#0000ff" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Version" defStyleNum="dsKeyWord" color="#ff0000" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Version Type" defStyleNum="dsDataType" color="#ff0000" selColor="#ffffff" bold="1" italic="1"/>
- <itemData name="Unit Test" defStyleNum="dsKeyWord" color="#ff00ff" selColor="#ffffff" bold="1" italic="0"/>
- <itemData name="Pragmas" defStyleNum="dsKeyWord" color="#00aa00" selColor="#ffffff" bold="1" italic="0"/>
-
- <itemData name="Integer" defStyleNum="dsDecVal"/>
- <itemData name="Binary" defStyleNum="dsBaseN" color="#00dddd" selColor="#00ffff" bold="0" italic="0"/>
- <itemData name="Octal" defStyleNum="dsBaseN" color="#00aaaa" selColor="#00ffff" bold="0" italic="0"/>
- <itemData name="Hex" defStyleNum="dsBaseN" color="#006666" selColor="#00ffff" bold="0" italic="0"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
-
- <itemData name="Escape String" defStyleNum="dsString" color="#00aa00" selColor="#ff0000" bold="0" italic="0"/>
- <itemData name="String" defStyleNum="dsString" color="#00aa00" selColor="#ff0000" bold="0" italic="0"/>
- <itemData name="Char" defStyleNum="dsChar" color="#ff00ff" selColor="#ff00ff" bold="0" italic="0"/>
- <itemData name="Wysiwyg" defStyleNum="dsChar" color="#a100a1" selColor="#ff00ff" bold="0" italic="0"/>
-
- <itemData name="Comment" defStyleNum="dsComment"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="//"/>
- <comment name="multiLine" start="/+" end="+/"/>
- </comments>
- <keywords casesensitive="TRUE"/>
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name=".desktop" version="1.02" kateversion="2.1" section="Other" extensions="*.desktop;*.kdelnk" mimetype="application/x-desktop">
- <highlighting>
- <contexts>
- <context attribute="Key" lineEndContext="#stay" name="Normal">
- <RegExpr String="^\[.*\]$" attribute="Section" context="#stay" beginRegion="Section" endRegion="Section" />
- <RegExpr String="\[.*\]" attribute="Language" context="Value"/>
- <DetectChar char="=" attribute="Normal Text" context="Value"/>
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Value"/>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Section" defStyleNum="dsKeyword"/>
- <itemData name="Key" defStyleNum="dsDataType"/>
- <itemData name="Language" defStyleNum="dsNormal" color="#0000FF" selColor="#ffffff" italic="0" bold="1"/>
- </itemDatas>
- </highlighting>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Diff" version="1.01" kateversion="2.1" section="Other" extensions="*.diff;*patch" mimetype="text/x-diff">
- <highlighting>
-
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <RegExpr attribute="Keyword" context="Keyword" String="^(\+\+\+|\-\-\-|\*\*\*|diff|\d)" />
- <RegExpr attribute="Added line" context="Added" String="^(\+|>|!)" />
- <RegExpr attribute="Removed line" context="Removed" String="^(\-|<)" />
- <RegExpr attribute="Data Type" context="Data" String="^\@\@" />
- </context>
-
- <context attribute="Keyword" lineEndContext="#pop" name="Keyword"/>
- <context attribute="Removed line" lineEndContext="#pop" name="Removed"/>
- <context attribute="Added line" lineEndContext="#pop" name="Added"/>
- <context attribute="Data Type" lineEndContext="#pop" name="Data"/>
-
- </contexts>
-
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Removed line" defStyleNum="dsOthers"/>
- <itemData name="Added line" defStyleNum="dsString"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- </itemDatas>
- </highlighting>
- <general>
- <keywords casesensitive="1" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="E Language" version="0.1" kateversion="2.1" section="Sources" extensions="*.e" mimetype="text/x-e-src">
- <highlighting>
- <list name="Type">
- <item> FALSE </item>
- <item> MAX_INT </item>
- <item> MIN_INT </item>
- <item> NULL </item>
- <item> TRUE </item>
- <item> UNDEF </item>
- <item> bit </item>
- <item> bits </item>
- <item> body </item>
- <item> bool </item>
- <item> byte </item>
- <item> byte_array </item>
- <item> continue </item>
- <item> copy </item>
- <item> default </item>
- <item> external_pointer </item>
- <item> files </item>
- <item> file </item>
- <item> form </item>
- <item> global </item>
- <item> index </item>
- <item> init </item>
- <item> int </item>
- <item> it </item>
- <item> list </item>
- <item> load </item>
- <item> long </item>
- <item> me </item>
- <item> method </item>
- <item> module </item>
- <item> ntv </item>
- <item> of </item>
- <item> pat </item>
- <item> print </item>
- <item> result </item>
- <item> source_ref </item>
- <item> string </item>
- <item> symtab </item>
- <item> sys </item>
- <item> test </item>
- <item> uint </item>
- <item> untyped </item>
- <item> vec </item>
- </list>
- <list name="Function">
- <item> run </item>
- <item> init </item>
- <item> pre_generate </item>
- <item> dut_error </item>
- <item> pack </item>
- <item> unpack </item>
- <item> post_generate </item>
- <item> pre_generate </item>
- <item> set_config </item>
- <item> hex </item>
- <item> stop_run </item>
- <item> append </item>
- <item> size </item>
- <item> delete </item>
- <item> is_empty </item>
- <item> deep_compare </item>
- <item> deep_compare_physical </item>
- <item> clear </item>
- <item> pop0 </item>
- <item> setup </item>
- <item> crc_32 </item>
- </list>
- <list name="Statement">
- <item> chars </item>
- <item> define </item>
- <item> extend </item>
- <item> event </item>
- <item> ECHO </item>
- <item> DOECHO </item>
- <item> import </item>
- <item> initialize </item>
- <item> non_terminal </item>
- <item> struct </item>
- <item> unit </item>
- <item> script </item>
- <item> testgroup </item>
- <item> type </item>
- </list>
- <list name="Action">
- <item> C </item>
- <item> add </item>
- <item> also </item>
- <item> and </item>
- <item> as </item>
- <item> as_a </item>
- <item> break </item>
- <item> code </item>
- <item> compute </item>
- <item> computed </item>
- <item> delayed </item>
- <item> do </item>
- <item> else </item>
- <item> each </item>
- <item> emit </item>
- <item> empty </item>
- <item> end </item>
- <item> exit </item>
- <item> finish </item>
- <item> for </item>
- <item> from </item>
- <item> if </item>
- <item> in </item>
- <item> is </item>
- <item> like </item>
- <item> log </item>
- <item> new </item>
- <item> no </item>
- <item> not </item>
- <item> only </item>
- <item> or </item>
- <item> out </item>
- <item> read </item>
- <item> repeat </item>
- <item> return </item>
- <item> reverse </item>
- <item> routine </item>
- <item> step </item>
- <item> then </item>
- <item> to </item>
- <item> traceable </item>
- <item> untraceable </item>
- <item> var </item>
- <item> when </item>
- <item> while </item>
- <item> with </item>
- <item> write </item>
- <item> xor </item>
- </list>
- <list name="Generation">
- <item> before </item>
- <item> by </item>
- <item> choose </item>
- <item> gen </item>
- <item> keep </item>
- <item> keeping </item>
- <item> matches </item>
- <item> next </item>
- <item> select </item>
- <item> sequence </item>
- <item> soft </item>
- <item> using </item>
- </list>
- <list name="Cover">
- <item> address </item>
- <item> cover </item>
- <item> error </item>
- <item> events </item>
- <item> event </item>
- <item> length </item>
- <item> kind </item>
- <item> ranges </item>
- <item> range </item>
- <item> sample </item>
- <item> text </item>
- <item> value </item>
- <item> item </item>
- <item> transition </item>
- <item> illegal </item>
- </list>
- <list name="Simulator">
- <item> always </item>
- <item> all </item>
- <item> basic </item>
- <item> call </item>
- <item> cycles </item>
- <item> cycle </item>
- <item> clock </item>
- <item> change </item>
- <item> check </item>
- <item> expect </item>
- <item> fall </item>
- <item> first </item>
- <item> forever </item>
- <item> idle </item>
- <item> initial </item>
- <item> negedge </item>
- <item> others </item>
- <item> on </item>
- <item> posedge </item>
- <item> rise </item>
- <item> start </item>
- <item> that </item>
- <item> time </item>
- <item> task </item>
- <item> until </item>
- <item> verilog </item>
- <item> vhdl </item>
- <item> wait </item>
- <item> within </item>
- </list>
- <contexts>
-
- <context name="out_comment" attribute="OutSide E code" lineEndContext="#stay">
- <Detect2Chars attribute="code_begin" context="normal" char="<" char1="'" />
- </context>
-
- <context name="normal" attribute="Normal Text" lineEndContext="#stay">
- <DetectChar attribute="Operators" context="#stay" char="{" beginRegion="Region1"/>
- <DetectChar attribute="Operators" context="#stay" char="}" endRegion="Region1"/>
- <HlCHex attribute="Integer" context="#stay" />
- <HlCOct attribute="Integer" context="#stay" />
- <Int attribute="Integer" context="#stay" />
- <Detect2Chars attribute="code_end" context="out_comment" char="'" char1=">" />
- <Detect2Chars attribute="Comment" context="comment" char="-" char1="-" />
- <Detect2Chars attribute="Comment" context="comment" char="/" char1="/" />
- <DetectChar attribute="Vector" context="string" char=""" />
- <AnyChar attribute="Operators" context="#stay" String="'[&><=:+\-*\|].,;" />
- <keyword attribute="Data Type" context="#stay" String="Type"/>
- <keyword attribute="Function" context="#stay" String="Function"/>
- <keyword attribute="Statement" context="#stay" String="Statement"/>
- <keyword attribute="Action" context="#stay" String="Action"/>
- <keyword attribute="Keyword" context="#stay" String="Generation"/>
- <keyword attribute="Keyword" context="#stay" String="Cover"/>
- <keyword attribute="Keyword" context="#stay" String="Simulator"/>
-
- </context>
-
-
- <context name="comment" attribute="Comment" lineEndContext="#pop" />
-
- <context name="string" attribute="Vector" lineEndContext="#stay" >
- <DetectChar attribute="Vector" context="#pop" char=""" />
- </context>
-
- </contexts>
-
- <itemDatas>
- <itemData name="OutSide E code" defStyleNum="dsComment"/>
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="Keyword" defStyleNum="dsKeyword" />
- <itemData name="Function" defStyleNum="dsNormal" color="#0000FF" selColor="#00ff00" bold="1" italic="0" />
- <itemData name="Statement" defStyleNum="dsNormal" color="#8080FF" selColor="#00ff00" bold="1" italic="0" />
- <itemData name="Action" defStyleNum="dsNormal" color="#FF8080" selColor="#00ff00" bold="1" italic="0" />
- <itemData name="Data Type" defStyleNum="dsDataType" />
- <itemData name="Comment" defStyleNum="dsComment" />
- <itemData name="Integer" defStyleNum="dsDecVal" />
- <itemData name="Bit" defStyleNum="dsDecVal" />
- <itemData name="Vector" defStyleNum="dsString" />
- <itemData name="Operators" defStyleNum="dsNormal" color="#404000" selColor="#00ff00" bold="0" italic="0" />
- </itemDatas>
-
- </highlighting>
- <general>
- <keywords casesensitive="1" />
- </general>
-</language>
-
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Eiffel" version="1.02" kateversion="2.1" section="Sources" extensions="*.e" mimetype="text/x-eiffel-src">
- <highlighting>
- <list name="keywords">
- <item> indexing </item>
- <item> class </item>
- <item> inherit </item>
- <item> creation </item>
- <item> feature </item>
- <item> rename </item>
- <item> redefine </item>
- <item> undefine </item>
- <item> select </item>
- <item> export </item>
- <item> local </item>
- <item> deferred </item>
- <item> do </item>
- <item> is </item>
- <item> once </item>
- <item> alias </item>
- <item> external </item>
- <item> rescue </item>
- <item> debug </item>
- <item> if </item>
- <item> inspect </item>
- <item> from </item>
- <item> else </item>
- <item> elseif </item>
- <item> when </item>
- <item> until </item>
- <item> loop </item>
- <item> then </item>
- <item> obsolete </item>
- <item> end </item>
- </list>
- <list name="assertions">
- <item> check </item>
- <item> ensure </item>
- <item> require </item>
- <item> variant </item>
- <item> invariant </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <Float attribute="Float" context="#stay"/>
- <Int attribute="Decimal" context="#stay"/>
- <RegExpr attribute="Char" context="#stay" String="'.'"/>
- <DetectChar attribute="String" context="String" char="""/>
- <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
- <keyword attribute="Assertions" context="#stay" String="assertions"/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="String">
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
- <context attribute="Comment" name="Comment" lineEndContext="#pop"/>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="Keyword" defStyleNum="dsKeyword" />
- <itemData name="Decimal" defStyleNum="dsDecVal" />
- <itemData name="Float" defStyleNum="dsFloat" />
- <itemData name="Char" defStyleNum="dsChar" />
- <itemData name="String" defStyleNum="dsString" />
- <itemData name="Comment" defStyleNum="dsComment" />
- <itemData name="Assertions" defStyleNum="dsOthers" />
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="--" />
- </comments>
- <keywords casesensitive="1" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="ferite" version="1.02" kateversion="2.1" section="Scripts" extensions="*.fe;*.feh" mimetype="text/x-ferite-src">
- <highlighting>
- <list name="keywords">
- <item> break </item>
- <item> case </item>
- <item> continue </item>
- <item> else </item>
- <item> for </item>
- <item> if </item>
- <item> do </item>
- <item> function </item>
- <item> namespace </item>
- <item> while </item>
- <item> class </item>
- <item> new </item>
- <item> uses </item>
- <item> global </item>
- <item> return </item>
- <item> self </item>
- <item> super </item>
- <item> null </item>
- <item> iferr </item>
- <item> fix </item>
- </list>
- <list name="types">
- <item> number </item>
- <item> void </item>
- <item> string </item>
- <item> array </item>
- <item> object </item>
- <item> final </item>
- <item> static </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Default" >
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <keyword attribute="Data Type" context="#stay" String="types"/>
- <Float attribute="Float" context="#stay">
- <AnyChar String="fF" attribute="Float" context="#stay"/>
- </Float>
- <HlCOct attribute="Octal" context="#stay" />
- <HlCHex attribute="Hex" context="#stay" />
- <Int attribute="Decimal" context="#stay" >
- <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
- </Int>
- <HlCChar attribute="Char" context="#stay"/>
- <DetectChar attribute="String" context="String" char="""/>
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Multiline Comment" char="/" char1="*"/>
- <AnyChar attribute="Symbol" context="#stay" String="!%&()+,-<=>?[]^{|}~"/>
- <StringDetect attribute="Comment" context="Undeffed" String="#if 0" insensitive="FALSE"/>
- <RegExpr attribute="Preprocessor" context="Preprocessor" String="^#"/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="String">
- <LineContinue attribute="String" context="#stay"/>
- <HlCStringChar attribute="String Char" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="Comment">
- <RegExpr attribute="Decimal" context="#stay" String="(FIXME|TODO)" />
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
- <RegExpr attribute="Decimal" context="#stay" String="(FIXME|TODO)" />
- </context>
- <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
- <LineContinue attribute="Preprocessor" context="#stay"/>
- <RangeDetect attribute="Prep. Lib" context="#stay" char=""" char1="""/>
- <RangeDetect attribute="Prep. Lib" context="#stay" char="<" char1=">"/>
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Multiline Comment 2" char="/" char1="*"/>
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment 2">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="unknown" />
- <context attribute="Normal Text" lineEndContext="#pop" name ="unknown 2" />
- <context attribute="Comment" lineEndContext="#stay" name="Undeffed">
- <RegExpr attribute="Decimal" context="#stay" String="(FIXME|TODO)" />
- <RegExpr attribute="Comment" context="#pop" String="^#endif" />
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Octal" defStyleNum="dsBaseN"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Char" defStyleNum="dsChar"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="String Char" defStyleNum="dsChar"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Symbol" defStyleNum="dsNormal"/>
- <itemData name="Preprocessor" defStyleNum="dsOthers"/>
- <itemData name="Prep. Lib" defStyleNum="dsOthers"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="//" />
- <comment name="multiLine" start="/*" end="*/" />
- </comments>
- <keywords casesensitive="1" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Fortran" version="1.04" kateversion="2.1" section="Sources" extensions="*.f;*.F;*.for;*.FOR;*.f90;*.F90;*.fpp;*.FPP" mimetype="text/x-fortran-src">
- <highlighting>
- <list name="keywords">
- <item> common </item>
- <item> continue </item>
- <item> block </item>
- <item> data </item>
- <item> date </item>
- <item> function </item>
- <item> include </item>
- <item> parameter </item>
- <item> implicit </item>
- <item> none </item>
- <item> equivalence </item>
- <item> if </item>
- <item> then </item>
- <item> else </item>
- <item> elseif </item>
- <item> endif </item>
- <item> go </item>
- <item> to </item>
- <item> goto </item>
- <item> program </item>
- <item> subroutine </item>
- <item> end </item>
- <item> call </item>
- <item> while </item>
- <item> cycle </item>
- <item> do </item>
- <item> enddo </item>
- <item> for </item>
- <item> break </item>
- <item> pause </item>
- <item> return </item>
- <item> stop </item>
- </list>
- <list name="io_functions">
- <item> access </item>
- <item> backspace </item>
- <item> close </item>
- <item> inquire </item>
- <item> open </item>
- <item> print </item>
- <item> read </item>
- <item> rewind </item>
- <item> write </item>
- <item> format </item>
- </list>
- <list name="maths">
- <item> abs </item>
- <item> acos </item>
- <item> aimag </item>
- <item> aint </item>
- <item> alog </item>
- <item> alog10 </item>
- <item> amax0 </item>
- <item> amax1 </item>
- <item> amin0 </item>
- <item> amin1 </item>
- <item> amod </item>
- <item> anint </item>
- <item> aprime </item>
- <item> asin </item>
- <item> atan </item>
- <item> atan2 </item>
- <item> acos </item>
- <item> cabs </item>
- <item> cexp </item>
- <item> clog </item>
- <item> conjg </item>
- <item> cos </item>
- <item> cosh </item>
- <item> ccos </item>
- <item> csin </item>
- <item> csqrt </item>
- <item> dabs </item>
- <item> dacos </item>
- <item> dasin </item>
- <item> datan </item>
- <item> datan2 </item>
- <item> dconjg </item>
- <item> dcos </item>
- <item> dcosh </item>
- <item> dfloat </item>
- <item> ddmim </item>
- <item> dexp </item>
- <item> dim </item>
- <item> dint </item>
- <item> dlog </item>
- <item> dlog10 </item>
- <item> dmax1 </item>
- <item> dmin1 </item>
- <item> dmod </item>
- <item> dnint </item>
- <item> dsign </item>
- <item> dsin </item>
- <item> dsinh </item>
- <item> dsqrt </item>
- <item> dtan </item>
- <item> dtanh </item>
- <item> exp </item>
- <item> iabs </item>
- <item> idim </item>
- <item> index </item>
- <item> isign </item>
- <item> len </item>
- <item> log </item>
- <item> log10 </item>
- <item> max </item>
- <item> max0 </item>
- <item> max1 </item>
- <item> min </item>
- <item> min0 </item>
- <item> min1 </item>
- <item> mod </item>
- <item> rand </item>
- <item> sign </item>
- <item> sin </item>
- <item> sinh </item>
- <item> sqrt </item>
- <item> tan </item>
- <item> tanh </item>
- </list>
- <list name="types">
- <item> character </item>
- <item> complex </item>
- <item> double </item>
- <item> precision </item>
- <item> real </item>
- <item> real*8 </item>
- <item> integer </item>
- <item> logical </item>
- <item> dimension </item>
- <item> external </item>
- <item> intrinsic </item>
- <item> save </item>
-
- <item> char </item>
- <item> cmplx </item>
- <item> dble </item>
- <item> dcmplx </item>
- <item> float </item>
- <item> ichar </item>
- <item> idint </item>
- <item> ifix </item>
- <item> int </item>
- <item> sngl </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="default" >
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <keyword attribute="Data Type" context="#stay" String="types"/>
- <keyword attribute="IO Function" context="#stay" String="io_functions"/>
- <keyword attribute="Math Intrinsic" context="#stay" String="maths"/>
- <RegExpr attribute="Conditional" context="#stay" String="\.(and|AND|or|OR|eqv|EQV|neqv|NEQV|lt|LT|le|LE|eq|EQ|ne|NE|eqv|EQV|neqv|NEQV|ge|GE|gt|GT|not|NOT|true|TRUE|false|FALSE)\."/>
- <RegExpr attribute="Float" context="#stay" String="[0-9]*\.[0-9]*[dD][+|-]{0,1}[0-9]*"/>
- <Float attribute="Float" context="#stay">
- <AnyChar attribute="Float" context="#stay" String="fFdD"/>
- </Float>
- <Int attribute="Decimal" context="#stay" />
- <HlCChar attribute="Char" context="#stay"/>
- <DetectChar attribute="String" context="strings 1" char="""/>
- <DetectChar attribute="String" context="strings 2" char="'"/>
- <RegExpr attribute="Preprocessor" context="#stay" String="^(#|cDEC\$|CDEC\$).*$"/>
- <RegExpr attribute="Comment" context="#stay" String="^[cC\*].*$"/>
- <RegExpr attribute="Comment" context="#stay" String="!.*$"/>
- <AnyChar attribute="Symbol" context="#stay" String="!%&()+,-<=>?[]^{|}~"/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="strings 1">
- <HlCStringChar attribute="String Char" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
- <context attribute="String" lineEndContext="#pop" name="strings 2">
- <HlCStringChar attribute="String Char" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="'"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Octal" defStyleNum="dsBaseN"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Char" defStyleNum="dsChar"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="String Char" defStyleNum="dsChar"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Symbol" defStyleNum="dsNormal"/>
- <itemData name="Preprocessor" defStyleNum="dsOthers"/>
- <itemData name="Conditional" defStyleNum="dsOthers" color="#008000" selColor="#ffa0a0" bold="1" italic="0"/>
- <itemData name="IO Function" defStyleNum="dsKeyword" color="#006060" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Math Intrinsic" defStyleNum="dsKeyword" color="#600060" selColor="#ffa0ff" bold="1" italic="0"/>
- </itemDatas>
- </highlighting>
- <general>
- <keywords casesensitive="0"/>
- <comments>
- <comment name="singleLine" start="c"/>
- <comment name="singleLine" start="!"/>
- </comments>
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="GDL" version="1.0" kateversion="2.0" section="Sources" extensions="*.gdl;*.vcg;*.GDL;*.VCG" mimetype="">
- <highlighting>
- <list name="colors">
- <item> white </item>
- <item> blue </item>
- <item> red </item>
- <item> green </item>
- <item> yellow </item>
- <item> magenta </item>
- <item> cyan </item>
- <item> darkgrey </item>
- <item> darkgray </item>
- <item> darkblue </item>
- <item> darkred </item>
- <item> darkgreen </item>
- <item> darkyellow </item>
- <item> darkmagenta </item>
- <item> darkcyan </item>
- <item> gold </item>
- <item> lightgrey </item>
- <item> lightgray </item>
- <item> lightblue </item>
- <item> lightred </item>
- <item> lightgreen </item>
- <item> lightyellow </item>
- <item> lightmagenta </item>
- <item> lightcyan </item>
- <item> lilac </item>
- <item> turquoise </item>
- <item> aquamarine </item>
- <item> khaki </item>
- <item> purple </item>
- <item> yellowgreen </item>
- <item> pink </item>
- <item> orange </item>
- <item> orchid </item>
- <item> black </item>
- </list>
- <list name="shapes">
- <item> box </item>
- <item> triangle </item>
- <item> circle </item>
- <item> ellipse </item>
- <item> hexagon </item>
- <item> rhomb </item>
- <item> rhomboid </item>
- <item> trapeze </item>
- <item> uptrapeze </item>
- <item> trapezoid </item>
- <item> uptrapezoid </item>
- <item> lparallelogram </item>
- <item> rparallelogram </item>
- </list>
- <list name="states">
- <item> unfolded </item>
- <item> folded </item>
- <item> boxed </item>
- <item> clustered </item>
- <item> wrapped </item>
- <item> exclusive </item>
- <item> white </item>
- </list>
- <list name="algorithms">
- <item> normal </item>
- <item> tree </item>
- <item> forcedir </item>
- <item> dfs </item>
- <item> minbackward </item>
- <item> maxdepth </item>
- <item> maxdepthslow </item>
- <item> mindepth </item>
- <item> mindepthslow </item>
- <item> minindegree </item>
- <item> minoutdegree </item>
- <item> maxindegree </item>
- <item> maxoutdegree </item>
- <item> maxdegree </item>
- <item> mindegree </item>
- </list>
- <list name="forcedir">
- <item> attraction </item>
- <item> repulsion </item>
- <item> randomfactor </item>
- <item> randomimpulse </item>
- <item> randomrounds </item>
- <item> tempscheme </item>
- <item> temptreshold </item>
- <item> tempmin </item>
- <item> tempmax </item>
- </list>
- <list name="magnetic">
- <item> no </item>
- <item> polar </item>
- <item> circular </item>
- <item> polcircular </item>
- <item> orthogonal </item>
- </list>
- <list name="orientation">
- <item> toptobottom </item>
- <item> bottomtotop </item>
- <item> lefttoright </item>
- <item> righttoleft </item>
- <item> top_to_bottom </item>
- <item> bottom_to_top </item>
- <item> left_to_right </item>
- <item> right_to_left </item>
- </list>
- <list name="lines">
- <item> solid </item>
- <item> continuous </item>
- <item> dashed </item>
- <item> dotted </item>
- <item> double </item>
- <item> triple </item>
- <item> invisible </item>
- </list>
- <list name="fisheye">
- <item> pfish </item>
- <item> cfish </item>
- <item> fpfish </item>
- <item> fcfish </item>
- <item> dpfish </item>
- <item> dcfish </item>
- </list>
- <contexts>
- <context name="default" attribute="Normal" lineEndContext="#stay">
- <Detect2Chars attribute="Comment" context="ccomment" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="cppcomment" char="/" char1="*"/>
- <StringDetect attribute="Keyword" context="#stay" String="focus"/>
- <RegExpr attribute="Keyword" context="#stay" String="(graph|edge|node|region|backedge|(left|right|)(bent|)nearedge):"/>
- <RegExpr attribute="Value" context="#stay" String="loc *:"/>
- <StringDetect attribute="Value" context="centry" String="colorentry"/>
- <RegExpr attribute="Value" context="arrowmode" String="arrow_?mode *:"/>
- <RegExpr attribute="Value" context="colorid" String="(foldnode.|node.|)(text|border|)color *:"/>
- <RegExpr attribute="Value" context="colorid" String="(foldedge.|edge.|)(arrow|backarrow|)color *:"/>
- <RegExpr attribute="Value" context="arrow" String="(foldedge.|edge.|)(arrow|backarrow)style *:"/>
- <RegExpr attribute="Value" context="lineid" String="(foldedge.|edge.|)linestyle *:"/>
- <RegExpr attribute="Value" context="lineid" String="(foldnode.|node.|)borderstyle *:"/>
- <RegExpr attribute="Value" context="fishid" String="view *:"/>
- <RegExpr attribute="Value" context="shapeid" String="(foldnode.|node.|)shape"/>
- <RegExpr attribute="Value" context="lquote" String="(source|target)(name|)"/>
- <RegExpr attribute="Value" context="lquote" String="title *:"/>
- <RegExpr attribute="Value" context="lquote" String="(foldnode.|node.|foldedge.|edge.|)label *:"/>
- <RegExpr attribute="Value" context="fontlq" String="(foldnode.|node.|foldedge.|edge.|)fontname *:"/>
- <RegExpr attribute="Value" context="lquote" String="infoname(1|2|3) *:"/>
- <RegExpr attribute="Value" context="lquote" String="(foldnode.|node.|)info(1|2|3) *:"/>
- <RegExpr attribute="Value" context="intval" String="spreadlevel *:"/>
- <RegExpr attribute="Value" context="nodelevel" String="(foldnode.|node.|)(level|vertical_?order) *:"/>
- <RegExpr attribute="Value" context="intval" String="(foldnode.|node.|foldedge.|edge.|)horizontal_?order *:"/>
- <RegExpr attribute="Value" context="stateid" String="stat(e|us) *:"/>
- <RegExpr attribute="Value" context="algid" String="layout_?algorithm *:"/>
- <RegExpr attribute="Value" context="boolean" String="crossing_?optimization *:"/>
- <RegExpr attribute="Value" context="boolean" String="crossing_?phase2 *:"/>
- <RegExpr attribute="Value" context="boolean" String="(dirty_edge_|display_edge_|displayedge|late_edge_|subgraph_?)labels *:"/>
- <RegExpr attribute="Value" context="boolean" String="s?manhatt(a|e)n_?edges *:"/>
- <RegExpr attribute="Value" context="boolean" String="(nodes|near_?edges|edges|splines) *:"/>
- <RegExpr attribute="Value" context="classname" String="classname"/>
- <RegExpr attribute="Value" context="orient" String="orientation *:"/>
- <RegExpr attribute="Value" context="nodealign" String="node_alignment *:"/>
- <RegExpr attribute="Value" context="textmode" String="(foldnode.|node.|)textmode *:"/>
- <RegExpr attribute="Value" context="boolean" String="equal_y_dist *:"/>
- <RegExpr attribute="Value" context="boolean" String="equal_?ydist *:"/>
- <RegExpr attribute="Value" context="weight" String="crossing_?weight *:"/>
- <RegExpr attribute="Value" context="boolean" String="(fast_?|)icons *:"/>
- <RegExpr attribute="Value" context="boolean" String="fine_?tuning *:"/>
- <RegExpr attribute="Value" context="boolean" String="(f?straight_?|priority_)phase *:"/>
- <RegExpr attribute="Value" context="boolean" String="ignore_?singles *:"/>
- <RegExpr attribute="Value" context="boolean" String="(in|out|)port_?sharing *:"/>
- <RegExpr attribute="Value" context="boolean" String="linear_?segments *:"/>
- <RegExpr attribute="Value" context="intval" String="(foldnode.|node.|)(height|width|borderwidth|stretch|shrink) *:"/>
- <RegExpr attribute="Value" context="intval" String="(foldedge.|edge.|)(arrowsize|backarrowsize|thickness|class|priority) *:"/>
- <RegExpr attribute="Value" context="intval" String="anchor *:"/>
- <RegExpr attribute="Value" context="intval" String="iconcolors *:"/>
- <RegExpr attribute="Value" context="intval" String="hidden *:"/>
- <RegExpr attribute="Value" context="boolean" String="energetic *:"/>
- <RegExpr attribute="Value" context="intval" String="layout_(up|down|near|spline)factor *:"/>
- <RegExpr attribute="Value" context="intval" String="border +(x|y) *:"/>
- <RegExpr attribute="Value" context="intval" String="splinefactor *:"/>
- <RegExpr attribute="Value" context="floatval" String="(gravity|tempfactor|treefactor) *:"/>
- <RegExpr attribute="Value" context="intval" String="(xspace|xbase|xmax|xraster|x) *:"/>
- <RegExpr attribute="Value" context="intval" String="(yspace|ybase|ymax|yraster|y) *:"/>
- <RegExpr attribute="Value" context="intval" String="(xlraster|xlspace) *:"/>
- <RegExpr attribute="Value" context="intval" String="magnetic_force(1|2) *:"/>
- <RegExpr attribute="Value" context="magnor" String="magnetic_field(1|2) *:"/>
- <RegExpr attribute="Value" context="intval" String="(a|b|c|fd|p|r|s)(max) *:"/>
- <RegExpr attribute="Value" context="intval" String="(c|p|r)(min) *:"/>
- <keyword attribute="Value" context="intval" String="forcedir"/>
- <RegExpr attribute="Value" context="scaling" String="scaling *:"/>
- <RegExpr attribute="Value" context="lquote" String="useraction(name|cmd)(1|2|3|4) *:"/>
- </context>
- <context name="string" attribute="String" lineEndContext="#stay">
- <DetectChar attribute="String" context="default" char="""/>
- <Detect2Chars attribute="Char" context="#stay" char="\" char1="""/>
- <RegExpr attribute="Char" context="#stay" String="\\(n|a|t|b)"/>
- <RegExpr attribute="Char" context="#stay" String="\\fi(0|1|2)[0-9][0-9]"/>
- <RegExpr attribute="Char" context="#stay" String="\\f(u|I|b|B|n|[0-9][0-9])"/>
- </context>
- <context name="scaling" attribute="Normal" lineEndContext="#stay">
- <StringDetect attribute="Datatype" context="default" String="maxspect"/>
- <Float attribute="Float" context="default"/>
- </context>
- <context name="ccomment" attribute="Comment" lineEndContext="default">
- </context>
- <context name="cppcomment" attribute="Comment" lineEndContext="#stay">
- <Detect2Chars attribute="Comment" context="default" char="*" char1="/"/>
- </context>
- <context name="colorid" attribute="Normal" lineEndContext="#stay">
- <keyword attribute="Datatype" context="default" String="colors"/>
- <RegExpr attribute="Datatype" context="default" String="[0-9][0-9]?"/>
- </context>
- <context name="shapeid" attribute="Normal" lineEndContext="#stay">
- <keyword attribute="Datatype" context="default" String="shapes"/>
- </context>
- <context name="lquote" attribute="Normal" lineEndContext="#stay">
- <DetectChar attribute="String" context="string" char="""/>
- </context>
- <context name="stateid" attribute="Normal" lineEndContext="#stay">
- <keyword attribute="Datatype" context="default" String="states"/>
- </context>
- <context name="algid" attribute="Normal" lineEndContext="#stay">
- <keyword attribute="Datatype" context="default" String="algorithms"/>
- </context>
- <context name="fishid" attribute="Normal" lineEndContext="#stay">
- <keyword attribute="Datatype" context="default" String="fisheye"/>
- </context>
- <context name="boolean" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Datatype" context="default" String="(yes|no)"/>
- </context>
- <context name="lineid" attribute="Normal" lineEndContext="#stay">
- <keyword attribute="Datatype" context="default" String="lines"/>
- </context>
- <context name="intval" attribute="Normal" lineEndContext="#stay">
- <Int attribute="Integer" context="longint"/>
- </context>
- <context name="longint" attribute="Normal" lineEndContext="default">
- <Int attribute="Integer" context="longint"/>
- <RegExpr attribute="Normal" context="default" String="\ "/>
- </context>
- <context name="centry" attribute="Normal" lineEndContext="default">
- <RegExpr attribute="Value" context="cecolon" String="[0-9][0-9]?"/>
- </context>
- <context name="rgb" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Integer" context="default" String="[0-9][0-9]?[0-9]? +[0-9][0-9]?[0-9]? +[0-9][0-9]?[0-9]?"/>
- </context>
- <context name="floatval" attribute="Normal" lineEndContext="#stay">
- <Float attribute="Float" context="default"/>
- </context>
- <context name="fontlq" attribute="Normal" lineEndContext="#stay">
- <DetectChar attribute="Datatype" context="fontbase" char="""/>
- </context>
- <context name="fontbase" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Datatype" context="fontsize" String="((tim|ncen)(R|B|I|BI)|(cour|helv)(R|B|O|BO)|symb)"/>
- </context>
- <context name="fontsize" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Datatype" context="#stay" String="(08|10|12|14|18|24)(.vcf|)"/>
- <DetectChar attribute="Datatype" context="default" char="""/>
- </context>
- <context name="arrow" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Datatype" context="default" String="(solid|line|none)"/>
- </context>
- <context name="arrowmode" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Datatype" context="default" String="(free|fixed)"/>
- </context>
- <context name="magnor" attribute="Normal" lineEndContext="#stay">
- <keyword attribute="Datatype" context="default" String="magnetic"/>
- <keyword attribute="Datatype" context="default" String="orientation"/>
- </context>
- <context name="orient" attribute="Normal" lineEndContext="#stay">
- <keyword attribute="Datatype" context="default" String="orientation"/>
- </context>
- <context name="nodealign" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Datatype" context="default" String="(top|center|bottom)"/>
- </context>
- <context name="nodelevel" attribute="Normal" lineEndContext="#stay">
- <StringDetect attribute="Datatype" context="default" String="maxlevel"/>
- <Int attribute="Integer" context="longint"/>
- </context>
- <context name="classname" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Value" context="#stay" String="[0-9]+"/>
- <DetectChar attribute="Value" context="lquote" char=":"/>
- </context>
- <context name="cecolon" attribute="Normal" lineEndContext="#stay">
- <DetectChar attribute="Value" context="rgb" char=":"/>
- </context>
- <context name="weight" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Datatype" context="default" String="(medianbary|barymedian|bary|median)"/>
- </context>
- <context name="textmode" attribute="Normal" lineEndContext="#stay">
- <RegExpr attribute="Datatype" context="default" String="(center|left_justify|right_justify)"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal" defStyleNum="dsNormal"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="Char" defStyleNum="dsChar"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Integer" defStyleNum="dsDecVal"/>
- <itemData name="Datatype" defStyleNum="dsDataType"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Value" defStyleNum="dsOthers"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="//" />
- <comment name="multiLine" start="/*" end="*/"/>
- </comments>
- <keywords casesensitive="1"/>
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<!--
-
-*************************************************************************
-* *
-* Syntax highlighting for the GNU Assembler *
-* Copyright (C) 2002, John Zaitseff *
-* *
-*************************************************************************
-
-Updated: Roland Pabel <roland@pabel.name>
-Date: 15th August, 2002
-Version: 1.01
-
-Author: John Zaitseff <J.Zaitseff@zap.org.au>
-Date: 15th April, 2002
-Version: 1.0
-
-This file contains the XML syntax highlighting description for the GNU
-Assembler, for KATE, the KDE Advanced Editor. Keywords have been taken
-directly from the GNU Assembler source code (read.c).
-
-Known problems: Floating point highlighting does not work correctly.
-
-This program, including associated files, is free software. You may
-distribute it and/or modify it under the terms of the GNU General Public
-License as published by the Free Software Foundation; either Version 2 of
-the license, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
--->
-
-<language name="GNU Assembler" version="1.04" kateversion="2.1" section="Sources"
- extensions="*.s;*.S" mimetype="text/x-asm"
- author="John Zaitseff (J.Zaitseff@zap.org.au), Roland Pabel (roland@pabel.name)" license="GPL">
- <highlighting>
- <list name="keywords">
- <item>.abort</item>
- <item>.align</item>
- <item>.appfile</item>
- <item>.appline</item>
- <item>.ascii</item>
- <item>.asciz</item>
- <item>.balign</item>
- <item>.balignl</item>
- <item>.balignw</item>
- <item>.byte</item>
- <item>.comm</item>
- <item>.common.s</item>
- <item>.common</item>
- <item>.data</item>
- <item>.dc.b</item>
- <item>.dc.d</item>
- <item>.dc.l</item>
- <item>.dc.s</item>
- <item>.dc.w</item>
- <item>.dc.x</item>
- <item>.dc</item>
- <item>.dcb.b</item>
- <item>.dcb.d</item>
- <item>.dcb.l</item>
- <item>.dcb.s</item>
- <item>.dcb.w</item>
- <item>.dcb.x</item>
- <item>.dcb</item>
- <item>.debug</item>
- <item>.def</item>
- <item>.desc</item>
- <item>.dim</item>
- <item>.double</item>
- <item>.ds.b</item>
- <item>.ds.d</item>
- <item>.ds.l</item>
- <item>.ds.p</item>
- <item>.ds.s</item>
- <item>.ds.w</item>
- <item>.ds.x</item>
- <item>.ds</item>
- <item>.dsect</item>
- <item>.eject</item>
- <item>.else</item>
- <item>.elsec</item>
- <item>.elseif</item>
- <item>.end</item>
- <item>.endc</item>
- <item>.endef</item>
- <item>.endfunc</item>
- <item>.endif</item>
- <item>.endm</item>
- <item>.endr</item>
- <item>.equ</item>
- <item>.equiv</item>
- <item>.err</item>
- <item>.exitm</item>
- <item>.extend</item>
- <item>.extern</item>
- <item>.fail</item>
- <item>.file</item>
- <item>.fill</item>
- <item>.float</item>
- <item>.format</item>
- <item>.func</item>
- <item>.global</item>
- <item>.globl</item>
- <item>.hidden</item>
- <item>.hword</item>
- <item>.ident</item>
- <item>.if</item>
- <item>.ifc</item>
- <item>.ifdef</item>
- <item>.ifeq</item>
- <item>.ifeqs</item>
- <item>.ifge</item>
- <item>.ifgt</item>
- <item>.ifle</item>
- <item>.iflt</item>
- <item>.ifnc</item>
- <item>.ifndef</item>
- <item>.ifne</item>
- <item>.ifnes</item>
- <item>.ifnotdef</item>
- <item>.include</item>
- <item>.int</item>
- <item>.internal</item>
- <item>.irep</item>
- <item>.irepc</item>
- <item>.irp</item>
- <item>.irpc</item>
- <item>.lcomm</item>
- <item>.lflags</item>
- <item>.line</item>
- <item>.linkonce</item>
- <item>.list</item>
- <item>.llen</item>
- <item>.ln</item>
- <item>.long</item>
- <item>.lsym</item>
- <item>.macro</item>
- <item>.mexit</item>
- <item>.name</item>
- <item>.noformat</item>
- <item>.nolist</item>
- <item>.nopage</item>
- <item>.octa</item>
- <item>.offset</item>
- <item>.org</item>
- <item>.p2align</item>
- <item>.p2alignl</item>
- <item>.p2alignw</item>
- <item>.page</item>
- <item>.plen</item>
- <item>.popsection</item>
- <item>.previous</item>
- <item>.print</item>
- <item>.protected</item>
- <item>.psize</item>
- <item>.purgem</item>
- <item>.pushsection</item>
- <item>.quad</item>
- <item>.rep</item>
- <item>.rept</item>
- <item>.rva</item>
- <item>.sbttl</item>
- <item>.scl</item>
- <item>.sect.s</item>
- <item>.sect</item>
- <item>.section.s</item>
- <item>.section</item>
- <item>.set</item>
- <item>.short</item>
- <item>.single</item>
- <item>.size</item>
- <item>.skip</item>
- <item>.sleb128</item>
- <item>.space</item>
- <item>.spc</item>
- <item>.stabd</item>
- <item>.stabn</item>
- <item>.stabs</item>
- <item>.string</item>
- <item>.struct</item>
- <item>.subsection</item>
- <item>.symver</item>
- <item>.tag</item>
- <item>.text</item>
- <item>.title</item>
- <item>.ttl</item>
- <item>.type</item>
- <item>.uleb128</item>
- <item>.use</item>
- <item>.val</item>
- <item>.version</item>
- <item>.vtable_entry</item>
- <item>.vtable_inherit</item>
- <item>.weak</item>
- <item>.word</item>
- <item>.xcom</item>
- <item>.xdef</item>
- <item>.xref</item>
- <item>.xstabs</item>
- <item>.zero</item>
- <!-- Directives specific to ARM -->
- <item>.arm</item>
- <item>.bss</item>
- <item>.code</item>
- <item>.even</item>
- <item>.force_thumb</item>
- <item>.ldouble</item>
- <item>.loc</item>
- <item>.ltorg</item>
- <item>.packed</item>
- <item>.pool</item>
- <item>.req</item>
- <item>.thumb</item>
- <item>.thumb_func</item>
- <item>.thumb_set</item>
- </list>
-
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <RegExpr attribute="Label" context="#stay" String="^\s*[A-Za-z0-9_.$]+:" />
- <keyword attribute="Keyword" context="#stay" String="keywords"/>
- <HlCOct attribute="Octal" context="#stay" />
- <HlCHex attribute="Hex" context="#stay" />
- <RegExpr attribute="Binary" context="#stay" String="0[bB][01]+" />
- <Int attribute="Decimal" context="#stay" />
- <RegExpr attribute="Float" context="#stay" String="0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+" />
- <RegExpr attribute="Normal Text" context="#stay" String="[A-Za-z_.$][A-Za-z0-9_.$]*" />
- <RegExpr attribute="Char" context="#stay" String="'(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)" />
- <DetectChar attribute="String" context="String" char=""" />
- <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="*" />
- <DetectChar attribute="Comment" context="Commentar 2" char="@" />
- <DetectChar attribute="Comment" context="Commentar 2" char=";" />
- <AnyChar attribute="Symbol" context="#stay" String="!#%&*()+,-<=>?/:[]^{|}~" />
- <RegExpr attribute="Preprocessor" context="Preprocessor" String="^#" />
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar 1">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="Commentar 2" />
- <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor" />
- <context attribute="String" lineEndContext="#pop" name="String">
- <LineContinue attribute="String" context="Some Context" />
- <HlCStringChar attribute="String Char" context="#stay" />
- <DetectChar attribute="String" context="#pop" char=""" />
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Some Context" />
- </contexts>
-
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="Label" defStyleNum="dsNormal" />
- <itemData name="Keyword" defStyleNum="dsKeyword" />
- <itemData name="Decimal" defStyleNum="dsDecVal" />
- <itemData name="Octal" defStyleNum="dsBaseN" />
- <itemData name="Hex" defStyleNum="dsBaseN" />
- <itemData name="Binary" defStyleNum="dsBaseN" />
- <itemData name="Float" defStyleNum="dsFloat" />
- <itemData name="Char" defStyleNum="dsChar" />
- <itemData name="String" defStyleNum="dsString" />
- <itemData name="String Char" defStyleNum="dsChar" />
- <itemData name="Symbol" defStyleNum="dsNormal" />
- <itemData name="Comment" defStyleNum="dsComment" />
- <itemData name="Preprocessor" defStyleNum="dsOthers" />
- </itemDatas>
- </highlighting>
-
- <general>
- <comments>
- <comment name="singleLine" start=";" />
- <comment name="singleLine" start="@" />
- <comment name="multiLine" start="/*" end="*/" />
- </comments>
- <keywords casesensitive="1" weakDeliminator="_.$" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<!-- Haskell syntax highlighting by Marcel Martin <mmar@freenet.de> -->
-<language name="Haskell" version="1.02" kateversion="2.1" section="Sources"
- extensions="*.hs"
- author="Marcel Martin (mmar@freenet.de)" license="">
- <highlighting>
- <list name="keywords">
- <item> case </item>
- <item> class </item>
- <item> data </item>
- <item> deriving </item>
- <item> do </item>
- <item> else </item>
- <item> if </item>
- <item> in </item>
- <item> infixl </item>
- <item> infixr </item>
- <item> instance </item>
- <item> let </item>
- <item> module </item>
- <item> of </item>
- <item> primitive </item>
- <item> then </item>
- <item> type </item>
- <item> where </item>
- </list>
- <list name="infix operators">
- <item> quot </item>
- <item> rem </item>
- <item> div </item>
- <item> mod </item>
- <item> elem </item>
- <item> notElem </item>
- <item> seq </item>
- </list>
- <list name="functions">
- <!--
- These operators are not handled yet.
- <item> !! </item>
- <item> % </item>
- <item> && </item>
- <item> $! </item>
- <item> $ </item>
- <item> * </item>
- <item> ** </item>
- <item> - </item>
- <item> . </item>
- <item> /= </item>
- <item> < </item>
- <item> <= </item>
- <item> =<< </item>
- <item> == </item>
- <item> > </item>
- <item> >= </item>
- <item> >> </item>
- <item> >>= </item>
- <item> ^ </item>
- <item> ^^ </item>
- <item> ++ </item>
- <item> || </item>
- //-->
-
- <item> FilePath </item>
- <item> IOError </item>
- <item> abs </item>
- <item> acos </item>
- <item> acosh </item>
- <item> all </item>
- <item> and </item>
- <item> any </item>
- <item> appendFile </item>
- <item> approxRational </item>
- <item> asTypeOf </item>
- <item> asin </item>
- <item> asinh </item>
- <item> atan </item>
- <item> atan2 </item>
- <item> atanh </item>
- <item> basicIORun </item>
- <item> break </item>
- <item> catch </item>
- <item> ceiling </item>
- <item> chr </item>
- <item> compare </item>
- <item> concat </item>
- <item> concatMap </item>
- <item> const </item>
- <item> cos </item>
- <item> cosh </item>
- <item> curry </item>
- <item> cycle </item>
- <item> decodeFloat </item>
- <item> denominator </item>
- <item> digitToInt </item>
- <item> div </item>
- <item> divMod </item>
- <item> drop </item>
- <item> dropWhile </item>
- <item> either </item>
- <item> elem </item>
- <item> encodeFloat </item>
- <item> enumFrom </item>
- <item> enumFromThen </item>
- <item> enumFromThenTo </item>
- <item> enumFromTo </item>
- <item> error </item>
- <item> even </item>
- <item> exp </item>
- <item> exponent </item>
- <item> fail </item>
- <item> filter </item>
- <item> flip </item>
- <item> floatDigits </item>
- <item> floatRadix </item>
- <item> floatRange </item>
- <item> floor </item>
- <item> fmap </item>
- <item> foldl </item>
- <item> foldl1 </item>
- <item> foldr </item>
- <item> foldr1 </item>
- <item> fromDouble </item>
- <item> fromEnum </item>
- <item> fromInt </item>
- <item> fromInteger </item>
- <item> fromIntegral </item>
- <item> fromRational </item>
- <item> fst </item>
- <item> gcd </item>
- <item> getChar </item>
- <item> getContents </item>
- <item> getLine </item>
- <item> head </item>
- <item> id </item>
- <item> inRange </item>
- <item> index </item>
- <item> init </item>
- <item> intToDigit </item>
- <item> interact </item>
- <item> ioError </item>
- <item> isAlpha </item>
- <item> isAlphaNum </item>
- <item> isAscii </item>
- <item> isControl </item>
- <item> isDenormalized </item>
- <item> isDigit </item>
- <item> isHexDigit </item>
- <item> isIEEE </item>
- <item> isInfinite </item>
- <item> isLower </item>
- <item> isNaN </item>
- <item> isNegativeZero </item>
- <item> isOctDigit </item>
- <item> isPrint </item>
- <item> isSpace </item>
- <item> isUpper </item>
- <item> iterate </item>
- <item> last </item>
- <item> lcm </item>
- <item> length </item>
- <item> lex </item>
- <item> lexDigits </item>
- <item> lexLitChar </item>
- <item> lines </item>
- <item> log </item>
- <item> logBase </item>
- <item> lookup </item>
- <item> map </item>
- <item> mapM </item>
- <item> mapM_ </item>
- <item> max </item>
- <item> maxBound </item>
- <item> maximum </item>
- <item> maybe </item>
- <item> min </item>
- <item> minBound </item>
- <item> minimum </item>
- <item> mod </item>
- <item> negate </item>
- <item> not </item>
- <item> notElem </item>
- <item> null </item>
- <item> numerator </item>
- <item> odd </item>
- <item> or </item>
- <item> ord </item>
- <item> otherwise </item>
- <item> pi </item>
- <item> pred </item>
- <item> primExitWith </item>
- <item> print </item>
- <item> product </item>
- <item> properFraction </item>
- <item> putChar </item>
- <item> putStr </item>
- <item> putStrLn </item>
- <item> quot </item>
- <item> quotRem </item>
- <item> range </item>
- <item> rangeSize </item>
- <item> read </item>
- <item> readDec </item>
- <item> readFile </item>
- <item> readFloat </item>
- <item> readHex </item>
- <item> readIO </item>
- <item> readInt </item>
- <item> readList </item>
- <item> readLitChar </item>
- <item> readLn </item>
- <item> readOct </item>
- <item> readParen </item>
- <item> readSigned </item>
- <item> reads </item>
- <item> readsPrec </item>
- <item> realToFrac </item>
- <item> recip </item>
- <item> rem </item>
- <item> repeat </item>
- <item> replicate </item>
- <item> return </item>
- <item> reverse </item>
- <item> round </item>
- <item> scaleFloat </item>
- <item> scanl </item>
- <item> scanl1 </item>
- <item> scanr </item>
- <item> scanr1 </item>
- <item> seq </item>
- <item> sequence </item>
- <item> sequence_ </item>
- <item> show </item>
- <item> showChar </item>
- <item> showInt </item>
- <item> showList </item>
- <item> showLitChar </item>
- <item> showParen </item>
- <item> showSigned </item>
- <item> showString </item>
- <item> shows </item>
- <item> showsPrec </item>
- <item> significand </item>
- <item> signum </item>
- <item> sin </item>
- <item> sinh </item>
- <item> snd </item>
- <item> span </item>
- <item> splitAt </item>
- <item> sqrt </item>
- <item> subtract </item>
- <item> succ </item>
- <item> sum </item>
- <item> tail </item>
- <item> take </item>
- <item> takeWhile </item>
- <item> tan </item>
- <item> tanh </item>
- <item> threadToIOResult </item>
- <item> toEnum </item>
- <item> toInt </item>
- <item> toInteger </item>
- <item> toLower </item>
- <item> toRational </item>
- <item> toUpper </item>
- <item> truncate </item>
- <item> uncurry </item>
- <item> undefined </item>
- <item> unlines </item>
- <item> until </item>
- <item> unwords </item>
- <item> unzip </item>
- <item> unzip3 </item>
- <item> userError </item>
- <item> words </item>
- <item> writeFile </item>
- <item> zip </item>
- <item> zip3 </item>
- <item> zipWith </item>
- <item> zipWith3 </item>
- </list>
- <list name="type constructors">
- <item> Bool </item>
- <item> Char </item>
- <item> Double </item>
- <item> Either </item>
- <item> Float </item>
- <item> IO </item>
- <item> Integer </item>
- <item> Int </item>
- <item> Maybe </item>
- <item> Ordering </item>
- <item> Rational </item>
- <item> Ratio </item>
- <item> ReadS </item>
- <item> ShowS </item>
- <item> String </item>
-
- </list>
- <list name="classes">
- <item> Bounded </item>
- <item> Enum </item>
- <item> Eq </item>
- <item> Floating </item>
- <item> Fractional </item>
- <item> Functor </item>
- <item> Integral </item>
- <item> Ix </item>
- <item> Monad </item>
- <item> Num </item>
- <item> Ord </item>
- <item> Read </item>
- <item> RealFloat </item>
- <item> RealFrac </item>
- <item> Real </item>
- <item> Show </item>
- </list>
- <list name="data constructors">
- <item> EQ </item>
- <item> False </item>
- <item> GT </item>
- <item> Just </item>
- <item> LT </item>
- <item> Left </item>
- <item> Nothing </item>
- <item> Right </item>
- <item> True </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="normal">
- <Detect2Chars attribute="Comment" context="comment_multi_line" char="{" char1="-" />
- <Detect2Chars attribute="Comment" context="comment_single_line" char="-" char1="-" />
- <keyword attribute="Keyword" context="#stay" String="keywords" />
- <keyword attribute="Class" context="#stay" String="classes" />
- <keyword attribute="Type Constructor" context="#stay" String="type constructors" />
- <keyword attribute="Function" context="#stay" String="functions" />
- <keyword attribute="Data Constructor" context="#stay" String="data constructors" />
- <DetectChar attribute="String" context="string" char=""" />
- <DetectChar attribute="Infix Operator" context="infix" char="`"/>
- <RegExpr attribute="Normal Text" context="#stay" String="[A-Za-z0-9_][']+" />
- <DetectChar attribute="Char" context="single_char" char="'" />
- <RegExpr attribute="Function Definition" context="#stay" String="[a-z_]+[A-Za-z_0-9]*'*\s*::" />
- <Float attribute="Float" context="#stay" />
- <Int attribute="Decimal" context="#stay" />
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="comment_single_line" />
- <context attribute="Comment" lineEndContext="#stay" name="comment_multi_line">
- <Detect2Chars attribute="Comment" context="#pop" char="-" char1="}" />
- </context>
- <context attribute="String" lineEndContext="#stay" name="string">
- <RegExpr attribute="String" context="#stay" String="\\." />
- <DetectChar attribute="String" context="#pop" char=""" />
- </context>
- <context attribute="Infix Operator" lineEndContext="#stay" name="infix">
- <DetectChar attribute="Infix Operator" context="#pop" char="`"/>
- </context>
- <context attribute="Char" lineEndContext="#pop" name="single_char">
- <RegExpr attribute="Char" context="#stay" String="\\." />
- <DetectChar attribute="Char" context="#pop" char="'" />
- </context>
- <context attribute="Function Definition" lineEndContext="#pop" name="function_definition">
- <DetectChar attribute="Function Definition" context="#pop" char=";" />
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Function" defStyleNum="dsOthers"/>
- <itemData name="Function Definition" defStyleNum="dsOthers"/>
- <itemData name="Class" defStyleNum="dsKeyword"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Char" defStyleNum="dsChar"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="Constructor" defStyleNum="dsOthers"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Data Constructor" defStyleNum="dsKeyword"/>
- <itemData name="Type Constructor" defStyleNum="dsDataType"/>
- <itemData name="Infix Operator" defStyleNum="dsOthers"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="--" />
- <comment name="multiLine" start="{-" end="-}" />
- </comments>
- <keywords casesensitive="1" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="HTML" version="1.05" kateversion="2.1" section="Markup" extensions="*.html;*.htm;*.shtml;*.shtm" mimetype="text/html">
- <highlighting>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="normal">
- <StringDetect attribute="Comment" context="comment" String="<!--"/>
- <StringDetect attribute="Keyword" context="javascript_hook" String="<SCRIPT" insensitive="TRUE" beginRegion="Script" />
- <StringDetect attribute="Keyword" context="CSS_hook" String="<style" insensitive="TRUE" beginRegion="Style" />
-
- <RegExpr attribute="Keyword" context="tagname" String="<\s*\/?\s*[a-zA-Z0-9_]*" />
- </context>
-
- <context attribute="Identifier" lineEndContext="#stay" name="tagname">
- <DetectChar attribute="Keyword" context="#pop" char=">"/>
- <RegExpr attribute="Normal Text" context="values" String="\s*=\s*"/>
- </context>
-
- <context attribute="Wrong Values" lineEndContext="#stay" name="values">
- <RegExpr attribute="Types" context="#pop" String="\s*#?[a-zA-Z0-9]*" />
- <DetectChar attribute="Types" context="string" char=""" />
- </context>
-
- <context attribute="Types" lineEndContext="#stay" name="string">
- <DetectChar attribute="Types" context="#pop#pop" char=""" />
- </context>
-
- <context attribute="Comment" lineEndContext="#stay" name="comment">
- <StringDetect attribute="Comment" context="#pop" String="-->"/>
- </context>
-
- <context attribute="Identifier" lineEndContext="#stay" name="javascript_hook">
- <DetectChar attribute="Keyword" context="javascript" char=">"/>
- <RegExpr attribute="Normal Text" context="values" String="\s*=\s*"/>
- </context>
- <context attribute="Normal Text" lineEndContext="#stay" name="javascript">
- <Detect2Chars attribute="Comment" char="/" char1="/" context="javascript_comment"/>
- <StringDetect attribute="Keyword" context="#pop#pop" String="</SCRIPT>" insensitive="TRUE" endRegion="Script"/>
- <IncludeRules context="##JavaScript"/>
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="javascript_comment">
- <StringDetect attribute="Keyword" context="#pop#pop#pop" String="</SCRIPT>" insensitive="TRUE" endRegion="Script" />
- <RegExpr attribute="Wrong Values" context="#stay" String="(FIXME|TODO)" />
- </context>
-
- <context attribute="Identifier" lineEndContext="#stay" name="CSS_hook">
- <DetectChar attribute="Keyword" context="CSS" char=">"/>
- <RegExpr attribute="Normal Text" context="values" String="\s*=\s*"/>
- </context>
- <context attribute="Normal Text" lineEndContext="#stay" name="CSS">
- <IncludeRules context="##CSS"/>
- <StringDetect attribute="Keyword" context="#pop#pop" String="</style>" insensitive="TRUE" endRegion="Style"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Identifier" defStyleNum="dsOthers"/>
- <itemData name="Types" defStyleNum="dsDataType"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Wrong Values" defStyleNum="dsNormal" color="#ff0000" selColor="#ffffff" italic="0" bold="1"/>
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="multiLine" start="<!--" end="//-->" />
- </comments>
- <keywords casesensitive="0" />
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Quake, Wolfenstein, Half-Life" version="1.02" kateversion="2.1" section="Games" extensions="*.cfg" mimetype="">
-
-<highlighting>
-<list name="Commands">
-<item> ForceCloseComman </item>
-<item> _config_com_baud </item>
-<item> _config_com_modem </item>
-<item> _vid_default_mode </item>
-<item> _vid_default_mode_win </item>
-<item> _vid_wait_override </item>
-<item> _windowed_mouse </item>
-<item> addip </item>
-<item> addressbook </item>
-<item> adjust_crosshair </item>
-<item> advancedupdate </item>
-<item> allow_download </item>
-<item> allow_download_maps </item>
-<item> allow_download_models </item>
-<item> allow_download_skins </item>
-<item> allow_download_sounds </item>
-<item> allskins </item>
-<item> appenddemo </item>
-<item> autosave </item>
-<item> ban </item>
-<item> banClient </item>
-<item> banUser </item>
-<item> banid </item>
-<item> baseskin </item>
-<item> begin </item>
-<item> bf </item>
-<item> bgetmod </item>
-<item> bindlist </item>
-<item> block_switch </item>
-<item> bottomcolor </item>
-<item> buyNow </item>
-<item> buyequip </item>
-<item> cache_endgather </item>
-<item> cache_flush </item>
-<item> cache_mapchange </item>
-<item> cache_print </item>
-<item> cache_profile </item>
-<item> cache_setindex </item>
-<item> cache_startgather </item>
-<item> cache_usedfile </item>
-<item> cancelselect </item>
-<item> cd </item>
-<item> centerview </item>
-<item> changeVectors </item>
-<item> changelevel </item>
-<item> changelevel2 </item>
-<item> changing </item>
-<item> chase_active </item>
-<item> cinematic </item>
-<item> cl_deadbodyfilter </item>
-<item> cl_gibfilter </item>
-<item> cl_hightrack </item>
-<item> cl_hudswap </item>
-<item> cl_messages </item>
-<item> cl_nodelta </item>
-<item> cl_nolerp </item>
-<item> cl_nopred </item>
-<item> cl_predict_players </item>
-<item> cl_rate </item>
-<item> cl_sbar </item>
-<item> cl_sbar_separator </item>
-<item> cl_shownet </item>
-<item> cl_sidespeed </item>
-<item> cl_solid_players </item>
-<item> cl_warncmd </item>
-<item> cl_writecfg </item>
-<item> clear </item>
-<item> clearplayers </item>
-<item> clientinfo </item>
-<item> clientkick </item>
-<item> cmd </item>
-<item> cmdline </item>
-<item> cmdlist </item>
-<item> color </item>
-<item> commands </item>
-<item> condebug </item>
-<item> condump </item>
-<item> configstrings </item>
-<item> confirm_quit </item>
-<item> connect </item>
-<item> contimes </item>
-<item> coop </item>
-<item> crash </item>
-<item> credits </item>
-<item> cropimages </item>
-<item> crosshair </item>
-<item> cvar_restart </item>
-<item> cvarlist </item>
-<item> d_mipcap </item>
-<item> d_subdiv16 </item>
-<item> deathmatch </item>
-<item> delta_clear </item>
-<item> delta_stats </item>
-<item> demo </item>
-<item> demolist </item>
-<item> demomap </item>
-<item> demos </item>
-<item> developer </item>
-<item> devmap </item>
-<item> dir </item>
-<item> disconnect </item>
-<item> dlfile </item>
-<item> dmoptions </item>
-<item> download </item>
-<item> drawradar </item>
-<item> drop </item>
-<item> dropclient </item>
-<item> dumpuser </item>
-<item> edict </item>
-<item> edictcount </item>
-<item> edicts </item>
-<item> endmovie </item>
-<item> entities </item>
-<item> envmap </item>
-<item> error </item>
-<item> escape </item>
-<item> exec </item>
-<item> exit </item>
-<item> fastsprites </item>
-<item> fdir </item>
-<item> filterban </item>
-<item> firstperson </item>
-<item> floodprot </item>
-<item> floodprotmsg </item>
-<item> flush </item>
-<item> fly </item>
-<item> force_centerview </item>
-<item> fov </item>
-<item> fraglogfile </item>
-<item> freelook </item>
-<item> freeze </item>
-<item> front </item>
-<item> fs_openedList </item>
-<item> fs_referencedList </item>
-<item> fullinfo </item>
-<item> fullserverinfo </item>
-<item> game </item>
-<item> gameCompleteStatus </item>
-<item> gamedir </item>
-<item> gamemap </item>
-<item> gameversion </item>
-<item> getcertificate </item>
-<item> gfxinfo </item>
-<item> gg </item>
-<item> gib </item>
-<item> gibload </item>
-<item> gibstats </item>
-<item> give </item>
-<item> gl_affinemodels </item>
-<item> gl_clear </item>
-<item> gl_colorlights </item>
-<item> gl_constretch </item>
-<item> gl_cull </item>
-<item> gl_dlight_lightmap </item>
-<item> gl_dlight_polyblend </item>
-<item> gl_dlight_smooth </item>
-<item> gl_fb_bmodels </item>
-<item> gl_fb_models </item>
-<item> gl_finish </item>
-<item> gl_fires </item>
-<item> gl_flashblend </item>
-<item> gl_keeptjunctions </item>
-<item> gl_lerp_anim </item>
-<item> gl_lightmode </item>
-<item> gl_max_size </item>
-<item> gl_multitexture </item>
-<item> gl_nobind </item>
-<item> gl_nocolors </item>
-<item> gl_picmip </item>
-<item> gl_playermip </item>
-<item> gl_polyblend </item>
-<item> gl_reportjunctions </item>
-<item> gl_sky_clip </item>
-<item> gl_skymultipass </item>
-<item> gl_smoothmodels </item>
-<item> gl_texsort </item>
-<item> gl_texturemode </item>
-<item> gl_triplebuffer </item>
-<item> gl_ztrick </item>
-<item> globalservers </item>
-<item> god </item>
-<item> gun </item>
-<item> gun_model </item>
-<item> gun_next </item>
-<item> gun_prev </item>
-<item> gunsmoke </item>
-<item> heartbeat </item>
-<item> help </item>
-<item> hideconsole </item>
-<item> hideradar </item>
-<item> host_speeds </item>
-<item> hostname </item>
-<item> hpkextract </item>
-<item> hpklist </item>
-<item> hpkremove </item>
-<item> hpkval </item>
-<item> hud_centerid </item>
-<item> imagelist </item>
-<item> impulse </item>
-<item> imt </item>
-<item> in_bind </item>
-<item> in_paste_buffer </item>
-<item> in_restart </item>
-<item> in_unbind </item>
-<item> info </item>
-<item> interp </item>
-<item> invdrop </item>
-<item> inven </item>
-<item> invnext </item>
-<item> invnextp </item>
-<item> invnextw </item>
-<item> invprev </item>
-<item> invprevp </item>
-<item> invprevw </item>
-<item> invuse </item>
-<item> joinserver </item>
-<item> joy </item>
-<item> joy_advancedupdate </item>
-<item> joy_enable </item>
-<item> joyadvanced </item>
-<item> joyadvancedupdat </item>
-<item> joyadvancedupdate </item>
-<item> joyname </item>
-<item> joystick </item>
-<item> keys </item>
-<item> kick </item>
-<item> kill </item>
-<item> killserver </item>
-<item> lefthand </item>
-<item> link </item>
-<item> list </item>
-<item> listdemo </item>
-<item> listen </item>
-<item> listid </item>
-<item> listip </item>
-<item> listmaps </item>
-<item> load </item>
-<item> loadas8bit </item>
-<item> loadgame </item>
-<item> loading </item>
-<item> loadsky </item>
-<item> loadtranslations </item>
-<item> loc </item>
-<item> localinfo </item>
-<item> localservers </item>
-<item> log </item>
-<item> logaddress </item>
-<item> logfile </item>
-<item> lookspring </item>
-<item> lookstrafe </item>
-<item> m_filter </item>
-<item> main </item>
-<item> map </item>
-<item> map_restart </item>
-<item> maplist </item>
-<item> maps </item>
-<item> maxplayers </item>
-<item> max_smokepuffs </item>
-<item> max_shells </item>
-<item> mcache </item>
-<item> meminfo </item>
-<item> menu </item>
-<item> menu_addressbook </item>
-<item> menu_credits </item>
-<item> menu_help </item>
-<item> menu_keys </item>
-<item> menu_load </item>
-<item> menu_loadgame </item>
-<item> menu_main </item>
-<item> menu_multiplayer </item>
-<item> menu_options </item>
-<item> menu_playerconfig </item>
-<item> menu_quit </item>
-<item> menu_save </item>
-<item> menu_savegame </item>
-<item> menu_setup </item>
-<item> menu_select </item>
-<item> menu_singleplayer </item>
-<item> menu_startserver </item>
-<item> menu_video </item>
-<item> menu_dmoptions </item>
-<item> menu_game </item>
-<item> menu_joinserver </item>
-<item> messagemode </item>
-<item> messagemode2 </item>
-<item> messagemode3 </item>
-<item> messagemode4 </item>
-<item> model </item>
-<item> modelist </item>
-<item> modellist </item>
-<item> msg </item>
-<item> multiplayer </item>
-<item> music </item>
-<item> name </item>
-<item> net_stats </item>
-<item> new </item>
-<item> next </item>
-<item> nextul </item>
-<item> nightvision </item>
-<item> no_pogo_stick </item>
-<item> noaim </item>
-<item> noclip </item>
-<item> noexit </item>
-<item> nomonsters </item>
-<item> noskins </item>
-<item> nosound </item>
-<item> notarget </item>
-<item> options </item>
-<item> packet </item>
-<item> password </item>
-<item> path </item>
-<item> pausable </item>
-<item> pause </item>
-<item> paused </item>
-<item> ping </item>
-<item> pingservers </item>
-<item> play </item>
-<item> playdemo </item>
-<item> playerconfig </item>
-<item> players </item>
-<item> playvol </item>
-<item> pushlatency </item>
-<item> pointfile </item>
-<item> ppdemostart </item>
-<item> pr_boundscheck </item>
-<item> precache </item>
-<item> prespawn </item>
-<item> prev </item>
-<item> profile </item>
-<item> profilequit </item>
-<item> prog </item>
-<item> quit </item>
-<item> r_drawentities </item>
-<item> r_drawflat </item>
-<item> r_draworder </item>
-<item> r_drawviewmodel </item>
-<item> r_dspeeds </item>
-<item> r_dynamic </item>
-<item> r_fullbright </item>
-<item> r_lightmap </item>
-<item> r_netgraph </item>
-<item> r_netgraph_box </item>
-<item> r_norefresh </item>
-<item> r_novis </item>
-<item> r_numedges </item>
-<item> r_numsurfs </item>
-<item> r_particles </item>
-<item> r_polymodelstats </item>
-<item> r_reportsurfout </item>
-<item> r_shadows </item>
-<item> r_speeds </item>
-<item> r_timegraph </item>
-<item> r_wateralpha </item>
-<item> r_waterripple </item>
-<item> r_waterwarp </item>
-<item> r_zgraph </item>
-<item> rcon </item>
-<item> rcon_password </item>
-<item> reconnect </item>
-<item> record </item>
-<item> registered </item>
-<item> reload </item>
-<item> removedemo </item>
-<item> removeid </item>
-<item> removeip </item>
-<item> rerecord </item>
-<item> reset </item>
-<item> resetrcon </item>
-<item> restart </item>
-<item> retry </item>
-<item> s_disable_a3d </item>
-<item> s_enable_a3d </item>
-<item> s_info </item>
-<item> s_list </item>
-<item> s_stop </item>
-<item> samelevel </item>
-<item> save </item>
-<item> savegame </item>
-<item> savetranslations </item>
-<item> score </item>
-<item> screenshot </item>
-<item> screenshotJPEG </item>
-<item> sectorlist </item>
-<item> sendents </item>
-<item> serverinfo </item>
-<item> serverprofile </item>
-<item> serverrecord </item>
-<item> serverstatus </item>
-<item> serverstop </item>
-<item> setRecommended </item>
-<item> setdemoinfo </item>
-<item> setenv </item>
-<item> setinfo </item>
-<item> setmaster </item>
-<item> setrom </item>
-<item> shaderlist </item>
-<item> show_fps </item>
-<item> show_time </item>
-<item> showdrop </item>
-<item> showinfo </item>
-<item> showip </item>
-<item> showpackets </item>
-<item> showpause </item>
-<item> showram </item>
-<item> showturtle </item>
-<item> shutdownserver </item>
-<item> singlePlayLink </item>
-<item> sizedown </item>
-<item> sizeup </item>
-<item> skill </item>
-<item> skin </item>
-<item> skinlist </item>
-<item> skins </item>
-<item> sky </item>
-<item> skyboxlist </item>
-<item> slist </item>
-<item> slot1 </item>
-<item> slot10 </item>
-<item> slot2 </item>
-<item> slot3 </item>
-<item> slot4 </item>
-<item> slot5 </item>
-<item> slot6 </item>
-<item> slot7 </item>
-<item> slot8 </item>
-<item> slot9 </item>
-<item> snap </item>
-<item> snapall </item>
-<item> snapshot </item>
-<item> snapto </item>
-<item> snd </item>
-<item> snd_noextraupdate </item>
-<item> snd_restart </item>
-<item> snd_show </item>
-<item> soundfade </item>
-<item> soundinfo </item>
-<item> soundlist </item>
-<item> spawn </item>
-<item> spdevmap </item>
-<item> speak </item>
-<item> special </item>
-<item> specmode </item>
-<item> spectator </item>
-<item> spectator_password </item>
-<item> spk </item>
-<item> spmap </item>
-<item> startLimboMode </item>
-<item> startSingleplayer </item>
-<item> startdemos </item>
-<item> startmovie </item>
-<item> startserver </item>
-<item> stat </item>
-<item> stats </item>
-<item> status </item>
-<item> stop </item>
-<item> stopLimboMode </item>
-<item> stopdemo </item>
-<item> stoprecord </item>
-<item> stopsound </item>
-<item> stopul </item>
-<item> streamingsound </item>
-<item> stuffcmd </item>
-<item> stuffcmds </item>
-<item> sv </item>
-<item> sv_allow_log </item>
-<item> sv_allow_pings </item>
-<item> sv_allow_status </item>
-<item> sv_gamedir </item>
-<item> sv_highchars </item>
-<item> sv_mapcheck </item>
-<item> sv_nostep </item>
-<item> sv_spectatormaxspeed </item>
-<item> sv_spetalk </item>
-<item> sv_maplist </item>
-<item> swapdemo </item>
-<item> sys_cpuid </item>
-<item> sys_dead_sleep </item>
-<item> sys_extrasleep </item>
-<item> sys_nostdout </item>
-<item> systeminfo </item>
-<item> taginfo </item>
-<item> team </item>
-<item> teamplay </item>
-<item> tell </item>
-<item> test </item>
-<item> test2 </item>
-<item> time </item>
-<item> thirdperson </item>
-<item> timedemo </item>
-<item> timeleft </item>
-<item> timerefresh </item>
-<item> toggle </item>
-<item> togglebrowser </item>
-<item> togglechat </item>
-<item> toggleconsole </item>
-<item> togglemenu </item>
-<item> topcolor </item>
-<item> touchFile </item>
-<item> trackplayer </item>
-<item> ui_restart </item>
-<item> unalias </item>
-<item> unbindall </item>
-<item> updatehunkusage </item>
-<item> updatescreen </item>
-<item> upload </item>
-<item> use </item>
-<item> user </item>
-<item> userinfo </item>
-<item> users </item>
-<item> v_centerspeed </item>
-<item> v_cshift </item>
-<item> v_idlescale </item>
-<item> version </item>
-<item> vid </item>
-<item> vid_center </item>
-<item> vid_config_x </item>
-<item> vid_describecurrentmode </item>
-<item> vid_describemode </item>
-<item> vid_describemodes </item>
-<item> vid_forcemode </item>
-<item> vid_fullscreen </item>
-<item> vid_fullscreen_mode </item>
-<item> vid_minimize </item>
-<item> vid_nopageflip </item>
-<item> vid_nummodes </item>
-<item> vid_restart </item>
-<item> vid_stretch_by_2 </item>
-<item> vid_testmode </item>
-<item> vid_windowed </item>
-<item> vid_windowed_mode </item>
-<item> vid_front </item>
-<item> video </item>
-<item> viewframe </item>
-<item> viewmodel </item>
-<item> viewnext </item>
-<item> viewpos </item>
-<item> viewprev </item>
-<item> vminfo </item>
-<item> vmprofile </item>
-<item> voice_showbanned </item>
-<item> votemap </item>
-<item> vstr </item>
-<item> wait </item>
-<item> watervis </item>
-<item> wave </item>
-<item> weapon </item>
-<item> weapon_knife </item>
-<item> weaplast </item>
-<item> weapnext </item>
-<item> weapprev </item>
-<item> windowsr_drawentities </item>
-<item> writecfg </item>
-<item> writeconfig </item>
-<item> writeid </item>
-<item> writeip </item>
-<item> z_stats </item>
-</list>
-
-
-<list name="Variables">
-<item> ah </item>
-<item> ActiveAction </item>
-<item> _cl_color </item>
-<item> _cl_name </item>
-<item> _config_com_baud </item>
-<item> _config_com_irq </item>
-<item> _config_com_modem </item>
-<item> _config_com_port </item>
-<item> _config_modem_clear </item>
-<item> _config_modem_dialtype </item>
-<item> _config_modem_hangup </item>
-<item> _config_modem_init </item>
-<item> _snd_mixahead </item>
-<item> _vid_default_mode </item>
-<item> _vid_default_mode_win </item>
-<item> _vid_wait_override </item>
-<item> _windowed_mouse </item>
-<item> address </item>
-<item> adr </item>
-<item> adr0 </item>
-<item> adr1 </item>
-<item> adr2 </item>
-<item> adr3 </item>
-<item> adr4 </item>
-<item> adr5 </item>
-<item> adr6 </item>
-<item> adr7 </item>
-<item> adr8 </item>
-<item> advanced </item>
-<item> advaxisr </item>
-<item> advaxisu </item>
-<item> advaxisv </item>
-<item> advaxisx </item>
-<item> advaxisy </item>
-<item> advaxisz </item>
-<item> airaccelerate </item>
-<item> allow </item>
-<item> allow_download_players </item>
-<item> ambient_fade </item>
-<item> ambient_level </item>
-<item> anglespeedkey </item>
-<item> arch </item>
-<item> array </item>
-<item> arrays </item>
-<item> att </item>
-<item> auto </item>
-<item> autoskins </item>
-<item> b </item>
-<item> bgmbuffer </item>
-<item> bgmvolume </item>
-<item> bit </item>
-<item> bitdepth </item>
-<item> blend </item>
-<item> bob </item>
-<item> bob_pitch </item>
-<item> bob_roll </item>
-<item> bob_up </item>
-<item> bot_aasoptimize </item>
-<item> bot_challenge </item>
-<item> bot_debug </item>
-<item> bot_developer </item>
-<item> bot_enable </item>
-<item> bot_fastchat </item>
-<item> bot_forceclustering </item>
-<item> bot_forcereachability </item>
-<item> bot_forcewrite </item>
-<item> bot_grapple </item>
-<item> bot_groundonly </item>
-<item> bot_interbreedbots </item>
-<item> bot_interbreedchar </item>
-<item> bot_interbreedcycle </item>
-<item> bot_interbreedwrite </item>
-<item> bot_maxdebugpolys </item>
-<item> bot_miniplayers </item>
-<item> bot_minplayers </item>
-<item> bot_nochat </item>
-<item> bot_pause </item>
-<item> bot_reachability </item>
-<item> bot_reloadcharacters </item>
-<item> bot_report </item>
-<item> bot_rocketjump </item>
-<item> bot_saveroutingcache </item>
-<item> bot_testclusters </item>
-<item> bot_testichat </item>
-<item> bot_testrchat </item>
-<item> bot_testsolid </item>
-<item> bot_thinktime </item>
-<item> bot_visualizejumppads </item>
-<item> brighten </item>
-<item> brightness </item>
-<item> broken </item>
-<item> cd </item>
-<item> cd_loopcount </item>
-<item> cd_looptrack </item>
-<item> cd_nocd </item>
-<item> cd_plugin </item>
-<item> centermove </item>
-<item> centerspeed </item>
-<item> centertime </item>
-<item> cg_autoactivate </item>
-<item> cg_autoswitch </item>
-<item> cg_blinktime </item>
-<item> cg_bloodTime </item>
-<item> cg_bobpitch </item>
-<item> cg_bobroll </item>
-<item> cg_bobup </item>
-<item> cg_brassTime </item>
-<item> cg_cameraOrbitDelay </item>
-<item> cg_clipboardName </item>
-<item> cg_coronafardist </item>
-<item> cg_coronas </item>
-<item> cg_crosshairAlpha </item>
-<item> cg_crosshairHealth </item>
-<item> cg_crosshairSize </item>
-<item> cg_crosshairX </item>
-<item> cg_crosshairY </item>
-<item> cg_currentSelectedPlayer </item>
-<item> cg_currentSelectedPlayerName </item>
-<item> cg_cursorHints </item>
-<item> cg_cycleAllWeaps </item>
-<item> cg_deferPlayers </item>
-<item> cg_descriptiveText </item>
-<item> cg_draw2D </item>
-<item> cg_draw3dIcons </item>
-<item> cg_drawAllWeaps </item>
-<item> cg_drawAmmoWarning </item>
-<item> cg_drawAttacker </item>
-<item> cg_drawCompass </item>
-<item> cg_drawCrosshair </item>
-<item> cg_drawCrosshairNames </item>
-<item> cg_drawCrosshairPickups </item>
-<item> cg_drawFPGun </item>
-<item> cg_drawFPS </item>
-<item> cg_drawFrags </item>
-<item> cg_drawGun </item>
-<item> cg_drawIcons </item>
-<item> cg_drawNotifyText </item>
-<item> cg_drawRewards </item>
-<item> cg_drawSnapshot </item>
-<item> cg_drawSpreadScale </item>
-<item> cg_drawStatus </item>
-<item> cg_drawTeamOverlay </item>
-<item> cg_drawTimer </item>
-<item> cg_emptyswitch </item>
-<item> cg_fov </item>
-<item> cg_forcemodel </item>
-<item> cg_gibs </item>
-<item> cg_hudAlpha </item>
-<item> cg_hudFiles </item>
-<item> cg_lagometer </item>
-<item> cg_marks </item>
-<item> cg_marktime </item>
-<item> cg_noplayeranims </item>
-<item> cg_nopredict </item>
-<item> cg_noTaunt </item>
-<item> cg_noVoiceChats </item>
-<item> cg_noVoiceText </item>
-<item> cg_particleDist </item>
-<item> cg_particleLOD </item>
-<item> cg_popupLimboMenu </item>
-<item> cg_predictItems </item>
-<item> cg_quickMessageAlt </item>
-<item> cg_railTrailTime </item>
-<item> cg_recoilPitch </item>
-<item> cg_reticleBrightness </item>
-<item> cg_reticleType </item>
-<item> cg_runpitch </item>
-<item> cg_runroll </item>
-<item> cg_scorePlums </item>
-<item> cg_selectedPlayer </item>
-<item> cg_selectedPlayerName </item>
-<item> cg_shadows </item>
-<item> cg_showblood </item>
-<item> cg_simpleItems </item>
-<item> cg_skybox </item>
-<item> cg_stereoSeparation </item>
-<item> cg_teamChatHeight </item>
-<item> cg_teamChatTime </item>
-<item> cg_teamChatsOnly </item>
-<item> cg_thirdperson </item>
-<item> cg_thirdpersonrange </item>
-<item> cg_thirdPersonAngle </item>
-<item> cg_useWeapsForZoom </item>
-<item> cg_uselessNostalgia </item>
-<item> cg_viewsize </item>
-<item> cg_voiceSpriteTime </item>
-<item> cg_weaponCycleDelay </item>
-<item> cg_wolfparticles </item>
-<item> cg_zoomDefaultBinoc </item>
-<item> cg_zoomDefaultFG </item>
-<item> cg_zoomDefaultSniper </item>
-<item> cg_zoomDefaultSnooper </item>
-<item> cg_zoomStepBinoc </item>
-<item> cg_zoomStepFG </item>
-<item> cg_zoomStepSnooper </item>
-<item> cg_zoomfov </item>
-<item> cg_zoomstepsniper </item>
-<item> chase_active </item>
-<item> chase_back </item>
-<item> chase_right </item>
-<item> chase_up </item>
-<item> cheats </item>
-<item> cl </item>
-<item> cl_allowDownload </item>
-<item> cl_anglespeedkey </item>
-<item> cl_anonymous </item>
-<item> cl_autoexec </item>
-<item> cl_autoskins </item>
-<item> cl_avidemo </item>
-<item> cl_backspeed </item>
-<item> cl_blend </item>
-<item> cl_bob </item>
-<item> cl_bobcycle </item>
-<item> cl_bobup </item>
-<item> cl_bypassMouseInput </item>
-<item> cl_cacheGathering </item>
-<item> cl_camera_maxpitch </item>
-<item> cl_camera_maxyaw </item>
-<item> cl_chasecam </item>
-<item> cl_chatmode </item>
-<item> cl_conXOffset </item>
-<item> cl_crossx </item>
-<item> cl_crossy </item>
-<item> cl_cshift_bonus </item>
-<item> cl_cshift_content </item>
-<item> cl_cshift_damage </item>
-<item> cl_cshift_powerup </item>
-<item> cl_debugMove </item>
-<item> cl_debugTranslation </item>
-<item> cl_demospeed </item>
-<item> cl_entities </item>
-<item> cl_footsteps </item>
-<item> cl_forceavidemo </item>
-<item> cl_forwardspeed </item>
-<item> cl_freelook </item>
-<item> cl_freezeDemo </item>
-<item> cl_gun </item>
-<item> cl_hidefrags </item>
-<item> cl_hightrack </item>
-<item> cl_hudswap </item>
-<item> cl_language </item>
-<item> cl_lights </item>
-<item> cl_maxPing </item>
-<item> cl_maxfps </item>
-<item> cl_maxpackets </item>
-<item> cl_motd </item>
-<item> cl_motdString </item>
-<item> cl_mouseAccel </item>
-<item> cl_movespeedkey </item>
-<item> cl_nodelta </item>
-<item> cl_nofake </item>
-<item> cl_nolerp </item>
-<item> cl_nopred </item>
-<item> cl_noprint </item>
-<item> cl_noskins </item>
-<item> cl_packetdup </item>
-<item> cl_parsesay </item>
-<item> cl_particles </item>
-<item> cl_paused </item>
-<item> cl_pitchspeed </item>
-<item> cl_predict </item>
-<item> cl_predict_players </item>
-<item> cl_predict_players2 </item>
-<item> cl_observercrosshair </item>
-<item> cl_quakerc </item>
-<item> cl_rollangle </item>
-<item> cl_rollspeed </item>
-<item> cl_run </item>
-<item> cl_running </item>
-<item> cl_serverStatusResendTime </item>
-<item> cl_showfps </item>
-<item> cl_showSend </item>
-<item> cl_showServerCommands </item>
-<item> cl_showTimeDelta </item>
-<item> cl_showmiss </item>
-<item> cl_showmouserate </item>
-<item> cl_shownet </item>
-<item> cl_shownuments </item>
-<item> cl_sidespeed </item>
-<item> cl_stats </item>
-<item> cl_stereo </item>
-<item> cl_stereo_separation </item>
-<item> cl_testblend </item>
-<item> cl_testentities </item>
-<item> cl_testlights </item>
-<item> cl_testparticles </item>
-<item> cl_timeNudge </item>
-<item> cl_timeout </item>
-<item> cl_upspeed </item>
-<item> cl_verstring </item>
-<item> cl_visibleClients </item>
-<item> cl_vwep </item>
-<item> cl_waitForFire </item>
-<item> cl_wavefilerecord </item>
-<item> cl_yawspeed </item>
-<item> clear </item>
-<item> clearcolor </item>
-<item> clientport </item>
-<item> cm_playerCurveClip </item>
-<item> cmd_highchars </item>
-<item> cmd_warncmd </item>
-<item> cmdlist </item>
-<item> color </item>
-<item> color1 </item>
-<item> color2 </item>
-<item> com_blood </item>
-<item> com_buildScript </item>
-<item> com_cameraMode </item>
-<item> com_dropsim </item>
-<item> com_hunkMegs </item>
-<item> com_hunkused </item>
-<item> com_introplayed </item>
-<item> com_maxfps </item>
-<item> com_recommendedSet </item>
-<item> com_showtrace </item>
-<item> com_soundMegs </item>
-<item> com_speeds </item>
-<item> com_zoneMegs </item>
-<item> compiled </item>
-<item> con_debug </item>
-<item> con_notifytime </item>
-<item> con_restricted </item>
-<item> conspeed </item>
-<item> contrast </item>
-<item> coop </item>
-<item> crosshair </item>
-<item> crosshaircolor </item>
-<item> cull </item>
-<item> d_mipcap </item>
-<item> d_mipscale </item>
-<item> deathmatch </item>
-<item> debug_protocol </item>
-<item> debuggraph </item>
-<item> dedicated </item>
-<item> devdll </item>
-<item> developer </item>
-<item> dlabs </item>
-<item> dmflags </item>
-<item> dm </item>
-<item> down </item>
-<item> download </item>
-<item> drawall </item>
-<item> drawbuffer </item>
-<item> drawentities </item>
-<item> drawflat </item>
-<item> draworder </item>
-<item> drawworld </item>
-<item> driver </item>
-<item> dspeeds </item>
-<item> dynamic </item>
-<item> easter_eggs </item>
-<item> edgefriction </item>
-<item> empty </item>
-<item> enforcetime </item>
-<item> entities </item>
-<item> entlatency </item>
-<item> ext </item>
-<item> filter </item>
-<item> filterban </item>
-<item> finish </item>
-<item> fixedtime </item>
-<item> flashblend </item>
-<item> flood </item>
-<item> flood_msgs </item>
-<item> flood_persecond </item>
-<item> flood_waitdelay </item>
-<item> flushmap </item>
-<item> footsteps </item>
-<item> forward </item>
-<item> forwardsensitivity </item>
-<item> forwardspeed </item>
-<item> forwardthreshold </item>
-<item> fov </item>
-<item> fraglimit </item>
-<item> freelook </item>
-<item> fs_basegame </item>
-<item> fs_basepath </item>
-<item> fs_cdpath </item>
-<item> fs_copyfiles </item>
-<item> fs_debug </item>
-<item> fs_game </item>
-<item> fs_globalcfg </item>
-<item> fs_homepath </item>
-<item> fs_pluginpath </item>
-<item> fs_restrict </item>
-<item> fs_sharepath </item>
-<item> fs_skinbase </item>
-<item> fs_usercfg </item>
-<item> fs_userpath </item>
-<item> fullbright </item>
-<item> fullscreen </item>
-<item> g_allowvote </item>
-<item> g_altStopwatchMode </item>
-<item> g_arenasFile </item>
-<item> g_blueTeam </item>
-<item> g_botsFile </item>
-<item> g_complaintlimit </item>
-<item> g_currentRound </item>
-<item> g_friendlyFire </item>
-<item> g_gameskill </item>
-<item> g_gametype </item>
-<item> g_maxlives </item>
-<item> g_minGameClients </item>
-<item> g_missionStats </item>
-<item> g_nextTimeLimit </item>
-<item> g_noTeamSwitching </item>
-<item> g_redTeam </item>
-<item> g_select_empty </item>
-<item> g_spAwards </item>
-<item> g_spScores1 </item>
-<item> g_spScores2 </item>
-<item> g_spScores3 </item>
-<item> g_spScores4 </item>
-<item> g_spScores5 </item>
-<item> g_spSkill </item>
-<item> g_spVideos </item>
-<item> g_userAlliedRespawnTime </item>
-<item> g_userAxisRespawnTime </item>
-<item> g_userTimeLimit </item>
-<item> game </item>
-<item> gamecfg </item>
-<item> gamedate </item>
-<item> gamedir </item>
-<item> gamename </item>
-<item> gamestate </item>
-<item> gamma </item>
-<item> gender </item>
-<item> gender_auto </item>
-<item> gl_3dlabs_broken </item>
-<item> gl_allow_software </item>
-<item> gl_bitdepth </item>
-<item> gl_clear </item>
-<item> gl_conalpha </item>
-<item> gl_conspin </item>
-<item> gl_cshiftpercent </item>
-<item> gl_cull </item>
-<item> gl_drawbuffer </item>
-<item> gl_driver </item>
-<item> gl_dynamic </item>
-<item> gl_ext_compiled_vertex_array </item>
-<item> gl_ext_multitexture </item>
-<item> gl_ext_palettedtexture </item>
-<item> gl_ext_pointparameters </item>
-<item> gl_ext_swapinterval </item>
-<item> gl_finish </item>
-<item> gl_flashblend </item>
-<item> gl_keeptjunctions </item>
-<item> gl_lightmap </item>
-<item> gl_lightmap_align </item>
-<item> gl_lightmap_subimage </item>
-<item> gl_lockpvs </item>
-<item> gl_log </item>
-<item> gl_max_size </item>
-<item> gl_mesh_cache </item>
-<item> gl_mode </item>
-<item> gl_modulate </item>
-<item> gl_monolightmap </item>
-<item> gl_nobind </item>
-<item> gl_nocolors </item>
-<item> gl_nosubimage </item>
-<item> gl_occlusion </item>
-<item> gl_particle_att_a </item>
-<item> gl_particle_att_b </item>
-<item> gl_particle_att_c </item>
-<item> gl_particle_max_size </item>
-<item> gl_particle_min_size </item>
-<item> gl_particle_mip </item>
-<item> gl_particle_size </item>
-<item> gl_picmip </item>
-<item> gl_playermip </item>
-<item> gl_polyblend </item>
-<item> gl_reporttjunctions </item>
-<item> gl_round_down </item>
-<item> gl_saturatelighting </item>
-<item> gl_screenshot_byte_swap </item>
-<item> gl_shadows </item>
-<item> gl_showtris </item>
-<item> gl_sky_debug </item>
-<item> gl_sky_divide </item>
-<item> gl_skymip </item>
-<item> gl_smoothmodels </item>
-<item> gl_subdivide_size </item>
-<item> gl_swapinterval </item>
-<item> gl_texsort </item>
-<item> gl_texturealphamode </item>
-<item> gl_texturemode </item>
-<item> gl_texturesolidmode </item>
-<item> gl_triplebuffer </item>
-<item> gl_vertex_arrays </item>
-<item> gl_ztrick </item>
-<item> graphheight </item>
-<item> graphscale </item>
-<item> graphshift </item>
-<item> gravity </item>
-<item> gun </item>
-<item> gun_x </item>
-<item> gun_y </item>
-<item> gun_z </item>
-<item> hand </item>
-<item> handicap </item>
-<item> head </item>
-<item> headModel </item>
-<item> headmodel </item>
-<item> host </item>
-<item> host_framerate </item>
-<item> host_speeds </item>
-<item> hostname </item>
-<item> hostport </item>
-<item> hud_fastswitch </item>
-<item> in </item>
-<item> in_amp </item>
-<item> in_bind_imt </item>
-<item> in_debugjoystick </item>
-<item> in_dga </item>
-<item> in_dga_mouseaccel </item>
-<item> in_dgamouse </item>
-<item> in_grab </item>
-<item> in_joystick </item>
-<item> in_midi </item>
-<item> in_mouse </item>
-<item> in_mouse_amp </item>
-<item> in_mouse_filter </item>
-<item> in_mouse_pre_amp </item>
-<item> in_pre_amp </item>
-<item> initsound </item>
-<item> intensity </item>
-<item> ip </item>
-<item> ip_clientport </item>
-<item> ip_hostport </item>
-<item> ipx </item>
-<item> ipx_clientport </item>
-<item> ipx_hostport </item>
-<item> journal </item>
-<item> joy </item>
-<item> joy_advanced </item>
-<item> joy_advaxisr </item>
-<item> joy_advaxisu </item>
-<item> joy_advaxisv </item>
-<item> joy_advaxisx </item>
-<item> joy_advaxisy </item>
-<item> joy_advaxisz </item>
-<item> joy_amp </item>
-<item> joy_device </item>
-<item> joy_forwardsensitivity </item>
-<item> joy_forwardthreshold </item>
-<item> joy_name </item>
-<item> joy_pitchsensitivity </item>
-<item> joy_pitchthreshold </item>
-<item> joy_pre_amp </item>
-<item> joy_sensitivity </item>
-<item> joy_sidesensitivity </item>
-<item> joy_sidethreshold </item>
-<item> joy_threshold </item>
-<item> joy_upsensitivity </item>
-<item> joy_upthreshold </item>
-<item> joy_yawsensitivity </item>
-<item> joy_yawthreshold </item>
-<item> joyadvanced </item>
-<item> joyadvaxisr </item>
-<item> joyadvaxisu </item>
-<item> joyadvaxisv </item>
-<item> joyadvaxisx </item>
-<item> joyadvaxisy </item>
-<item> joyadvaxisz </item>
-<item> joyaxis1 </item>
-<item> joyaxis2 </item>
-<item> joyaxis3 </item>
-<item> joyaxis4 </item>
-<item> joyaxis5 </item>
-<item> joyaxis6 </item>
-<item> joyaxis7 </item>
-<item> joyaxis8 </item>
-<item> joyforwardsensitivity </item>
-<item> joyforwardthreshold </item>
-<item> joyname </item>
-<item> joypitchsensitivity </item>
-<item> joypitchthreshold </item>
-<item> joysidesensitivity </item>
-<item> joysidethreshold </item>
-<item> joystick </item>
-<item> joywwhack1 </item>
-<item> joywwhack2 </item>
-<item> joyyawsensitivity </item>
-<item> joyyawthreshold </item>
-<item> khz </item>
-<item> lcd_x </item>
-<item> lcd_yaw </item>
-<item> lerpmodels </item>
-<item> lightmap </item>
-<item> lights </item>
-<item> limit </item>
-<item> listen </item>
-<item> loadas </item>
-<item> loadas8bit </item>
-<item> localid </item>
-<item> lockpvs </item>
-<item> log </item>
-<item> log_stats </item>
-<item> logfile </item>
-<item> lookspring </item>
-<item> lookstrafe </item>
-<item> loopcount </item>
-<item> looptrack </item>
-<item> m_filter </item>
-<item> m_forward </item>
-<item> m_pitch </item>
-<item> m_side </item>
-<item> m_yaw </item>
-<item> mapname </item>
-<item> maps </item>
-<item> max </item>
-<item> maxclients </item>
-<item> maxedges </item>
-<item> maxentities </item>
-<item> maxfps </item>
-<item> maxplayers </item>
-<item> maxspectators </item>
-<item> maxsurfs </item>
-<item> maxvelocity </item>
-<item> min </item>
-<item> mipcap </item>
-<item> mipscale </item>
-<item> mixahead </item>
-<item> mode </item>
-<item> model </item>
-<item> models </item>
-<item> modex </item>
-<item> modulate </item>
-<item> monolightmap </item>
-<item> mouse </item>
-<item> mp_currentPlayerType </item>
-<item> mp_currentTeam </item>
-<item> mp_playerType </item>
-<item> mp_team </item>
-<item> mp_weapon </item>
-<item> mp_autokick </item>
-<item> mp_autoteambalance </item>
-<item> mp_c4timer </item>
-<item> mp_flashlight </item>
-<item> mp_footsteps </item>
-<item> mp_forcechasecam </item>
-<item> mp_freezetime </item>
-<item> mp_friendlyfire </item>
-<item> mp_hostagepenalty </item>
-<item> mp_limitteams </item>
-<item> mp_logmessages </item>
-<item> mp_mapvoteration </item>
-<item> mp_roundtime </item>
-<item> mp_timelimit </item>
-<item> mp_tkpunish </item>
-<item> msg </item>
-<item> msgs </item>
-<item> multitexture </item>
-<item> name </item>
-<item> net_graph </item>
-<item> net_ip </item>
-<item> net_messagetimeout </item>
-<item> net_noudp </item>
-<item> net_port </item>
-<item> net_qport </item>
-<item> net_restart </item>
-<item> netdosexpire </item>
-<item> netdosvalues </item>
-<item> netgraph </item>
-<item> nextdemo </item>
-<item> nextmap </item>
-<item> nextserver </item>
-<item> noalttab </item>
-<item> nobind </item>
-<item> nocd </item>
-<item> nocull </item>
-<item> nodelta </item>
-<item> noexit </item>
-<item> nomonsters </item>
-<item> norefresh </item>
-<item> noreload </item>
-<item> noskins </item>
-<item> nosound </item>
-<item> nosubimage </item>
-<item> novis </item>
-<item> palettedtexture </item>
-<item> particle </item>
-<item> particles </item>
-<item> password </item>
-<item> pausable </item>
-<item> persecond </item>
-<item> picmip </item>
-<item> pitch </item>
-<item> pitchsensitivity </item>
-<item> pitchspeed </item>
-<item> pitchthreshold </item>
-<item> playermip </item>
-<item> players </item>
-<item> pointparameters </item>
-<item> polyblend </item>
-<item> polymodelstats </item>
-<item> port </item>
-<item> pr_checkextensions </item>
-<item> pr_deadbeef_ents </item>
-<item> pr_deadbeef_locals </item>
-<item> pr_debug </item>
-<item> pr_source_path </item>
-<item> precache </item>
-<item> predict </item>
-<item> primary </item>
-<item> printspeed </item>
-<item> protocol </item>
-<item> public </item>
-<item> pushlatency </item>
-<item> qport </item>
-<item> r_aliastransadj </item>
-<item> r_aliastransbase </item>
-<item> r_allowExtensions </item>
-<item> r_allowSoftwareGL </item>
-<item> r_ambient </item>
-<item> r_ambientScale </item>
-<item> r_bonesDebug </item>
-<item> r_cache </item>
-<item> r_cacheModels </item>
-<item> r_cacheShaders </item>
-<item> r_clear </item>
-<item> r_clearcolor </item>
-<item> r_colorMipLevels </item>
-<item> r_colorbits </item>
-<item> r_compressModels </item>
-<item> r_customaspect </item>
-<item> r_customheight </item>
-<item> r_customwidth </item>
-<item> r_debugSort </item>
-<item> r_debugSurface </item>
-<item> r_debuglight </item>
-<item> r_depthbits </item>
-<item> r_detailtextures </item>
-<item> r_directedScale </item>
-<item> r_displayRefresh </item>
-<item> r_dlightBacks </item>
-<item> r_dlight_lightmap </item>
-<item> r_dlight_max </item>
-<item> r_drawBuffer </item>
-<item> r_drawSun </item>
-<item> r_drawentities </item>
-<item> r_drawexplosions </item>
-<item> r_drawflat </item>
-<item> r_draworder </item>
-<item> r_drawviewmodel </item>
-<item> r_drawworld </item>
-<item> r_dspeeds </item>
-<item> r_dynamic </item>
-<item> r_dynamiclight </item>
-<item> r_explosionclip </item>
-<item> r_exportCompressedModels </item>
-<item> r_ext_compiled_vertex_array </item>
-<item> r_ext_compress_textures </item>
-<item> r_ext_compressed_textures </item>
-<item> r_ext_gamma_control </item>
-<item> r_ext_multitexture </item>
-<item> r_ext_texture_env_add </item>
-<item> r_facePlaneCull </item>
-<item> r_fastsky </item>
-<item> r_finish </item>
-<item> r_firecolor </item>
-<item> r_flareFade </item>
-<item> r_flareSize </item>
-<item> r_flares </item>
-<item> r_fullbright </item>
-<item> r_fullscreen </item>
-<item> r_gamma </item>
-<item> r_glDriver </item>
-<item> r_glIgnoreWicked3D </item>
-<item> r_graphheight </item>
-<item> r_highQualit </item>
-<item> r_highQualityVideo </item>
-<item> r_ignore </item>
-<item> r_ignoreFastPath </item>
-<item> r_ignoreGLErrors </item>
-<item> r_ignorehwgamma </item>
-<item> r_inGameVideo </item>
-<item> r_intensity </item>
-<item> r_lastValidRenderer </item>
-<item> r_lerpmodels </item>
-<item> r_lightmap </item>
-<item> r_lightmap_components </item>
-<item> r_lockpvs </item>
-<item> r_lodCurveError </item>
-<item> r_lodbias </item>
-<item> r_lodscale </item>
-<item> r_logFile </item>
-<item> r_lowMemTextureSize </item>
-<item> r_lowMemTextureThreshold </item>
-<item> r_mapOverBrightBits </item>
-<item> r_maxedges </item>
-<item> r_maxpolys </item>
-<item> r_maxpolyverts </item>
-<item> r_maxsurfs </item>
-<item> r_measureOverdraw </item>
-<item> r_mirroralpha </item>
-<item> r_mode </item>
-<item> r_netgraph </item>
-<item> r_netgraph_alpha </item>
-<item> r_nobind </item>
-<item> r_nocull </item>
-<item> r_nocurves </item>
-<item> r_noportals </item>
-<item> r_norefresh </item>
-<item> r_novis </item>
-<item> r_numedges </item>
-<item> r_numsurfs </item>
-<item> r_offsetfactor </item>
-<item> r_offsetunits </item>
-<item> r_overBrightBits </item>
-<item> r_particles_max </item>
-<item> r_particles_style </item>
-<item> r_picmip </item>
-<item> r_picmip2 </item>
-<item> r_polymodelstats </item>
-<item> r_portalOnly </item>
-<item> r_preloadTextures </item>
-<item> r_previousglDriver </item>
-<item> r_primitives </item>
-<item> r_printShaders </item>
-<item> r_railCoreWidth </item>
-<item> r_railSegmentLength </item>
-<item> r_railWidth </item>
-<item> r_reportedgeout </item>
-<item> r_reportsurfout </item>
-<item> r_rmse </item>
-<item> r_roundImagesDown </item>
-<item> r_saveFontData </item>
-<item> r_shadows </item>
-<item> r_showImages </item>
-<item> r_showSmp </item>
-<item> r_showcluster </item>
-<item> r_shownormals </item>
-<item> r_showsky </item>
-<item> r_showtris </item>
-<item> r_simpleMipMaps </item>
-<item> r_singleShader </item>
-<item> r_skipBackEnd </item>
-<item> r_skyname </item>
-<item> r_smp </item>
-<item> r_speeds </item>
-<item> r_stencilbits </item>
-<item> r_stereo </item>
-<item> r_subdivisions </item>
-<item> r_swapInterval </item>
-<item> r_textureMode </item>
-<item> r_texturebits </item>
-<item> r_timegraph </item>
-<item> r_uiFullScreen </item>
-<item> r_verbose </item>
-<item> r_vertexLight </item>
-<item> r_wateralpha </item>
-<item> r_waterwarp </item>
-<item> r_wolffog </item>
-<item> r_zfar </item>
-<item> r_znear </item>
-<item> rate </item>
-<item> rcon </item>
-<item> rconAddress </item>
-<item> rconPassword </item>
-<item> rcon_address </item>
-<item> rcon_password </item>
-<item> reconnect </item>
-<item> ref </item>
-<item> registered </item>
-<item> reportedgeout </item>
-<item> reportsurfout </item>
-<item> roll </item>
-<item> rollangle </item>
-<item> rollspeed </item>
-<item> round </item>
-<item> run </item>
-<item> run_pitch </item>
-<item> run_roll </item>
-<item> s_compression </item>
-<item> s_defaultsound </item>
-<item> s_doppler </item>
-<item> s_initsound </item>
-<item> s_khz </item>
-<item> s_loadas8bit </item>
-<item> s_mixPreStep </item>
-<item> s_mixahead </item>
-<item> s_musicvolume </item>
-<item> s_mute </item>
-<item> s_nocompressed </item>
-<item> s_usingA3D </item>
-<item> s_primary </item>
-<item> s_separation </item>
-<item> s_show </item>
-<item> s_testsound </item>
-<item> s_volume </item>
-<item> s_wavonly </item>
-<item> samelevel </item>
-<item> saturatelighting </item>
-<item> saved1 </item>
-<item> saved2 </item>
-<item> saved3 </item>
-<item> saved4 </item>
-<item> savedgamecfg </item>
-<item> scr </item>
-<item> scr_centertime </item>
-<item> scr_consize </item>
-<item> scr_conspeed </item>
-<item> scr_drawall </item>
-<item> scr_ofsx </item>
-<item> scr_ofsy </item>
-<item> scr_ofsz </item>
-<item> scr_printspeed </item>
-<item> scr_showpause </item>
-<item> scr_showturtle </item>
-<item> scratch1 </item>
-<item> scratch2 </item>
-<item> scratch3 </item>
-<item> scratch4 </item>
-<item> screenshot </item>
-<item> select </item>
-<item> sensitivity </item>
-<item> separation </item>
-<item> server1 </item>
-<item> server10 </item>
-<item> server11 </item>
-<item> server12 </item>
-<item> server13 </item>
-<item> server14 </item>
-<item> server15 </item>
-<item> server16 </item>
-<item> server2 </item>
-<item> server3 </item>
-<item> server4 </item>
-<item> server5 </item>
-<item> server6 </item>
-<item> server7 </item>
-<item> server8 </item>
-<item> server9 </item>
-<item> serverprofile </item>
-<item> sex </item>
-<item> shadows </item>
-<item> show </item>
-<item> showclamp </item>
-<item> showdrop </item>
-<item> showmiss </item>
-<item> shownet </item>
-<item> showpackets </item>
-<item> showpause </item>
-<item> showram </item>
-<item> showtrace </item>
-<item> showtris </item>
-<item> showturtle </item>
-<item> side </item>
-<item> sidesensitivity </item>
-<item> sidespeed </item>
-<item> sidethreshold </item>
-<item> size </item>
-<item> skill </item>
-<item> skin </item>
-<item> skymip </item>
-<item> snaps </item>
-<item> snd_bits </item>
-<item> snd_device </item>
-<item> snd_interp </item>
-<item> snd_loadas8bit </item>
-<item> snd_mixahead </item>
-<item> snd_noextraupdate </item>
-<item> snd_oss_mmaped </item>
-<item> snd_output </item>
-<item> snd_phasesep </item>
-<item> snd_rate </item>
-<item> snd_render </item>
-<item> snd_show </item>
-<item> snd_stereo </item>
-<item> snd_volumesep </item>
-<item> sndbits </item>
-<item> sndchannels </item>
-<item> snddevice </item>
-<item> sndspeed </item>
-<item> software </item>
-<item> sounds </item>
-<item> spectator </item>
-<item> spectator_password </item>
-<item> speeds </item>
-<item> stats </item>
-<item> stereo </item>
-<item> stipplealpha </item>
-<item> surfcacheoverride </item>
-<item> sv </item>
-<item> sv_accelerate </item>
-<item> sv_aim </item>
-<item> sv_airaccelerate </item>
-<item> sv_allowAnonymous </item>
-<item> sv_allowDownload </item>
-<item> sv_cheats </item>
-<item> sv_enforcetime </item>
-<item> sv_floodProtect </item>
-<item> sv_fps </item>
-<item> sv_friction </item>
-<item> sv_gravity </item>
-<item> sv_hostname </item>
-<item> sv_idealpitchscale </item>
-<item> sv_keywords </item>
-<item> sv_killserver </item>
-<item> sv_mapChecksum </item>
-<item> sv_master1 </item>
-<item> sv_master2 </item>
-<item> sv_master3 </item>
-<item> sv_master4 </item>
-<item> sv_master5 </item>
-<item> sv_maxPing </item>
-<item> sv_maxRate </item>
-<item> sv_maxclients </item>
-<item> sv_maxrate </item>
-<item> sv_maxspeed </item>
-<item> sv_maxtic </item>
-<item> sv_maxvelocity </item>
-<item> sv_minPing </item>
-<item> sv_minqfversion </item>
-<item> sv_mintic </item>
-<item> sv_netdosprotect </item>
-<item> sv_noreload </item>
-<item> sv_nostep </item>
-<item> sv_onlyVisibleClients </item>
-<item> sv_padPackets </item>
-<item> sv_pakNames </item>
-<item> sv_paks </item>
-<item> sv_paused </item>
-<item> sv_phs </item>
-<item> sv_privateClients </item>
-<item> sv_privatePassword </item>
-<item> sv_progs </item>
-<item> sv_pure </item>
-<item> sv_reconnect_limit </item>
-<item> sv_reconnectlimit </item>
-<item> sv_referencedPakNames </item>
-<item> sv_referencedPaks </item>
-<item> sv_restartround </item>
-<item> sv_rollangle </item>
-<item> sv_rollspeed </item>
-<item> sv_running </item>
-<item> sv_serverid </item>
-<item> sv_showAverageBPS </item>
-<item> sv_showloss </item>
-<item> sv_spectalk </item>
-<item> sv_stopspeed </item>
-<item> sv_timefmt </item>
-<item> sv_timekick </item>
-<item> sv_timekick_fuzz </item>
-<item> sv_timekick_interval </item>
-<item> sv_timeout </item>
-<item> sv_timestamps </item>
-<item> sv_wateraccelerate </item>
-<item> sv_waterfriction </item>
-<item> sv_zombietime </item>
-<item> sw </item>
-<item> sw_allow_modex </item>
-<item> sw_clearcolor </item>
-<item> sw_drawflat </item>
-<item> sw_draworder </item>
-<item> sw_maxedges </item>
-<item> sw_maxsurfs </item>
-<item> sw_mipcap </item>
-<item> sw_mipscale </item>
-<item> sw_mode </item>
-<item> sw_polymodelstats </item>
-<item> sw_reportedgeout </item>
-<item> sw_reportsurfout </item>
-<item> sw_stipplealpha </item>
-<item> sw_surfcacheoverride </item>
-<item> sw_waterwarp </item>
-<item> swapinterval </item>
-<item> sys_cpustring </item>
-<item> sys_nostdout </item>
-<item> sys_sleep </item>
-<item> sys_ticrate </item>
-<item> team </item>
-<item> team_headmodel </item>
-<item> team_model </item>
-<item> teamplay </item>
-<item> teamtask </item>
-<item> temp1 </item>
-<item> testblend </item>
-<item> testentities </item>
-<item> testlights </item>
-<item> testparticles </item>
-<item> testsound </item>
-<item> texturealphamode </item>
-<item> texturemode </item>
-<item> texturesolidmode </item>
-<item> timedemo </item>
-<item> timegraph </item>
-<item> timelimit </item>
-<item> timeout </item>
-<item> timescale </item>
-<item> topcolor </item>
-<item> triplebuffer </item>
-<item> ttycon </item>
-<item> ui_Q3Model </item>
-<item> ui_actualNetGametype </item>
-<item> ui_bigFont </item>
-<item> ui_browserGameType </item>
-<item> ui_browserMaster </item>
-<item> ui_browserShowEmpty </item>
-<item> ui_browserShowFriendlyFire </item>
-<item> ui_browserShowFull </item>
-<item> ui_browserShowMaxlives </item>
-<item> ui_browserShowTourney </item>
-<item> ui_browserSortKey </item>
-<item> ui_cdkeychecked </item>
-<item> ui_class </item>
-<item> ui_cmd </item>
-<item> ui_ctf_capturelimit </item>
-<item> ui_ctf_friendly </item>
-<item> ui_ctf_timelimit </item>
-<item> ui_currentMap </item>
-<item> ui_currentNetMap </item>
-<item> ui_dedicated </item>
-<item> ui_ffa_fraglimit </item>
-<item> ui_ffa_timelimit </item>
-<item> ui_gametype </item>
-<item> ui_glCustom </item>
-<item> ui_isSpectator </item>
-<item> ui_joinGametype </item>
-<item> ui_limboMode </item>
-<item> ui_limboObjective </item>
-<item> ui_limboOptions </item>
-<item> ui_limboPrevOptions </item>
-<item> ui_mapIndex </item>
-<item> ui_master </item>
-<item> ui_menuFiles </item>
-<item> ui_mousePitch </item>
-<item> ui_netGametype </item>
-<item> ui_netSource </item>
-<item> ui_notebookCurrentPage </item>
-<item> ui_objective </item>
-<item> ui_prevClass </item>
-<item> ui_prevTeam </item>
-<item> ui_prevWeapon </item>
-<item> ui_serverStatusTimeOut </item>
-<item> ui_singlePlayerActive </item>
-<item> ui_smallFont </item>
-<item> ui_spSelection </item>
-<item> ui_team </item>
-<item> ui_teamArenaFirstRun </item>
-<item> ui_team_fraglimit </item>
-<item> ui_team_friendly </item>
-<item> ui_team_timelimit </item>
-<item> ui_tourney_fraglimit </item>
-<item> ui_tourney_timelimit </item>
-<item> ui_userAlliedRespawnTime </item>
-<item> ui_userAxisRespawnTime </item>
-<item> ui_userTimeLimit </item>
-<item> ui_weapon </item>
-<item> up </item>
-<item> upsensitivity </item>
-<item> upspeed </item>
-<item> upthreshold </item>
-<item> username </item>
-<item> v_centermove </item>
-<item> v_centerspeed </item>
-<item> v_idlescale </item>
-<item> v_ipitch_cycle </item>
-<item> v_ipitch_level </item>
-<item> v_iroll_cycle </item>
-<item> v_iroll_level </item>
-<item> v_iuaw_cycle </item>
-<item> v_iyaw_cycle </item>
-<item> v_iyaw_level </item>
-<item> v_kickpitch </item>
-<item> v_kickroll </item>
-<item> v_kicktime </item>
-<item> version </item>
-<item> vertex </item>
-<item> vid </item>
-<item> vid_config_x </item>
-<item> vid_config_y </item>
-<item> vid_fullscreen </item>
-<item> vid_fullscreen_mode </item>
-<item> vid_gamma </item>
-<item> vid_height </item>
-<item> vid_mode </item>
-<item> vid_nopageflip </item>
-<item> vid_ref </item>
-<item> vid_system_gamma </item>
-<item> vid_use8bit </item>
-<item> vid_wait </item>
-<item> vid_width </item>
-<item> vid_window_x </item>
-<item> vid_window_y </item>
-<item> vid_windowed_mode </item>
-<item> vid_xpos </item>
-<item> vid_ypos </item>
-<item> viewlog </item>
-<item> viewsize </item>
-<item> vm_cgame </item>
-<item> vm_game </item>
-<item> vm_ui </item>
-<item> volume </item>
-<item> vwep </item>
-<item> waitdelay </item>
-<item> waterwarp </item>
-<item> wavonly </item>
-<item> win </item>
-<item> win_noalttab </item>
-<item> win_hinstance </item>
-<item> win_wndproc </item>
-<item> xpos </item>
-<item> yaw </item>
-<item> yawsensitivity </item>
-<item> yawspeed </item>
-<item> yawthreshold </item>
-<item> ypos </item>
-<item> zombietime </item>
-<item> ztrick </item>
-</list>
-
-
-<list name="Actions">
-<item> +attack </item>
-<item> +ttack2 </item>
-<item> +alt1 </item>
-<item> +activate </item>
-<item> +back </item>
-<item> +break </item>
-<item> +button0 </item>
-<item> +button1 </item>
-<item> +button10 </item>
-<item> +button11 </item>
-<item> +button12 </item>
-<item> +button13 </item>
-<item> +button14 </item>
-<item> +button2 </item>
-<item> +button3 </item>
-<item> +button4 </item>
-<item> +button5 </item>
-<item> +button6 </item>
-<item> +button7 </item>
-<item> +button8 </item>
-<item> +button9 </item>
-<item> +camdistance </item>
-<item> +camin </item>
-<item> +cammousemove </item>
-<item> +camout </item>
-<item> +campitchdown </item>
-<item> +campitchup </item>
-<item> +camyawleft </item>
-<item> +camyawright </item>
-<item> +commandmenu </item>
-<item> +dropweapon </item>
-<item> +duck </item>
-<item> +forward </item>
-<item> +graph </item>
-<item> +jlook </item>
-<item> +jump </item>
-<item> +kick </item>
-<item> +klook </item>
-<item> +leanleft </item>
-<item> +leanright </item>
-<item> +left </item>
-<item> +lookdown </item>
-<item> +lookup </item>
-<item> +mlook </item>
-<item> +movedown </item>
-<item> +moveleft </item>
-<item> +moveright </item>
-<item> +moveup </item>
-<item> +nvgadjust </item>
-<item> +quickgren </item>
-<item> +reload </item>
-<item> +right </item>
-<item> +salute </item>
-<item> +score </item>
-<item> +showscores </item>
-<item> +speed </item>
-<item> +sprint </item>
-<item> +strafe </item>
-<item> +use </item>
-<item> +useitem </item>
-<item> +voicerecord </item>
-<item> +wbutton7 </item>
-<item> +zoom </item>
-<item> -activate </item>
-<item> -alt1 </item>
-<item> -attack </item>
-<item> -attack2 </item>
-<item> -back </item>
-<item> -break </item>
-<item> -button0 </item>
-<item> -button1 </item>
-<item> -button10 </item>
-<item> -button11 </item>
-<item> -button12 </item>
-<item> -button13 </item>
-<item> -button14 </item>
-<item> -button2 </item>
-<item> -button3 </item>
-<item> -button4 </item>
-<item> -button5 </item>
-<item> -button6 </item>
-<item> -button7 </item>
-<item> -button8 </item>
-<item> -button9 </item>
-<item> -camdistance </item>
-<item> -camin </item>
-<item> -cammousemove </item>
-<item> -camout </item>
-<item> -campitchdown </item>
-<item> -campitchup </item>
-<item> -camyawleft </item>
-<item> -camyawright </item>
-<item> -commandmenu </item>
-<item> -dropweapon </item>
-<item> -duck </item>
-<item> -forward </item>
-<item> -graph </item>
-<item> -jlook </item>
-<item> -jump </item>
-<item> -kick </item>
-<item> -klook </item>
-<item> -leanleft </item>
-<item> -leanright </item>
-<item> -left </item>
-<item> -lookdown </item>
-<item> -lookup </item>
-<item> -mlook </item>
-<item> -movedown </item>
-<item> -moveleft </item>
-<item> -moveright </item>
-<item> -moveup </item>
-<item> -nvgadjust </item>
-<item> -quickgren </item>
-<item> -reload </item>
-<item> -right </item>
-<item> -salute </item>
-<item> -score </item>
-<item> -showscores </item>
-<item> -speed </item>
-<item> -sprint </item>
-<item> -strafe </item>
-<item> -use </item>
-<item> -useitem </item>
-<item> -voicerecord </item>
-<item> -wbutton7 </item>
-<item> -zoom </item>
-</list>
-
-
-<list name="KeyTypes">
-<item> * </item>
-<item> [ </item>
-<item> ] </item>
-<item> \ </item>
-<item> / </item>
-<item> ' </item>
-<item> = </item>
-<item> - </item>
-<item> + </item>
-<item> , </item>
-<item> . </item>
-<item> ` </item>
-<item> ~ </item>
-<item> 1 </item>
-<item> 2 </item>
-<item> 3 </item>
-<item> 4 </item>
-<item> 5 </item>
-<item> 6 </item>
-<item> 7 </item>
-<item> 8 </item>
-<item> 9 </item>
-<item> 0 </item>
-<item> a </item>
-<item> b </item>
-<item> c </item>
-<item> d </item>
-<item> e </item>
-<item> f </item>
-<item> g </item>
-<item> h </item>
-<item> i </item>
-<item> j </item>
-<item> k </item>
-<item> l </item>
-<item> m </item>
-<item> n </item>
-<item> o </item>
-<item> p </item>
-<item> q </item>
-<item> r </item>
-<item> s </item>
-<item> t </item>
-<item> u </item>
-<item> v </item>
-<item> x </item>
-<item> w </item>
-<item> y </item>
-<item> z </item>
-<item> ALT </item>
-<item> AUX1 </item>
-<item> AUX10 </item>
-<item> AUX11 </item>
-<item> AUX12 </item>
-<item> AUX13 </item>
-<item> AUX14 </item>
-<item> AUX15 </item>
-<item> AUX16 </item>
-<item> AUX17 </item>
-<item> AUX18 </item>
-<item> AUX2 </item>
-<item> AUX20 </item>
-<item> AUX21 </item>
-<item> AUX22 </item>
-<item> AUX23 </item>
-<item> AUX24 </item>
-<item> AUX25 </item>
-<item> AUX26 </item>
-<item> AUX27 </item>
-<item> AUX28 </item>
-<item> AUX29 </item>
-<item> AUX3 </item>
-<item> AUX30 </item>
-<item> AUX31 </item>
-<item> AUX32 </item>
-<item> AUX4 </item>
-<item> AUX5 </item>
-<item> AUX6 </item>
-<item> AUX7 </item>
-<item> AUX8 </item>
-<item> AUX9 </item>
-<item> BACKSPACE </item>
-<item> CTRL </item>
-<item> DEL </item>
-<item> DOWNARROW </item>
-<item> END </item>
-<item> ENTER </item>
-<item> ESCAPE </item>
-<item> F1 </item>
-<item> F10 </item>
-<item> F11 </item>
-<item> F12 </item>
-<item> F2 </item>
-<item> F3 </item>
-<item> F4 </item>
-<item> F5 </item>
-<item> F6 </item>
-<item> F7 </item>
-<item> F8 </item>
-<item> F9 </item>
-<item> HOME </item>
-<item> INS </item>
-<item> JOY1 </item>
-<item> JOY2 </item>
-<item> JOY3 </item>
-<item> JOY4 </item>
-<item> KP_SLASH </item>
-<item> KP_5 </item>
-<item> KP_UPARROW </item>
-<item> KP_LEFTARROW </item>
-<item> KP_RIGHTARROW </item>
-<item> KP_DOWNARROW </item>
-<item> KP_HOME </item>
-<item> KP_END </item>
-<item> KP_PGUP </item>
-<item> KP_PGDN </item>
-<item> KP_INS </item>
-<item> KP_DEL </item>
-<item> LEFTARROW </item>
-<item> MOUSE1 </item>
-<item> MOUSE2 </item>
-<item> MOUSE3 </item>
-<item> MWHEELDOWN </item>
-<item> MWHEELUP </item>
-<item> PAUSE </item>
-<item> PGDN </item>
-<item> PGUP </item>
-<item> RIGHTARROW </item>
-<item> SEMICOLON </item>
-<item> CAPSLOCK </item>
-<item> SHIFT </item>
-<item> SPACE </item>
-<item> TAB </item>
-<item> UPARROW </item>
-</list>
-
- <list name="Symbols">
- <item> ; </item>
- <item> $ </item>
- </list>
- <list name="BindFamily">
- <item> bind </item>
- <item> unbind </item>
- </list>
- <list name="setFamily">
- <item> set </item>
- <item> seta </item>
- <item> setu </item>
- <item> sets </item>
- </list>
- <list name="PrintsString">
- <item> echo </item>
- <item> say_team </item>
- <item> say </item>
- </list>
-
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
- <keyword attribute="Command" context="Arg area" String="Commands"/>
- <keyword attribute="Variable" context="Arg area" String="Variables"/>
- <keyword attribute="Action" context="#stay" String="Actions"/>
- <keyword attribute="Symbol" context="#stay" String="Symbols"/>
- <keyword attribute="Command" context="Bind phrase" String="BindFamily"/>
- <keyword attribute="Command" context="Alias phrase" String="setFamily"/>
- <keyword attribute="Command" context="Echo" String="PrintsString"/>
- <StringDetect attribute="Command" context="Alias phrase" String="alias" insensitive="TRUE"/>
- <keyword attribute="Command" context="Echo" String="PrintsString"/>
- <DetectChar attribute="Symbol" context="#stay" char="$"/>
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
- </context>
- <context attribute="Comment" lineEndContext="Normal Text" name="Comment"/>
- <context attribute="String" lineEndContext="Normal Text" name="String">
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
- <context attribute="Normal Text" lineEndContext="Normal Text" name="Arg area">
- <DetectChar attribute="String" context="String" char="""/>
- <Float attribute="Float" context="#stay"/>
- <Int attribute="Int" context="#stay"/>
- <DetectChar attribute="Symbol" context="#pop" char=";"/>
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
- <DetectChar attribute="Symbol" context="Normal Text" char="$"/>
- </context>
- <context attribute="Normal Text" lineEndContext="Normal Text" name="Arg area in sub phrase">
- <Float attribute="Float" context="#stay"/>
- <Int attribute="Int" context="#stay"/>
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
- <DetectChar attribute="Symbol" context="#pop" char=";"/>
- </context>
- <context attribute="Normal Text" lineEndContext="Normal Text" name="Sub phrase">
- <keyword attribute="Command" context="Arg area in sub phrase" String="Commands"/>
- <keyword attribute="Variable" context="Arg area in sub phrase" String="Variables"/>
- <keyword attribute="Action" context="#stay" String="Actions"/>
- <keyword attribute="Symbol" context="#stay" String="Symbols"/>
- <keyword attribute="Command" context="Bind phrase" String="BindFamily"/>
- <keyword attribute="Command" context="Normal Text" String="setFamily"/>
- <keyword attribute="Command" context="Echo" String="PrintsString"/>
- <StringDetect attribute="Command" context="Alias phrase" String="alias"/>
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
- <DetectChar attribute="Symbol" context="#stay" char=";"/>
- <Int attribute="Int" context="#stay"/>
- <DetectChar attribute="Symbol" context="#pop" char=";"/>
- </context>
- <context attribute="Normal Text" lineEndContext="Normal Text" name="Bind phrase">
- <keyword attribute="Hex" context="Sub phrase" String="KeyTypes"/>
- </context>
- <context attribute="Identifier" lineEndContext="Normal Text" name="Alias phrase">
- <DetectChar attribute="Identifier" context="Sub phrase" char=" "/>
- </context>
- <context attribute="String" lineEndContext="Normal Text" name="Echo">
- <DetectChar attribute="Symbol" context="#pop" char=";"/>
- <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Command" defStyleNum="dsKeyword" />
- <itemData name="Action" defStyleNum="dsNormal" color="#ffcc00" italic="1" selColor="#00ff00" bold="1" />
- <itemData name="Variable" defStyleNum="dsNormal" color="#0000ff" italic="1" selColor="#00ff00" bold="1" />
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="Comment" defStyleNum="dsComment" />
- <itemData name="Float" defStyleNum="dsFloat" />
- <itemData name="Int" defStyleNum="dsFloat" />
- <itemData name="String" defStyleNum="dsNormal" color="#ff0000" italic="1" selColor="#00ff00" bold="0" />
- <itemData name="String Char" defStyleNum="dsChar" />
- <itemData name="Hex" defStyleNum="dsBaseN" />
- <itemData name="Symbol" defStyleNum="dsOthers" />
- <itemData name="Identifier" defStyleNum="dsDataType" />
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="//"/>
- </comments>
- <keywords weakDeliminator=",+~-=/\.[]$" additionalDeliminator="";$" casesensitive="0"/>
- </general>
-</language>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="IDL" version="1.03" kateversion="2.1" section="Sources" extensions="*.idl" mimetype="text/x-idl-src">
- <highlighting>
- <list name="keywords">
- <item> any </item>
- <item> attribute </item>
- <item> case </item>
- <item> const </item>
- <item> context </item>
- <item> default </item>
- <item> enum </item>
- <item> exception </item>
- <item> FALSE </item>
- <item> fixed </item>
- <item> public </item>
- <item> in </item>
- <item> inout </item>
- <item> interface </item>
- <item> module </item>
- <item> Object </item>
- <item> oneway </item>
- <item> out </item>
- <item> raises </item>
- <item> readonly </item>
- <item> sequence </item>
- <item> struct </item>
- <item> switch </item>
- <item> TRUE </item>
- <item> typedef </item>
- <item> unsigned </item>
- <item> union </item>
- </list>
- <list name="types">
- <item> boolean </item>
- <item> char </item>
- <item> double </item>
- <item> float </item>
- <item> long </item>
- <item> octet </item>
- <item> short </item>
- <item> string </item>
- <item> void </item>
- <item> wchar </item>
- <item> wstring </item>
- </list>
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
- <keyword attribute="Keyword" context="#stay" String="keywords" />
- <keyword attribute="Data Type" context="#stay" String="types" />
- <HlCOct attribute="Octal" context="#stay"/>
- <HlCHex attribute="Hex" context="#stay"/>
- <HlCChar attribute="Char" context="#stay"/>
- <DetectChar attribute="String" context="String" char="""/>
- <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*"/>
- <AnyChar attribute="Symbol" context="#stay" String="!%&()+,-<=>?[]^{|}~"/>
- <StringDetect attribute="Comment" context="Some Context3" String="#if 0" insensitive="FALSE"/>
- <RegExpr attribute="Preprocessor" context="Preprocessor" String="^#"/>
- </context>
- <context attribute="String" lineEndContext="#stay" name="String">
- <LineContinue attribute="String" context="Some Context"/>
- <HlCStringChar attribute="String Char" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="""/>
- </context>
- <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
- <RegExpr attribute="Decimal" context="#stay" String="(FIXME|TODO)" />
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
- <RegExpr attribute="Decimal" context="#stay" String="(FIXME|TODO)" />
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
- </context>
- <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
- <LineContinue attribute="Preprocessor" context="Some Context2"/>
- <RangeDetect attribute="Prep. Lib" context="#stay" char=""" char1="""/>
- <RangeDetect attribute="Prep. Lib" context="#stay" char="<" char1=">"/>
- <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*"/>
- </context>
- <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
- <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Some Context"/>
- <context attribute="Normal Text" lineEndContext="#pop" name="Some Context2"/>
- <context attribute="Normal Text" lineEndContext="#stay" name="Some Context3">
- <RegExpr attribute="Decimal" context="#stay" String="(FIXME|TODO)" />
- <RegExpr attribute="Comment" context="#pop" String="^#endif" />
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Data Type" defStyleNum="dsDataType"/>
- <itemData name="Decimal" defStyleNum="dsDecVal"/>
- <itemData name="Octal" defStyleNum="dsBaseN"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Char" defStyleNum="dsChar"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="String Char" defStyleNum="dsChar"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Symbol" defStyleNum="dsNormal"/>
- <itemData name="Preprocessor" defStyleNum="dsOthers"/>
- <itemData name="Prep. Lib" defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
- </itemDatas>
- </highlighting>
- <general>
- <comments>
- <comment name="singleLine" start="//" />
- <comment name="multiLine" start="/*" end="*/" />
- </comments>
- <keywords casesensitive="1" />
- </general>
-</language>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="ILERPG" version="1.02" kateversion="2.1" section="Sources" extensions="QRPGLESRC.*" mimetype="text/x-ilerpg-src" casesensitive="0">
- <highlighting>
- <list name="biffs">
- <item> ABS </item>
- <item> ADDR </item>
- <item> CHAR </item>
- <item> DECH </item>
- <item> DECPOS </item>
- <item> DEC </item>
- <item> EDITC </item>
- <item> EDITFLT </item>
- <item> EDITW </item>
- <item> ELEM </item>
- <item> EOF </item>
- <item> EQUAL </item>
- <item> ERROR </item>
- <item> FLOAT </item>
- <item> FOUND </item>
- <item> INTH </item>
- <item> INT </item>
- <item> LEN </item>
- <item> NULLIND </item>
- <item> OPEN </item>
- <item> PADDR </item>
- <item> PARMS </item>
- <item> REPLACE </item>
- <item> SCAN </item>
- <item> SIZE </item>
- <item> STATUS </item>
- <item> STR </item>
- <item> SUBST </item>
- <item> TRIMR </item>
- <item> TRIML </item>
- <item> TRIM </item>
- <item> UNSH </item>
- <item> UNS </item>
- </list>
- <list name="opcodes">
- <item> Z-ADD </item>
- <item> Z-SUB </item>
- <item> ACQ </item>
- <item> ADDDUR </item>
- <item> ADD </item>
- <item> ALLOC </item>
- <item> ANDGT </item>
- <item> ANDLT </item>
- <item> ANDEQ </item>
- <item> ANDNE </item>
- <item> ANDGE </item>
- <item> ANDLE </item>
- <item> AND </item>
- <item> BEGSR </item>
- <item> BITOFF </item>
- <item> BITON </item>
- <item> CABGT </item>
- <item> CABLT </item>
- <item> CABEQ </item>
- <item> CABNE </item>
- <item> CABGE </item>
- <item> CABLE </item>
- <item> CAB </item>
- <item> CALLB </item>
- <item> CALLP </item>
- <item> CALL </item>
- <item> CASGT </item>
- <item> CASLT </item>
- <item> CASEQ </item>
- <item> CASNE </item>
- <item> CASGE </item>
- <item> CASLE </item>
- <item> CAS </item>
- <item> CAT </item>
- <item> CHAIN </item>
- <item> CHECKR </item>
- <item> CHECK </item>
- <item> CLEAR </item>
- <item> CLOSE </item>
- <item> COMMIT </item>
- <item> COMP </item>
- <item> DEALLOC </item>
- <item> DEFINE </item>
- <item> DELETE </item>
- <item> DIV </item>
- <item> DOWGT </item>
- <item> DOWLT </item>
- <item> DOWEQ </item>
- <item> DOWNE </item>
- <item> DOWGE </item>
- <item> DOWLE </item>
- <item> DOUGT </item>
- <item> DOULT </item>
- <item> DOUEQ </item>
- <item> DOUNE </item>
- <item> DOUGE </item>
- <item> DOULE </item>
- <item> DOU </item>
- <item> DOW </item>
- <item> DO </item>
- <item> DSPLY </item>
- <item> DUMP </item>
- <item> ELSE </item>
- <item> ENDCS </item>
- <item> ENDDO </item>
- <item> ENDIF </item>
- <item> ENDSL </item>
- <item> ENDSR </item>
- <item> END </item>
- <item> EVAL </item>
- <item> EXCEPT </item>
- <item> EXFMT </item>
- <item> EXSR </item>
- <item> EXTRCT </item>
- <item> FEOD </item>
- <item> FORCE </item>
- <item> GOTO </item>
- <item> IFGT </item>
- <item> IFLT </item>
- <item> IFEQ </item>
- <item> IFNE </item>
- <item> IFGE </item>
- <item> IFLE </item>
- <item> IF </item>
- <item> IN </item>
- <item> ITER </item>
- <item> KFLD </item>
- <item> KLIST </item>
- <item> LEAVE </item>
- <item> LOOKUP </item>
- <item> MHHZO </item>
- <item> MHLZO </item>
- <item> MLHZO </item>
- <item> MLLZO </item>
- <item> MOVE </item>
- <item> MOVEA </item>
- <item> MOVEL </item>
- <item> MULT </item>
- <item> MVR </item>
- <item> NEXT </item>
- <item> OCCUR </item>
- <item> OPEN </item>
- <item> ORGT </item>
- <item> ORLT </item>
- <item> OREQ </item>
- <item> ORNE </item>
- <item> ORGE </item>
- <item> ORLE </item>
- <item> OR </item>
- <item> OTHER </item>
- <item> OUT </item>
- <item> PARM </item>
- <item> PLIST </item>
- <item> POST </item>
- <item> READC </item>
- <item> READE </item>
- <item> READPE </item>
- <item> READP </item>
- <item> READ </item>
- <item> REALLOC </item>
- <item> REL </item>
- <item> RESET </item>
- <item> RETURN </item>
- <item> ROLBK </item>
- <item> SCAN </item>
- <item> SELECT </item>
- <item> SETGT </item>
- <item> SETLL </item>
- <item> SETOFF </item>
- <item> SETON </item>
- <item> SHTDN </item>
- <item> SORTA </item>
- <item> SQRT </item>
- <item> SUBDUR </item>
- <item> SUBST </item>
- <item> SUB </item>
- <item> TAG </item>
- <item> TESTB </item>
- <item> TESTN </item>
- <item> TESTZ </item>
- <item> TEST </item>
- <item> TIME </item>
- <item> UNLOCK </item>
- <item> UPDATE </item>
- <item> WHENGT </item>
- <item> WHENLT </item>
- <item> WHENEQ </item>
- <item> WHENNR </item>
- <item> WHENGE </item>
- <item> WHENLE </item>
- <item> WHEN </item>
- <item> WRITE </item>
- <item> XFOOT </item>
- <item> XLATE </item>
- <item> *BLANKS </item>
- </list>
-
- <contexts>
-
- <context attribute="Normal Text" lineEndContext="#stay" name="Default">
- <RegExpr attribute="Comment" context="context3" String="[POIHFDC ]?\*"/>
- <RegExpr attribute="Keyword" context="context1" String="[POIHFDC]"/>
- </context>
-
- <context attribute="Normal Text" lineEndContext="#pop" name="context1">
- <keyword attribute="Keyword" context="#stay" String="opcodes"/>
- <DetectChar attribute="Biff" context="context7" char="%"/>
- <DetectChar attribute="Constant" context="context3" char="'"/>
- <Float attribute="Float" context="#stay"/>
- <RegExpr attribute="Hex" context="#stay" String="[Xx]'[0-9|a-f|A-f]{2,}'"/>
-
- <Int attribute="Decimal" context="#stay">
- <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
- <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
- </Int>
- </context>
-
- <context attribute="Comment" lineEndContext="#pop" name="context3">
- <RegExpr attribute="BoldComment" context="#stay" String="\(*(FIXME|TODO)\)*" />
- <RegExpr attribute="BoldComment" context="#stay" String="\(*(NOTE:)\)*" />
- <DetectChar attribute="BoldComment" context="context6" char="!"/>
- <RegExpr attribute="DivideComment" context="#stay" String="-|="/>
- </context>
-
- <context attribute="Constant" lineEndContext="#stay" name="context4">
- <DetectChar attribute="Constant" context="#pop" char="'"/>
- </context>
-
- <context attribute="Constant" lineEndContext="#stay" name="context5">
- <RegExpr attribute="Normal Text" context="#stay" String="[FHDICO]"/>
- <DetectChar attribute="Constant" context="#pop" char=" "/>
- </context>
- <context attribute="Keyword" lineEndContext="#pop#pop" name="context6">
- </context>
- <context attribute="BoldComment" lineEndContext="Default" name="context7">
- <DetectChar attribute="BoldComment" context="context3" char="!"/>
- </context>
- <context attribute="Biff" lineEndContext="#pop#pop#pop" name="context8">
- <keyword attribute="Biff" context="#pop#pop" String="biffs"/>
- <DetectChar attribute="Biff" context="#pop#pop" char=" "/>
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="Keyword" defStyleNum="dsKeyword" />
- <itemData name="Biff" defStyleNum="dsKeyword" />
- <itemData name="RegExpr" defStyleNum="dsBaseN" />
- <itemData name="Symbol" defStyleNum="dsNormal"/>
- <itemData name="Decimal" defStyleNum="dsDecVal" />
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Octal" defStyleNum="dsBaseN"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Base-N" defStyleNum="dsBaseN" />
- <itemData name="Float" defStyleNum="dsFloat" />
- <itemData name="Char" defStyleNum="dsChar" />
- <itemData name="Constant" defStyleNum="dsNormal" color="#FF0000" selColor="#000000" bold="0" italic="0"/>
- <itemData name="Fill" defStyleNum="dsNormal" color="#FF6347" selColor="#000000" bold="0" italic="0"/>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="BoldComment" defStyleNum="dsNormal" color="#CD853F" selColor="#808080" bold="1" italic="1"/>
- <itemData name="DivideComment" defStyleNum="dsComment" bold="1"/>
- <itemData name="Directive" defStyleNum="dsOthers"/>
- </itemDatas>
- </highlighting>
- <general>
- <keywords casesensitive="0" />
- </general>
-</language>
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<!-- author: Giancarlo Niccolai (giancarlo@niccolai.ws) -->
-<!-- This file is released under GPL license 2.0 or any later version at your choice. -->
-<!-- $Id: inform.xml,v 1.4 2004/02/03 20:26:06 cullmann Exp $ -->
-<language name="Inform" version="1.21" kateversion="2.1" section="Sources"
- extensions="*.inf;*.h" mimetype="text/x-inform-src"
- author="Giancarlo Niccolai (giancarlo@niccolai.ws)" license="GPL">
-<highlighting>
- <list name="keywords">
- <item> if </item>
- <item> for </item>
- <item> else </item>
- <item> box </item>
- <item> break </item>
- <item> continue </item>
- <item> do </item>
- <item> until </item>
- <item> font </item>
- <item> give </item>
- <item> inversion </item>
- <item> jump </item>
- <item> on </item>
- <item> to </item>
- <item> move </item>
- <item> new_line </item>
- <item> objectloop </item>
- <item> print </item>
- <item> print_ret </item>
- <item> quit </item>
- <item> read </item>
- <item> remove </item>
- <item> restore </item>
- <item> return </item>
- <item> rtrue </item>
- <item> rfalse </item>
- <item> save </item>
- <item> spaces </item>
- <item> spring </item>
- <item> style </item>
- <item> switch </item>
- </list>
-
- <list name="functions">
- <item> metaclass </item>
- <item> parent </item>
- <item> child </item>
- <item> children </item>
- <item> Achieved </item>
- <item> AddToScope </item>
- <item> allowpushdir </item>
- <item> CDefArt </item>
- <item> ChangeDefault </item>
- <item> DefArt </item>
- <item> DoMenu </item>
- <item> EnglishNumber </item>
- <item> HasLightSource </item>
- <item> InDefArt </item>
- <item> Locale </item>
- <item> LoopOverScope </item>
- <item> NextWord </item>
- <item> NextWordStopped </item>
- <item> NounDomain </item>
- <item> ObjectIsUntouchable </item>
- <item> OffersLight </item>
- <item> PlaceInScope </item>
- <item> PlayerTo </item>
- <item> PrintShortName </item>
- <item> ScopeWithin </item>
- <item> SetTime </item>
- <item> StartDaemon </item>
- <item> StartTimer </item>
- <item> StopDaemon </item>
- <item> StopTimer </item>
- <item> TestScope </item>
- <item> TryNumber </item>
- <item> UnsignedCompare </item>
- <item> WordAddress </item>
- <item> WordLenght </item>
- <item> WriteListFrom </item>
- <item> YesOrNo </item>
- <item> ZRegion </item>
- </list>
- <list name="actions">
- <item> Pronouns </item>
- <item> Quit </item>
- <item> Restore </item>
- <item> Save </item>
- <item> Verify </item>
- <item> Restart </item>
- <item> ScriptOn </item>
- <item> ScriptOff </item>
- <item> NotifyOn </item>
- <item> NotifyOff </item>
- <item> Places </item>
- <item> Objects </item>
- <item> Score </item>
- <item> FullScore </item>
- <item> Version </item>
- <item> LMode1 </item>
- <item> LMode2 </item>
- <item> LMode3 </item>
- <item> Inv </item>
-
-
- <item> Inv </item>
- <item> InvTall </item>
- <item> InvWide </item>
- <item> Take </item>
- <item> Drop </item>
- <item> Empty </item>
- <item> Enter </item>
- <item> Exit </item>
- <item> GetOff </item>
- <item> Go </item>
- <item> GoIn </item>
- <item> Look </item>
- <item> Examine </item>
- <item> Search </item>
- <item> Give </item>
- <item> Show </item>
- <item> Unlock </item>
- <item> Lock </item>
- <item> SwitchOn </item>
- <item> SwitchOff </item>
- <item> Open </item>
- <item> Close </item>
- <item> Disrobe </item>
- <item> Wear </item>
- <item> Eat </item>
-
- <item> LetGo </item>
- <item> Receive </item>
- <item> Insert </item>
- <item> PutOn </item>
- <item> Transfer </item>
- <item> Empty </item>
- <item> EmptyT </item>
- <item> GetOff </item>
- <item> GoIn </item>
- <item> Listen </item>
- <item> Taste </item>
- <item> Touch </item>
-
- <item> Pull </item>
- <item> Push </item>
- <item> Wave </item>
- <item> Turn </item>
- <item> PushDir </item>
- <item> ThrowAt </item>
- <item> ThrownAt </item>
- <item> JumpOn </item>
- <item> Drink </item>
- <item> Attack </item>
- <item> Tie </item>
- <item> Fill </item>
- <item> Swing </item>
- <item> Blow </item>
- <item> Rub </item>
- <item> Set </item>
- <item> SetTo </item>
- <item> Buy </item>
- <item> Climb </item>
- <item> Squeeze </item>
- <item> Climb </item>
- <item> Burn </item>
- <item> Cut </item>
- <item> Dig </item>
-
- <item> Consult </item>
- <item> Tell </item>
- <item> Answer </item>
- <item> Ask </item>
- <item> AskFor </item>
- <item> Kiss </item>
-
- <item> Sleep </item>
- <item> Sing </item>
- <item> WaveHands </item>
- <item> Swim </item>
- <item> Sorry </item>
- <item> Sing </item>
- <item> Strong </item>
- <item> Mild </item>
- <item> Smell </item>
- <item> Pray </item>
- <item> Jump </item>
- <item> Think </item>
- <item> VagueGo </item>
- <item> Yes </item>
- <item> No </item>
- <item> Sing </item>
- </list>
-
- <list name="special_vals" >
- <item> String </item>
- <item> Routine </item>
- <item> bold </item>
- <item> roman </item>
- <item> underline </item>
- <item> fixed </item>
- <item> nothing </item>
- <item> true </item>
- <item> false </item>
- <item> on </item>
- <item> off </item>
- <item> sender </item>
- <item> self </item>
- <item> location </item>
- <item> score </item>
- <item> action </item>
- <item> actor </item>
- <item> noun </item>
- <item> second </item>
- <item> the_time </item>
- <item> consult_from </item>
- <item> consult_words </item>
- <item> wn </item>
- <item> actors_location </item>
- <item> buffer </item>
- <item> player </item>
- </list>
-
- <list name="pragmas" >
- <item> Ifdef </item>
- <item> Ifndef </item>
- <item> Iftrue </item>
- <item> Iffalse </item>
- <item> Ifnot </item>
- <item> Endif </item>
- <item> End </item>
- <item> Abbreviate </item>
- <item> Array </item>
- <item> Attribute </item>
- <item> Constant </item>
- <item> Default </item>
- <item> Extend </item>
- <item> Global </item>
- <item> Ifnot </item>
- <item> Iftrue </item>
- <item> Iffalse </item>
- <item> Import </item>
- <item> Include </item>
- <item> Link </item>
- <item> Lowstring </item>
- <item> Message </item>
- <item> Property </item>
- <item> Release </item>
- <item> Replace </item>
- <item> Serial </item>
- <item> Switches </item>
- <item> Statusline </item>
- <item> score </item>
- <item> System_file </item>
- <item> Verb </item>
- </list>
-
- <list name="inline_pragmas" >
- <item> #ifdef </item>
- <item> #else </item>
- <item> #ifndef </item>
- <item> #endif </item>
- </list>
-
- <list name="operators">
- <item> has </item>
- <item> hasn't </item>
- <item> in </item>
- <item> notin </item>
- <item> provides </item>
- <item> ofclass </item>
- <item> or </item>
- </list>
-
- <list name="ClassDeclOps">
- <item> with </item>
- <item> private </item>
- <item> has </item>
- </list>
-
- <contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="TopLevel">
- <DetectChar attribute="Comment" context="comment" char="!" />
- <DetectChar attribute="String" context="string" char=""" />
- <RegExpr attribute="Function" context="funcdef" beginRegion="reg_function"
- String="[[]\s*[a-zA-Z_]+[a-zA-Z_0-9]*" />
-
- <RegExpr String="^ *object |^ *class " attribute="Pragma"
- context="ClassDecl"
- insensitive="TRUE" beginRegion="reg_class" />
-
- <keyword attribute="Pragma" context="#stay" String="pragmas" />
- <keyword attribute="Pragma" context="#stay" String="inline_pragmas" />
-
- <RegExpr attribute="Operator" context="#stay" String="--?>" />
- <RegExpr attribute="Normal Text" context="#stay" String="[a-zA-Z_]+[0-9]*" />
- <RegExpr attribute="Number" context="#stay" String="\$[0-9a-fA-F]{1,4}" />
- <RegExpr attribute="Number" context="#stay" String="[0-9]+" />
- </context>
-
- <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
- <DetectChar attribute="Comment" context="comment" char="!" />
- <DetectChar attribute="String" context="string" char=""" />
- <DetectChar attribute="Word" context="word" char="'" />
- <keyword attribute="Pragma" context="#stay" String="inline_pragmas" />
- <RegExpr attribute="Operator" context="#stay" String="--?>" />
- <keyword attribute="Keyword" context="#stay" String="keywords" />
- <keyword attribute="Actions" context="#stay" String="actions" />
- <keyword attribute="PredefFunction" context="#stay" String="functions" />
- <keyword attribute="Values" context="#stay" String="special_vals" />
- <keyword attribute="Operator" context="#stay" String="operators" />
- <RegExpr attribute="Actions" context="#stay" String="##[a-zA-Z_]+[a-zA-Z_0-9]*" />
- <RegExpr attribute="OpCode" context="#stay" String="@[a-zA-Z_]+[a-zA-Z_0-9]*" />
- <RegExpr attribute="Number" context="#stay" String="\$[0-9a-fA-F]{1,4}" />
- <RegExpr String="[a-zA-Z_]+[a-zA-Z_0-9]*" attribute="Normal Text" context="#stay" />
- <RegExpr attribute="Number" context="#stay" String="[0-9]+" />
- <DetectChar char="{" attribute="Keyword" context="#stay"
- beginRegion="reg_compound" />
- <DetectChar char="}" attribute="Keyword" context="#stay"
- endRegion="reg_compound" />
- <RegExpr attribute="Operator" context="#stay" String="[%&()+-<=>{|}~]"/>
- </context>
-
- <context attribute="Normal Text" lineEndContext="#stay" name="PropDefVal rules">
- <DetectChar attribute="Comment" context="comment" char="!" />
- <DetectChar attribute="String" context="string" char=""" />
- <DetectChar attribute="Word" context="word" char="'" />
- <DetectChar attribute="Function" context="prop_func_def" char="[" beginRegion="reg_prop_def_func" />
- <DetectChar attribute="Operator" context="#pop" char="," />
- <RegExpr attribute="Number" context="#stay" String="\$[0-9a-fA-F]{1,4}" />
- <RegExpr attribute="Number" context="#stay" String="[0-9]+" />
- </context>
-
-
- <context name="funcdef" attribute="Normal Text" lineEndContext="#stay" >
- <IncludeRules context="Normal" />
- <Detect2Chars attribute="Function" context="#pop" char="]" char1=";"
- endRegion="reg_function"/>
- </context>
-
- <context name="ClassDecl" attribute="Normal Text" lineEndContext="ClassDecl_1">
- <IncludeRules context="PropDefVal rules" />
- </context>
-
- <context name="ClassDecl_1" attribute="Normal Text" lineEndContext="#stay">
- <RegExpr String="^[\t ]*has " attribute="Keyword" context="has_decl" insensitive="TRUE"/>
- <keyword String="ClassDeclOps" attribute="Keyword" context="#stay" />
- <RegExpr String="[a-zA-Z_]+[a-zA-Z_0-9]*" context = "prop_def"
- attribute="Function"/>
- <DetectChar char=";" context="#pop" attribute="Pragma" endRegion="reg_class"/>
- </context>
-
-
- <context attribute="Word" lineEndContext="#pop" name="word">
- <DetectChar attribute="Word" context="#pop" char="'" />
- </context>
-
- <context attribute="String" lineEndContext="#stay" name="string">
- <DetectChar attribute="String" context="#pop" char=""" />
- </context>
-
- <context name="prop_func_def" attribute="Normal Text" lineEndContext="#stay">
- <DetectChar context="#pop" char="]" attribute="Function"
- endRegion="reg_prop_func"/>
- <IncludeRules context="Normal" />
- </context>
-
- <context name="prop_def" attribute="Normal Text" lineEndContext="#stay" >
- <DetectChar char="," context="#pop" attribute="Function"
- endRegion="reg_prop"/>
- <DetectChar char=";" context="#pop#pop#pop" attribute="Pragma" endRegion="reg_class"/>
- <DetectChar char="[" context="prop_func_def" attribute="Function"
- beginRegion="reg_prop_func"/>
- <IncludeRules context="PropDefVal rules" />
- </context>
-
- <context name="has_decl" attribute="Normal Text" lineEndContext="#stay" >
- <DetectChar char=";" context="#pop#pop#pop" attribute="Pragma" endRegion="reg_class"/>
- <IncludeRules context="PropDefVal rules" />
- </context>
-
- <context attribute="Comment" lineEndContext="#pop" name="comment"/>
-
- </contexts>
-
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Actions" defStyleNum="dsDataType" color="#E06060" selColor="#400000" bold="0" italic="0"/>
- <itemData name="Operator" defStyleNum="dsBaseN" color="#A01060" selColor="#400040" bold="0" italic="0"/>
- <itemData name="Number" defStyleNum="dsDecVal" color="#5050C0" selColor="#000000" bold="0" italic="0"/>
- <itemData name="OpCode" defStyleNum="dsDecVal" color="#3015F0" selColor="#000000" bold="1" italic="0"/>
- <itemData name="Values" defStyleNum="dsBaseN" color="#7020F0" selColor="#400000" bold="1" italic="0" />
- <itemData name="Pragma" defStyleNum="dsOthers" color="#109010" selColor="#400000" bold="1" italic="0" />
- <itemData name="PredefFunction" defStyleNum="dsNormal" color="#000090" selColor="#ffffff" bold="1" italic="0"/>
- <itemData name="Function" defStyleNum="dsNormal" color="#000090" selColor="#ffffff" bold="0" italic="0"/>
- <itemData name="Comment" defStyleNum="dsComment" color="#707070" selColor="#ffffff" bold="0" italic="1"/>
- <itemData name="String" defStyleNum="dsString" color="#007000" selColor="#007000" bold="0" italic="0"/>
- <itemData name="Word" defStyleNum="dsString" color="#007000" selColor="#007000" bold="0" italic="1"/>
- </itemDatas>
-</highlighting>
-<general>
- <comments>
- <comment name="singleLine" start="!" />
- </comments>
- <keywords casesensitive="1" />
-</general>
-</language>
diff --git a/tests/examplefiles/perl5db.pl b/tests/examplefiles/perl5db.pl index b4edc838..ab9d5e30 100644 --- a/tests/examplefiles/perl5db.pl +++ b/tests/examplefiles/perl5db.pl @@ -9,585 +9,6 @@ perl5db.pl - the perl debugger =head1 DESCRIPTION -C<perl5db.pl> is the perl debugger. It is loaded automatically by Perl when -you invoke a script with C<perl -d>. This documentation tries to outline the -structure and services provided by C<perl5db.pl>, and to describe how you -can use them. - -=head1 GENERAL NOTES - -The debugger can look pretty forbidding to many Perl programmers. There are -a number of reasons for this, many stemming out of the debugger's history. - -When the debugger was first written, Perl didn't have a lot of its nicer -features - no references, no lexical variables, no closures, no object-oriented -programming. So a lot of the things one would normally have done using such -features was done using global variables, globs and the C<local()> operator -in creative ways. - -Some of these have survived into the current debugger; a few of the more -interesting and still-useful idioms are noted in this section, along with notes -on the comments themselves. - -=head2 Why not use more lexicals? - -Experienced Perl programmers will note that the debugger code tends to use -mostly package globals rather than lexically-scoped variables. This is done -to allow a significant amount of control of the debugger from outside the -debugger itself. - -Unfortunately, though the variables are accessible, they're not well -documented, so it's generally been a decision that hasn't made a lot of -difference to most users. Where appropriate, comments have been added to -make variables more accessible and usable, with the understanding that these -I<are> debugger internals, and are therefore subject to change. Future -development should probably attempt to replace the globals with a well-defined -API, but for now, the variables are what we've got. - -=head2 Automated variable stacking via C<local()> - -As you may recall from reading C<perlfunc>, the C<local()> operator makes a -temporary copy of a variable in the current scope. When the scope ends, the -old copy is restored. This is often used in the debugger to handle the -automatic stacking of variables during recursive calls: - - sub foo { - local $some_global++; - - # Do some stuff, then ... - return; - } - -What happens is that on entry to the subroutine, C<$some_global> is localized, -then altered. When the subroutine returns, Perl automatically undoes the -localization, restoring the previous value. Voila, automatic stack management. - -The debugger uses this trick a I<lot>. Of particular note is C<DB::eval>, -which lets the debugger get control inside of C<eval>'ed code. The debugger -localizes a saved copy of C<$@> inside the subroutine, which allows it to -keep C<$@> safe until it C<DB::eval> returns, at which point the previous -value of C<$@> is restored. This makes it simple (well, I<simpler>) to keep -track of C<$@> inside C<eval>s which C<eval> other C<eval's>. - -In any case, watch for this pattern. It occurs fairly often. - -=head2 The C<^> trick - -This is used to cleverly reverse the sense of a logical test depending on -the value of an auxiliary variable. For instance, the debugger's C<S> -(search for subroutines by pattern) allows you to negate the pattern -like this: - - # Find all non-'foo' subs: - S !/foo/ - -Boolean algebra states that the truth table for XOR looks like this: - -=over 4 - -=item * 0 ^ 0 = 0 - -(! not present and no match) --> false, don't print - -=item * 0 ^ 1 = 1 - -(! not present and matches) --> true, print - -=item * 1 ^ 0 = 1 - -(! present and no match) --> true, print - -=item * 1 ^ 1 = 0 - -(! present and matches) --> false, don't print - -=back - -As you can see, the first pair applies when C<!> isn't supplied, and -the second pair applies when it is. The XOR simply allows us to -compact a more complicated if-then-elseif-else into a more elegant -(but perhaps overly clever) single test. After all, it needed this -explanation... - -=head2 FLAGS, FLAGS, FLAGS - -There is a certain C programming legacy in the debugger. Some variables, -such as C<$single>, C<$trace>, and C<$frame>, have I<magical> values composed -of 1, 2, 4, etc. (powers of 2) OR'ed together. This allows several pieces -of state to be stored independently in a single scalar. - -A test like - - if ($scalar & 4) ... - -is checking to see if the appropriate bit is on. Since each bit can be -"addressed" independently in this way, C<$scalar> is acting sort of like -an array of bits. Obviously, since the contents of C<$scalar> are just a -bit-pattern, we can save and restore it easily (it will just look like -a number). - -The problem, is of course, that this tends to leave magic numbers scattered -all over your program whenever a bit is set, cleared, or checked. So why do -it? - -=over 4 - -=item * - -First, doing an arithmetical or bitwise operation on a scalar is -just about the fastest thing you can do in Perl: C<use constant> actually -creates a subroutine call, and array and hash lookups are much slower. Is -this over-optimization at the expense of readability? Possibly, but the -debugger accesses these variables a I<lot>. Any rewrite of the code will -probably have to benchmark alternate implementations and see which is the -best balance of readability and speed, and then document how it actually -works. - -=item * - -Second, it's very easy to serialize a scalar number. This is done in -the restart code; the debugger state variables are saved in C<%ENV> and then -restored when the debugger is restarted. Having them be just numbers makes -this trivial. - -=item * - -Third, some of these variables are being shared with the Perl core -smack in the middle of the interpreter's execution loop. It's much faster for -a C program (like the interpreter) to check a bit in a scalar than to access -several different variables (or a Perl array). - -=back - -=head2 What are those C<XXX> comments for? - -Any comment containing C<XXX> means that the comment is either somewhat -speculative - it's not exactly clear what a given variable or chunk of -code is doing, or that it is incomplete - the basics may be clear, but the -subtleties are not completely documented. - -Send in a patch if you can clear up, fill out, or clarify an C<XXX>. - -=head1 DATA STRUCTURES MAINTAINED BY CORE - -There are a number of special data structures provided to the debugger by -the Perl interpreter. - -The array C<@{$main::{'_<'.$filename}}> (aliased locally to C<@dbline> via glob -assignment) contains the text from C<$filename>, with each element -corresponding to a single line of C<$filename>. - -The hash C<%{'_<'.$filename}> (aliased locally to C<%dbline> via glob -assignment) contains breakpoints and actions. The keys are line numbers; -you can set individual values, but not the whole hash. The Perl interpreter -uses this hash to determine where breakpoints have been set. Any true value is -considered to be a breakpoint; C<perl5db.pl> uses C<$break_condition\0$action>. -Values are magical in numeric context: 1 if the line is breakable, 0 if not. - -The scalar C<${"_<$filename"}> simply contains the string C<_<$filename>. -This is also the case for evaluated strings that contain subroutines, or -which are currently being executed. The $filename for C<eval>ed strings looks -like C<(eval 34)> or C<(re_eval 19)>. - -=head1 DEBUGGER STARTUP - -When C<perl5db.pl> starts, it reads an rcfile (C<perl5db.ini> for -non-interactive sessions, C<.perldb> for interactive ones) that can set a number -of options. In addition, this file may define a subroutine C<&afterinit> -that will be executed (in the debugger's context) after the debugger has -initialized itself. - -Next, it checks the C<PERLDB_OPTS> environment variable and treats its -contents as the argument of a C<o> command in the debugger. - -=head2 STARTUP-ONLY OPTIONS - -The following options can only be specified at startup. -To set them in your rcfile, add a call to -C<&parse_options("optionName=new_value")>. - -=over 4 - -=item * TTY - -the TTY to use for debugging i/o. - -=item * noTTY - -if set, goes in NonStop mode. On interrupt, if TTY is not set, -uses the value of noTTY or F<$HOME/.perldbtty$$> to find TTY using -Term::Rendezvous. Current variant is to have the name of TTY in this -file. - -=item * ReadLine - -If false, a dummy ReadLine is used, so you can debug -ReadLine applications. - -=item * NonStop - -if true, no i/o is performed until interrupt. - -=item * LineInfo - -file or pipe to print line number info to. If it is a -pipe, a short "emacs like" message is used. - -=item * RemotePort - -host:port to connect to on remote host for remote debugging. - -=back - -=head3 SAMPLE RCFILE - - &parse_options("NonStop=1 LineInfo=db.out"); - sub afterinit { $trace = 1; } - -The script will run without human intervention, putting trace -information into C<db.out>. (If you interrupt it, you had better -reset C<LineInfo> to something I<interactive>!) - -=head1 INTERNALS DESCRIPTION - -=head2 DEBUGGER INTERFACE VARIABLES - -Perl supplies the values for C<%sub>. It effectively inserts -a C<&DB::DB();> in front of each place that can have a -breakpoint. At each subroutine call, it calls C<&DB::sub> with -C<$DB::sub> set to the called subroutine. It also inserts a C<BEGIN -{require 'perl5db.pl'}> before the first line. - -After each C<require>d file is compiled, but before it is executed, a -call to C<&DB::postponed($main::{'_<'.$filename})> is done. C<$filename> -is the expanded name of the C<require>d file (as found via C<%INC>). - -=head3 IMPORTANT INTERNAL VARIABLES - -=head4 C<$CreateTTY> - -Used to control when the debugger will attempt to acquire another TTY to be -used for input. - -=over - -=item * 1 - on C<fork()> - -=item * 2 - debugger is started inside debugger - -=item * 4 - on startup - -=back - -=head4 C<$doret> - -The value -2 indicates that no return value should be printed. -Any other positive value causes C<DB::sub> to print return values. - -=head4 C<$evalarg> - -The item to be eval'ed by C<DB::eval>. Used to prevent messing with the current -contents of C<@_> when C<DB::eval> is called. - -=head4 C<$frame> - -Determines what messages (if any) will get printed when a subroutine (or eval) -is entered or exited. - -=over 4 - -=item * 0 - No enter/exit messages - -=item * 1 - Print I<entering> messages on subroutine entry - -=item * 2 - Adds exit messages on subroutine exit. If no other flag is on, acts like 1+2. - -=item * 4 - Extended messages: C<< <in|out> I<context>=I<fully-qualified sub name> from I<file>:I<line> >>. If no other flag is on, acts like 1+4. - -=item * 8 - Adds parameter information to messages, and overloaded stringify and tied FETCH is enabled on the printed arguments. Ignored if C<4> is not on. - -=item * 16 - Adds C<I<context> return from I<subname>: I<value>> messages on subroutine/eval exit. Ignored if C<4> is is not on. - -=back - -To get everything, use C<$frame=30> (or C<o f=30> as a debugger command). -The debugger internally juggles the value of C<$frame> during execution to -protect external modules that the debugger uses from getting traced. - -=head4 C<$level> - -Tracks current debugger nesting level. Used to figure out how many -C<E<lt>E<gt>> pairs to surround the line number with when the debugger -outputs a prompt. Also used to help determine if the program has finished -during command parsing. - -=head4 C<$onetimeDump> - -Controls what (if anything) C<DB::eval()> will print after evaluating an -expression. - -=over 4 - -=item * C<undef> - don't print anything - -=item * C<dump> - use C<dumpvar.pl> to display the value returned - -=item * C<methods> - print the methods callable on the first item returned - -=back - -=head4 C<$onetimeDumpDepth> - -Controls how far down C<dumpvar.pl> will go before printing C<...> while -dumping a structure. Numeric. If C<undef>, print all levels. - -=head4 C<$signal> - -Used to track whether or not an C<INT> signal has been detected. C<DB::DB()>, -which is called before every statement, checks this and puts the user into -command mode if it finds C<$signal> set to a true value. - -=head4 C<$single> - -Controls behavior during single-stepping. Stacked in C<@stack> on entry to -each subroutine; popped again at the end of each subroutine. - -=over 4 - -=item * 0 - run continuously. - -=item * 1 - single-step, go into subs. The C<s> command. - -=item * 2 - single-step, don't go into subs. The C<n> command. - -=item * 4 - print current sub depth (turned on to force this when C<too much -recursion> occurs. - -=back - -=head4 C<$trace> - -Controls the output of trace information. - -=over 4 - -=item * 1 - The C<t> command was entered to turn on tracing (every line executed is printed) - -=item * 2 - watch expressions are active - -=item * 4 - user defined a C<watchfunction()> in C<afterinit()> - -=back - -=head4 C<$slave_editor> - -1 if C<LINEINFO> was directed to a pipe; 0 otherwise. - -=head4 C<@cmdfhs> - -Stack of filehandles that C<DB::readline()> will read commands from. -Manipulated by the debugger's C<source> command and C<DB::readline()> itself. - -=head4 C<@dbline> - -Local alias to the magical line array, C<@{$main::{'_<'.$filename}}> , -supplied by the Perl interpreter to the debugger. Contains the source. - -=head4 C<@old_watch> - -Previous values of watch expressions. First set when the expression is -entered; reset whenever the watch expression changes. - -=head4 C<@saved> - -Saves important globals (C<$@>, C<$!>, C<$^E>, C<$,>, C<$/>, C<$\>, C<$^W>) -so that the debugger can substitute safe values while it's running, and -restore them when it returns control. - -=head4 C<@stack> - -Saves the current value of C<$single> on entry to a subroutine. -Manipulated by the C<c> command to turn off tracing in all subs above the -current one. - -=head4 C<@to_watch> - -The 'watch' expressions: to be evaluated before each line is executed. - -=head4 C<@typeahead> - -The typeahead buffer, used by C<DB::readline>. - -=head4 C<%alias> - -Command aliases. Stored as character strings to be substituted for a command -entered. - -=head4 C<%break_on_load> - -Keys are file names, values are 1 (break when this file is loaded) or undef -(don't break when it is loaded). - -=head4 C<%dbline> - -Keys are line numbers, values are C<condition\0action>. If used in numeric -context, values are 0 if not breakable, 1 if breakable, no matter what is -in the actual hash entry. - -=head4 C<%had_breakpoints> - -Keys are file names; values are bitfields: - -=over 4 - -=item * 1 - file has a breakpoint in it. - -=item * 2 - file has an action in it. - -=back - -A zero or undefined value means this file has neither. - -=head4 C<%option> - -Stores the debugger options. These are character string values. - -=head4 C<%postponed> - -Saves breakpoints for code that hasn't been compiled yet. -Keys are subroutine names, values are: - -=over 4 - -=item * C<compile> - break when this sub is compiled - -=item * C<< break +0 if <condition> >> - break (conditionally) at the start of this routine. The condition will be '1' if no condition was specified. - -=back - -=head4 C<%postponed_file> - -This hash keeps track of breakpoints that need to be set for files that have -not yet been compiled. Keys are filenames; values are references to hashes. -Each of these hashes is keyed by line number, and its values are breakpoint -definitions (C<condition\0action>). - -=head1 DEBUGGER INITIALIZATION - -The debugger's initialization actually jumps all over the place inside this -package. This is because there are several BEGIN blocks (which of course -execute immediately) spread through the code. Why is that? - -The debugger needs to be able to change some things and set some things up -before the debugger code is compiled; most notably, the C<$deep> variable that -C<DB::sub> uses to tell when a program has recursed deeply. In addition, the -debugger has to turn off warnings while the debugger code is compiled, but then -restore them to their original setting before the program being debugged begins -executing. - -The first C<BEGIN> block simply turns off warnings by saving the current -setting of C<$^W> and then setting it to zero. The second one initializes -the debugger variables that are needed before the debugger begins executing. -The third one puts C<$^X> back to its former value. - -We'll detail the second C<BEGIN> block later; just remember that if you need -to initialize something before the debugger starts really executing, that's -where it has to go. - -=cut - -package DB; - -use IO::Handle; - -# Debugger for Perl 5.00x; perl5db.pl patch level: -$VERSION = 1.28; - -$header = "perl5db.pl version $VERSION"; - -=head1 DEBUGGER ROUTINES - -=head2 C<DB::eval()> - -This function replaces straight C<eval()> inside the debugger; it simplifies -the process of evaluating code in the user's context. - -The code to be evaluated is passed via the package global variable -C<$DB::evalarg>; this is done to avoid fiddling with the contents of C<@_>. - -Before we do the C<eval()>, we preserve the current settings of C<$trace>, -C<$single>, C<$^D> and C<$usercontext>. The latter contains the -preserved values of C<$@>, C<$!>, C<$^E>, C<$,>, C<$/>, C<$\>, C<$^W> and the -user's current package, grabbed when C<DB::DB> got control. This causes the -proper context to be used when the eval is actually done. Afterward, we -restore C<$trace>, C<$single>, and C<$^D>. - -Next we need to handle C<$@> without getting confused. We save C<$@> in a -local lexical, localize C<$saved[0]> (which is where C<save()> will put -C<$@>), and then call C<save()> to capture C<$@>, C<$!>, C<$^E>, C<$,>, -C<$/>, C<$\>, and C<$^W>) and set C<$,>, C<$/>, C<$\>, and C<$^W> to values -considered sane by the debugger. If there was an C<eval()> error, we print -it on the debugger's output. If C<$onetimedump> is defined, we call -C<dumpit> if it's set to 'dump', or C<methods> if it's set to -'methods'. Setting it to something else causes the debugger to do the eval -but not print the result - handy if you want to do something else with it -(the "watch expressions" code does this to get the value of the watch -expression but not show it unless it matters). - -In any case, we then return the list of output from C<eval> to the caller, -and unwinding restores the former version of C<$@> in C<@saved> as well -(the localization of C<$saved[0]> goes away at the end of this scope). - -=head3 Parameters and variables influencing execution of DB::eval() - -C<DB::eval> isn't parameterized in the standard way; this is to keep the -debugger's calls to C<DB::eval()> from mucking with C<@_>, among other things. -The variables listed below influence C<DB::eval()>'s execution directly. - -=over 4 - -=item C<$evalarg> - the thing to actually be eval'ed - -=item C<$trace> - Current state of execution tracing - -=item C<$single> - Current state of single-stepping - -=item C<$onetimeDump> - what is to be displayed after the evaluation - -=item C<$onetimeDumpDepth> - how deep C<dumpit()> should go when dumping results - -=back - -The following variables are altered by C<DB::eval()> during its execution. They -are "stacked" via C<local()>, enabling recursive calls to C<DB::eval()>. - -=over 4 - -=item C<@res> - used to capture output from actual C<eval>. - -=item C<$otrace> - saved value of C<$trace>. - -=item C<$osingle> - saved value of C<$single>. - -=item C<$od> - saved value of C<$^D>. - -=item C<$saved[0]> - saved value of C<$@>. - -=item $\ - for output of C<$@> if there is an evaluation error. - -=back - -=head3 The problem of lexicals - -The context of C<DB::eval()> presents us with some problems. Obviously, -we want to be 'sandboxed' away from the debugger's internals when we do -the eval, but we need some way to control how punctuation variables and -debugger globals are used. - -We can't use local, because the code inside C<DB::eval> can see localized -variables; and we can't use C<my> either for the same reason. The code -in this routine compromises and uses C<my>. - After this routine is over, we don't have user code executing in the debugger's context, so we can use C<my> freely. @@ -700,235 +121,6 @@ sub eval { # were originally written, and explaining them away from the code # in question seems conterproductive.. -JM) -######################################################################## -# Changes: 0.94 -# + A lot of things changed after 0.94. First of all, core now informs -# debugger about entry into XSUBs, overloaded operators, tied operations, -# BEGIN and END. Handy with `O f=2'. -# + This can make debugger a little bit too verbose, please be patient -# and report your problems promptly. -# + Now the option frame has 3 values: 0,1,2. XXX Document! -# + Note that if DESTROY returns a reference to the object (or object), -# the deletion of data may be postponed until the next function call, -# due to the need to examine the return value. -# -# Changes: 0.95 -# + `v' command shows versions. -# -# Changes: 0.96 -# + `v' command shows version of readline. -# primitive completion works (dynamic variables, subs for `b' and `l', -# options). Can `p %var' -# + Better help (`h <' now works). New commands <<, >>, {, {{. -# {dump|print}_trace() coded (to be able to do it from <<cmd). -# + `c sub' documented. -# + At last enough magic combined to stop after the end of debuggee. -# + !! should work now (thanks to Emacs bracket matching an extra -# `]' in a regexp is caught). -# + `L', `D' and `A' span files now (as documented). -# + Breakpoints in `require'd code are possible (used in `R'). -# + Some additional words on internal work of debugger. -# + `b load filename' implemented. -# + `b postpone subr' implemented. -# + now only `q' exits debugger (overwritable on $inhibit_exit). -# + When restarting debugger breakpoints/actions persist. -# + Buglet: When restarting debugger only one breakpoint/action per -# autoloaded function persists. -# -# Changes: 0.97: NonStop will not stop in at_exit(). -# + Option AutoTrace implemented. -# + Trace printed differently if frames are printed too. -# + new `inhibitExit' option. -# + printing of a very long statement interruptible. -# Changes: 0.98: New command `m' for printing possible methods -# + 'l -' is a synonym for `-'. -# + Cosmetic bugs in printing stack trace. -# + `frame' & 8 to print "expanded args" in stack trace. -# + Can list/break in imported subs. -# + new `maxTraceLen' option. -# + frame & 4 and frame & 8 granted. -# + new command `m' -# + nonstoppable lines do not have `:' near the line number. -# + `b compile subname' implemented. -# + Will not use $` any more. -# + `-' behaves sane now. -# Changes: 0.99: Completion for `f', `m'. -# + `m' will remove duplicate names instead of duplicate functions. -# + `b load' strips trailing whitespace. -# completion ignores leading `|'; takes into account current package -# when completing a subroutine name (same for `l'). -# Changes: 1.07: Many fixed by tchrist 13-March-2000 -# BUG FIXES: -# + Added bare minimal security checks on perldb rc files, plus -# comments on what else is needed. -# + Fixed the ornaments that made "|h" completely unusable. -# They are not used in print_help if they will hurt. Strip pod -# if we're paging to less. -# + Fixed mis-formatting of help messages caused by ornaments -# to restore Larry's original formatting. -# + Fixed many other formatting errors. The code is still suboptimal, -# and needs a lot of work at restructuring. It's also misindented -# in many places. -# + Fixed bug where trying to look at an option like your pager -# shows "1". -# + Fixed some $? processing. Note: if you use csh or tcsh, you will -# lose. You should consider shell escapes not using their shell, -# or else not caring about detailed status. This should really be -# unified into one place, too. -# + Fixed bug where invisible trailing whitespace on commands hoses you, -# tricking Perl into thinking you weren't calling a debugger command! -# + Fixed bug where leading whitespace on commands hoses you. (One -# suggests a leading semicolon or any other irrelevant non-whitespace -# to indicate literal Perl code.) -# + Fixed bugs that ate warnings due to wrong selected handle. -# + Fixed a precedence bug on signal stuff. -# + Fixed some unseemly wording. -# + Fixed bug in help command trying to call perl method code. -# + Fixed to call dumpvar from exception handler. SIGPIPE killed us. -# ENHANCEMENTS: -# + Added some comments. This code is still nasty spaghetti. -# + Added message if you clear your pre/post command stacks which was -# very easy to do if you just typed a bare >, <, or {. (A command -# without an argument should *never* be a destructive action; this -# API is fundamentally screwed up; likewise option setting, which -# is equally buggered.) -# + Added command stack dump on argument of "?" for >, <, or {. -# + Added a semi-built-in doc viewer command that calls man with the -# proper %Config::Config path (and thus gets caching, man -k, etc), -# or else perldoc on obstreperous platforms. -# + Added to and rearranged the help information. -# + Detected apparent misuse of { ... } to declare a block; this used -# to work but now is a command, and mysteriously gave no complaint. -# -# Changes: 1.08: Apr 25, 2001 Jon Eveland <jweveland@yahoo.com> -# BUG FIX: -# + This patch to perl5db.pl cleans up formatting issues on the help -# summary (h h) screen in the debugger. Mostly columnar alignment -# issues, plus converted the printed text to use all spaces, since -# tabs don't seem to help much here. -# -# Changes: 1.09: May 19, 2001 Ilya Zakharevich <ilya@math.ohio-state.edu> -# Minor bugs corrected; -# + Support for auto-creation of new TTY window on startup, either -# unconditionally, or if started as a kid of another debugger session; -# + New `O'ption CreateTTY -# I<CreateTTY> bits control attempts to create a new TTY on events: -# 1: on fork() -# 2: debugger is started inside debugger -# 4: on startup -# + Code to auto-create a new TTY window on OS/2 (currently one -# extra window per session - need named pipes to have more...); -# + Simplified interface for custom createTTY functions (with a backward -# compatibility hack); now returns the TTY name to use; return of '' -# means that the function reset the I/O handles itself; -# + Better message on the semantic of custom createTTY function; -# + Convert the existing code to create a TTY into a custom createTTY -# function; -# + Consistent support for TTY names of the form "TTYin,TTYout"; -# + Switch line-tracing output too to the created TTY window; -# + make `b fork' DWIM with CORE::GLOBAL::fork; -# + High-level debugger API cmd_*(): -# cmd_b_load($filenamepart) # b load filenamepart -# cmd_b_line($lineno [, $cond]) # b lineno [cond] -# cmd_b_sub($sub [, $cond]) # b sub [cond] -# cmd_stop() # Control-C -# cmd_d($lineno) # d lineno (B) -# The cmd_*() API returns FALSE on failure; in this case it outputs -# the error message to the debugging output. -# + Low-level debugger API -# break_on_load($filename) # b load filename -# @files = report_break_on_load() # List files with load-breakpoints -# breakable_line_in_filename($name, $from [, $to]) -# # First breakable line in the -# # range $from .. $to. $to defaults -# # to $from, and may be less than -# # $to -# breakable_line($from [, $to]) # Same for the current file -# break_on_filename_line($name, $lineno [, $cond]) -# # Set breakpoint,$cond defaults to -# # 1 -# break_on_filename_line_range($name, $from, $to [, $cond]) -# # As above, on the first -# # breakable line in range -# break_on_line($lineno [, $cond]) # As above, in the current file -# break_subroutine($sub [, $cond]) # break on the first breakable line -# ($name, $from, $to) = subroutine_filename_lines($sub) -# # The range of lines of the text -# The low-level API returns TRUE on success, and die()s on failure. -# -# Changes: 1.10: May 23, 2001 Daniel Lewart <d-lewart@uiuc.edu> -# BUG FIXES: -# + Fixed warnings generated by "perl -dWe 42" -# + Corrected spelling errors -# + Squeezed Help (h) output into 80 columns -# -# Changes: 1.11: May 24, 2001 David Dyck <dcd@tc.fluke.com> -# + Made "x @INC" work like it used to -# -# Changes: 1.12: May 24, 2001 Daniel Lewart <d-lewart@uiuc.edu> -# + Fixed warnings generated by "O" (Show debugger options) -# + Fixed warnings generated by "p 42" (Print expression) -# Changes: 1.13: Jun 19, 2001 Scott.L.Miller@compaq.com -# + Added windowSize option -# Changes: 1.14: Oct 9, 2001 multiple -# + Clean up after itself on VMS (Charles Lane in 12385) -# + Adding "@ file" syntax (Peter Scott in 12014) -# + Debug reloading selfloaded stuff (Ilya Zakharevich in 11457) -# + $^S and other debugger fixes (Ilya Zakharevich in 11120) -# + Forgot a my() declaration (Ilya Zakharevich in 11085) -# Changes: 1.15: Nov 6, 2001 Michael G Schwern <schwern@pobox.com> -# + Updated 1.14 change log -# + Added *dbline explainatory comments -# + Mentioning perldebguts man page -# Changes: 1.16: Feb 15, 2002 Mark-Jason Dominus <mjd@plover.com> -# + $onetimeDump improvements -# Changes: 1.17: Feb 20, 2002 Richard Foley <richard.foley@rfi.net> -# Moved some code to cmd_[.]()'s for clarity and ease of handling, -# rationalised the following commands and added cmd_wrapper() to -# enable switching between old and frighteningly consistent new -# behaviours for diehards: 'o CommandSet=pre580' (sigh...) -# a(add), A(del) # action expr (added del by line) -# + b(add), B(del) # break [line] (was b,D) -# + w(add), W(del) # watch expr (was W,W) -# # added del by expr -# + h(summary), h h(long) # help (hh) (was h h,h) -# + m(methods), M(modules) # ... (was m,v) -# + o(option) # lc (was O) -# + v(view code), V(view Variables) # ... (was w,V) -# Changes: 1.18: Mar 17, 2002 Richard Foley <richard.foley@rfi.net> -# + fixed missing cmd_O bug -# Changes: 1.19: Mar 29, 2002 Spider Boardman -# + Added missing local()s -- DB::DB is called recursively. -# Changes: 1.20: Feb 17, 2003 Richard Foley <richard.foley@rfi.net> -# + pre'n'post commands no longer trashed with no args -# + watch val joined out of eval() -# Changes: 1.21: Jun 04, 2003 Joe McMahon <mcmahon@ibiblio.org> -# + Added comments and reformatted source. No bug fixes/enhancements. -# + Includes cleanup by Robin Barker and Jarkko Hietaniemi. -# Changes: 1.22 Jun 09, 2003 Alex Vandiver <alexmv@MIT.EDU> -# + Flush stdout/stderr before the debugger prompt is printed. -# Changes: 1.23: Dec 21, 2003 Dominique Quatravaux -# + Fix a side-effect of bug #24674 in the perl debugger ("odd taint bug") -# Changes: 1.24: Mar 03, 2004 Richard Foley <richard.foley@rfi.net> -# + Added command to save all debugger commands for sourcing later. -# + Added command to display parent inheritance tree of given class. -# + Fixed minor newline in history bug. -# Changes: 1.25: Apr 17, 2004 Richard Foley <richard.foley@rfi.net> -# + Fixed option bug (setting invalid options + not recognising valid short forms) -# Changes: 1.26: Apr 22, 2004 Richard Foley <richard.foley@rfi.net> -# + unfork the 5.8.x and 5.9.x debuggers. -# + whitespace and assertions call cleanup across versions -# + H * deletes (resets) history -# + i now handles Class + blessed objects -# Changes: 1.27: May 09, 2004 Richard Foley <richard.foley@rfi.net> -# + updated pod page references - clunky. -# + removed windowid restriction for forking into an xterm. -# + more whitespace again. -# + wrapped restart and enabled rerun [-n] (go back n steps) command. -# Changes: 1.28: Oct 12, 2004 Richard Foley <richard.foley@rfi.net> -# + Added threads support (inc. e and E commands) -#################################################################### - =head1 DEBUGGER INITIALIZATION The debugger starts up in phases. @@ -1803,7626 +995,4 @@ if ( defined &afterinit ) { # May be defined in $rcfile # Inform us about "Stack dump during die enabled ..." in dieLevel(). $I_m_init = 1; -############################################################ Subroutines - -=head1 SUBROUTINES - -=head2 DB - -This gigantic subroutine is the heart of the debugger. Called before every -statement, its job is to determine if a breakpoint has been reached, and -stop if so; read commands from the user, parse them, and execute -them, and hen send execution off to the next statement. - -Note that the order in which the commands are processed is very important; -some commands earlier in the loop will actually alter the C<$cmd> variable -to create other commands to be executed later. This is all highly I<optimized> -but can be confusing. Check the comments for each C<$cmd ... && do {}> to -see what's happening in any given command. - -=cut - -sub DB { - - # lock the debugger and get the thread id for the prompt - lock($DBGR); - my $tid; - if ($ENV{PERL5DB_THREADED}) { - $tid = eval { "[".threads->self->tid."]" }; - } - - # Check for whether we should be running continuously or not. - # _After_ the perl program is compiled, $single is set to 1: - if ( $single and not $second_time++ ) { - - # Options say run non-stop. Run until we get an interrupt. - if ($runnonstop) { # Disable until signal - # If there's any call stack in place, turn off single - # stepping into subs throughout the stack. - for ( $i = 0 ; $i <= $stack_depth ; ) { - $stack[ $i++ ] &= ~1; - } - - # And we are now no longer in single-step mode. - $single = 0; - - # If we simply returned at this point, we wouldn't get - # the trace info. Fall on through. - # return; - } ## end if ($runnonstop) - - elsif ($ImmediateStop) { - - # We are supposed to stop here; XXX probably a break. - $ImmediateStop = 0; # We've processed it; turn it off - $signal = 1; # Simulate an interrupt to force - # us into the command loop - } - } ## end if ($single and not $second_time... - - # If we're in single-step mode, or an interrupt (real or fake) - # has occurred, turn off non-stop mode. - $runnonstop = 0 if $single or $signal; - - # Preserve current values of $@, $!, $^E, $,, $/, $\, $^W. - # The code being debugged may have altered them. - &save; - - # Since DB::DB gets called after every line, we can use caller() to - # figure out where we last were executing. Sneaky, eh? This works because - # caller is returning all the extra information when called from the - # debugger. - local ( $package, $filename, $line ) = caller; - local $filename_ini = $filename; - - # set up the context for DB::eval, so it can properly execute - # code on behalf of the user. We add the package in so that the - # code is eval'ed in the proper package (not in the debugger!). - local $usercontext = - '($@, $!, $^E, $,, $/, $\, $^W) = @saved;' . "package $package;"; - - # Create an alias to the active file magical array to simplify - # the code here. - local (*dbline) = $main::{ '_<' . $filename }; - - # we need to check for pseudofiles on Mac OS (these are files - # not attached to a filename, but instead stored in Dev:Pseudo) - if ( $^O eq 'MacOS' && $#dbline < 0 ) { - $filename_ini = $filename = 'Dev:Pseudo'; - *dbline = $main::{ '_<' . $filename }; - } - - # Last line in the program. - local $max = $#dbline; - - # if we have something here, see if we should break. - if ( $dbline{$line} - && ( ( $stop, $action ) = split( /\0/, $dbline{$line} ) ) ) - { - - # Stop if the stop criterion says to just stop. - if ( $stop eq '1' ) { - $signal |= 1; - } - - # It's a conditional stop; eval it in the user's context and - # see if we should stop. If so, remove the one-time sigil. - elsif ($stop) { - $evalarg = "\$DB::signal |= 1 if do {$stop}"; - &eval; - $dbline{$line} =~ s/;9($|\0)/$1/; - } - } ## end if ($dbline{$line} && ... - - # Preserve the current stop-or-not, and see if any of the W - # (watch expressions) has changed. - my $was_signal = $signal; - - # If we have any watch expressions ... - if ( $trace & 2 ) { - for ( my $n = 0 ; $n <= $#to_watch ; $n++ ) { - $evalarg = $to_watch[$n]; - local $onetimeDump; # Tell DB::eval() to not output results - - # Fix context DB::eval() wants to return an array, but - # we need a scalar here. - my ($val) = join( "', '", &eval ); - $val = ( ( defined $val ) ? "'$val'" : 'undef' ); - - # Did it change? - if ( $val ne $old_watch[$n] ) { - - # Yep! Show the difference, and fake an interrupt. - $signal = 1; - print $OUT <<EOP; -Watchpoint $n:\t$to_watch[$n] changed: - old value:\t$old_watch[$n] - new value:\t$val -EOP - $old_watch[$n] = $val; - } ## end if ($val ne $old_watch... - } ## end for (my $n = 0 ; $n <= ... - } ## end if ($trace & 2) - -=head2 C<watchfunction()> - -C<watchfunction()> is a function that can be defined by the user; it is a -function which will be run on each entry to C<DB::DB>; it gets the -current package, filename, and line as its parameters. - -The watchfunction can do anything it likes; it is executing in the -debugger's context, so it has access to all of the debugger's internal -data structures and functions. - -C<watchfunction()> can control the debugger's actions. Any of the following -will cause the debugger to return control to the user's program after -C<watchfunction()> executes: - -=over 4 - -=item * - -Returning a false value from the C<watchfunction()> itself. - -=item * - -Altering C<$single> to a false value. - -=item * - -Altering C<$signal> to a false value. - -=item * - -Turning off the C<4> bit in C<$trace> (this also disables the -check for C<watchfunction()>. This can be done with - - $trace &= ~4; - -=back - -=cut - - # If there's a user-defined DB::watchfunction, call it with the - # current package, filename, and line. The function executes in - # the DB:: package. - if ( $trace & 4 ) { # User-installed watch - return - if watchfunction( $package, $filename, $line ) - and not $single - and not $was_signal - and not( $trace & ~4 ); - } ## end if ($trace & 4) - - # Pick up any alteration to $signal in the watchfunction, and - # turn off the signal now. - $was_signal = $signal; - $signal = 0; - -=head2 GETTING READY TO EXECUTE COMMANDS - -The debugger decides to take control if single-step mode is on, the -C<t> command was entered, or the user generated a signal. If the program -has fallen off the end, we set things up so that entering further commands -won't cause trouble, and we say that the program is over. - -=cut - - # Check to see if we should grab control ($single true, - # trace set appropriately, or we got a signal). - if ( $single || ( $trace & 1 ) || $was_signal ) { - - # Yes, grab control. - if ($slave_editor) { - - # Tell the editor to update its position. - $position = "\032\032$filename:$line:0\n"; - print_lineinfo($position); - } - -=pod - -Special check: if we're in package C<DB::fake>, we've gone through the -C<END> block at least once. We set up everything so that we can continue -to enter commands and have a valid context to be in. - -=cut - - elsif ( $package eq 'DB::fake' ) { - - # Fallen off the end already. - $term || &setterm; - print_help(<<EOP); -Debugged program terminated. Use B<q> to quit or B<R> to restart, - use B<o> I<inhibit_exit> to avoid stopping after program termination, - B<h q>, B<h R> or B<h o> to get additional info. -EOP - - # Set the DB::eval context appropriately. - $package = 'main'; - $usercontext = - '($@, $!, $^E, $,, $/, $\, $^W) = @saved;' - . "package $package;"; # this won't let them modify, alas - } ## end elsif ($package eq 'DB::fake') - -=pod - -If the program hasn't finished executing, we scan forward to the -next executable line, print that out, build the prompt from the file and line -number information, and print that. - -=cut - - else { - - # Still somewhere in the midst of execution. Set up the - # debugger prompt. - $sub =~ s/\'/::/; # Swap Perl 4 package separators (') to - # Perl 5 ones (sorry, we don't print Klingon - #module names) - - $prefix = $sub =~ /::/ ? "" : "${'package'}::"; - $prefix .= "$sub($filename:"; - $after = ( $dbline[$line] =~ /\n$/ ? '' : "\n" ); - - # Break up the prompt if it's really long. - if ( length($prefix) > 30 ) { - $position = "$prefix$line):\n$line:\t$dbline[$line]$after"; - $prefix = ""; - $infix = ":\t"; - } - else { - $infix = "):\t"; - $position = "$prefix$line$infix$dbline[$line]$after"; - } - - # Print current line info, indenting if necessary. - if ($frame) { - print_lineinfo( ' ' x $stack_depth, - "$line:\t$dbline[$line]$after" ); - } - else { - print_lineinfo($position); - } - - # Scan forward, stopping at either the end or the next - # unbreakable line. - for ( $i = $line + 1 ; $i <= $max && $dbline[$i] == 0 ; ++$i ) - { #{ vi - - # Drop out on null statements, block closers, and comments. - last if $dbline[$i] =~ /^\s*[\;\}\#\n]/; - - # Drop out if the user interrupted us. - last if $signal; - - # Append a newline if the line doesn't have one. Can happen - # in eval'ed text, for instance. - $after = ( $dbline[$i] =~ /\n$/ ? '' : "\n" ); - - # Next executable line. - $incr_pos = "$prefix$i$infix$dbline[$i]$after"; - $position .= $incr_pos; - if ($frame) { - - # Print it indented if tracing is on. - print_lineinfo( ' ' x $stack_depth, - "$i:\t$dbline[$i]$after" ); - } - else { - print_lineinfo($incr_pos); - } - } ## end for ($i = $line + 1 ; $i... - } ## end else [ if ($slave_editor) - } ## end if ($single || ($trace... - -=pod - -If there's an action to be executed for the line we stopped at, execute it. -If there are any preprompt actions, execute those as well. - -=cut - - # If there's an action, do it now. - $evalarg = $action, &eval if $action; - - # Are we nested another level (e.g., did we evaluate a function - # that had a breakpoint in it at the debugger prompt)? - if ( $single || $was_signal ) { - - # Yes, go down a level. - local $level = $level + 1; - - # Do any pre-prompt actions. - foreach $evalarg (@$pre) { - &eval; - } - - # Complain about too much recursion if we passed the limit. - print $OUT $stack_depth . " levels deep in subroutine calls!\n" - if $single & 4; - - # The line we're currently on. Set $incr to -1 to stay here - # until we get a command that tells us to advance. - $start = $line; - $incr = -1; # for backward motion. - - # Tack preprompt debugger actions ahead of any actual input. - @typeahead = ( @$pretype, @typeahead ); - -=head2 WHERE ARE WE? - -XXX Relocate this section? - -The debugger normally shows the line corresponding to the current line of -execution. Sometimes, though, we want to see the next line, or to move elsewhere -in the file. This is done via the C<$incr>, C<$start>, and C<$max> variables. - -C<$incr> controls by how many lines the I<current> line should move forward -after a command is executed. If set to -1, this indicates that the I<current> -line shouldn't change. - -C<$start> is the I<current> line. It is used for things like knowing where to -move forwards or backwards from when doing an C<L> or C<-> command. - -C<$max> tells the debugger where the last line of the current file is. It's -used to terminate loops most often. - -=head2 THE COMMAND LOOP - -Most of C<DB::DB> is actually a command parsing and dispatch loop. It comes -in two parts: - -=over 4 - -=item * - -The outer part of the loop, starting at the C<CMD> label. This loop -reads a command and then executes it. - -=item * - -The inner part of the loop, starting at the C<PIPE> label. This part -is wholly contained inside the C<CMD> block and only executes a command. -Used to handle commands running inside a pager. - -=back - -So why have two labels to restart the loop? Because sometimes, it's easier to -have a command I<generate> another command and then re-execute the loop to do -the new command. This is faster, but perhaps a bit more convoluted. - -=cut - - # The big command dispatch loop. It keeps running until the - # user yields up control again. - # - # If we have a terminal for input, and we get something back - # from readline(), keep on processing. - CMD: - while ( - - # We have a terminal, or can get one ... - ( $term || &setterm ), - - # ... and it belogs to this PID or we get one for this PID ... - ( $term_pid == $$ or resetterm(1) ), - - # ... and we got a line of command input ... - defined( - $cmd = &readline( - "$pidprompt $tid DB" - . ( '<' x $level ) - . ( $#hist + 1 ) - . ( '>' x $level ) . " " - ) - ) - ) - { - - share($cmd); - # ... try to execute the input as debugger commands. - - # Don't stop running. - $single = 0; - - # No signal is active. - $signal = 0; - - # Handle continued commands (ending with \): - $cmd =~ s/\\$/\n/ && do { - $cmd .= &readline(" cont: "); - redo CMD; - }; - -=head4 The null command - -A newline entered by itself means I<re-execute the last command>. We grab the -command out of C<$laststep> (where it was recorded previously), and copy it -back into C<$cmd> to be executed below. If there wasn't any previous command, -we'll do nothing below (no command will match). If there was, we also save it -in the command history and fall through to allow the command parsing to pick -it up. - -=cut - - # Empty input means repeat the last command. - $cmd =~ /^$/ && ( $cmd = $laststep ); - chomp($cmd); # get rid of the annoying extra newline - push( @hist, $cmd ) if length($cmd) > 1; - push( @truehist, $cmd ); - share(@hist); - share(@truehist); - - # This is a restart point for commands that didn't arrive - # via direct user input. It allows us to 'redo PIPE' to - # re-execute command processing without reading a new command. - PIPE: { - $cmd =~ s/^\s+//s; # trim annoying leading whitespace - $cmd =~ s/\s+$//s; # trim annoying trailing whitespace - ($i) = split( /\s+/, $cmd ); - -=head3 COMMAND ALIASES - -The debugger can create aliases for commands (these are stored in the -C<%alias> hash). Before a command is executed, the command loop looks it up -in the alias hash and substitutes the contents of the alias for the command, -completely replacing it. - -=cut - - # See if there's an alias for the command, and set it up if so. - if ( $alias{$i} ) { - - # Squelch signal handling; we want to keep control here - # if something goes loco during the alias eval. - local $SIG{__DIE__}; - local $SIG{__WARN__}; - - # This is a command, so we eval it in the DEBUGGER's - # scope! Otherwise, we can't see the special debugger - # variables, or get to the debugger's subs. (Well, we - # _could_, but why make it even more complicated?) - eval "\$cmd =~ $alias{$i}"; - if ($@) { - local $\ = ''; - print $OUT "Couldn't evaluate `$i' alias: $@"; - next CMD; - } - } ## end if ($alias{$i}) - -=head3 MAIN-LINE COMMANDS - -All of these commands work up to and after the program being debugged has -terminated. - -=head4 C<q> - quit - -Quit the debugger. This entails setting the C<$fall_off_end> flag, so we don't -try to execute further, cleaning any restart-related stuff out of the -environment, and executing with the last value of C<$?>. - -=cut - - $cmd =~ /^q$/ && do { - $fall_off_end = 1; - clean_ENV(); - exit $?; - }; - -=head4 C<t> - trace - -Turn tracing on or off. Inverts the appropriate bit in C<$trace> (q.v.). - -=cut - - $cmd =~ /^t$/ && do { - $trace ^= 1; - local $\ = ''; - print $OUT "Trace = " - . ( ( $trace & 1 ) ? "on" : "off" ) . "\n"; - next CMD; - }; - -=head4 C<S> - list subroutines matching/not matching a pattern - -Walks through C<%sub>, checking to see whether or not to print the name. - -=cut - - $cmd =~ /^S(\s+(!)?(.+))?$/ && do { - - $Srev = defined $2; # Reverse scan? - $Spatt = $3; # The pattern (if any) to use. - $Snocheck = !defined $1; # No args - print all subs. - - # Need to make these sane here. - local $\ = ''; - local $, = ''; - - # Search through the debugger's magical hash of subs. - # If $nocheck is true, just print the sub name. - # Otherwise, check it against the pattern. We then use - # the XOR trick to reverse the condition as required. - foreach $subname ( sort( keys %sub ) ) { - if ( $Snocheck or $Srev ^ ( $subname =~ /$Spatt/ ) ) { - print $OUT $subname, "\n"; - } - } - next CMD; - }; - -=head4 C<X> - list variables in current package - -Since the C<V> command actually processes this, just change this to the -appropriate C<V> command and fall through. - -=cut - - $cmd =~ s/^X\b/V $package/; - -=head4 C<V> - list variables - -Uses C<dumpvar.pl> to dump out the current values for selected variables. - -=cut - - # Bare V commands get the currently-being-debugged package - # added. - $cmd =~ /^V$/ && do { - $cmd = "V $package"; - }; - - # V - show variables in package. - $cmd =~ /^V\b\s*(\S+)\s*(.*)/ && do { - - # Save the currently selected filehandle and - # force output to debugger's filehandle (dumpvar - # just does "print" for output). - local ($savout) = select($OUT); - - # Grab package name and variables to dump. - $packname = $1; - @vars = split( ' ', $2 ); - - # If main::dumpvar isn't here, get it. - do 'dumpvar.pl' unless defined &main::dumpvar; - if ( defined &main::dumpvar ) { - - # We got it. Turn off subroutine entry/exit messages - # for the moment, along with return values. - local $frame = 0; - local $doret = -2; - - # must detect sigpipe failures - not catching - # then will cause the debugger to die. - eval { - &main::dumpvar( - $packname, - defined $option{dumpDepth} - ? $option{dumpDepth} - : -1, # assume -1 unless specified - @vars - ); - }; - - # The die doesn't need to include the $@, because - # it will automatically get propagated for us. - if ($@) { - die unless $@ =~ /dumpvar print failed/; - } - } ## end if (defined &main::dumpvar) - else { - - # Couldn't load dumpvar. - print $OUT "dumpvar.pl not available.\n"; - } - - # Restore the output filehandle, and go round again. - select($savout); - next CMD; - }; - -=head4 C<x> - evaluate and print an expression - -Hands the expression off to C<DB::eval>, setting it up to print the value -via C<dumpvar.pl> instead of just printing it directly. - -=cut - - $cmd =~ s/^x\b/ / && do { # Remainder gets done by DB::eval() - $onetimeDump = 'dump'; # main::dumpvar shows the output - - # handle special "x 3 blah" syntax XXX propagate - # doc back to special variables. - if ( $cmd =~ s/^\s*(\d+)(?=\s)/ / ) { - $onetimedumpDepth = $1; - } - }; - -=head4 C<m> - print methods - -Just uses C<DB::methods> to determine what methods are available. - -=cut - - $cmd =~ s/^m\s+([\w:]+)\s*$/ / && do { - methods($1); - next CMD; - }; - - # m expr - set up DB::eval to do the work - $cmd =~ s/^m\b/ / && do { # Rest gets done by DB::eval() - $onetimeDump = 'methods'; # method output gets used there - }; - -=head4 C<f> - switch files - -=cut - - $cmd =~ /^f\b\s*(.*)/ && do { - $file = $1; - $file =~ s/\s+$//; - - # help for no arguments (old-style was return from sub). - if ( !$file ) { - print $OUT - "The old f command is now the r command.\n"; # hint - print $OUT "The new f command switches filenames.\n"; - next CMD; - } ## end if (!$file) - - # if not in magic file list, try a close match. - if ( !defined $main::{ '_<' . $file } ) { - if ( ($try) = grep( m#^_<.*$file#, keys %main:: ) ) { - { - $try = substr( $try, 2 ); - print $OUT "Choosing $try matching `$file':\n"; - $file = $try; - } - } ## end if (($try) = grep(m#^_<.*$file#... - } ## end if (!defined $main::{ ... - - # If not successfully switched now, we failed. - if ( !defined $main::{ '_<' . $file } ) { - print $OUT "No file matching `$file' is loaded.\n"; - next CMD; - } - - # We switched, so switch the debugger internals around. - elsif ( $file ne $filename ) { - *dbline = $main::{ '_<' . $file }; - $max = $#dbline; - $filename = $file; - $start = 1; - $cmd = "l"; - } ## end elsif ($file ne $filename) - - # We didn't switch; say we didn't. - else { - print $OUT "Already in $file.\n"; - next CMD; - } - }; - -=head4 C<.> - return to last-executed line. - -We set C<$incr> to -1 to indicate that the debugger shouldn't move ahead, -and then we look up the line in the magical C<%dbline> hash. - -=cut - - # . command. - $cmd =~ /^\.$/ && do { - $incr = -1; # stay at current line - - # Reset everything to the old location. - $start = $line; - $filename = $filename_ini; - *dbline = $main::{ '_<' . $filename }; - $max = $#dbline; - - # Now where are we? - print_lineinfo($position); - next CMD; - }; - -=head4 C<-> - back one window - -We change C<$start> to be one window back; if we go back past the first line, -we set it to be the first line. We ser C<$incr> to put us back at the -currently-executing line, and then put a C<l $start +> (list one window from -C<$start>) in C<$cmd> to be executed later. - -=cut - - # - - back a window. - $cmd =~ /^-$/ && do { - - # back up by a window; go to 1 if back too far. - $start -= $incr + $window + 1; - $start = 1 if $start <= 0; - $incr = $window - 1; - - # Generate and execute a "l +" command (handled below). - $cmd = 'l ' . ($start) . '+'; - }; - -=head3 PRE-580 COMMANDS VS. NEW COMMANDS: C<a, A, b, B, h, l, L, M, o, O, P, v, w, W, E<lt>, E<lt>E<lt>, {, {{> - -In Perl 5.8.0, a realignment of the commands was done to fix up a number of -problems, most notably that the default case of several commands destroying -the user's work in setting watchpoints, actions, etc. We wanted, however, to -retain the old commands for those who were used to using them or who preferred -them. At this point, we check for the new commands and call C<cmd_wrapper> to -deal with them instead of processing them in-line. - -=cut - - # All of these commands were remapped in perl 5.8.0; - # we send them off to the secondary dispatcher (see below). - $cmd =~ /^([aAbBeEhilLMoOPvwW]\b|[<>\{]{1,2})\s*(.*)/so && do { - &cmd_wrapper( $1, $2, $line ); - next CMD; - }; - -=head4 C<y> - List lexicals in higher scope - -Uses C<PadWalker> to find the lexicals supplied as arguments in a scope -above the current one and then displays then using C<dumpvar.pl>. - -=cut - - $cmd =~ /^y(?:\s+(\d*)\s*(.*))?$/ && do { - - # See if we've got the necessary support. - eval { require PadWalker; PadWalker->VERSION(0.08) } - or &warn( - $@ =~ /locate/ - ? "PadWalker module not found - please install\n" - : $@ - ) - and next CMD; - - # Load up dumpvar if we don't have it. If we can, that is. - do 'dumpvar.pl' unless defined &main::dumpvar; - defined &main::dumpvar - or print $OUT "dumpvar.pl not available.\n" - and next CMD; - - # Got all the modules we need. Find them and print them. - my @vars = split( ' ', $2 || '' ); - - # Find the pad. - my $h = eval { PadWalker::peek_my( ( $1 || 0 ) + 1 ) }; - - # Oops. Can't find it. - $@ and $@ =~ s/ at .*//, &warn($@), next CMD; - - # Show the desired vars with dumplex(). - my $savout = select($OUT); - - # Have dumplex dump the lexicals. - dumpvar::dumplex( $_, $h->{$_}, - defined $option{dumpDepth} ? $option{dumpDepth} : -1, - @vars ) - for sort keys %$h; - select($savout); - next CMD; - }; - -=head3 COMMANDS NOT WORKING AFTER PROGRAM ENDS - -All of the commands below this point don't work after the program being -debugged has ended. All of them check to see if the program has ended; this -allows the commands to be relocated without worrying about a 'line of -demarcation' above which commands can be entered anytime, and below which -they can't. - -=head4 C<n> - single step, but don't trace down into subs - -Done by setting C<$single> to 2, which forces subs to execute straight through -when entered (see C<DB::sub>). We also save the C<n> command in C<$laststep>, -so a null command knows what to re-execute. - -=cut - - # n - next - $cmd =~ /^n$/ && do { - end_report(), next CMD if $finished and $level <= 1; - - # Single step, but don't enter subs. - $single = 2; - - # Save for empty command (repeat last). - $laststep = $cmd; - last CMD; - }; - -=head4 C<s> - single-step, entering subs - -Sets C<$single> to 1, which causes C<DB::sub> to continue tracing inside -subs. Also saves C<s> as C<$lastcmd>. - -=cut - - # s - single step. - $cmd =~ /^s$/ && do { - - # Get out and restart the command loop if program - # has finished. - end_report(), next CMD if $finished and $level <= 1; - - # Single step should enter subs. - $single = 1; - - # Save for empty command (repeat last). - $laststep = $cmd; - last CMD; - }; - -=head4 C<c> - run continuously, setting an optional breakpoint - -Most of the code for this command is taken up with locating the optional -breakpoint, which is either a subroutine name or a line number. We set -the appropriate one-time-break in C<@dbline> and then turn off single-stepping -in this and all call levels above this one. - -=cut - - # c - start continuous execution. - $cmd =~ /^c\b\s*([\w:]*)\s*$/ && do { - - # Hey, show's over. The debugged program finished - # executing already. - end_report(), next CMD if $finished and $level <= 1; - - # Capture the place to put a one-time break. - $subname = $i = $1; - - # Probably not needed, since we finish an interactive - # sub-session anyway... - # local $filename = $filename; - # local *dbline = *dbline; # XXX Would this work?! - # - # The above question wonders if localizing the alias - # to the magic array works or not. Since it's commented - # out, we'll just leave that to speculation for now. - - # If the "subname" isn't all digits, we'll assume it - # is a subroutine name, and try to find it. - if ( $subname =~ /\D/ ) { # subroutine name - # Qualify it to the current package unless it's - # already qualified. - $subname = $package . "::" . $subname - unless $subname =~ /::/; - - # find_sub will return "file:line_number" corresponding - # to where the subroutine is defined; we call find_sub, - # break up the return value, and assign it in one - # operation. - ( $file, $i ) = ( find_sub($subname) =~ /^(.*):(.*)$/ ); - - # Force the line number to be numeric. - $i += 0; - - # If we got a line number, we found the sub. - if ($i) { - - # Switch all the debugger's internals around so - # we're actually working with that file. - $filename = $file; - *dbline = $main::{ '_<' . $filename }; - - # Mark that there's a breakpoint in this file. - $had_breakpoints{$filename} |= 1; - - # Scan forward to the first executable line - # after the 'sub whatever' line. - $max = $#dbline; - ++$i while $dbline[$i] == 0 && $i < $max; - } ## end if ($i) - - # We didn't find a sub by that name. - else { - print $OUT "Subroutine $subname not found.\n"; - next CMD; - } - } ## end if ($subname =~ /\D/) - - # At this point, either the subname was all digits (an - # absolute line-break request) or we've scanned through - # the code following the definition of the sub, looking - # for an executable, which we may or may not have found. - # - # If $i (which we set $subname from) is non-zero, we - # got a request to break at some line somewhere. On - # one hand, if there wasn't any real subroutine name - # involved, this will be a request to break in the current - # file at the specified line, so we have to check to make - # sure that the line specified really is breakable. - # - # On the other hand, if there was a subname supplied, the - # preceding block has moved us to the proper file and - # location within that file, and then scanned forward - # looking for the next executable line. We have to make - # sure that one was found. - # - # On the gripping hand, we can't do anything unless the - # current value of $i points to a valid breakable line. - # Check that. - if ($i) { - - # Breakable? - if ( $dbline[$i] == 0 ) { - print $OUT "Line $i not breakable.\n"; - next CMD; - } - - # Yes. Set up the one-time-break sigil. - $dbline{$i} =~ s/($|\0)/;9$1/; # add one-time-only b.p. - } ## end if ($i) - - # Turn off stack tracing from here up. - for ( $i = 0 ; $i <= $stack_depth ; ) { - $stack[ $i++ ] &= ~1; - } - last CMD; - }; - -=head4 C<r> - return from a subroutine - -For C<r> to work properly, the debugger has to stop execution again -immediately after the return is executed. This is done by forcing -single-stepping to be on in the call level above the current one. If -we are printing return values when a C<r> is executed, set C<$doret> -appropriately, and force us out of the command loop. - -=cut - - # r - return from the current subroutine. - $cmd =~ /^r$/ && do { - - # Can't do anythign if the program's over. - end_report(), next CMD if $finished and $level <= 1; - - # Turn on stack trace. - $stack[$stack_depth] |= 1; - - # Print return value unless the stack is empty. - $doret = $option{PrintRet} ? $stack_depth - 1 : -2; - last CMD; - }; - -=head4 C<T> - stack trace - -Just calls C<DB::print_trace>. - -=cut - - $cmd =~ /^T$/ && do { - print_trace( $OUT, 1 ); # skip DB - next CMD; - }; - -=head4 C<w> - List window around current line. - -Just calls C<DB::cmd_w>. - -=cut - - $cmd =~ /^w\b\s*(.*)/s && do { &cmd_w( 'w', $1 ); next CMD; }; - -=head4 C<W> - watch-expression processing. - -Just calls C<DB::cmd_W>. - -=cut - - $cmd =~ /^W\b\s*(.*)/s && do { &cmd_W( 'W', $1 ); next CMD; }; - -=head4 C</> - search forward for a string in the source - -We take the argument and treat it as a pattern. If it turns out to be a -bad one, we return the error we got from trying to C<eval> it and exit. -If not, we create some code to do the search and C<eval> it so it can't -mess us up. - -=cut - - $cmd =~ /^\/(.*)$/ && do { - - # The pattern as a string. - $inpat = $1; - - # Remove the final slash. - $inpat =~ s:([^\\])/$:$1:; - - # If the pattern isn't null ... - if ( $inpat ne "" ) { - - # Turn of warn and die procesing for a bit. - local $SIG{__DIE__}; - local $SIG{__WARN__}; - - # Create the pattern. - eval '$inpat =~ m' . "\a$inpat\a"; - if ( $@ ne "" ) { - - # Oops. Bad pattern. No biscuit. - # Print the eval error and go back for more - # commands. - print $OUT "$@"; - next CMD; - } - $pat = $inpat; - } ## end if ($inpat ne "") - - # Set up to stop on wrap-around. - $end = $start; - - # Don't move off the current line. - $incr = -1; - - # Done in eval so nothing breaks if the pattern - # does something weird. - eval ' - for (;;) { - # Move ahead one line. - ++$start; - - # Wrap if we pass the last line. - $start = 1 if ($start > $max); - - # Stop if we have gotten back to this line again, - last if ($start == $end); - - # A hit! (Note, though, that we are doing - # case-insensitive matching. Maybe a qr// - # expression would be better, so the user could - # do case-sensitive matching if desired. - if ($dbline[$start] =~ m' . "\a$pat\a" . 'i) { - if ($slave_editor) { - # Handle proper escaping in the slave. - print $OUT "\032\032$filename:$start:0\n"; - } - else { - # Just print the line normally. - print $OUT "$start:\t",$dbline[$start],"\n"; - } - # And quit since we found something. - last; - } - } '; - - # If we wrapped, there never was a match. - print $OUT "/$pat/: not found\n" if ( $start == $end ); - next CMD; - }; - -=head4 C<?> - search backward for a string in the source - -Same as for C</>, except the loop runs backwards. - -=cut - - # ? - backward pattern search. - $cmd =~ /^\?(.*)$/ && do { - - # Get the pattern, remove trailing question mark. - $inpat = $1; - $inpat =~ s:([^\\])\?$:$1:; - - # If we've got one ... - if ( $inpat ne "" ) { - - # Turn off die & warn handlers. - local $SIG{__DIE__}; - local $SIG{__WARN__}; - eval '$inpat =~ m' . "\a$inpat\a"; - - if ( $@ ne "" ) { - - # Ouch. Not good. Print the error. - print $OUT $@; - next CMD; - } - $pat = $inpat; - } ## end if ($inpat ne "") - - # Where we are now is where to stop after wraparound. - $end = $start; - - # Don't move away from this line. - $incr = -1; - - # Search inside the eval to prevent pattern badness - # from killing us. - eval ' - for (;;) { - # Back up a line. - --$start; - - # Wrap if we pass the first line. - - $start = $max if ($start <= 0); - - # Quit if we get back where we started, - last if ($start == $end); - - # Match? - if ($dbline[$start] =~ m' . "\a$pat\a" . 'i) { - if ($slave_editor) { - # Yep, follow slave editor requirements. - print $OUT "\032\032$filename:$start:0\n"; - } - else { - # Yep, just print normally. - print $OUT "$start:\t",$dbline[$start],"\n"; - } - - # Found, so done. - last; - } - } '; - - # Say we failed if the loop never found anything, - print $OUT "?$pat?: not found\n" if ( $start == $end ); - next CMD; - }; - -=head4 C<$rc> - Recall command - -Manages the commands in C<@hist> (which is created if C<Term::ReadLine> reports -that the terminal supports history). It find the the command required, puts it -into C<$cmd>, and redoes the loop to execute it. - -=cut - - # $rc - recall command. - $cmd =~ /^$rc+\s*(-)?(\d+)?$/ && do { - - # No arguments, take one thing off history. - pop(@hist) if length($cmd) > 1; - - # Relative (- found)? - # Y - index back from most recent (by 1 if bare minus) - # N - go to that particular command slot or the last - # thing if nothing following. - $i = $1 ? ( $#hist - ( $2 || 1 ) ) : ( $2 || $#hist ); - - # Pick out the command desired. - $cmd = $hist[$i]; - - # Print the command to be executed and restart the loop - # with that command in the buffer. - print $OUT $cmd, "\n"; - redo CMD; - }; - -=head4 C<$sh$sh> - C<system()> command - -Calls the C<DB::system()> to handle the command. This keeps the C<STDIN> and -C<STDOUT> from getting messed up. - -=cut - - # $sh$sh - run a shell command (if it's all ASCII). - # Can't run shell commands with Unicode in the debugger, hmm. - $cmd =~ /^$sh$sh\s*([\x00-\xff]*)/ && do { - - # System it. - &system($1); - next CMD; - }; - -=head4 C<$rc I<pattern> $rc> - Search command history - -Another command to manipulate C<@hist>: this one searches it with a pattern. -If a command is found, it is placed in C<$cmd> and executed via C<redo>. - -=cut - - # $rc pattern $rc - find a command in the history. - $cmd =~ /^$rc([^$rc].*)$/ && do { - - # Create the pattern to use. - $pat = "^$1"; - - # Toss off last entry if length is >1 (and it always is). - pop(@hist) if length($cmd) > 1; - - # Look backward through the history. - for ( $i = $#hist ; $i ; --$i ) { - - # Stop if we find it. - last if $hist[$i] =~ /$pat/; - } - - if ( !$i ) { - - # Never found it. - print $OUT "No such command!\n\n"; - next CMD; - } - - # Found it. Put it in the buffer, print it, and process it. - $cmd = $hist[$i]; - print $OUT $cmd, "\n"; - redo CMD; - }; - -=head4 C<$sh> - Invoke a shell - -Uses C<DB::system> to invoke a shell. - -=cut - - # $sh - start a shell. - $cmd =~ /^$sh$/ && do { - - # Run the user's shell. If none defined, run Bourne. - # We resume execution when the shell terminates. - &system( $ENV{SHELL} || "/bin/sh" ); - next CMD; - }; - -=head4 C<$sh I<command>> - Force execution of a command in a shell - -Like the above, but the command is passed to the shell. Again, we use -C<DB::system> to avoid problems with C<STDIN> and C<STDOUT>. - -=cut - - # $sh command - start a shell and run a command in it. - $cmd =~ /^$sh\s*([\x00-\xff]*)/ && do { - - # XXX: using csh or tcsh destroys sigint retvals! - #&system($1); # use this instead - - # use the user's shell, or Bourne if none defined. - &system( $ENV{SHELL} || "/bin/sh", "-c", $1 ); - next CMD; - }; - -=head4 C<H> - display commands in history - -Prints the contents of C<@hist> (if any). - -=cut - - $cmd =~ /^H\b\s*\*/ && do { - @hist = @truehist = (); - print $OUT "History cleansed\n"; - next CMD; - }; - - $cmd =~ /^H\b\s*(-(\d+))?/ && do { - - # Anything other than negative numbers is ignored by - # the (incorrect) pattern, so this test does nothing. - $end = $2 ? ( $#hist - $2 ) : 0; - - # Set to the minimum if less than zero. - $hist = 0 if $hist < 0; - - # Start at the end of the array. - # Stay in while we're still above the ending value. - # Tick back by one each time around the loop. - for ( $i = $#hist ; $i > $end ; $i-- ) { - - # Print the command unless it has no arguments. - print $OUT "$i: ", $hist[$i], "\n" - unless $hist[$i] =~ /^.?$/; - } - next CMD; - }; - -=head4 C<man, doc, perldoc> - look up documentation - -Just calls C<runman()> to print the appropriate document. - -=cut - - # man, perldoc, doc - show manual pages. - $cmd =~ /^(?:man|(?:perl)?doc)\b(?:\s+([^(]*))?$/ && do { - runman($1); - next CMD; - }; - -=head4 C<p> - print - -Builds a C<print EXPR> expression in the C<$cmd>; this will get executed at -the bottom of the loop. - -=cut - - # p - print (no args): print $_. - $cmd =~ s/^p$/print {\$DB::OUT} \$_/; - - # p - print the given expression. - $cmd =~ s/^p\b/print {\$DB::OUT} /; - -=head4 C<=> - define command alias - -Manipulates C<%alias> to add or list command aliases. - -=cut - - # = - set up a command alias. - $cmd =~ s/^=\s*// && do { - my @keys; - if ( length $cmd == 0 ) { - - # No args, get current aliases. - @keys = sort keys %alias; - } - elsif ( my ( $k, $v ) = ( $cmd =~ /^(\S+)\s+(\S.*)/ ) ) { - - # Creating a new alias. $k is alias name, $v is - # alias value. - - # can't use $_ or kill //g state - for my $x ( $k, $v ) { - - # Escape "alarm" characters. - $x =~ s/\a/\\a/g; - } - - # Substitute key for value, using alarm chars - # as separators (which is why we escaped them in - # the command). - $alias{$k} = "s\a$k\a$v\a"; - - # Turn off standard warn and die behavior. - local $SIG{__DIE__}; - local $SIG{__WARN__}; - - # Is it valid Perl? - unless ( eval "sub { s\a$k\a$v\a }; 1" ) { - - # Nope. Bad alias. Say so and get out. - print $OUT "Can't alias $k to $v: $@\n"; - delete $alias{$k}; - next CMD; - } - - # We'll only list the new one. - @keys = ($k); - } ## end elsif (my ($k, $v) = ($cmd... - - # The argument is the alias to list. - else { - @keys = ($cmd); - } - - # List aliases. - for my $k (@keys) { - - # Messy metaquoting: Trim the substiution code off. - # We use control-G as the delimiter because it's not - # likely to appear in the alias. - if ( ( my $v = $alias{$k} ) =~ ss\a$k\a(.*)\a$1 ) { - - # Print the alias. - print $OUT "$k\t= $1\n"; - } - elsif ( defined $alias{$k} ) { - - # Couldn't trim it off; just print the alias code. - print $OUT "$k\t$alias{$k}\n"; - } - else { - - # No such, dude. - print "No alias for $k\n"; - } - } ## end for my $k (@keys) - next CMD; - }; - -=head4 C<source> - read commands from a file. - -Opens a lexical filehandle and stacks it on C<@cmdfhs>; C<DB::readline> will -pick it up. - -=cut - - # source - read commands from a file (or pipe!) and execute. - $cmd =~ /^source\s+(.*\S)/ && do { - if ( open my $fh, $1 ) { - - # Opened OK; stick it in the list of file handles. - push @cmdfhs, $fh; - } - else { - - # Couldn't open it. - &warn("Can't execute `$1': $!\n"); - } - next CMD; - }; - -=head4 C<save> - send current history to a file - -Takes the complete history, (not the shrunken version you see with C<H>), -and saves it to the given filename, so it can be replayed using C<source>. - -Note that all C<^(save|source)>'s are commented out with a view to minimise recursion. - -=cut - - # save source - write commands to a file for later use - $cmd =~ /^save\s*(.*)$/ && do { - my $file = $1 || '.perl5dbrc'; # default? - if ( open my $fh, "> $file" ) { - - # chomp to remove extraneous newlines from source'd files - chomp( my @truelist = - map { m/^\s*(save|source)/ ? "#$_" : $_ } - @truehist ); - print $fh join( "\n", @truelist ); - print "commands saved in $file\n"; - } - else { - &warn("Can't save debugger commands in '$1': $!\n"); - } - next CMD; - }; - -=head4 C<R> - restart - -Restart the debugger session. - -=head4 C<rerun> - rerun the current session - -Return to any given position in the B<true>-history list - -=cut - - # R - restart execution. - # rerun - controlled restart execution. - $cmd =~ /^(R|rerun\s*(.*))$/ && do { - my @args = ($1 eq 'R' ? restart() : rerun($2)); - - # Close all non-system fds for a clean restart. A more - # correct method would be to close all fds that were not - # open when the process started, but this seems to be - # hard. See "debugger 'R'estart and open database - # connections" on p5p. - - my $max_fd = 1024; # default if POSIX can't be loaded - if (eval { require POSIX }) { - $max_fd = POSIX::sysconf(POSIX::_SC_OPEN_MAX()); - } - - if (defined $max_fd) { - foreach ($^F+1 .. $max_fd-1) { - next unless open FD_TO_CLOSE, "<&=$_"; - close(FD_TO_CLOSE); - } - } - - # And run Perl again. We use exec() to keep the - # PID stable (and that way $ini_pids is still valid). - exec(@args) || print $OUT "exec failed: $!\n"; - - last CMD; - }; - -=head4 C<|, ||> - pipe output through the pager. - -For C<|>, we save C<OUT> (the debugger's output filehandle) and C<STDOUT> -(the program's standard output). For C<||>, we only save C<OUT>. We open a -pipe to the pager (restoring the output filehandles if this fails). If this -is the C<|> command, we also set up a C<SIGPIPE> handler which will simply -set C<$signal>, sending us back into the debugger. - -We then trim off the pipe symbols and C<redo> the command loop at the -C<PIPE> label, causing us to evaluate the command in C<$cmd> without -reading another. - -=cut - - # || - run command in the pager, with output to DB::OUT. - $cmd =~ /^\|\|?\s*[^|]/ && do { - if ( $pager =~ /^\|/ ) { - - # Default pager is into a pipe. Redirect I/O. - open( SAVEOUT, ">&STDOUT" ) - || &warn("Can't save STDOUT"); - open( STDOUT, ">&OUT" ) - || &warn("Can't redirect STDOUT"); - } ## end if ($pager =~ /^\|/) - else { - - # Not into a pipe. STDOUT is safe. - open( SAVEOUT, ">&OUT" ) || &warn("Can't save DB::OUT"); - } - - # Fix up environment to record we have less if so. - fix_less(); - - unless ( $piped = open( OUT, $pager ) ) { - - # Couldn't open pipe to pager. - &warn("Can't pipe output to `$pager'"); - if ( $pager =~ /^\|/ ) { - - # Redirect I/O back again. - open( OUT, ">&STDOUT" ) # XXX: lost message - || &warn("Can't restore DB::OUT"); - open( STDOUT, ">&SAVEOUT" ) - || &warn("Can't restore STDOUT"); - close(SAVEOUT); - } ## end if ($pager =~ /^\|/) - else { - - # Redirect I/O. STDOUT already safe. - open( OUT, ">&STDOUT" ) # XXX: lost message - || &warn("Can't restore DB::OUT"); - } - next CMD; - } ## end unless ($piped = open(OUT,... - - # Set up broken-pipe handler if necessary. - $SIG{PIPE} = \&DB::catch - if $pager =~ /^\|/ - && ( "" eq $SIG{PIPE} || "DEFAULT" eq $SIG{PIPE} ); - - # Save current filehandle, unbuffer out, and put it back. - $selected = select(OUT); - $| = 1; - - # Don't put it back if pager was a pipe. - select($selected), $selected = "" unless $cmd =~ /^\|\|/; - - # Trim off the pipe symbols and run the command now. - $cmd =~ s/^\|+\s*//; - redo PIPE; - }; - -=head3 END OF COMMAND PARSING - -Anything left in C<$cmd> at this point is a Perl expression that we want to -evaluate. We'll always evaluate in the user's context, and fully qualify -any variables we might want to address in the C<DB> package. - -=cut - - # t - turn trace on. - $cmd =~ s/^t\s/\$DB::trace |= 1;\n/; - - # s - single-step. Remember the last command was 's'. - $cmd =~ s/^s\s/\$DB::single = 1;\n/ && do { $laststep = 's' }; - - # n - single-step, but not into subs. Remember last command - # was 'n'. - $cmd =~ s/^n\s/\$DB::single = 2;\n/ && do { $laststep = 'n' }; - - } # PIPE: - - # Make sure the flag that says "the debugger's running" is - # still on, to make sure we get control again. - $evalarg = "\$^D = \$^D | \$DB::db_stop;\n$cmd"; - - # Run *our* eval that executes in the caller's context. - &eval; - - # Turn off the one-time-dump stuff now. - if ($onetimeDump) { - $onetimeDump = undef; - $onetimedumpDepth = undef; - } - elsif ( $term_pid == $$ ) { - STDOUT->flush(); - STDERR->flush(); - - # XXX If this is the master pid, print a newline. - print $OUT "\n"; - } - } ## end while (($term || &setterm... - -=head3 POST-COMMAND PROCESSING - -After each command, we check to see if the command output was piped anywhere. -If so, we go through the necessary code to unhook the pipe and go back to -our standard filehandles for input and output. - -=cut - - continue { # CMD: - - # At the end of every command: - if ($piped) { - - # Unhook the pipe mechanism now. - if ( $pager =~ /^\|/ ) { - - # No error from the child. - $? = 0; - - # we cannot warn here: the handle is missing --tchrist - close(OUT) || print SAVEOUT "\nCan't close DB::OUT\n"; - - # most of the $? crud was coping with broken cshisms - # $? is explicitly set to 0, so this never runs. - if ($?) { - print SAVEOUT "Pager `$pager' failed: "; - if ( $? == -1 ) { - print SAVEOUT "shell returned -1\n"; - } - elsif ( $? >> 8 ) { - print SAVEOUT ( $? & 127 ) - ? " (SIG#" . ( $? & 127 ) . ")" - : "", ( $? & 128 ) ? " -- core dumped" : "", "\n"; - } - else { - print SAVEOUT "status ", ( $? >> 8 ), "\n"; - } - } ## end if ($?) - - # Reopen filehandle for our output (if we can) and - # restore STDOUT (if we can). - open( OUT, ">&STDOUT" ) || &warn("Can't restore DB::OUT"); - open( STDOUT, ">&SAVEOUT" ) - || &warn("Can't restore STDOUT"); - - # Turn off pipe exception handler if necessary. - $SIG{PIPE} = "DEFAULT" if $SIG{PIPE} eq \&DB::catch; - - # Will stop ignoring SIGPIPE if done like nohup(1) - # does SIGINT but Perl doesn't give us a choice. - } ## end if ($pager =~ /^\|/) - else { - - # Non-piped "pager". Just restore STDOUT. - open( OUT, ">&SAVEOUT" ) || &warn("Can't restore DB::OUT"); - } - - # Close filehandle pager was using, restore the normal one - # if necessary, - close(SAVEOUT); - select($selected), $selected = "" unless $selected eq ""; - - # No pipes now. - $piped = ""; - } ## end if ($piped) - } # CMD: - -=head3 COMMAND LOOP TERMINATION - -When commands have finished executing, we come here. If the user closed the -input filehandle, we turn on C<$fall_off_end> to emulate a C<q> command. We -evaluate any post-prompt items. We restore C<$@>, C<$!>, C<$^E>, C<$,>, C<$/>, -C<$\>, and C<$^W>, and return a null list as expected by the Perl interpreter. -The interpreter will then execute the next line and then return control to us -again. - -=cut - - # No more commands? Quit. - $fall_off_end = 1 unless defined $cmd; # Emulate `q' on EOF - - # Evaluate post-prompt commands. - foreach $evalarg (@$post) { - &eval; - } - } # if ($single || $signal) - - # Put the user's globals back where you found them. - ( $@, $!, $^E, $,, $/, $\, $^W ) = @saved; - (); -} ## end sub DB - -# The following code may be executed now: -# BEGIN {warn 4} - -=head2 sub - -C<sub> is called whenever a subroutine call happens in the program being -debugged. The variable C<$DB::sub> contains the name of the subroutine -being called. - -The core function of this subroutine is to actually call the sub in the proper -context, capturing its output. This of course causes C<DB::DB> to get called -again, repeating until the subroutine ends and returns control to C<DB::sub> -again. Once control returns, C<DB::sub> figures out whether or not to dump the -return value, and returns its captured copy of the return value as its own -return value. The value then feeds back into the program being debugged as if -C<DB::sub> hadn't been there at all. - -C<sub> does all the work of printing the subroutine entry and exit messages -enabled by setting C<$frame>. It notes what sub the autoloader got called for, -and also prints the return value if needed (for the C<r> command and if -the 16 bit is set in C<$frame>). - -It also tracks the subroutine call depth by saving the current setting of -C<$single> in the C<@stack> package global; if this exceeds the value in -C<$deep>, C<sub> automatically turns on printing of the current depth by -setting the C<4> bit in C<$single>. In any case, it keeps the current setting -of stop/don't stop on entry to subs set as it currently is set. - -=head3 C<caller()> support - -If C<caller()> is called from the package C<DB>, it provides some -additional data, in the following order: - -=over 4 - -=item * C<$package> - -The package name the sub was in - -=item * C<$filename> - -The filename it was defined in - -=item * C<$line> - -The line number it was defined on - -=item * C<$subroutine> - -The subroutine name; C<(eval)> if an C<eval>(). - -=item * C<$hasargs> - -1 if it has arguments, 0 if not - -=item * C<$wantarray> - -1 if array context, 0 if scalar context - -=item * C<$evaltext> - -The C<eval>() text, if any (undefined for C<eval BLOCK>) - -=item * C<$is_require> - -frame was created by a C<use> or C<require> statement - -=item * C<$hints> - -pragma information; subject to change between versions - -=item * C<$bitmask> - -pragma information; subject to change between versions - -=item * C<@DB::args> - -arguments with which the subroutine was invoked - -=back - -=cut - -sub sub { - - # lock ourselves under threads - lock($DBGR); - - # Whether or not the autoloader was running, a scalar to put the - # sub's return value in (if needed), and an array to put the sub's - # return value in (if needed). - my ( $al, $ret, @ret ) = ""; - if ($sub =~ /^threads::new$/ && $ENV{PERL5DB_THREADED}) { - print "creating new thread\n"; - } - - # If the last ten characters are C'::AUTOLOAD', note we've traced - # into AUTOLOAD for $sub. - if ( length($sub) > 10 && substr( $sub, -10, 10 ) eq '::AUTOLOAD' ) { - $al = " for $$sub"; - } - - # We stack the stack pointer and then increment it to protect us - # from a situation that might unwind a whole bunch of call frames - # at once. Localizing the stack pointer means that it will automatically - # unwind the same amount when multiple stack frames are unwound. - local $stack_depth = $stack_depth + 1; # Protect from non-local exits - - # Expand @stack. - $#stack = $stack_depth; - - # Save current single-step setting. - $stack[-1] = $single; - - # Turn off all flags except single-stepping. - $single &= 1; - - # If we've gotten really deeply recursed, turn on the flag that will - # make us stop with the 'deep recursion' message. - $single |= 4 if $stack_depth == $deep; - - # If frame messages are on ... - ( - $frame & 4 # Extended frame entry message - ? ( - print_lineinfo( ' ' x ( $stack_depth - 1 ), "in " ), - - # Why -1? But it works! :-( - # Because print_trace will call add 1 to it and then call - # dump_trace; this results in our skipping -1+1 = 0 stack frames - # in dump_trace. - print_trace( $LINEINFO, -1, 1, 1, "$sub$al" ) - ) - : print_lineinfo( ' ' x ( $stack_depth - 1 ), "entering $sub$al\n" ) - - # standard frame entry message - ) - if $frame; - - # Determine the sub's return type,and capture approppriately. - if (wantarray) { - - # Called in array context. call sub and capture output. - # DB::DB will recursively get control again if appropriate; we'll come - # back here when the sub is finished. - if ($assertion) { - $assertion = 0; - eval { @ret = &$sub; }; - if ($@) { - print $OUT $@; - $signal = 1 unless $warnassertions; - } - } - else { - @ret = &$sub; - } - - # Pop the single-step value back off the stack. - $single |= $stack[ $stack_depth-- ]; - - # Check for exit trace messages... - ( - $frame & 4 # Extended exit message - ? ( - print_lineinfo( ' ' x $stack_depth, "out " ), - print_trace( $LINEINFO, -1, 1, 1, "$sub$al" ) - ) - : print_lineinfo( ' ' x $stack_depth, "exited $sub$al\n" ) - - # Standard exit message - ) - if $frame & 2; - - # Print the return info if we need to. - if ( $doret eq $stack_depth or $frame & 16 ) { - - # Turn off output record separator. - local $\ = ''; - my $fh = ( $doret eq $stack_depth ? $OUT : $LINEINFO ); - - # Indent if we're printing because of $frame tracing. - print $fh ' ' x $stack_depth if $frame & 16; - - # Print the return value. - print $fh "list context return from $sub:\n"; - dumpit( $fh, \@ret ); - - # And don't print it again. - $doret = -2; - } ## end if ($doret eq $stack_depth... - # And we have to return the return value now. - @ret; - } ## end if (wantarray) - - # Scalar context. - else { - if ($assertion) { - $assertion = 0; - eval { - - # Save the value if it's wanted at all. - $ret = &$sub; - }; - if ($@) { - print $OUT $@; - $signal = 1 unless $warnassertions; - } - $ret = undef unless defined wantarray; - } - else { - if ( defined wantarray ) { - - # Save the value if it's wanted at all. - $ret = &$sub; - } - else { - - # Void return, explicitly. - &$sub; - undef $ret; - } - } # if assertion - - # Pop the single-step value off the stack. - $single |= $stack[ $stack_depth-- ]; - - # If we're doing exit messages... - ( - $frame & 4 # Extended messsages - ? ( - print_lineinfo( ' ' x $stack_depth, "out " ), - print_trace( $LINEINFO, -1, 1, 1, "$sub$al" ) - ) - : print_lineinfo( ' ' x $stack_depth, "exited $sub$al\n" ) - - # Standard messages - ) - if $frame & 2; - - # If we are supposed to show the return value... same as before. - if ( $doret eq $stack_depth or $frame & 16 and defined wantarray ) { - local $\ = ''; - my $fh = ( $doret eq $stack_depth ? $OUT : $LINEINFO ); - print $fh ( ' ' x $stack_depth ) if $frame & 16; - print $fh ( - defined wantarray - ? "scalar context return from $sub: " - : "void context return from $sub\n" - ); - dumpit( $fh, $ret ) if defined wantarray; - $doret = -2; - } ## end if ($doret eq $stack_depth... - - # Return the appropriate scalar value. - $ret; - } ## end else [ if (wantarray) -} ## end sub sub - -=head1 EXTENDED COMMAND HANDLING AND THE COMMAND API - -In Perl 5.8.0, there was a major realignment of the commands and what they did, -Most of the changes were to systematize the command structure and to eliminate -commands that threw away user input without checking. - -The following sections describe the code added to make it easy to support -multiple command sets with conflicting command names. This section is a start -at unifying all command processing to make it simpler to develop commands. - -Note that all the cmd_[a-zA-Z] subroutines require the command name, a line -number, and C<$dbline> (the current line) as arguments. - -Support functions in this section which have multiple modes of failure C<die> -on error; the rest simply return a false value. - -The user-interface functions (all of the C<cmd_*> functions) just output -error messages. - -=head2 C<%set> - -The C<%set> hash defines the mapping from command letter to subroutine -name suffix. - -C<%set> is a two-level hash, indexed by set name and then by command name. -Note that trying to set the CommandSet to C<foobar> simply results in the -5.8.0 command set being used, since there's no top-level entry for C<foobar>. - -=cut - -### The API section - -my %set = ( # - 'pre580' => { - 'a' => 'pre580_a', - 'A' => 'pre580_null', - 'b' => 'pre580_b', - 'B' => 'pre580_null', - 'd' => 'pre580_null', - 'D' => 'pre580_D', - 'h' => 'pre580_h', - 'M' => 'pre580_null', - 'O' => 'o', - 'o' => 'pre580_null', - 'v' => 'M', - 'w' => 'v', - 'W' => 'pre580_W', - }, - 'pre590' => { - '<' => 'pre590_prepost', - '<<' => 'pre590_prepost', - '>' => 'pre590_prepost', - '>>' => 'pre590_prepost', - '{' => 'pre590_prepost', - '{{' => 'pre590_prepost', - }, -); - -=head2 C<cmd_wrapper()> (API) - -C<cmd_wrapper()> allows the debugger to switch command sets -depending on the value of the C<CommandSet> option. - -It tries to look up the command in the C<%set> package-level I<lexical> -(which means external entities can't fiddle with it) and create the name of -the sub to call based on the value found in the hash (if it's there). I<All> -of the commands to be handled in a set have to be added to C<%set>; if they -aren't found, the 5.8.0 equivalent is called (if there is one). - -This code uses symbolic references. - -=cut - -sub cmd_wrapper { - my $cmd = shift; - my $line = shift; - my $dblineno = shift; - - # Assemble the command subroutine's name by looking up the - # command set and command name in %set. If we can't find it, - # default to the older version of the command. - my $call = 'cmd_' - . ( $set{$CommandSet}{$cmd} - || ( $cmd =~ /^[<>{]+/o ? 'prepost' : $cmd ) ); - - # Call the command subroutine, call it by name. - return &$call( $cmd, $line, $dblineno ); -} ## end sub cmd_wrapper - -=head3 C<cmd_a> (command) - -The C<a> command handles pre-execution actions. These are associated with a -particular line, so they're stored in C<%dbline>. We default to the current -line if none is specified. - -=cut - -sub cmd_a { - my $cmd = shift; - my $line = shift || ''; # [.|line] expr - my $dbline = shift; - - # If it's dot (here), or not all digits, use the current line. - $line =~ s/^(\.|(?:[^\d]))/$dbline/; - - # Should be a line number followed by an expression. - if ( $line =~ /^\s*(\d*)\s*(\S.+)/ ) { - my ( $lineno, $expr ) = ( $1, $2 ); - - # If we have an expression ... - if ( length $expr ) { - - # ... but the line isn't breakable, complain. - if ( $dbline[$lineno] == 0 ) { - print $OUT - "Line $lineno($dbline[$lineno]) does not have an action?\n"; - } - else { - - # It's executable. Record that the line has an action. - $had_breakpoints{$filename} |= 2; - - # Remove any action, temp breakpoint, etc. - $dbline{$lineno} =~ s/\0[^\0]*//; - - # Add the action to the line. - $dbline{$lineno} .= "\0" . action($expr); - } - } ## end if (length $expr) - } ## end if ($line =~ /^\s*(\d*)\s*(\S.+)/) - else { - - # Syntax wrong. - print $OUT - "Adding an action requires an optional lineno and an expression\n" - ; # hint - } -} ## end sub cmd_a - -=head3 C<cmd_A> (command) - -Delete actions. Similar to above, except the delete code is in a separate -subroutine, C<delete_action>. - -=cut - -sub cmd_A { - my $cmd = shift; - my $line = shift || ''; - my $dbline = shift; - - # Dot is this line. - $line =~ s/^\./$dbline/; - - # Call delete_action with a null param to delete them all. - # The '1' forces the eval to be true. It'll be false only - # if delete_action blows up for some reason, in which case - # we print $@ and get out. - if ( $line eq '*' ) { - eval { &delete_action(); 1 } or print $OUT $@ and return; - } - - # There's a real line number. Pass it to delete_action. - # Error trapping is as above. - elsif ( $line =~ /^(\S.*)/ ) { - eval { &delete_action($1); 1 } or print $OUT $@ and return; - } - - # Swing and a miss. Bad syntax. - else { - print $OUT - "Deleting an action requires a line number, or '*' for all\n" ; # hint - } -} ## end sub cmd_A - -=head3 C<delete_action> (API) - -C<delete_action> accepts either a line number or C<undef>. If a line number -is specified, we check for the line being executable (if it's not, it -couldn't have had an action). If it is, we just take the action off (this -will get any kind of an action, including breakpoints). - -=cut - -sub delete_action { - my $i = shift; - if ( defined($i) ) { - - # Can there be one? - die "Line $i has no action .\n" if $dbline[$i] == 0; - - # Nuke whatever's there. - $dbline{$i} =~ s/\0[^\0]*//; # \^a - delete $dbline{$i} if $dbline{$i} eq ''; - } - else { - print $OUT "Deleting all actions...\n"; - for my $file ( keys %had_breakpoints ) { - local *dbline = $main::{ '_<' . $file }; - my $max = $#dbline; - my $was; - for ( $i = 1 ; $i <= $max ; $i++ ) { - if ( defined $dbline{$i} ) { - $dbline{$i} =~ s/\0[^\0]*//; - delete $dbline{$i} if $dbline{$i} eq ''; - } - unless ( $had_breakpoints{$file} &= ~2 ) { - delete $had_breakpoints{$file}; - } - } ## end for ($i = 1 ; $i <= $max... - } ## end for my $file (keys %had_breakpoints) - } ## end else [ if (defined($i)) -} ## end sub delete_action - -=head3 C<cmd_b> (command) - -Set breakpoints. Since breakpoints can be set in so many places, in so many -ways, conditionally or not, the breakpoint code is kind of complex. Mostly, -we try to parse the command type, and then shuttle it off to an appropriate -subroutine to actually do the work of setting the breakpoint in the right -place. - -=cut - -sub cmd_b { - my $cmd = shift; - my $line = shift; # [.|line] [cond] - my $dbline = shift; - - # Make . the current line number if it's there.. - $line =~ s/^\./$dbline/; - - # No line number, no condition. Simple break on current line. - if ( $line =~ /^\s*$/ ) { - &cmd_b_line( $dbline, 1 ); - } - - # Break on load for a file. - elsif ( $line =~ /^load\b\s*(.*)/ ) { - my $file = $1; - $file =~ s/\s+$//; - &cmd_b_load($file); - } - - # b compile|postpone <some sub> [<condition>] - # The interpreter actually traps this one for us; we just put the - # necessary condition in the %postponed hash. - elsif ( $line =~ /^(postpone|compile)\b\s*([':A-Za-z_][':\w]*)\s*(.*)/ ) { - - # Capture the condition if there is one. Make it true if none. - my $cond = length $3 ? $3 : '1'; - - # Save the sub name and set $break to 1 if $1 was 'postpone', 0 - # if it was 'compile'. - my ( $subname, $break ) = ( $2, $1 eq 'postpone' ); - - # De-Perl4-ify the name - ' separators to ::. - $subname =~ s/\'/::/g; - - # Qualify it into the current package unless it's already qualified. - $subname = "${'package'}::" . $subname unless $subname =~ /::/; - - # Add main if it starts with ::. - $subname = "main" . $subname if substr( $subname, 0, 2 ) eq "::"; - - # Save the break type for this sub. - $postponed{$subname} = $break ? "break +0 if $cond" : "compile"; - } ## end elsif ($line =~ ... - - # b <sub name> [<condition>] - elsif ( $line =~ /^([':A-Za-z_][':\w]*(?:\[.*\])?)\s*(.*)/ ) { - - # - $subname = $1; - $cond = length $2 ? $2 : '1'; - &cmd_b_sub( $subname, $cond ); - } - - # b <line> [<condition>]. - elsif ( $line =~ /^(\d*)\s*(.*)/ ) { - - # Capture the line. If none, it's the current line. - $line = $1 || $dbline; - - # If there's no condition, make it '1'. - $cond = length $2 ? $2 : '1'; - - # Break on line. - &cmd_b_line( $line, $cond ); - } - - # Line didn't make sense. - else { - print "confused by line($line)?\n"; - } -} ## end sub cmd_b - -=head3 C<break_on_load> (API) - -We want to break when this file is loaded. Mark this file in the -C<%break_on_load> hash, and note that it has a breakpoint in -C<%had_breakpoints>. - -=cut - -sub break_on_load { - my $file = shift; - $break_on_load{$file} = 1; - $had_breakpoints{$file} |= 1; -} - -=head3 C<report_break_on_load> (API) - -Gives us an array of filenames that are set to break on load. Note that -only files with break-on-load are in here, so simply showing the keys -suffices. - -=cut - -sub report_break_on_load { - sort keys %break_on_load; -} - -=head3 C<cmd_b_load> (command) - -We take the file passed in and try to find it in C<%INC> (which maps modules -to files they came from). We mark those files for break-on-load via -C<break_on_load> and then report that it was done. - -=cut - -sub cmd_b_load { - my $file = shift; - my @files; - - # This is a block because that way we can use a redo inside it - # even without there being any looping structure at all outside it. - { - - # Save short name and full path if found. - push @files, $file; - push @files, $::INC{$file} if $::INC{$file}; - - # Tack on .pm and do it again unless there was a '.' in the name - # already. - $file .= '.pm', redo unless $file =~ /\./; - } - - # Do the real work here. - break_on_load($_) for @files; - - # All the files that have break-on-load breakpoints. - @files = report_break_on_load; - - # Normalize for the purposes of our printing this. - local $\ = ''; - local $" = ' '; - print $OUT "Will stop on load of `@files'.\n"; -} ## end sub cmd_b_load - -=head3 C<$filename_error> (API package global) - -Several of the functions we need to implement in the API need to work both -on the current file and on other files. We don't want to duplicate code, so -C<$filename_error> is used to contain the name of the file that's being -worked on (if it's not the current one). - -We can now build functions in pairs: the basic function works on the current -file, and uses C<$filename_error> as part of its error message. Since this is -initialized to C<"">, no filename will appear when we are working on the -current file. - -The second function is a wrapper which does the following: - -=over 4 - -=item * - -Localizes C<$filename_error> and sets it to the name of the file to be processed. - -=item * - -Localizes the C<*dbline> glob and reassigns it to point to the file we want to process. - -=item * - -Calls the first function. - -The first function works on the I<current> file (i.e., the one we changed to), -and prints C<$filename_error> in the error message (the name of the other file) -if it needs to. When the functions return, C<*dbline> is restored to point -to the actual current file (the one we're executing in) and -C<$filename_error> is restored to C<"">. This restores everything to -the way it was before the second function was called at all. - -See the comments in C<breakable_line> and C<breakable_line_in_file> for more -details. - -=back - -=cut - -$filename_error = ''; - -=head3 breakable_line(from, to) (API) - -The subroutine decides whether or not a line in the current file is breakable. -It walks through C<@dbline> within the range of lines specified, looking for -the first line that is breakable. - -If C<$to> is greater than C<$from>, the search moves forwards, finding the -first line I<after> C<$to> that's breakable, if there is one. - -If C<$from> is greater than C<$to>, the search goes I<backwards>, finding the -first line I<before> C<$to> that's breakable, if there is one. - -=cut - -sub breakable_line { - - my ( $from, $to ) = @_; - - # $i is the start point. (Where are the FORTRAN programs of yesteryear?) - my $i = $from; - - # If there are at least 2 arguments, we're trying to search a range. - if ( @_ >= 2 ) { - - # $delta is positive for a forward search, negative for a backward one. - my $delta = $from < $to ? +1 : -1; - - # Keep us from running off the ends of the file. - my $limit = $delta > 0 ? $#dbline : 1; - - # Clever test. If you're a mathematician, it's obvious why this - # test works. If not: - # If $delta is positive (going forward), $limit will be $#dbline. - # If $to is less than $limit, ($limit - $to) will be positive, times - # $delta of 1 (positive), so the result is > 0 and we should use $to - # as the stopping point. - # - # If $to is greater than $limit, ($limit - $to) is negative, - # times $delta of 1 (positive), so the result is < 0 and we should - # use $limit ($#dbline) as the stopping point. - # - # If $delta is negative (going backward), $limit will be 1. - # If $to is zero, ($limit - $to) will be 1, times $delta of -1 - # (negative) so the result is > 0, and we use $to as the stopping - # point. - # - # If $to is less than zero, ($limit - $to) will be positive, - # times $delta of -1 (negative), so the result is not > 0, and - # we use $limit (1) as the stopping point. - # - # If $to is 1, ($limit - $to) will zero, times $delta of -1 - # (negative), still giving zero; the result is not > 0, and - # we use $limit (1) as the stopping point. - # - # if $to is >1, ($limit - $to) will be negative, times $delta of -1 - # (negative), giving a positive (>0) value, so we'll set $limit to - # $to. - - $limit = $to if ( $limit - $to ) * $delta > 0; - - # The real search loop. - # $i starts at $from (the point we want to start searching from). - # We move through @dbline in the appropriate direction (determined - # by $delta: either -1 (back) or +1 (ahead). - # We stay in as long as we haven't hit an executable line - # ($dbline[$i] == 0 means not executable) and we haven't reached - # the limit yet (test similar to the above). - $i += $delta while $dbline[$i] == 0 and ( $limit - $i ) * $delta > 0; - - } ## end if (@_ >= 2) - - # If $i points to a line that is executable, return that. - return $i unless $dbline[$i] == 0; - - # Format the message and print it: no breakable lines in range. - my ( $pl, $upto ) = ( '', '' ); - ( $pl, $upto ) = ( 's', "..$to" ) if @_ >= 2 and $from != $to; - - # If there's a filename in filename_error, we'll see it. - # If not, not. - die "Line$pl $from$upto$filename_error not breakable\n"; -} ## end sub breakable_line - -=head3 breakable_line_in_filename(file, from, to) (API) - -Like C<breakable_line>, but look in another file. - -=cut - -sub breakable_line_in_filename { - - # Capture the file name. - my ($f) = shift; - - # Swap the magic line array over there temporarily. - local *dbline = $main::{ '_<' . $f }; - - # If there's an error, it's in this other file. - local $filename_error = " of `$f'"; - - # Find the breakable line. - breakable_line(@_); - - # *dbline and $filename_error get restored when this block ends. - -} ## end sub breakable_line_in_filename - -=head3 break_on_line(lineno, [condition]) (API) - -Adds a breakpoint with the specified condition (or 1 if no condition was -specified) to the specified line. Dies if it can't. - -=cut - -sub break_on_line { - my ( $i, $cond ) = @_; - - # Always true if no condition supplied. - $cond = 1 unless @_ >= 2; - - my $inii = $i; - my $after = ''; - my $pl = ''; - - # Woops, not a breakable line. $filename_error allows us to say - # if it was in a different file. - die "Line $i$filename_error not breakable.\n" if $dbline[$i] == 0; - - # Mark this file as having breakpoints in it. - $had_breakpoints{$filename} |= 1; - - # If there is an action or condition here already ... - if ( $dbline{$i} ) { - - # ... swap this condition for the existing one. - $dbline{$i} =~ s/^[^\0]*/$cond/; - } - else { - - # Nothing here - just add the condition. - $dbline{$i} = $cond; - } -} ## end sub break_on_line - -=head3 cmd_b_line(line, [condition]) (command) - -Wrapper for C<break_on_line>. Prints the failure message if it -doesn't work. - -=cut - -sub cmd_b_line { - eval { break_on_line(@_); 1 } or do { - local $\ = ''; - print $OUT $@ and return; - }; -} ## end sub cmd_b_line - -=head3 break_on_filename_line(file, line, [condition]) (API) - -Switches to the file specified and then calls C<break_on_line> to set -the breakpoint. - -=cut - -sub break_on_filename_line { - my ( $f, $i, $cond ) = @_; - - # Always true if condition left off. - $cond = 1 unless @_ >= 3; - - # Switch the magical hash temporarily. - local *dbline = $main::{ '_<' . $f }; - - # Localize the variables that break_on_line uses to make its message. - local $filename_error = " of `$f'"; - local $filename = $f; - - # Add the breakpoint. - break_on_line( $i, $cond ); -} ## end sub break_on_filename_line - -=head3 break_on_filename_line_range(file, from, to, [condition]) (API) - -Switch to another file, search the range of lines specified for an -executable one, and put a breakpoint on the first one you find. - -=cut - -sub break_on_filename_line_range { - my ( $f, $from, $to, $cond ) = @_; - - # Find a breakable line if there is one. - my $i = breakable_line_in_filename( $f, $from, $to ); - - # Always true if missing. - $cond = 1 unless @_ >= 3; - - # Add the breakpoint. - break_on_filename_line( $f, $i, $cond ); -} ## end sub break_on_filename_line_range - -=head3 subroutine_filename_lines(subname, [condition]) (API) - -Search for a subroutine within a given file. The condition is ignored. -Uses C<find_sub> to locate the desired subroutine. - -=cut - -sub subroutine_filename_lines { - my ( $subname, $cond ) = @_; - - # Returned value from find_sub() is fullpathname:startline-endline. - # The match creates the list (fullpathname, start, end). Falling off - # the end of the subroutine returns this implicitly. - find_sub($subname) =~ /^(.*):(\d+)-(\d+)$/; -} ## end sub subroutine_filename_lines - -=head3 break_subroutine(subname) (API) - -Places a break on the first line possible in the specified subroutine. Uses -C<subroutine_filename_lines> to find the subroutine, and -C<break_on_filename_line_range> to place the break. - -=cut - -sub break_subroutine { - my $subname = shift; - - # Get filename, start, and end. - my ( $file, $s, $e ) = subroutine_filename_lines($subname) - or die "Subroutine $subname not found.\n"; - - # Null condition changes to '1' (always true). - $cond = 1 unless @_ >= 2; - - # Put a break the first place possible in the range of lines - # that make up this subroutine. - break_on_filename_line_range( $file, $s, $e, @_ ); -} ## end sub break_subroutine - -=head3 cmd_b_sub(subname, [condition]) (command) - -We take the incoming subroutine name and fully-qualify it as best we can. - -=over 4 - -=item 1. If it's already fully-qualified, leave it alone. - -=item 2. Try putting it in the current package. - -=item 3. If it's not there, try putting it in CORE::GLOBAL if it exists there. - -=item 4. If it starts with '::', put it in 'main::'. - -=back - -After all this cleanup, we call C<break_subroutine> to try to set the -breakpoint. - -=cut - -sub cmd_b_sub { - my ( $subname, $cond ) = @_; - - # Add always-true condition if we have none. - $cond = 1 unless @_ >= 2; - - # If the subname isn't a code reference, qualify it so that - # break_subroutine() will work right. - unless ( ref $subname eq 'CODE' ) { - - # Not Perl4. - $subname =~ s/\'/::/g; - my $s = $subname; - - # Put it in this package unless it's already qualified. - $subname = "${'package'}::" . $subname - unless $subname =~ /::/; - - # Requalify it into CORE::GLOBAL if qualifying it into this - # package resulted in its not being defined, but only do so - # if it really is in CORE::GLOBAL. - $subname = "CORE::GLOBAL::$s" - if not defined &$subname - and $s !~ /::/ - and defined &{"CORE::GLOBAL::$s"}; - - # Put it in package 'main' if it has a leading ::. - $subname = "main" . $subname if substr( $subname, 0, 2 ) eq "::"; - - } ## end unless (ref $subname eq 'CODE') - - # Try to set the breakpoint. - eval { break_subroutine( $subname, $cond ); 1 } or do { - local $\ = ''; - print $OUT $@ and return; - } -} ## end sub cmd_b_sub - -=head3 C<cmd_B> - delete breakpoint(s) (command) - -The command mostly parses the command line and tries to turn the argument -into a line spec. If it can't, it uses the current line. It then calls -C<delete_breakpoint> to actually do the work. - -If C<*> is specified, C<cmd_B> calls C<delete_breakpoint> with no arguments, -thereby deleting all the breakpoints. - -=cut - -sub cmd_B { - my $cmd = shift; - - # No line spec? Use dbline. - # If there is one, use it if it's non-zero, or wipe it out if it is. - my $line = ( $_[0] =~ /^\./ ) ? $dbline : shift || ''; - my $dbline = shift; - - # If the line was dot, make the line the current one. - $line =~ s/^\./$dbline/; - - # If it's * we're deleting all the breakpoints. - if ( $line eq '*' ) { - eval { &delete_breakpoint(); 1 } or print $OUT $@ and return; - } - - # If there is a line spec, delete the breakpoint on that line. - elsif ( $line =~ /^(\S.*)/ ) { - eval { &delete_breakpoint( $line || $dbline ); 1 } or do { - local $\ = ''; - print $OUT $@ and return; - }; - } ## end elsif ($line =~ /^(\S.*)/) - - # No line spec. - else { - print $OUT - "Deleting a breakpoint requires a line number, or '*' for all\n" - ; # hint - } -} ## end sub cmd_B - -=head3 delete_breakpoint([line]) (API) - -This actually does the work of deleting either a single breakpoint, or all -of them. - -For a single line, we look for it in C<@dbline>. If it's nonbreakable, we -just drop out with a message saying so. If it is, we remove the condition -part of the 'condition\0action' that says there's a breakpoint here. If, -after we've done that, there's nothing left, we delete the corresponding -line in C<%dbline> to signal that no action needs to be taken for this line. - -For all breakpoints, we iterate through the keys of C<%had_breakpoints>, -which lists all currently-loaded files which have breakpoints. We then look -at each line in each of these files, temporarily switching the C<%dbline> -and C<@dbline> structures to point to the files in question, and do what -we did in the single line case: delete the condition in C<@dbline>, and -delete the key in C<%dbline> if nothing's left. - -We then wholesale delete C<%postponed>, C<%postponed_file>, and -C<%break_on_load>, because these structures contain breakpoints for files -and code that haven't been loaded yet. We can just kill these off because there -are no magical debugger structures associated with them. - -=cut - -sub delete_breakpoint { - my $i = shift; - - # If we got a line, delete just that one. - if ( defined($i) ) { - - # Woops. This line wasn't breakable at all. - die "Line $i not breakable.\n" if $dbline[$i] == 0; - - # Kill the condition, but leave any action. - $dbline{$i} =~ s/^[^\0]*//; - - # Remove the entry entirely if there's no action left. - delete $dbline{$i} if $dbline{$i} eq ''; - } - - # No line; delete them all. - else { - print $OUT "Deleting all breakpoints...\n"; - - # %had_breakpoints lists every file that had at least one - # breakpoint in it. - for my $file ( keys %had_breakpoints ) { - - # Switch to the desired file temporarily. - local *dbline = $main::{ '_<' . $file }; - - my $max = $#dbline; - my $was; - - # For all lines in this file ... - for ( $i = 1 ; $i <= $max ; $i++ ) { - - # If there's a breakpoint or action on this line ... - if ( defined $dbline{$i} ) { - - # ... remove the breakpoint. - $dbline{$i} =~ s/^[^\0]+//; - if ( $dbline{$i} =~ s/^\0?$// ) { - - # Remove the entry altogether if no action is there. - delete $dbline{$i}; - } - } ## end if (defined $dbline{$i... - } ## end for ($i = 1 ; $i <= $max... - - # If, after we turn off the "there were breakpoints in this file" - # bit, the entry in %had_breakpoints for this file is zero, - # we should remove this file from the hash. - if ( not $had_breakpoints{$file} &= ~1 ) { - delete $had_breakpoints{$file}; - } - } ## end for my $file (keys %had_breakpoints) - - # Kill off all the other breakpoints that are waiting for files that - # haven't been loaded yet. - undef %postponed; - undef %postponed_file; - undef %break_on_load; - } ## end else [ if (defined($i)) -} ## end sub delete_breakpoint - -=head3 cmd_stop (command) - -This is meant to be part of the new command API, but it isn't called or used -anywhere else in the debugger. XXX It is probably meant for use in development -of new commands. - -=cut - -sub cmd_stop { # As on ^C, but not signal-safy. - $signal = 1; -} - -=head3 C<cmd_e> - threads - -Display the current thread id: - - e - -This could be how (when implemented) to send commands to this thread id (e cmd) -or that thread id (e tid cmd). - -=cut - -sub cmd_e { - my $cmd = shift; - my $line = shift; - unless (exists($INC{'threads.pm'})) { - print "threads not loaded($ENV{PERL5DB_THREADED}) - please run the debugger with PERL5DB_THREADED=1 set in the environment\n"; - } else { - my $tid = threads->self->tid; - print "thread id: $tid\n"; - } -} ## end sub cmd_e - -=head3 C<cmd_E> - list of thread ids - -Display the list of available thread ids: - - E - -This could be used (when implemented) to send commands to all threads (E cmd). - -=cut - -sub cmd_E { - my $cmd = shift; - my $line = shift; - unless (exists($INC{'threads.pm'})) { - print "threads not loaded($ENV{PERL5DB_THREADED}) - please run the debugger with PERL5DB_THREADED=1 set in the environment\n"; - } else { - my $tid = threads->self->tid; - print "thread ids: ".join(', ', - map { ($tid == $_->tid ? '<'.$_->tid.'>' : $_->tid) } threads->list - )."\n"; - } -} ## end sub cmd_E - -=head3 C<cmd_h> - help command (command) - -Does the work of either - -=over 4 - -=item * - -Showing all the debugger help - -=item * - -Showing help for a specific command - -=back - -=cut - -sub cmd_h { - my $cmd = shift; - - # If we have no operand, assume null. - my $line = shift || ''; - - # 'h h'. Print the long-format help. - if ( $line =~ /^h\s*/ ) { - print_help($help); - } - - # 'h <something>'. Search for the command and print only its help. - elsif ( $line =~ /^(\S.*)$/ ) { - - # support long commands; otherwise bogus errors - # happen when you ask for h on <CR> for example - my $asked = $1; # the command requested - # (for proper error message) - - my $qasked = quotemeta($asked); # for searching; we don't - # want to use it as a pattern. - # XXX: finds CR but not <CR> - - # Search the help string for the command. - if ( - $help =~ /^ # Start of a line - <? # Optional '<' - (?:[IB]<) # Optional markup - $qasked # The requested command - /mx - ) - { - - # It's there; pull it out and print it. - while ( - $help =~ /^ - (<? # Optional '<' - (?:[IB]<) # Optional markup - $qasked # The command - ([\s\S]*?) # Description line(s) - \n) # End of last description line - (?!\s) # Next line not starting with - # whitespace - /mgx - ) - { - print_help($1); - } - } - - # Not found; not a debugger command. - else { - print_help("B<$asked> is not a debugger command.\n"); - } - } ## end elsif ($line =~ /^(\S.*)$/) - - # 'h' - print the summary help. - else { - print_help($summary); - } -} ## end sub cmd_h - -=head3 C<cmd_i> - inheritance display - -Display the (nested) parentage of the module or object given. - -=cut - -sub cmd_i { - my $cmd = shift; - my $line = shift; - eval { require Class::ISA }; - if ($@) { - &warn( $@ =~ /locate/ - ? "Class::ISA module not found - please install\n" - : $@ ); - } - else { - ISA: - foreach my $isa ( split( /\s+/, $line ) ) { - $evalarg = $isa; - ($isa) = &eval; - no strict 'refs'; - print join( - ', ', - map { # snaffled unceremoniously from Class::ISA - "$_" - . ( - defined( ${"$_\::VERSION"} ) - ? ' ' . ${"$_\::VERSION"} - : undef ) - } Class::ISA::self_and_super_path(ref($isa) || $isa) - ); - print "\n"; - } - } -} ## end sub cmd_i - -=head3 C<cmd_l> - list lines (command) - -Most of the command is taken up with transforming all the different line -specification syntaxes into 'start-stop'. After that is done, the command -runs a loop over C<@dbline> for the specified range of lines. It handles -the printing of each line and any markers (C<==E<gt>> for current line, -C<b> for break on this line, C<a> for action on this line, C<:> for this -line breakable). - -We save the last line listed in the C<$start> global for further listing -later. - -=cut - -sub cmd_l { - my $current_line = $line; - my $cmd = shift; - my $line = shift; - - # If this is '-something', delete any spaces after the dash. - $line =~ s/^-\s*$/-/; - - # If the line is '$something', assume this is a scalar containing a - # line number. - if ( $line =~ /^(\$.*)/s ) { - - # Set up for DB::eval() - evaluate in *user* context. - $evalarg = $1; - # $evalarg = $2; - my ($s) = &eval; - - # Ooops. Bad scalar. - print( $OUT "Error: $@\n" ), next CMD if $@; - - # Good scalar. If it's a reference, find what it points to. - $s = CvGV_name($s); - print( $OUT "Interpreted as: $1 $s\n" ); - $line = "$1 $s"; - - # Call self recursively to really do the command. - &cmd_l( 'l', $s ); - } ## end if ($line =~ /^(\$.*)/s) - - # l name. Try to find a sub by that name. - elsif ( $line =~ /^([\':A-Za-z_][\':\w]*(\[.*\])?)/s ) { - my $s = $subname = $1; - - # De-Perl4. - $subname =~ s/\'/::/; - - # Put it in this package unless it starts with ::. - $subname = $package . "::" . $subname unless $subname =~ /::/; - - # Put it in CORE::GLOBAL if t doesn't start with :: and - # it doesn't live in this package and it lives in CORE::GLOBAL. - $subname = "CORE::GLOBAL::$s" - if not defined &$subname - and $s !~ /::/ - and defined &{"CORE::GLOBAL::$s"}; - - # Put leading '::' names into 'main::'. - $subname = "main" . $subname if substr( $subname, 0, 2 ) eq "::"; - - # Get name:start-stop from find_sub, and break this up at - # colons. - @pieces = split( /:/, find_sub($subname) || $sub{$subname} ); - - # Pull off start-stop. - $subrange = pop @pieces; - - # If the name contained colons, the split broke it up. - # Put it back together. - $file = join( ':', @pieces ); - - # If we're not in that file, switch over to it. - if ( $file ne $filename ) { - print $OUT "Switching to file '$file'.\n" - unless $slave_editor; - - # Switch debugger's magic structures. - *dbline = $main::{ '_<' . $file }; - $max = $#dbline; - $filename = $file; - } ## end if ($file ne $filename) - - # Subrange is 'start-stop'. If this is less than a window full, - # swap it to 'start+', which will list a window from the start point. - if ($subrange) { - if ( eval($subrange) < -$window ) { - $subrange =~ s/-.*/+/; - } - - # Call self recursively to list the range. - $line = $subrange; - &cmd_l( 'l', $subrange ); - } ## end if ($subrange) - - # Couldn't find it. - else { - print $OUT "Subroutine $subname not found.\n"; - } - } ## end elsif ($line =~ /^([\':A-Za-z_][\':\w]*(\[.*\])?)/s) - - # Bare 'l' command. - elsif ( $line =~ /^\s*$/ ) { - - # Compute new range to list. - $incr = $window - 1; - $line = $start . '-' . ( $start + $incr ); - - # Recurse to do it. - &cmd_l( 'l', $line ); - } - - # l [start]+number_of_lines - elsif ( $line =~ /^(\d*)\+(\d*)$/ ) { - - # Don't reset start for 'l +nnn'. - $start = $1 if $1; - - # Increment for list. Use window size if not specified. - # (Allows 'l +' to work.) - $incr = $2; - $incr = $window - 1 unless $incr; - - # Create a line range we'll understand, and recurse to do it. - $line = $start . '-' . ( $start + $incr ); - &cmd_l( 'l', $line ); - } ## end elsif ($line =~ /^(\d*)\+(\d*)$/) - - # l start-stop or l start,stop - elsif ( $line =~ /^((-?[\d\$\.]+)([-,]([\d\$\.]+))?)?/ ) { - - # Determine end point; use end of file if not specified. - $end = ( !defined $2 ) ? $max : ( $4 ? $4 : $2 ); - - # Go on to the end, and then stop. - $end = $max if $end > $max; - - # Determine start line. - $i = $2; - $i = $line if $i eq '.'; - $i = 1 if $i < 1; - $incr = $end - $i; - - # If we're running under a slave editor, force it to show the lines. - if ($slave_editor) { - print $OUT "\032\032$filename:$i:0\n"; - $i = $end; - } - - # We're doing it ourselves. We want to show the line and special - # markers for: - # - the current line in execution - # - whether a line is breakable or not - # - whether a line has a break or not - # - whether a line has an action or not - else { - for ( ; $i <= $end ; $i++ ) { - - # Check for breakpoints and actions. - my ( $stop, $action ); - ( $stop, $action ) = split( /\0/, $dbline{$i} ) - if $dbline{$i}; - - # ==> if this is the current line in execution, - # : if it's breakable. - $arrow = - ( $i == $current_line and $filename eq $filename_ini ) - ? '==>' - : ( $dbline[$i] + 0 ? ':' : ' ' ); - - # Add break and action indicators. - $arrow .= 'b' if $stop; - $arrow .= 'a' if $action; - - # Print the line. - print $OUT "$i$arrow\t", $dbline[$i]; - - # Move on to the next line. Drop out on an interrupt. - $i++, last if $signal; - } ## end for (; $i <= $end ; $i++) - - # Line the prompt up; print a newline if the last line listed - # didn't have a newline. - print $OUT "\n" unless $dbline[ $i - 1 ] =~ /\n$/; - } ## end else [ if ($slave_editor) - - # Save the point we last listed to in case another relative 'l' - # command is desired. Don't let it run off the end. - $start = $i; - $start = $max if $start > $max; - } ## end elsif ($line =~ /^((-?[\d\$\.]+)([-,]([\d\$\.]+))?)?/) -} ## end sub cmd_l - -=head3 C<cmd_L> - list breakpoints, actions, and watch expressions (command) - -To list breakpoints, the command has to look determine where all of them are -first. It starts a C<%had_breakpoints>, which tells us what all files have -breakpoints and/or actions. For each file, we switch the C<*dbline> glob (the -magic source and breakpoint data structures) to the file, and then look -through C<%dbline> for lines with breakpoints and/or actions, listing them -out. We look through C<%postponed> not-yet-compiled subroutines that have -breakpoints, and through C<%postponed_file> for not-yet-C<require>'d files -that have breakpoints. - -Watchpoints are simpler: we just list the entries in C<@to_watch>. - -=cut - -sub cmd_L { - my $cmd = shift; - - # If no argument, list everything. Pre-5.8.0 version always lists - # everything - my $arg = shift || 'abw'; - $arg = 'abw' unless $CommandSet eq '580'; # sigh... - - # See what is wanted. - my $action_wanted = ( $arg =~ /a/ ) ? 1 : 0; - my $break_wanted = ( $arg =~ /b/ ) ? 1 : 0; - my $watch_wanted = ( $arg =~ /w/ ) ? 1 : 0; - - # Breaks and actions are found together, so we look in the same place - # for both. - if ( $break_wanted or $action_wanted ) { - - # Look in all the files with breakpoints... - for my $file ( keys %had_breakpoints ) { - - # Temporary switch to this file. - local *dbline = $main::{ '_<' . $file }; - - # Set up to look through the whole file. - my $max = $#dbline; - my $was; # Flag: did we print something - # in this file? - - # For each line in the file ... - for ( $i = 1 ; $i <= $max ; $i++ ) { - - # We've got something on this line. - if ( defined $dbline{$i} ) { - - # Print the header if we haven't. - print $OUT "$file:\n" unless $was++; - - # Print the line. - print $OUT " $i:\t", $dbline[$i]; - - # Pull out the condition and the action. - ( $stop, $action ) = split( /\0/, $dbline{$i} ); - - # Print the break if there is one and it's wanted. - print $OUT " break if (", $stop, ")\n" - if $stop - and $break_wanted; - - # Print the action if there is one and it's wanted. - print $OUT " action: ", $action, "\n" - if $action - and $action_wanted; - - # Quit if the user hit interrupt. - last if $signal; - } ## end if (defined $dbline{$i... - } ## end for ($i = 1 ; $i <= $max... - } ## end for my $file (keys %had_breakpoints) - } ## end if ($break_wanted or $action_wanted) - - # Look for breaks in not-yet-compiled subs: - if ( %postponed and $break_wanted ) { - print $OUT "Postponed breakpoints in subroutines:\n"; - my $subname; - for $subname ( keys %postponed ) { - print $OUT " $subname\t$postponed{$subname}\n"; - last if $signal; - } - } ## end if (%postponed and $break_wanted) - - # Find files that have not-yet-loaded breaks: - my @have = map { # Combined keys - keys %{ $postponed_file{$_} } - } keys %postponed_file; - - # If there are any, list them. - if ( @have and ( $break_wanted or $action_wanted ) ) { - print $OUT "Postponed breakpoints in files:\n"; - my ( $file, $line ); - - for $file ( keys %postponed_file ) { - my $db = $postponed_file{$file}; - print $OUT " $file:\n"; - for $line ( sort { $a <=> $b } keys %$db ) { - print $OUT " $line:\n"; - my ( $stop, $action ) = split( /\0/, $$db{$line} ); - print $OUT " break if (", $stop, ")\n" - if $stop - and $break_wanted; - print $OUT " action: ", $action, "\n" - if $action - and $action_wanted; - last if $signal; - } ## end for $line (sort { $a <=>... - last if $signal; - } ## end for $file (keys %postponed_file) - } ## end if (@have and ($break_wanted... - if ( %break_on_load and $break_wanted ) { - print $OUT "Breakpoints on load:\n"; - my $file; - for $file ( keys %break_on_load ) { - print $OUT " $file\n"; - last if $signal; - } - } ## end if (%break_on_load and... - if ($watch_wanted) { - if ( $trace & 2 ) { - print $OUT "Watch-expressions:\n" if @to_watch; - for my $expr (@to_watch) { - print $OUT " $expr\n"; - last if $signal; - } - } ## end if ($trace & 2) - } ## end if ($watch_wanted) -} ## end sub cmd_L - -=head3 C<cmd_M> - list modules (command) - -Just call C<list_modules>. - -=cut - -sub cmd_M { - &list_modules(); -} - -=head3 C<cmd_o> - options (command) - -If this is just C<o> by itself, we list the current settings via -C<dump_option>. If there's a nonblank value following it, we pass that on to -C<parse_options> for processing. - -=cut - -sub cmd_o { - my $cmd = shift; - my $opt = shift || ''; # opt[=val] - - # Nonblank. Try to parse and process. - if ( $opt =~ /^(\S.*)/ ) { - &parse_options($1); - } - - # Blank. List the current option settings. - else { - for (@options) { - &dump_option($_); - } - } -} ## end sub cmd_o - -=head3 C<cmd_O> - nonexistent in 5.8.x (command) - -Advises the user that the O command has been renamed. - -=cut - -sub cmd_O { - print $OUT "The old O command is now the o command.\n"; # hint - print $OUT "Use 'h' to get current command help synopsis or\n"; # - print $OUT "use 'o CommandSet=pre580' to revert to old usage\n"; # -} - -=head3 C<cmd_v> - view window (command) - -Uses the C<$preview> variable set in the second C<BEGIN> block (q.v.) to -move back a few lines to list the selected line in context. Uses C<cmd_l> -to do the actual listing after figuring out the range of line to request. - -=cut - -sub cmd_v { - my $cmd = shift; - my $line = shift; - - # Extract the line to list around. (Astute readers will have noted that - # this pattern will match whether or not a numeric line is specified, - # which means that we'll always enter this loop (though a non-numeric - # argument results in no action at all)). - if ( $line =~ /^(\d*)$/ ) { - - # Total number of lines to list (a windowful). - $incr = $window - 1; - - # Set the start to the argument given (if there was one). - $start = $1 if $1; - - # Back up by the context amount. - $start -= $preview; - - # Put together a linespec that cmd_l will like. - $line = $start . '-' . ( $start + $incr ); - - # List the lines. - &cmd_l( 'l', $line ); - } ## end if ($line =~ /^(\d*)$/) -} ## end sub cmd_v - -=head3 C<cmd_w> - add a watch expression (command) - -The 5.8 version of this command adds a watch expression if one is specified; -it does nothing if entered with no operands. - -We extract the expression, save it, evaluate it in the user's context, and -save the value. We'll re-evaluate it each time the debugger passes a line, -and will stop (see the code at the top of the command loop) if the value -of any of the expressions changes. - -=cut - -sub cmd_w { - my $cmd = shift; - - # Null expression if no arguments. - my $expr = shift || ''; - - # If expression is not null ... - if ( $expr =~ /^(\S.*)/ ) { - - # ... save it. - push @to_watch, $expr; - - # Parameterize DB::eval and call it to get the expression's value - # in the user's context. This version can handle expressions which - # return a list value. - $evalarg = $expr; - my ($val) = join( ' ', &eval ); - $val = ( defined $val ) ? "'$val'" : 'undef'; - - # Save the current value of the expression. - push @old_watch, $val; - - # We are now watching expressions. - $trace |= 2; - } ## end if ($expr =~ /^(\S.*)/) - - # You have to give one to get one. - else { - print $OUT "Adding a watch-expression requires an expression\n"; # hint - } -} ## end sub cmd_w - -=head3 C<cmd_W> - delete watch expressions (command) - -This command accepts either a watch expression to be removed from the list -of watch expressions, or C<*> to delete them all. - -If C<*> is specified, we simply empty the watch expression list and the -watch expression value list. We also turn off the bit that says we've got -watch expressions. - -If an expression (or partial expression) is specified, we pattern-match -through the expressions and remove the ones that match. We also discard -the corresponding values. If no watch expressions are left, we turn off -the I<watching expressions> bit. - -=cut - -sub cmd_W { - my $cmd = shift; - my $expr = shift || ''; - - # Delete them all. - if ( $expr eq '*' ) { - - # Not watching now. - $trace &= ~2; - - print $OUT "Deleting all watch expressions ...\n"; - - # And all gone. - @to_watch = @old_watch = (); - } - - # Delete one of them. - elsif ( $expr =~ /^(\S.*)/ ) { - - # Where we are in the list. - my $i_cnt = 0; - - # For each expression ... - foreach (@to_watch) { - my $val = $to_watch[$i_cnt]; - - # Does this one match the command argument? - if ( $val eq $expr ) { # =~ m/^\Q$i$/) { - # Yes. Turn it off, and its value too. - splice( @to_watch, $i_cnt, 1 ); - splice( @old_watch, $i_cnt, 1 ); - } - $i_cnt++; - } ## end foreach (@to_watch) - - # We don't bother to turn watching off because - # a) we don't want to stop calling watchfunction() it it exists - # b) foreach over a null list doesn't do anything anyway - - } ## end elsif ($expr =~ /^(\S.*)/) - - # No command arguments entered. - else { - print $OUT - "Deleting a watch-expression requires an expression, or '*' for all\n" - ; # hint - } -} ## end sub cmd_W - -### END of the API section - -=head1 SUPPORT ROUTINES - -These are general support routines that are used in a number of places -throughout the debugger. - -=over 4 - -=item cmd_P - -Something to do with assertions - -=back - -=cut - -sub cmd_P { - unless ($ini_assertion) { - print $OUT "Assertions not supported in this Perl interpreter\n"; - } else { - if ( $cmd =~ /^.\b\s*([+-]?)\s*(~?)\s*(\w+(\s*\|\s*\w+)*)\s*$/ ) { - my ( $how, $neg, $flags ) = ( $1, $2, $3 ); - my $acu = parse_DollarCaretP_flags($flags); - if ( defined $acu ) { - $acu = ~$acu if $neg; - if ( $how eq '+' ) { $^P |= $acu } - elsif ( $how eq '-' ) { $^P &= ~$acu } - else { $^P = $acu } - } - - # else { print $OUT "undefined acu\n" } - } - my $expanded = expand_DollarCaretP_flags($^P); - print $OUT "Internal Perl debugger flags:\n\$^P=$expanded\n"; - $expanded; - } -} - -=head2 save - -save() saves the user's versions of globals that would mess us up in C<@saved>, -and installs the versions we like better. - -=cut - -sub save { - - # Save eval failure, command failure, extended OS error, output field - # separator, input record separator, output record separator and - # the warning setting. - @saved = ( $@, $!, $^E, $,, $/, $\, $^W ); - - $, = ""; # output field separator is null string - $/ = "\n"; # input record separator is newline - $\ = ""; # output record separator is null string - $^W = 0; # warnings are off -} ## end sub save - -=head2 C<print_lineinfo> - show where we are now - -print_lineinfo prints whatever it is that it is handed; it prints it to the -C<$LINEINFO> filehandle instead of just printing it to STDOUT. This allows -us to feed line information to a slave editor without messing up the -debugger output. - -=cut - -sub print_lineinfo { - - # Make the terminal sensible if we're not the primary debugger. - resetterm(1) if $LINEINFO eq $OUT and $term_pid != $$; - local $\ = ''; - local $, = ''; - print $LINEINFO @_; -} ## end sub print_lineinfo - -=head2 C<postponed_sub> - -Handles setting postponed breakpoints in subroutines once they're compiled. -For breakpoints, we use C<DB::find_sub> to locate the source file and line -range for the subroutine, then mark the file as having a breakpoint, -temporarily switch the C<*dbline> glob over to the source file, and then -search the given range of lines to find a breakable line. If we find one, -we set the breakpoint on it, deleting the breakpoint from C<%postponed>. - -=cut - -# The following takes its argument via $evalarg to preserve current @_ - -sub postponed_sub { - - # Get the subroutine name. - my $subname = shift; - - # If this is a 'break +<n> if <condition>' ... - if ( $postponed{$subname} =~ s/^break\s([+-]?\d+)\s+if\s// ) { - - # If there's no offset, use '+0'. - my $offset = $1 || 0; - - # find_sub's value is 'fullpath-filename:start-stop'. It's - # possible that the filename might have colons in it too. - my ( $file, $i ) = ( find_sub($subname) =~ /^(.*):(\d+)-.*$/ ); - if ($i) { - - # We got the start line. Add the offset '+<n>' from - # $postponed{subname}. - $i += $offset; - - # Switch to the file this sub is in, temporarily. - local *dbline = $main::{ '_<' . $file }; - - # No warnings, please. - local $^W = 0; # != 0 is magical below - - # This file's got a breakpoint in it. - $had_breakpoints{$file} |= 1; - - # Last line in file. - my $max = $#dbline; - - # Search forward until we hit a breakable line or get to - # the end of the file. - ++$i until $dbline[$i] != 0 or $i >= $max; - - # Copy the breakpoint in and delete it from %postponed. - $dbline{$i} = delete $postponed{$subname}; - } ## end if ($i) - - # find_sub didn't find the sub. - else { - local $\ = ''; - print $OUT "Subroutine $subname not found.\n"; - } - return; - } ## end if ($postponed{$subname... - elsif ( $postponed{$subname} eq 'compile' ) { $signal = 1 } - - #print $OUT "In postponed_sub for `$subname'.\n"; -} ## end sub postponed_sub - -=head2 C<postponed> - -Called after each required file is compiled, but before it is executed; -also called if the name of a just-compiled subroutine is a key of -C<%postponed>. Propagates saved breakpoints (from C<b compile>, C<b load>, -etc.) into the just-compiled code. - -If this is a C<require>'d file, the incoming parameter is the glob -C<*{"_<$filename"}>, with C<$filename> the name of the C<require>'d file. - -If it's a subroutine, the incoming parameter is the subroutine name. - -=cut - -sub postponed { - - # If there's a break, process it. - if ($ImmediateStop) { - - # Right, we've stopped. Turn it off. - $ImmediateStop = 0; - - # Enter the command loop when DB::DB gets called. - $signal = 1; - } - - # If this is a subroutine, let postponed_sub() deal with it. - return &postponed_sub unless ref \$_[0] eq 'GLOB'; - - # Not a subroutine. Deal with the file. - local *dbline = shift; - my $filename = $dbline; - $filename =~ s/^_<//; - local $\ = ''; - $signal = 1, print $OUT "'$filename' loaded...\n" - if $break_on_load{$filename}; - print_lineinfo( ' ' x $stack_depth, "Package $filename.\n" ) if $frame; - - # Do we have any breakpoints to put in this file? - return unless $postponed_file{$filename}; - - # Yes. Mark this file as having breakpoints. - $had_breakpoints{$filename} |= 1; - - # "Cannot be done: unsufficient magic" - we can't just put the - # breakpoints saved in %postponed_file into %dbline by assigning - # the whole hash; we have to do it one item at a time for the - # breakpoints to be set properly. - #%dbline = %{$postponed_file{$filename}}; - - # Set the breakpoints, one at a time. - my $key; - - for $key ( keys %{ $postponed_file{$filename} } ) { - - # Stash the saved breakpoint into the current file's magic line array. - $dbline{$key} = ${ $postponed_file{$filename} }{$key}; - } - - # This file's been compiled; discard the stored breakpoints. - delete $postponed_file{$filename}; - -} ## end sub postponed - -=head2 C<dumpit> - -C<dumpit> is the debugger's wrapper around dumpvar.pl. - -It gets a filehandle (to which C<dumpvar.pl>'s output will be directed) and -a reference to a variable (the thing to be dumped) as its input. - -The incoming filehandle is selected for output (C<dumpvar.pl> is printing to -the currently-selected filehandle, thank you very much). The current -values of the package globals C<$single> and C<$trace> are backed up in -lexicals, and they are turned off (this keeps the debugger from trying -to single-step through C<dumpvar.pl> (I think.)). C<$frame> is localized to -preserve its current value and it is set to zero to prevent entry/exit -messages from printing, and C<$doret> is localized as well and set to -2 to -prevent return values from being shown. - -C<dumpit()> then checks to see if it needs to load C<dumpvar.pl> and -tries to load it (note: if you have a C<dumpvar.pl> ahead of the -installed version in C<@INC>, yours will be used instead. Possible security -problem?). - -It then checks to see if the subroutine C<main::dumpValue> is now defined -(it should have been defined by C<dumpvar.pl>). If it has, C<dumpit()> -localizes the globals necessary for things to be sane when C<main::dumpValue()> -is called, and picks up the variable to be dumped from the parameter list. - -It checks the package global C<%options> to see if there's a C<dumpDepth> -specified. If not, -1 is assumed; if so, the supplied value gets passed on to -C<dumpvar.pl>. This tells C<dumpvar.pl> where to leave off when dumping a -structure: -1 means dump everything. - -C<dumpValue()> is then called if possible; if not, C<dumpit()>just prints a -warning. - -In either case, C<$single>, C<$trace>, C<$frame>, and C<$doret> are restored -and we then return to the caller. - -=cut - -sub dumpit { - - # Save the current output filehandle and switch to the one - # passed in as the first parameter. - local ($savout) = select(shift); - - # Save current settings of $single and $trace, and then turn them off. - my $osingle = $single; - my $otrace = $trace; - $single = $trace = 0; - - # XXX Okay, what do $frame and $doret do, again? - local $frame = 0; - local $doret = -2; - - # Load dumpvar.pl unless we've already got the sub we need from it. - unless ( defined &main::dumpValue ) { - do 'dumpvar.pl'; - } - - # If the load succeeded (or we already had dumpvalue()), go ahead - # and dump things. - if ( defined &main::dumpValue ) { - local $\ = ''; - local $, = ''; - local $" = ' '; - my $v = shift; - my $maxdepth = shift || $option{dumpDepth}; - $maxdepth = -1 unless defined $maxdepth; # -1 means infinite depth - &main::dumpValue( $v, $maxdepth ); - } ## end if (defined &main::dumpValue) - - # Oops, couldn't load dumpvar.pl. - else { - local $\ = ''; - print $OUT "dumpvar.pl not available.\n"; - } - - # Reset $single and $trace to their old values. - $single = $osingle; - $trace = $otrace; - - # Restore the old filehandle. - select($savout); -} ## end sub dumpit - -=head2 C<print_trace> - -C<print_trace>'s job is to print a stack trace. It does this via the -C<dump_trace> routine, which actually does all the ferreting-out of the -stack trace data. C<print_trace> takes care of formatting it nicely and -printing it to the proper filehandle. - -Parameters: - -=over 4 - -=item * - -The filehandle to print to. - -=item * - -How many frames to skip before starting trace. - -=item * - -How many frames to print. - -=item * - -A flag: if true, print a I<short> trace without filenames, line numbers, or arguments - -=back - -The original comment below seems to be noting that the traceback may not be -correct if this routine is called in a tied method. - -=cut - -# Tied method do not create a context, so may get wrong message: - -sub print_trace { - local $\ = ''; - my $fh = shift; - - # If this is going to a slave editor, but we're not the primary - # debugger, reset it first. - resetterm(1) - if $fh eq $LINEINFO # slave editor - and $LINEINFO eq $OUT # normal output - and $term_pid != $$; # not the primary - - # Collect the actual trace information to be formatted. - # This is an array of hashes of subroutine call info. - my @sub = dump_trace( $_[0] + 1, $_[1] ); - - # Grab the "short report" flag from @_. - my $short = $_[2]; # Print short report, next one for sub name - - # Run through the traceback info, format it, and print it. - my $s; - for ( $i = 0 ; $i <= $#sub ; $i++ ) { - - # Drop out if the user has lost interest and hit control-C. - last if $signal; - - # Set the separator so arrys print nice. - local $" = ', '; - - # Grab and stringify the arguments if they are there. - my $args = - defined $sub[$i]{args} - ? "(@{ $sub[$i]{args} })" - : ''; - - # Shorten them up if $maxtrace says they're too long. - $args = ( substr $args, 0, $maxtrace - 3 ) . '...' - if length $args > $maxtrace; - - # Get the file name. - my $file = $sub[$i]{file}; - - # Put in a filename header if short is off. - $file = $file eq '-e' ? $file : "file `$file'" unless $short; - - # Get the actual sub's name, and shorten to $maxtrace's requirement. - $s = $sub[$i]{sub}; - $s = ( substr $s, 0, $maxtrace - 3 ) . '...' if length $s > $maxtrace; - - # Short report uses trimmed file and sub names. - if ($short) { - my $sub = @_ >= 4 ? $_[3] : $s; - print $fh "$sub[$i]{context}=$sub$args from $file:$sub[$i]{line}\n"; - } ## end if ($short) - - # Non-short report includes full names. - else { - print $fh "$sub[$i]{context} = $s$args" - . " called from $file" - . " line $sub[$i]{line}\n"; - } - } ## end for ($i = 0 ; $i <= $#sub... -} ## end sub print_trace - -=head2 dump_trace(skip[,count]) - -Actually collect the traceback information available via C<caller()>. It does -some filtering and cleanup of the data, but mostly it just collects it to -make C<print_trace()>'s job easier. - -C<skip> defines the number of stack frames to be skipped, working backwards -from the most current. C<count> determines the total number of frames to -be returned; all of them (well, the first 10^9) are returned if C<count> -is omitted. - -This routine returns a list of hashes, from most-recent to least-recent -stack frame. Each has the following keys and values: - -=over 4 - -=item * C<context> - C<.> (null), C<$> (scalar), or C<@> (array) - -=item * C<sub> - subroutine name, or C<eval> information - -=item * C<args> - undef, or a reference to an array of arguments - -=item * C<file> - the file in which this item was defined (if any) - -=item * C<line> - the line on which it was defined - -=back - -=cut - -sub dump_trace { - - # How many levels to skip. - my $skip = shift; - - # How many levels to show. (1e9 is a cheap way of saying "all of them"; - # it's unlikely that we'll have more than a billion stack frames. If you - # do, you've got an awfully big machine...) - my $count = shift || 1e9; - - # We increment skip because caller(1) is the first level *back* from - # the current one. Add $skip to the count of frames so we have a - # simple stop criterion, counting from $skip to $count+$skip. - $skip++; - $count += $skip; - - # These variables are used to capture output from caller(); - my ( $p, $file, $line, $sub, $h, $context ); - - my ( $e, $r, @a, @sub, $args ); - - # XXX Okay... why'd we do that? - my $nothard = not $frame & 8; - local $frame = 0; - - # Do not want to trace this. - my $otrace = $trace; - $trace = 0; - - # Start out at the skip count. - # If we haven't reached the number of frames requested, and caller() is - # still returning something, stay in the loop. (If we pass the requested - # number of stack frames, or we run out - caller() returns nothing - we - # quit. - # Up the stack frame index to go back one more level each time. - for ( - $i = $skip ; - $i < $count - and ( $p, $file, $line, $sub, $h, $context, $e, $r ) = caller($i) ; - $i++ - ) - { - - # Go through the arguments and save them for later. - @a = (); - for $arg (@args) { - my $type; - if ( not defined $arg ) { # undefined parameter - push @a, "undef"; - } - - elsif ( $nothard and tied $arg ) { # tied parameter - push @a, "tied"; - } - elsif ( $nothard and $type = ref $arg ) { # reference - push @a, "ref($type)"; - } - else { # can be stringified - local $_ = - "$arg"; # Safe to stringify now - should not call f(). - - # Backslash any single-quotes or backslashes. - s/([\'\\])/\\$1/g; - - # Single-quote it unless it's a number or a colon-separated - # name. - s/(.*)/'$1'/s - unless /^(?: -?[\d.]+ | \*[\w:]* )$/x; - - # Turn high-bit characters into meta-whatever. - s/([\200-\377])/sprintf("M-%c",ord($1)&0177)/eg; - - # Turn control characters into ^-whatever. - s/([\0-\37\177])/sprintf("^%c",ord($1)^64)/eg; - - push( @a, $_ ); - } ## end else [ if (not defined $arg) - } ## end for $arg (@args) - - # If context is true, this is array (@)context. - # If context is false, this is scalar ($) context. - # If neither, context isn't defined. (This is apparently a 'can't - # happen' trap.) - $context = $context ? '@' : ( defined $context ? "\$" : '.' ); - - # if the sub has args ($h true), make an anonymous array of the - # dumped args. - $args = $h ? [@a] : undef; - - # remove trailing newline-whitespace-semicolon-end of line sequence - # from the eval text, if any. - $e =~ s/\n\s*\;\s*\Z// if $e; - - # Escape backslashed single-quotes again if necessary. - $e =~ s/([\\\'])/\\$1/g if $e; - - # if the require flag is true, the eval text is from a require. - if ($r) { - $sub = "require '$e'"; - } - - # if it's false, the eval text is really from an eval. - elsif ( defined $r ) { - $sub = "eval '$e'"; - } - - # If the sub is '(eval)', this is a block eval, meaning we don't - # know what the eval'ed text actually was. - elsif ( $sub eq '(eval)' ) { - $sub = "eval {...}"; - } - - # Stick the collected information into @sub as an anonymous hash. - push( - @sub, - { - context => $context, - sub => $sub, - args => $args, - file => $file, - line => $line - } - ); - - # Stop processing frames if the user hit control-C. - last if $signal; - } ## end for ($i = $skip ; $i < ... - - # Restore the trace value again. - $trace = $otrace; - @sub; -} ## end sub dump_trace - -=head2 C<action()> - -C<action()> takes input provided as the argument to an add-action command, -either pre- or post-, and makes sure it's a complete command. It doesn't do -any fancy parsing; it just keeps reading input until it gets a string -without a trailing backslash. - -=cut - -sub action { - my $action = shift; - - while ( $action =~ s/\\$// ) { - - # We have a backslash on the end. Read more. - $action .= &gets; - } ## end while ($action =~ s/\\$//) - - # Return the assembled action. - $action; -} ## end sub action - -=head2 unbalanced - -This routine mostly just packages up a regular expression to be used -to check that the thing it's being matched against has properly-matched -curly braces. - -Of note is the definition of the C<$balanced_brace_re> global via C<||=>, which -speeds things up by only creating the qr//'ed expression once; if it's -already defined, we don't try to define it again. A speed hack. - -=cut - -sub unbalanced { - - # I hate using globals! - $balanced_brace_re ||= qr{ - ^ \{ - (?: - (?> [^{}] + ) # Non-parens without backtracking - | - (??{ $balanced_brace_re }) # Group with matching parens - ) * - \} $ - }x; - return $_[0] !~ m/$balanced_brace_re/; -} ## end sub unbalanced - -=head2 C<gets()> - -C<gets()> is a primitive (very primitive) routine to read continuations. -It was devised for reading continuations for actions. -it just reads more input with C<readline()> and returns it. - -=cut - -sub gets { - &readline("cont: "); -} - -=head2 C<DB::system()> - handle calls to<system()> without messing up the debugger - -The C<system()> function assumes that it can just go ahead and use STDIN and -STDOUT, but under the debugger, we want it to use the debugger's input and -outout filehandles. - -C<DB::system()> socks away the program's STDIN and STDOUT, and then substitutes -the debugger's IN and OUT filehandles for them. It does the C<system()> call, -and then puts everything back again. - -=cut - -sub system { - - # We save, change, then restore STDIN and STDOUT to avoid fork() since - # some non-Unix systems can do system() but have problems with fork(). - open( SAVEIN, "<&STDIN" ) || &warn("Can't save STDIN"); - open( SAVEOUT, ">&STDOUT" ) || &warn("Can't save STDOUT"); - open( STDIN, "<&IN" ) || &warn("Can't redirect STDIN"); - open( STDOUT, ">&OUT" ) || &warn("Can't redirect STDOUT"); - - # XXX: using csh or tcsh destroys sigint retvals! - system(@_); - open( STDIN, "<&SAVEIN" ) || &warn("Can't restore STDIN"); - open( STDOUT, ">&SAVEOUT" ) || &warn("Can't restore STDOUT"); - close(SAVEIN); - close(SAVEOUT); - - # most of the $? crud was coping with broken cshisms - if ( $? >> 8 ) { - &warn( "(Command exited ", ( $? >> 8 ), ")\n" ); - } - elsif ($?) { - &warn( - "(Command died of SIG#", - ( $? & 127 ), - ( ( $? & 128 ) ? " -- core dumped" : "" ), - ")", "\n" - ); - } ## end elsif ($?) - - return $?; - -} ## end sub system - -=head1 TTY MANAGEMENT - -The subs here do some of the terminal management for multiple debuggers. - -=head2 setterm - -Top-level function called when we want to set up a new terminal for use -by the debugger. - -If the C<noTTY> debugger option was set, we'll either use the terminal -supplied (the value of the C<noTTY> option), or we'll use C<Term::Rendezvous> -to find one. If we're a forked debugger, we call C<resetterm> to try to -get a whole new terminal if we can. - -In either case, we set up the terminal next. If the C<ReadLine> option was -true, we'll get a C<Term::ReadLine> object for the current terminal and save -the appropriate attributes. We then - -=cut - -sub setterm { - - # Load Term::Readline, but quietly; don't debug it and don't trace it. - local $frame = 0; - local $doret = -2; - eval { require Term::ReadLine } or die $@; - - # If noTTY is set, but we have a TTY name, go ahead and hook up to it. - if ($notty) { - if ($tty) { - my ( $i, $o ) = split $tty, /,/; - $o = $i unless defined $o; - open( IN, "<$i" ) or die "Cannot open TTY `$i' for read: $!"; - open( OUT, ">$o" ) or die "Cannot open TTY `$o' for write: $!"; - $IN = \*IN; - $OUT = \*OUT; - my $sel = select($OUT); - $| = 1; - select($sel); - } ## end if ($tty) - - # We don't have a TTY - try to find one via Term::Rendezvous. - else { - eval "require Term::Rendezvous;" or die; - - # See if we have anything to pass to Term::Rendezvous. - # Use $HOME/.perldbtty$$ if not. - my $rv = $ENV{PERLDB_NOTTY} || "$ENV{HOME}/.perldbtty$$"; - - # Rendezvous and get the filehandles. - my $term_rv = new Term::Rendezvous $rv; - $IN = $term_rv->IN; - $OUT = $term_rv->OUT; - } ## end else [ if ($tty) - } ## end if ($notty) - - # We're a daughter debugger. Try to fork off another TTY. - if ( $term_pid eq '-1' ) { # In a TTY with another debugger - resetterm(2); - } - - # If we shouldn't use Term::ReadLine, don't. - if ( !$rl ) { - $term = new Term::ReadLine::Stub 'perldb', $IN, $OUT; - } - - # We're using Term::ReadLine. Get all the attributes for this terminal. - else { - $term = new Term::ReadLine 'perldb', $IN, $OUT; - - $rl_attribs = $term->Attribs; - $rl_attribs->{basic_word_break_characters} .= '-:+/*,[])}' - if defined $rl_attribs->{basic_word_break_characters} - and index( $rl_attribs->{basic_word_break_characters}, ":" ) == -1; - $rl_attribs->{special_prefixes} = '$@&%'; - $rl_attribs->{completer_word_break_characters} .= '$@&%'; - $rl_attribs->{completion_function} = \&db_complete; - } ## end else [ if (!$rl) - - # Set up the LINEINFO filehandle. - $LINEINFO = $OUT unless defined $LINEINFO; - $lineinfo = $console unless defined $lineinfo; - - $term->MinLine(2); - - if ( $term->Features->{setHistory} and "@hist" ne "?" ) { - $term->SetHistory(@hist); - } - - # XXX Ornaments are turned on unconditionally, which is not - # always a good thing. - ornaments($ornaments) if defined $ornaments; - $term_pid = $$; -} ## end sub setterm - -=head1 GET_FORK_TTY EXAMPLE FUNCTIONS - -When the process being debugged forks, or the process invokes a command -via C<system()> which starts a new debugger, we need to be able to get a new -C<IN> and C<OUT> filehandle for the new debugger. Otherwise, the two processes -fight over the terminal, and you can never quite be sure who's going to get the -input you're typing. - -C<get_fork_TTY> is a glob-aliased function which calls the real function that -is tasked with doing all the necessary operating system mojo to get a new -TTY (and probably another window) and to direct the new debugger to read and -write there. - -The debugger provides C<get_fork_TTY> functions which work for X Windows and -OS/2. Other systems are not supported. You are encouraged to write -C<get_fork_TTY> functions which work for I<your> platform and contribute them. - -=head3 C<xterm_get_fork_TTY> - -This function provides the C<get_fork_TTY> function for X windows. If a -program running under the debugger forks, a new <xterm> window is opened and -the subsidiary debugger is directed there. - -The C<open()> call is of particular note here. We have the new C<xterm> -we're spawning route file number 3 to STDOUT, and then execute the C<tty> -command (which prints the device name of the TTY we'll want to use for input -and output to STDOUT, then C<sleep> for a very long time, routing this output -to file number 3. This way we can simply read from the <XT> filehandle (which -is STDOUT from the I<commands> we ran) to get the TTY we want to use. - -Only works if C<xterm> is in your path and C<$ENV{DISPLAY}>, etc. are -properly set up. - -=cut - -sub xterm_get_fork_TTY { - ( my $name = $0 ) =~ s,^.*[/\\],,s; - open XT, -qq[3>&1 xterm -title "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\ - sleep 10000000' |]; - - # Get the output from 'tty' and clean it up a little. - my $tty = <XT>; - chomp $tty; - - $pidprompt = ''; # Shown anyway in titlebar - - # There's our new TTY. - return $tty; -} ## end sub xterm_get_fork_TTY - -=head3 C<os2_get_fork_TTY> - -XXX It behooves an OS/2 expert to write the necessary documentation for this! - -=cut - -# This example function resets $IN, $OUT itself -sub os2_get_fork_TTY { - local $^F = 40; # XXXX Fixme! - local $\ = ''; - my ( $in1, $out1, $in2, $out2 ); - - # Having -d in PERL5OPT would lead to a disaster... - local $ENV{PERL5OPT} = $ENV{PERL5OPT} if $ENV{PERL5OPT}; - $ENV{PERL5OPT} =~ s/(?:^|(?<=\s))-d\b// if $ENV{PERL5OPT}; - $ENV{PERL5OPT} =~ s/(?:^|(?<=\s))-d\B/-/ if $ENV{PERL5OPT}; - print $OUT "Making kid PERL5OPT->`$ENV{PERL5OPT}'.\n" if $ENV{PERL5OPT}; - local $ENV{PERL5LIB} = $ENV{PERL5LIB} ? $ENV{PERL5LIB} : $ENV{PERLLIB}; - $ENV{PERL5LIB} = '' unless defined $ENV{PERL5LIB}; - $ENV{PERL5LIB} = join ';', @ini_INC, split /;/, $ENV{PERL5LIB}; - ( my $name = $0 ) =~ s,^.*[/\\],,s; - my @args; - - if ( - pipe $in1, $out1 - and pipe $in2, $out2 - - # system P_SESSION will fail if there is another process - # in the same session with a "dependent" asynchronous child session. - and @args = ( - $rl, fileno $in1, fileno $out2, "Daughter Perl debugger $pids $name" - ) - and ( - ( $kpid = CORE::system 4, $^X, '-we', - <<'ES', @args ) >= 0 # P_SESSION -END {sleep 5 unless $loaded} -BEGIN {open STDIN, '</dev/con' or warn "reopen stdin: $!"} -use OS2::Process; - -my ($rl, $in) = (shift, shift); # Read from $in and pass through -set_title pop; -system P_NOWAIT, $^X, '-we', <<EOS or die "Cannot start a grandkid"; - open IN, '<&=$in' or die "open <&=$in: \$!"; - \$| = 1; print while sysread IN, \$_, 1<<16; -EOS - -my $out = shift; -open OUT, ">&=$out" or die "Cannot open &=$out for writing: $!"; -select OUT; $| = 1; -require Term::ReadKey if $rl; -Term::ReadKey::ReadMode(4) if $rl; # Nodelay on kbd. Pipe is automatically nodelay... -print while sysread STDIN, $_, 1<<($rl ? 16 : 0); -ES - or warn "system P_SESSION: $!, $^E" and 0 - ) - and close $in1 - and close $out2 - ) - { - $pidprompt = ''; # Shown anyway in titlebar - reset_IN_OUT( $in2, $out1 ); - $tty = '*reset*'; - return ''; # Indicate that reset_IN_OUT is called - } ## end if (pipe $in1, $out1 and... - return; -} ## end sub os2_get_fork_TTY - -=head2 C<create_IN_OUT($flags)> - -Create a new pair of filehandles, pointing to a new TTY. If impossible, -try to diagnose why. - -Flags are: - -=over 4 - -=item * 1 - Don't know how to create a new TTY. - -=item * 2 - Debugger has forked, but we can't get a new TTY. - -=item * 4 - standard debugger startup is happening. - -=back - -=cut - -sub create_IN_OUT { # Create a window with IN/OUT handles redirected there - - # If we know how to get a new TTY, do it! $in will have - # the TTY name if get_fork_TTY works. - my $in = &get_fork_TTY if defined &get_fork_TTY; - - # It used to be that - $in = $fork_TTY if defined $fork_TTY; # Backward compatibility - - if ( not defined $in ) { - my $why = shift; - - # We don't know how. - print_help(<<EOP) if $why == 1; -I<#########> Forked, but do not know how to create a new B<TTY>. I<#########> -EOP - - # Forked debugger. - print_help(<<EOP) if $why == 2; -I<#########> Daughter session, do not know how to change a B<TTY>. I<#########> - This may be an asynchronous session, so the parent debugger may be active. -EOP - - # Note that both debuggers are fighting over the same input. - print_help(<<EOP) if $why != 4; - Since two debuggers fight for the same TTY, input is severely entangled. - -EOP - print_help(<<EOP); - I know how to switch the output to a different window in xterms - and OS/2 consoles only. For a manual switch, put the name of the created I<TTY> - in B<\$DB::fork_TTY>, or define a function B<DB::get_fork_TTY()> returning this. - - On I<UNIX>-like systems one can get the name of a I<TTY> for the given window - by typing B<tty>, and disconnect the I<shell> from I<TTY> by B<sleep 1000000>. - -EOP - } ## end if (not defined $in) - elsif ( $in ne '' ) { - TTY($in); - } - else { - $console = ''; # Indicate no need to open-from-the-console - } - undef $fork_TTY; -} ## end sub create_IN_OUT - -=head2 C<resetterm> - -Handles rejiggering the prompt when we've forked off a new debugger. - -If the new debugger happened because of a C<system()> that invoked a -program under the debugger, the arrow between the old pid and the new -in the prompt has I<two> dashes instead of one. - -We take the current list of pids and add this one to the end. If there -isn't any list yet, we make one up out of the initial pid associated with -the terminal and our new pid, sticking an arrow (either one-dashed or -two dashed) in between them. - -If C<CreateTTY> is off, or C<resetterm> was called with no arguments, -we don't try to create a new IN and OUT filehandle. Otherwise, we go ahead -and try to do that. - -=cut - -sub resetterm { # We forked, so we need a different TTY - - # Needs to be passed to create_IN_OUT() as well. - my $in = shift; - - # resetterm(2): got in here because of a system() starting a debugger. - # resetterm(1): just forked. - my $systemed = $in > 1 ? '-' : ''; - - # If there's already a list of pids, add this to the end. - if ($pids) { - $pids =~ s/\]/$systemed->$$]/; - } - - # No pid list. Time to make one. - else { - $pids = "[$term_pid->$$]"; - } - - # The prompt we're going to be using for this debugger. - $pidprompt = $pids; - - # We now 0wnz this terminal. - $term_pid = $$; - - # Just return if we're not supposed to try to create a new TTY. - return unless $CreateTTY & $in; - - # Try to create a new IN/OUT pair. - create_IN_OUT($in); -} ## end sub resetterm - -=head2 C<readline> - -First, we handle stuff in the typeahead buffer. If there is any, we shift off -the next line, print a message saying we got it, add it to the terminal -history (if possible), and return it. - -If there's nothing in the typeahead buffer, check the command filehandle stack. -If there are any filehandles there, read from the last one, and return the line -if we got one. If not, we pop the filehandle off and close it, and try the -next one up the stack. - -If we've emptied the filehandle stack, we check to see if we've got a socket -open, and we read that and return it if we do. If we don't, we just call the -core C<readline()> and return its value. - -=cut - -sub readline { - - # Localize to prevent it from being smashed in the program being debugged. - local $.; - - # Pull a line out of the typeahead if there's stuff there. - if (@typeahead) { - - # How many lines left. - my $left = @typeahead; - - # Get the next line. - my $got = shift @typeahead; - - # Print a message saying we got input from the typeahead. - local $\ = ''; - print $OUT "auto(-$left)", shift, $got, "\n"; - - # Add it to the terminal history (if possible). - $term->AddHistory($got) - if length($got) > 1 - and defined $term->Features->{addHistory}; - return $got; - } ## end if (@typeahead) - - # We really need to read some input. Turn off entry/exit trace and - # return value printing. - local $frame = 0; - local $doret = -2; - - # If there are stacked filehandles to read from ... - while (@cmdfhs) { - - # Read from the last one in the stack. - my $line = CORE::readline( $cmdfhs[-1] ); - - # If we got a line ... - defined $line - ? ( print $OUT ">> $line" and return $line ) # Echo and return - : close pop @cmdfhs; # Pop and close - } ## end while (@cmdfhs) - - # Nothing on the filehandle stack. Socket? - if ( ref $OUT and UNIVERSAL::isa( $OUT, 'IO::Socket::INET' ) ) { - - # Send anyting we have to send. - $OUT->write( join( '', @_ ) ); - - # Receive anything there is to receive. - my $stuff; - $IN->recv( $stuff, 2048 ); # XXX "what's wrong with sysread?" - # XXX Don't know. You tell me. - - # What we got. - $stuff; - } ## end if (ref $OUT and UNIVERSAL::isa... - - # No socket. Just read from the terminal. - else { - $term->readline(@_); - } -} ## end sub readline - -=head1 OPTIONS SUPPORT ROUTINES - -These routines handle listing and setting option values. - -=head2 C<dump_option> - list the current value of an option setting - -This routine uses C<option_val> to look up the value for an option. -It cleans up escaped single-quotes and then displays the option and -its value. - -=cut - -sub dump_option { - my ( $opt, $val ) = @_; - $val = option_val( $opt, 'N/A' ); - $val =~ s/([\\\'])/\\$1/g; - printf $OUT "%20s = '%s'\n", $opt, $val; -} ## end sub dump_option - -sub options2remember { - foreach my $k (@RememberOnROptions) { - $option{$k} = option_val( $k, 'N/A' ); - } - return %option; -} - -=head2 C<option_val> - find the current value of an option - -This can't just be a simple hash lookup because of the indirect way that -the option values are stored. Some are retrieved by calling a subroutine, -some are just variables. - -You must supply a default value to be used in case the option isn't set. - -=cut - -sub option_val { - my ( $opt, $default ) = @_; - my $val; - - # Does this option exist, and is it a variable? - # If so, retrieve the value via the value in %optionVars. - if ( defined $optionVars{$opt} - and defined ${ $optionVars{$opt} } ) - { - $val = ${ $optionVars{$opt} }; - } - - # Does this option exist, and it's a subroutine? - # If so, call the subroutine via the ref in %optionAction - # and capture the value. - elsif ( defined $optionAction{$opt} - and defined &{ $optionAction{$opt} } ) - { - $val = &{ $optionAction{$opt} }(); - } - - # If there's an action or variable for the supplied option, - # but no value was set, use the default. - elsif (defined $optionAction{$opt} and not defined $option{$opt} - or defined $optionVars{$opt} and not defined ${ $optionVars{$opt} } ) - { - $val = $default; - } - - # Otherwise, do the simple hash lookup. - else { - $val = $option{$opt}; - } - - # If the value isn't defined, use the default. - # Then return whatever the value is. - $val = $default unless defined $val; - $val; -} ## end sub option_val - -=head2 C<parse_options> - -Handles the parsing and execution of option setting/displaying commands. - -An option entered by itself is assumed to be I<set me to 1> (the default value) -if the option is a boolean one. If not, the user is prompted to enter a valid -value or to query the current value (via C<option? >). - -If C<option=value> is entered, we try to extract a quoted string from the -value (if it is quoted). If it's not, we just use the whole value as-is. - -We load any modules required to service this option, and then we set it: if -it just gets stuck in a variable, we do that; if there's a subroutine to -handle setting the option, we call that. - -Finally, if we're running in interactive mode, we display the effect of the -user's command back to the terminal, skipping this if we're setting things -during initialization. - -=cut - -sub parse_options { - local ($_) = @_; - local $\ = ''; - - # These options need a value. Don't allow them to be clobbered by accident. - my %opt_needs_val = map { ( $_ => 1 ) } qw{ - dumpDepth arrayDepth hashDepth LineInfo maxTraceLen ornaments windowSize - pager quote ReadLine recallCommand RemotePort ShellBang TTY CommandSet - }; - - while (length) { - my $val_defaulted; - - # Clean off excess leading whitespace. - s/^\s+// && next; - - # Options are always all word characters, followed by a non-word - # separator. - s/^(\w+)(\W?)// or print( $OUT "Invalid option `$_'\n" ), last; - my ( $opt, $sep ) = ( $1, $2 ); - - # Make sure that such an option exists. - my $matches = grep( /^\Q$opt/ && ( $option = $_ ), @options ) - || grep( /^\Q$opt/i && ( $option = $_ ), @options ); - - print( $OUT "Unknown option `$opt'\n" ), next unless $matches; - print( $OUT "Ambiguous option `$opt'\n" ), next if $matches > 1; - my $val; - - # '?' as separator means query, but must have whitespace after it. - if ( "?" eq $sep ) { - print( $OUT "Option query `$opt?' followed by non-space `$_'\n" ), - last - if /^\S/; - - #&dump_option($opt); - } ## end if ("?" eq $sep) - - # Separator is whitespace (or just a carriage return). - # They're going for a default, which we assume is 1. - elsif ( $sep !~ /\S/ ) { - $val_defaulted = 1; - $val = "1"; # this is an evil default; make 'em set it! - } - - # Separator is =. Trying to set a value. - elsif ( $sep eq "=" ) { - - # If quoted, extract a quoted string. - if (s/ (["']) ( (?: \\. | (?! \1 ) [^\\] )* ) \1 //x) { - my $quote = $1; - ( $val = $2 ) =~ s/\\([$quote\\])/$1/g; - } - - # Not quoted. Use the whole thing. Warn about 'option='. - else { - s/^(\S*)//; - $val = $1; - print OUT qq(Option better cleared using $opt=""\n) - unless length $val; - } ## end else [ if (s/ (["']) ( (?: \\. | (?! \1 ) [^\\] )* ) \1 //x) - - } ## end elsif ($sep eq "=") - - # "Quoted" with [], <>, or {}. - else { #{ to "let some poor schmuck bounce on the % key in B<vi>." - my ($end) = - "\\" . substr( ")]>}$sep", index( "([<{", $sep ), 1 ); #} - s/^(([^\\$end]|\\[\\$end])*)$end($|\s+)// - or print( $OUT "Unclosed option value `$opt$sep$_'\n" ), last; - ( $val = $1 ) =~ s/\\([\\$end])/$1/g; - } ## end else [ if ("?" eq $sep) - - # Exclude non-booleans from getting set to 1 by default. - if ( $opt_needs_val{$option} && $val_defaulted ) { - my $cmd = ( $CommandSet eq '580' ) ? 'o' : 'O'; - print $OUT -"Option `$opt' is non-boolean. Use `$cmd $option=VAL' to set, `$cmd $option?' to query\n"; - next; - } ## end if ($opt_needs_val{$option... - - # Save the option value. - $option{$option} = $val if defined $val; - - # Load any module that this option requires. - eval qq{ - local \$frame = 0; - local \$doret = -2; - require '$optionRequire{$option}'; - 1; - } || die # XXX: shouldn't happen - if defined $optionRequire{$option} - && defined $val; - - # Set it. - # Stick it in the proper variable if it goes in a variable. - ${ $optionVars{$option} } = $val - if defined $optionVars{$option} - && defined $val; - - # Call the appropriate sub if it gets set via sub. - &{ $optionAction{$option} }($val) - if defined $optionAction{$option} - && defined &{ $optionAction{$option} } - && defined $val; - - # Not initialization - echo the value we set it to. - dump_option($option) unless $OUT eq \*STDERR; - } ## end while (length) -} ## end sub parse_options - -=head1 RESTART SUPPORT - -These routines are used to store (and restore) lists of items in environment -variables during a restart. - -=head2 set_list - -Set_list packages up items to be stored in a set of environment variables -(VAR_n, containing the number of items, and VAR_0, VAR_1, etc., containing -the values). Values outside the standard ASCII charset are stored by encoding -then as hexadecimal values. - -=cut - -sub set_list { - my ( $stem, @list ) = @_; - my $val; - - # VAR_n: how many we have. Scalar assignment gets the number of items. - $ENV{"${stem}_n"} = @list; - - # Grab each item in the list, escape the backslashes, encode the non-ASCII - # as hex, and then save in the appropriate VAR_0, VAR_1, etc. - for $i ( 0 .. $#list ) { - $val = $list[$i]; - $val =~ s/\\/\\\\/g; - $val =~ s/([\0-\37\177\200-\377])/"\\0x" . unpack('H2',$1)/eg; - $ENV{"${stem}_$i"} = $val; - } ## end for $i (0 .. $#list) -} ## end sub set_list - -=head2 get_list - -Reverse the set_list operation: grab VAR_n to see how many we should be getting -back, and then pull VAR_0, VAR_1. etc. back out. - -=cut - -sub get_list { - my $stem = shift; - my @list; - my $n = delete $ENV{"${stem}_n"}; - my $val; - for $i ( 0 .. $n - 1 ) { - $val = delete $ENV{"${stem}_$i"}; - $val =~ s/\\((\\)|0x(..))/ $2 ? $2 : pack('H2', $3) /ge; - push @list, $val; - } - @list; -} ## end sub get_list - -=head1 MISCELLANEOUS SIGNAL AND I/O MANAGEMENT - -=head2 catch() - -The C<catch()> subroutine is the essence of fast and low-impact. We simply -set an already-existing global scalar variable to a constant value. This -avoids allocating any memory possibly in the middle of something that will -get all confused if we do, particularly under I<unsafe signals>. - -=cut - -sub catch { - $signal = 1; - return; # Put nothing on the stack - malloc/free land! -} - -=head2 C<warn()> - -C<warn> emits a warning, by joining together its arguments and printing -them, with couple of fillips. - -If the composited message I<doesn't> end with a newline, we automatically -add C<$!> and a newline to the end of the message. The subroutine expects $OUT -to be set to the filehandle to be used to output warnings; it makes no -assumptions about what filehandles are available. - -=cut - -sub warn { - my ($msg) = join( "", @_ ); - $msg .= ": $!\n" unless $msg =~ /\n$/; - local $\ = ''; - print $OUT $msg; -} ## end sub warn - -=head1 INITIALIZATION TTY SUPPORT - -=head2 C<reset_IN_OUT> - -This routine handles restoring the debugger's input and output filehandles -after we've tried and failed to move them elsewhere. In addition, it assigns -the debugger's output filehandle to $LINEINFO if it was already open there. - -=cut - -sub reset_IN_OUT { - my $switch_li = $LINEINFO eq $OUT; - - # If there's a term and it's able to get a new tty, try to get one. - if ( $term and $term->Features->{newTTY} ) { - ( $IN, $OUT ) = ( shift, shift ); - $term->newTTY( $IN, $OUT ); - } - - # This term can't get a new tty now. Better luck later. - elsif ($term) { - &warn("Too late to set IN/OUT filehandles, enabled on next `R'!\n"); - } - - # Set the filehndles up as they were. - else { - ( $IN, $OUT ) = ( shift, shift ); - } - - # Unbuffer the output filehandle. - my $o = select $OUT; - $| = 1; - select $o; - - # Point LINEINFO to the same output filehandle if it was there before. - $LINEINFO = $OUT if $switch_li; -} ## end sub reset_IN_OUT - -=head1 OPTION SUPPORT ROUTINES - -The following routines are used to process some of the more complicated -debugger options. - -=head2 C<TTY> - -Sets the input and output filehandles to the specified files or pipes. -If the terminal supports switching, we go ahead and do it. If not, and -there's already a terminal in place, we save the information to take effect -on restart. - -If there's no terminal yet (for instance, during debugger initialization), -we go ahead and set C<$console> and C<$tty> to the file indicated. - -=cut - -sub TTY { - if ( @_ and $term and $term->Features->{newTTY} ) { - - # This terminal supports switching to a new TTY. - # Can be a list of two files, or on string containing both names, - # comma-separated. - # XXX Should this perhaps be an assignment from @_? - my ( $in, $out ) = shift; - if ( $in =~ /,/ ) { - - # Split list apart if supplied. - ( $in, $out ) = split /,/, $in, 2; - } - else { - - # Use the same file for both input and output. - $out = $in; - } - - # Open file onto the debugger's filehandles, if you can. - open IN, $in or die "cannot open `$in' for read: $!"; - open OUT, ">$out" or die "cannot open `$out' for write: $!"; - - # Swap to the new filehandles. - reset_IN_OUT( \*IN, \*OUT ); - - # Save the setting for later. - return $tty = $in; - } ## end if (@_ and $term and $term... - - # Terminal doesn't support new TTY, or doesn't support readline. - # Can't do it now, try restarting. - &warn("Too late to set TTY, enabled on next `R'!\n") if $term and @_; - - # Useful if done through PERLDB_OPTS: - $console = $tty = shift if @_; - - # Return whatever the TTY is. - $tty or $console; -} ## end sub TTY - -=head2 C<noTTY> - -Sets the C<$notty> global, controlling whether or not the debugger tries to -get a terminal to read from. If called after a terminal is already in place, -we save the value to use it if we're restarted. - -=cut - -sub noTTY { - if ($term) { - &warn("Too late to set noTTY, enabled on next `R'!\n") if @_; - } - $notty = shift if @_; - $notty; -} ## end sub noTTY - -=head2 C<ReadLine> - -Sets the C<$rl> option variable. If 0, we use C<Term::ReadLine::Stub> -(essentially, no C<readline> processing on this I<terminal>). Otherwise, we -use C<Term::ReadLine>. Can't be changed after a terminal's in place; we save -the value in case a restart is done so we can change it then. - -=cut - -sub ReadLine { - if ($term) { - &warn("Too late to set ReadLine, enabled on next `R'!\n") if @_; - } - $rl = shift if @_; - $rl; -} ## end sub ReadLine - -=head2 C<RemotePort> - -Sets the port that the debugger will try to connect to when starting up. -If the terminal's already been set up, we can't do it, but we remember the -setting in case the user does a restart. - -=cut - -sub RemotePort { - if ($term) { - &warn("Too late to set RemotePort, enabled on next 'R'!\n") if @_; - } - $remoteport = shift if @_; - $remoteport; -} ## end sub RemotePort - -=head2 C<tkRunning> - -Checks with the terminal to see if C<Tk> is running, and returns true or -false. Returns false if the current terminal doesn't support C<readline>. - -=cut - -sub tkRunning { - if ( ${ $term->Features }{tkRunning} ) { - return $term->tkRunning(@_); - } - else { - local $\ = ''; - print $OUT "tkRunning not supported by current ReadLine package.\n"; - 0; - } -} ## end sub tkRunning - -=head2 C<NonStop> - -Sets nonstop mode. If a terminal's already been set up, it's too late; the -debugger remembers the setting in case you restart, though. - -=cut - -sub NonStop { - if ($term) { - &warn("Too late to set up NonStop mode, enabled on next `R'!\n") - if @_; - } - $runnonstop = shift if @_; - $runnonstop; -} ## end sub NonStop - -sub DollarCaretP { - if ($term) { - &warn("Some flag changes could not take effect until next 'R'!\n") - if @_; - } - $^P = parse_DollarCaretP_flags(shift) if @_; - expand_DollarCaretP_flags($^P); -} - -sub OnlyAssertions { - if ($term) { - &warn("Too late to set up OnlyAssertions mode, enabled on next 'R'!\n") - if @_; - } - if (@_) { - unless ( defined $ini_assertion ) { - if ($term) { - &warn("Current Perl interpreter doesn't support assertions"); - } - return 0; - } - if (shift) { - unless ($ini_assertion) { - print "Assertions will be active on next 'R'!\n"; - $ini_assertion = 1; - } - $^P &= ~$DollarCaretP_flags{PERLDBf_SUB}; - $^P |= $DollarCaretP_flags{PERLDBf_ASSERTION}; - } - else { - $^P |= $DollarCaretP_flags{PERLDBf_SUB}; - } - } - !( $^P & $DollarCaretP_flags{PERLDBf_SUB} ) || 0; -} - -=head2 C<pager> - -Set up the C<$pager> variable. Adds a pipe to the front unless there's one -there already. - -=cut - -sub pager { - if (@_) { - $pager = shift; - $pager = "|" . $pager unless $pager =~ /^(\+?\>|\|)/; - } - $pager; -} ## end sub pager - -=head2 C<shellBang> - -Sets the shell escape command, and generates a printable copy to be used -in the help. - -=cut - -sub shellBang { - - # If we got an argument, meta-quote it, and add '\b' if it - # ends in a word character. - if (@_) { - $sh = quotemeta shift; - $sh .= "\\b" if $sh =~ /\w$/; - } - - # Generate the printable version for the help: - $psh = $sh; # copy it - $psh =~ s/\\b$//; # Take off trailing \b if any - $psh =~ s/\\(.)/$1/g; # De-escape - $psh; # return the printable version -} ## end sub shellBang - -=head2 C<ornaments> - -If the terminal has its own ornaments, fetch them. Otherwise accept whatever -was passed as the argument. (This means you can't override the terminal's -ornaments.) - -=cut - -sub ornaments { - if ( defined $term ) { - - # We don't want to show warning backtraces, but we do want die() ones. - local ( $warnLevel, $dieLevel ) = ( 0, 1 ); - - # No ornaments if the terminal doesn't support them. - return '' unless $term->Features->{ornaments}; - eval { $term->ornaments(@_) } || ''; - } - - # Use what was passed in if we can't determine it ourselves. - else { - $ornaments = shift; - } -} ## end sub ornaments - -=head2 C<recallCommand> - -Sets the recall command, and builds a printable version which will appear in -the help text. - -=cut - -sub recallCommand { - - # If there is input, metaquote it. Add '\b' if it ends with a word - # character. - if (@_) { - $rc = quotemeta shift; - $rc .= "\\b" if $rc =~ /\w$/; - } - - # Build it into a printable version. - $prc = $rc; # Copy it - $prc =~ s/\\b$//; # Remove trailing \b - $prc =~ s/\\(.)/$1/g; # Remove escapes - $prc; # Return the printable version -} ## end sub recallCommand - -=head2 C<LineInfo> - where the line number information goes - -Called with no arguments, returns the file or pipe that line info should go to. - -Called with an argument (a file or a pipe), it opens that onto the -C<LINEINFO> filehandle, unbuffers the filehandle, and then returns the -file or pipe again to the caller. - -=cut - -sub LineInfo { - return $lineinfo unless @_; - $lineinfo = shift; - - # If this is a valid "thing to be opened for output", tack a - # '>' onto the front. - my $stream = ( $lineinfo =~ /^(\+?\>|\|)/ ) ? $lineinfo : ">$lineinfo"; - - # If this is a pipe, the stream points to a slave editor. - $slave_editor = ( $stream =~ /^\|/ ); - - # Open it up and unbuffer it. - open( LINEINFO, "$stream" ) || &warn("Cannot open `$stream' for write"); - $LINEINFO = \*LINEINFO; - my $save = select($LINEINFO); - $| = 1; - select($save); - - # Hand the file or pipe back again. - $lineinfo; -} ## end sub LineInfo - -=head1 COMMAND SUPPORT ROUTINES - -These subroutines provide functionality for various commands. - -=head2 C<list_modules> - -For the C<M> command: list modules loaded and their versions. -Essentially just runs through the keys in %INC, picks each package's -C<$VERSION> variable, gets the file name, and formats the information -for output. - -=cut - -sub list_modules { # versions - my %version; - my $file; - - # keys are the "as-loaded" name, values are the fully-qualified path - # to the file itself. - for ( keys %INC ) { - $file = $_; # get the module name - s,\.p[lm]$,,i; # remove '.pl' or '.pm' - s,/,::,g; # change '/' to '::' - s/^perl5db$/DB/; # Special case: debugger - # moves to package DB - s/^Term::ReadLine::readline$/readline/; # simplify readline - - # If the package has a $VERSION package global (as all good packages - # should!) decode it and save as partial message. - if ( defined ${ $_ . '::VERSION' } ) { - $version{$file} = "${ $_ . '::VERSION' } from "; - } - - # Finish up the message with the file the package came from. - $version{$file} .= $INC{$file}; - } ## end for (keys %INC) - - # Hey, dumpit() formats a hash nicely, so why not use it? - dumpit( $OUT, \%version ); -} ## end sub list_modules - -=head2 C<sethelp()> - -Sets up the monster string used to format and print the help. - -=head3 HELP MESSAGE FORMAT - -The help message is a peculiar format unto itself; it mixes C<pod> I<ornaments> -(C<< B<> >> C<< I<> >>) with tabs to come up with a format that's fairly -easy to parse and portable, but which still allows the help to be a little -nicer than just plain text. - -Essentially, you define the command name (usually marked up with C<< B<> >> -and C<< I<> >>), followed by a tab, and then the descriptive text, ending in a -newline. The descriptive text can also be marked up in the same way. If you -need to continue the descriptive text to another line, start that line with -just tabs and then enter the marked-up text. - -If you are modifying the help text, I<be careful>. The help-string parser is -not very sophisticated, and if you don't follow these rules it will mangle the -help beyond hope until you fix the string. - -=cut - -sub sethelp { - - # XXX: make sure there are tabs between the command and explanation, - # or print_help will screw up your formatting if you have - # eeevil ornaments enabled. This is an insane mess. - - $help = " -Help is currently only available for the new 5.8 command set. -No help is available for the old command set. -We assume you know what you're doing if you switch to it. - -B<T> Stack trace. -B<s> [I<expr>] Single step [in I<expr>]. -B<n> [I<expr>] Next, steps over subroutine calls [in I<expr>]. -<B<CR>> Repeat last B<n> or B<s> command. -B<r> Return from current subroutine. -B<c> [I<line>|I<sub>] Continue; optionally inserts a one-time-only breakpoint - at the specified position. -B<l> I<min>B<+>I<incr> List I<incr>+1 lines starting at I<min>. -B<l> I<min>B<->I<max> List lines I<min> through I<max>. -B<l> I<line> List single I<line>. -B<l> I<subname> List first window of lines from subroutine. -B<l> I<\$var> List first window of lines from subroutine referenced by I<\$var>. -B<l> List next window of lines. -B<-> List previous window of lines. -B<v> [I<line>] View window around I<line>. -B<.> Return to the executed line. -B<f> I<filename> Switch to viewing I<filename>. File must be already loaded. - I<filename> may be either the full name of the file, or a regular - expression matching the full file name: - B<f> I</home/me/foo.pl> and B<f> I<oo\\.> may access the same file. - Evals (with saved bodies) are considered to be filenames: - B<f> I<(eval 7)> and B<f> I<eval 7\\b> access the body of the 7th eval - (in the order of execution). -B</>I<pattern>B</> Search forwards for I<pattern>; final B</> is optional. -B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional. -B<L> [I<a|b|w>] List actions and or breakpoints and or watch-expressions. -B<S> [[B<!>]I<pattern>] List subroutine names [not] matching I<pattern>. -B<t> Toggle trace mode. -B<t> I<expr> Trace through execution of I<expr>. -B<b> Sets breakpoint on current line) -B<b> [I<line>] [I<condition>] - Set breakpoint; I<line> defaults to the current execution line; - I<condition> breaks if it evaluates to true, defaults to '1'. -B<b> I<subname> [I<condition>] - Set breakpoint at first line of subroutine. -B<b> I<\$var> Set breakpoint at first line of subroutine referenced by I<\$var>. -B<b> B<load> I<filename> Set breakpoint on 'require'ing the given file. -B<b> B<postpone> I<subname> [I<condition>] - Set breakpoint at first line of subroutine after - it is compiled. -B<b> B<compile> I<subname> - Stop after the subroutine is compiled. -B<B> [I<line>] Delete the breakpoint for I<line>. -B<B> I<*> Delete all breakpoints. -B<a> [I<line>] I<command> - Set an action to be done before the I<line> is executed; - I<line> defaults to the current execution line. - Sequence is: check for breakpoint/watchpoint, print line - if necessary, do action, prompt user if necessary, - execute line. -B<a> Does nothing -B<A> [I<line>] Delete the action for I<line>. -B<A> I<*> Delete all actions. -B<w> I<expr> Add a global watch-expression. -B<w> Does nothing -B<W> I<expr> Delete a global watch-expression. -B<W> I<*> Delete all watch-expressions. -B<V> [I<pkg> [I<vars>]] List some (default all) variables in package (default current). - Use B<~>I<pattern> and B<!>I<pattern> for positive and negative regexps. -B<X> [I<vars>] Same as \"B<V> I<currentpackage> [I<vars>]\". -B<x> I<expr> Evals expression in list context, dumps the result. -B<m> I<expr> Evals expression in list context, prints methods callable - on the first element of the result. -B<m> I<class> Prints methods callable via the given class. -B<M> Show versions of loaded modules. -B<i> I<class> Prints nested parents of given class. -B<e> Display current thread id. -B<E> Display all thread ids the current one will be identified: <n>. -B<y> [I<n> [I<Vars>]] List lexicals in higher scope <n>. Vars same as B<V>. -B<P> Something to do with assertions... - -B<<> ? List Perl commands to run before each prompt. -B<<> I<expr> Define Perl command to run before each prompt. -B<<<> I<expr> Add to the list of Perl commands to run before each prompt. -B<< *> Delete the list of perl commands to run before each prompt. -B<>> ? List Perl commands to run after each prompt. -B<>> I<expr> Define Perl command to run after each prompt. -B<>>B<>> I<expr> Add to the list of Perl commands to run after each prompt. -B<>>B< *> Delete the list of Perl commands to run after each prompt. -B<{> I<db_command> Define debugger command to run before each prompt. -B<{> ? List debugger commands to run before each prompt. -B<{{> I<db_command> Add to the list of debugger commands to run before each prompt. -B<{ *> Delete the list of debugger commands to run before each prompt. -B<$prc> I<number> Redo a previous command (default previous command). -B<$prc> I<-number> Redo number'th-to-last command. -B<$prc> I<pattern> Redo last command that started with I<pattern>. - See 'B<O> I<recallCommand>' too. -B<$psh$psh> I<cmd> Run cmd in a subprocess (reads from DB::IN, writes to DB::OUT)" - . ( - $rc eq $sh - ? "" - : " -B<$psh> [I<cmd>] Run I<cmd> in subshell (forces \"\$SHELL -c 'cmd'\")." - ) . " - See 'B<O> I<shellBang>' too. -B<source> I<file> Execute I<file> containing debugger commands (may nest). -B<save> I<file> Save current debugger session (actual history) to I<file>. -B<rerun> Rerun session to current position. -B<rerun> I<n> Rerun session to numbered command. -B<rerun> I<-n> Rerun session to number'th-to-last command. -B<H> I<-number> Display last number commands (default all). -B<H> I<*> Delete complete history. -B<p> I<expr> Same as \"I<print {DB::OUT} expr>\" in current package. -B<|>I<dbcmd> Run debugger command, piping DB::OUT to current pager. -B<||>I<dbcmd> Same as B<|>I<dbcmd> but DB::OUT is temporarilly select()ed as well. -B<\=> [I<alias> I<value>] Define a command alias, or list current aliases. -I<command> Execute as a perl statement in current package. -B<R> Pure-man-restart of debugger, some of debugger state - and command-line options may be lost. - Currently the following settings are preserved: - history, breakpoints and actions, debugger B<O>ptions - and the following command-line options: I<-w>, I<-I>, I<-e>. - -B<o> [I<opt>] ... Set boolean option to true -B<o> [I<opt>B<?>] Query options -B<o> [I<opt>B<=>I<val>] [I<opt>=B<\">I<val>B<\">] ... - Set options. Use quotes in spaces in value. - I<recallCommand>, I<ShellBang> chars used to recall command or spawn shell; - I<pager> program for output of \"|cmd\"; - I<tkRunning> run Tk while prompting (with ReadLine); - I<signalLevel> I<warnLevel> I<dieLevel> level of verbosity; - I<inhibit_exit> Allows stepping off the end of the script. - I<ImmediateStop> Debugger should stop as early as possible. - I<RemotePort> Remote hostname:port for remote debugging - The following options affect what happens with B<V>, B<X>, and B<x> commands: - I<arrayDepth>, I<hashDepth> print only first N elements ('' for all); - I<compactDump>, I<veryCompact> change style of array and hash dump; - I<globPrint> whether to print contents of globs; - I<DumpDBFiles> dump arrays holding debugged files; - I<DumpPackages> dump symbol tables of packages; - I<DumpReused> dump contents of \"reused\" addresses; - I<quote>, I<HighBit>, I<undefPrint> change style of string dump; - I<bareStringify> Do not print the overload-stringified value; - Other options include: - I<PrintRet> affects printing of return value after B<r> command, - I<frame> affects printing messages on subroutine entry/exit. - I<AutoTrace> affects printing messages on possible breaking points. - I<maxTraceLen> gives max length of evals/args listed in stack trace. - I<ornaments> affects screen appearance of the command line. - I<CreateTTY> bits control attempts to create a new TTY on events: - 1: on fork() 2: debugger is started inside debugger - 4: on startup - During startup options are initialized from \$ENV{PERLDB_OPTS}. - You can put additional initialization options I<TTY>, I<noTTY>, - I<ReadLine>, I<NonStop>, and I<RemotePort> there (or use - `B<R>' after you set them). - -B<q> or B<^D> Quit. Set B<\$DB::finished = 0> to debug global destruction. -B<h> Summary of debugger commands. -B<h> [I<db_command>] Get help [on a specific debugger command], enter B<|h> to page. -B<h h> Long help for debugger commands -B<$doccmd> I<manpage> Runs the external doc viewer B<$doccmd> command on the - named Perl I<manpage>, or on B<$doccmd> itself if omitted. - Set B<\$DB::doccmd> to change viewer. - -Type `|h h' for a paged display if this was too hard to read. - -"; # Fix balance of vi % matching: }}}} - - # note: tabs in the following section are not-so-helpful - $summary = <<"END_SUM"; -I<List/search source lines:> I<Control script execution:> - B<l> [I<ln>|I<sub>] List source code B<T> Stack trace - B<-> or B<.> List previous/current line B<s> [I<expr>] Single step [in expr] - B<v> [I<line>] View around line B<n> [I<expr>] Next, steps over subs - B<f> I<filename> View source in file <B<CR>/B<Enter>> Repeat last B<n> or B<s> - B</>I<pattern>B</> B<?>I<patt>B<?> Search forw/backw B<r> Return from subroutine - B<M> Show module versions B<c> [I<ln>|I<sub>] Continue until position -I<Debugger controls:> B<L> List break/watch/actions - B<o> [...] Set debugger options B<t> [I<expr>] Toggle trace [trace expr] - B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint - B<$prc> [I<N>|I<pat>] Redo a previous command B<B> I<ln|*> Delete a/all breakpoints - B<H> [I<-num>] Display last num commands B<a> [I<ln>] I<cmd> Do cmd before line - B<=> [I<a> I<val>] Define/list an alias B<A> I<ln|*> Delete a/all actions - B<h> [I<db_cmd>] Get help on command B<w> I<expr> Add a watch expression - B<h h> Complete help page B<W> I<expr|*> Delete a/all watch exprs - B<|>[B<|>]I<db_cmd> Send output to pager B<$psh>\[B<$psh>\] I<syscmd> Run cmd in a subprocess - B<q> or B<^D> Quit B<R> Attempt a restart -I<Data Examination:> B<expr> Execute perl code, also see: B<s>,B<n>,B<t> I<expr> - B<x>|B<m> I<expr> Evals expr in list context, dumps the result or lists methods. - B<p> I<expr> Print expression (uses script's current package). - B<S> [[B<!>]I<pat>] List subroutine names [not] matching pattern - B<V> [I<Pk> [I<Vars>]] List Variables in Package. Vars can be ~pattern or !pattern. - B<X> [I<Vars>] Same as \"B<V> I<current_package> [I<Vars>]\". B<i> I<class> inheritance tree. - B<y> [I<n> [I<Vars>]] List lexicals in higher scope <n>. Vars same as B<V>. - B<e> Display thread id B<E> Display all thread ids. -For more help, type B<h> I<cmd_letter>, or run B<$doccmd perldebug> for all docs. -END_SUM - - # ')}}; # Fix balance of vi % matching - - # and this is really numb... - $pre580_help = " -B<T> Stack trace. -B<s> [I<expr>] Single step [in I<expr>]. -B<n> [I<expr>] Next, steps over subroutine calls [in I<expr>]. -B<CR>> Repeat last B<n> or B<s> command. -B<r> Return from current subroutine. -B<c> [I<line>|I<sub>] Continue; optionally inserts a one-time-only breakpoint - at the specified position. -B<l> I<min>B<+>I<incr> List I<incr>+1 lines starting at I<min>. -B<l> I<min>B<->I<max> List lines I<min> through I<max>. -B<l> I<line> List single I<line>. -B<l> I<subname> List first window of lines from subroutine. -B<l> I<\$var> List first window of lines from subroutine referenced by I<\$var>. -B<l> List next window of lines. -B<-> List previous window of lines. -B<w> [I<line>] List window around I<line>. -B<.> Return to the executed line. -B<f> I<filename> Switch to viewing I<filename>. File must be already loaded. - I<filename> may be either the full name of the file, or a regular - expression matching the full file name: - B<f> I</home/me/foo.pl> and B<f> I<oo\\.> may access the same file. - Evals (with saved bodies) are considered to be filenames: - B<f> I<(eval 7)> and B<f> I<eval 7\\b> access the body of the 7th eval - (in the order of execution). -B</>I<pattern>B</> Search forwards for I<pattern>; final B</> is optional. -B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional. -B<L> List all breakpoints and actions. -B<S> [[B<!>]I<pattern>] List subroutine names [not] matching I<pattern>. -B<t> Toggle trace mode. -B<t> I<expr> Trace through execution of I<expr>. -B<b> [I<line>] [I<condition>] - Set breakpoint; I<line> defaults to the current execution line; - I<condition> breaks if it evaluates to true, defaults to '1'. -B<b> I<subname> [I<condition>] - Set breakpoint at first line of subroutine. -B<b> I<\$var> Set breakpoint at first line of subroutine referenced by I<\$var>. -B<b> B<load> I<filename> Set breakpoint on `require'ing the given file. -B<b> B<postpone> I<subname> [I<condition>] - Set breakpoint at first line of subroutine after - it is compiled. -B<b> B<compile> I<subname> - Stop after the subroutine is compiled. -B<d> [I<line>] Delete the breakpoint for I<line>. -B<D> Delete all breakpoints. -B<a> [I<line>] I<command> - Set an action to be done before the I<line> is executed; - I<line> defaults to the current execution line. - Sequence is: check for breakpoint/watchpoint, print line - if necessary, do action, prompt user if necessary, - execute line. -B<a> [I<line>] Delete the action for I<line>. -B<A> Delete all actions. -B<W> I<expr> Add a global watch-expression. -B<W> Delete all watch-expressions. -B<V> [I<pkg> [I<vars>]] List some (default all) variables in package (default current). - Use B<~>I<pattern> and B<!>I<pattern> for positive and negative regexps. -B<X> [I<vars>] Same as \"B<V> I<currentpackage> [I<vars>]\". -B<x> I<expr> Evals expression in list context, dumps the result. -B<m> I<expr> Evals expression in list context, prints methods callable - on the first element of the result. -B<m> I<class> Prints methods callable via the given class. - -B<<> ? List Perl commands to run before each prompt. -B<<> I<expr> Define Perl command to run before each prompt. -B<<<> I<expr> Add to the list of Perl commands to run before each prompt. -B<>> ? List Perl commands to run after each prompt. -B<>> I<expr> Define Perl command to run after each prompt. -B<>>B<>> I<expr> Add to the list of Perl commands to run after each prompt. -B<{> I<db_command> Define debugger command to run before each prompt. -B<{> ? List debugger commands to run before each prompt. -B<{{> I<db_command> Add to the list of debugger commands to run before each prompt. -B<$prc> I<number> Redo a previous command (default previous command). -B<$prc> I<-number> Redo number'th-to-last command. -B<$prc> I<pattern> Redo last command that started with I<pattern>. - See 'B<O> I<recallCommand>' too. -B<$psh$psh> I<cmd> Run cmd in a subprocess (reads from DB::IN, writes to DB::OUT)" - . ( - $rc eq $sh - ? "" - : " -B<$psh> [I<cmd>] Run I<cmd> in subshell (forces \"\$SHELL -c 'cmd'\")." - ) . " - See 'B<O> I<shellBang>' too. -B<source> I<file> Execute I<file> containing debugger commands (may nest). -B<H> I<-number> Display last number commands (default all). -B<p> I<expr> Same as \"I<print {DB::OUT} expr>\" in current package. -B<|>I<dbcmd> Run debugger command, piping DB::OUT to current pager. -B<||>I<dbcmd> Same as B<|>I<dbcmd> but DB::OUT is temporarilly select()ed as well. -B<\=> [I<alias> I<value>] Define a command alias, or list current aliases. -I<command> Execute as a perl statement in current package. -B<v> Show versions of loaded modules. -B<R> Pure-man-restart of debugger, some of debugger state - and command-line options may be lost. - Currently the following settings are preserved: - history, breakpoints and actions, debugger B<O>ptions - and the following command-line options: I<-w>, I<-I>, I<-e>. - -B<O> [I<opt>] ... Set boolean option to true -B<O> [I<opt>B<?>] Query options -B<O> [I<opt>B<=>I<val>] [I<opt>=B<\">I<val>B<\">] ... - Set options. Use quotes in spaces in value. - I<recallCommand>, I<ShellBang> chars used to recall command or spawn shell; - I<pager> program for output of \"|cmd\"; - I<tkRunning> run Tk while prompting (with ReadLine); - I<signalLevel> I<warnLevel> I<dieLevel> level of verbosity; - I<inhibit_exit> Allows stepping off the end of the script. - I<ImmediateStop> Debugger should stop as early as possible. - I<RemotePort> Remote hostname:port for remote debugging - The following options affect what happens with B<V>, B<X>, and B<x> commands: - I<arrayDepth>, I<hashDepth> print only first N elements ('' for all); - I<compactDump>, I<veryCompact> change style of array and hash dump; - I<globPrint> whether to print contents of globs; - I<DumpDBFiles> dump arrays holding debugged files; - I<DumpPackages> dump symbol tables of packages; - I<DumpReused> dump contents of \"reused\" addresses; - I<quote>, I<HighBit>, I<undefPrint> change style of string dump; - I<bareStringify> Do not print the overload-stringified value; - Other options include: - I<PrintRet> affects printing of return value after B<r> command, - I<frame> affects printing messages on subroutine entry/exit. - I<AutoTrace> affects printing messages on possible breaking points. - I<maxTraceLen> gives max length of evals/args listed in stack trace. - I<ornaments> affects screen appearance of the command line. - I<CreateTTY> bits control attempts to create a new TTY on events: - 1: on fork() 2: debugger is started inside debugger - 4: on startup - During startup options are initialized from \$ENV{PERLDB_OPTS}. - You can put additional initialization options I<TTY>, I<noTTY>, - I<ReadLine>, I<NonStop>, and I<RemotePort> there (or use - `B<R>' after you set them). - -B<q> or B<^D> Quit. Set B<\$DB::finished = 0> to debug global destruction. -B<h> [I<db_command>] Get help [on a specific debugger command], enter B<|h> to page. -B<h h> Summary of debugger commands. -B<$doccmd> I<manpage> Runs the external doc viewer B<$doccmd> command on the - named Perl I<manpage>, or on B<$doccmd> itself if omitted. - Set B<\$DB::doccmd> to change viewer. - -Type `|h' for a paged display if this was too hard to read. - -"; # Fix balance of vi % matching: }}}} - - # note: tabs in the following section are not-so-helpful - $pre580_summary = <<"END_SUM"; -I<List/search source lines:> I<Control script execution:> - B<l> [I<ln>|I<sub>] List source code B<T> Stack trace - B<-> or B<.> List previous/current line B<s> [I<expr>] Single step [in expr] - B<w> [I<line>] List around line B<n> [I<expr>] Next, steps over subs - B<f> I<filename> View source in file <B<CR>/B<Enter>> Repeat last B<n> or B<s> - B</>I<pattern>B</> B<?>I<patt>B<?> Search forw/backw B<r> Return from subroutine - B<v> Show versions of modules B<c> [I<ln>|I<sub>] Continue until position -I<Debugger controls:> B<L> List break/watch/actions - B<O> [...] Set debugger options B<t> [I<expr>] Toggle trace [trace expr] - B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint - B<$prc> [I<N>|I<pat>] Redo a previous command B<d> [I<ln>] or B<D> Delete a/all breakpoints - B<H> [I<-num>] Display last num commands B<a> [I<ln>] I<cmd> Do cmd before line - B<=> [I<a> I<val>] Define/list an alias B<W> I<expr> Add a watch expression - B<h> [I<db_cmd>] Get help on command B<A> or B<W> Delete all actions/watch - B<|>[B<|>]I<db_cmd> Send output to pager B<$psh>\[B<$psh>\] I<syscmd> Run cmd in a subprocess - B<q> or B<^D> Quit B<R> Attempt a restart -I<Data Examination:> B<expr> Execute perl code, also see: B<s>,B<n>,B<t> I<expr> - B<x>|B<m> I<expr> Evals expr in list context, dumps the result or lists methods. - B<p> I<expr> Print expression (uses script's current package). - B<S> [[B<!>]I<pat>] List subroutine names [not] matching pattern - B<V> [I<Pk> [I<Vars>]] List Variables in Package. Vars can be ~pattern or !pattern. - B<X> [I<Vars>] Same as \"B<V> I<current_package> [I<Vars>]\". - B<y> [I<n> [I<Vars>]] List lexicals in higher scope <n>. Vars same as B<V>. -For more help, type B<h> I<cmd_letter>, or run B<$doccmd perldebug> for all docs. -END_SUM - - # ')}}; # Fix balance of vi % matching - -} ## end sub sethelp - -=head2 C<print_help()> - -Most of what C<print_help> does is just text formatting. It finds the -C<B> and C<I> ornaments, cleans them off, and substitutes the proper -terminal control characters to simulate them (courtesy of -C<Term::ReadLine::TermCap>). - -=cut - -sub print_help { - local $_ = shift; - - # Restore proper alignment destroyed by eeevil I<> and B<> - # ornaments: A pox on both their houses! - # - # A help command will have everything up to and including - # the first tab sequence padded into a field 16 (or if indented 20) - # wide. If it's wider than that, an extra space will be added. - s{ - ^ # only matters at start of line - ( \040{4} | \t )* # some subcommands are indented - ( < ? # so <CR> works - [BI] < [^\t\n] + ) # find an eeevil ornament - ( \t+ ) # original separation, discarded - ( .* ) # this will now start (no earlier) than - # column 16 - } { - my($leadwhite, $command, $midwhite, $text) = ($1, $2, $3, $4); - my $clean = $command; - $clean =~ s/[BI]<([^>]*)>/$1/g; - - # replace with this whole string: - ($leadwhite ? " " x 4 : "") - . $command - . ((" " x (16 + ($leadwhite ? 4 : 0) - length($clean))) || " ") - . $text; - - }mgex; - - s{ # handle bold ornaments - B < ( [^>] + | > ) > - } { - $Term::ReadLine::TermCap::rl_term_set[2] - . $1 - . $Term::ReadLine::TermCap::rl_term_set[3] - }gex; - - s{ # handle italic ornaments - I < ( [^>] + | > ) > - } { - $Term::ReadLine::TermCap::rl_term_set[0] - . $1 - . $Term::ReadLine::TermCap::rl_term_set[1] - }gex; - - local $\ = ''; - print $OUT $_; -} ## end sub print_help - -=head2 C<fix_less> - -This routine does a lot of gyrations to be sure that the pager is C<less>. -It checks for C<less> masquerading as C<more> and records the result in -C<$ENV{LESS}> so we don't have to go through doing the stats again. - -=cut - -sub fix_less { - - # We already know if this is set. - return if defined $ENV{LESS} && $ENV{LESS} =~ /r/; - - # Pager is less for sure. - my $is_less = $pager =~ /\bless\b/; - if ( $pager =~ /\bmore\b/ ) { - - # Nope, set to more. See what's out there. - my @st_more = stat('/usr/bin/more'); - my @st_less = stat('/usr/bin/less'); - - # is it really less, pretending to be more? - $is_less = @st_more - && @st_less - && $st_more[0] == $st_less[0] - && $st_more[1] == $st_less[1]; - } ## end if ($pager =~ /\bmore\b/) - - # changes environment! - # 'r' added so we don't do (slow) stats again. - $ENV{LESS} .= 'r' if $is_less; -} ## end sub fix_less - -=head1 DIE AND WARN MANAGEMENT - -=head2 C<diesignal> - -C<diesignal> is a just-drop-dead C<die> handler. It's most useful when trying -to debug a debugger problem. - -It does its best to report the error that occurred, and then forces the -program, debugger, and everything to die. - -=cut - -sub diesignal { - - # No entry/exit messages. - local $frame = 0; - - # No return value prints. - local $doret = -2; - - # set the abort signal handling to the default (just terminate). - $SIG{'ABRT'} = 'DEFAULT'; - - # If we enter the signal handler recursively, kill myself with an - # abort signal (so we just terminate). - kill 'ABRT', $$ if $panic++; - - # If we can show detailed info, do so. - if ( defined &Carp::longmess ) { - - # Don't recursively enter the warn handler, since we're carping. - local $SIG{__WARN__} = ''; - - # Skip two levels before reporting traceback: we're skipping - # mydie and confess. - local $Carp::CarpLevel = 2; # mydie + confess - - # Tell us all about it. - &warn( Carp::longmess("Signal @_") ); - } - - # No Carp. Tell us about the signal as best we can. - else { - local $\ = ''; - print $DB::OUT "Got signal @_\n"; - } - - # Drop dead. - kill 'ABRT', $$; -} ## end sub diesignal - -=head2 C<dbwarn> - -The debugger's own default C<$SIG{__WARN__}> handler. We load C<Carp> to -be able to get a stack trace, and output the warning message vi C<DB::dbwarn()>. - -=cut - -sub dbwarn { - - # No entry/exit trace. - local $frame = 0; - - # No return value printing. - local $doret = -2; - - # Turn off warn and die handling to prevent recursive entries to this - # routine. - local $SIG{__WARN__} = ''; - local $SIG{__DIE__} = ''; - - # Load Carp if we can. If $^S is false (current thing being compiled isn't - # done yet), we may not be able to do a require. - eval { require Carp } - if defined $^S; # If error/warning during compilation, - # require may be broken. - - # Use the core warn() unless Carp loaded OK. - CORE::warn( @_, - "\nCannot print stack trace, load with -MCarp option to see stack" ), - return - unless defined &Carp::longmess; - - # Save the current values of $single and $trace, and then turn them off. - my ( $mysingle, $mytrace ) = ( $single, $trace ); - $single = 0; - $trace = 0; - - # We can call Carp::longmess without its being "debugged" (which we - # don't want - we just want to use it!). Capture this for later. - my $mess = Carp::longmess(@_); - - # Restore $single and $trace to their original values. - ( $single, $trace ) = ( $mysingle, $mytrace ); - - # Use the debugger's own special way of printing warnings to print - # the stack trace message. - &warn($mess); -} ## end sub dbwarn - -=head2 C<dbdie> - -The debugger's own C<$SIG{__DIE__}> handler. Handles providing a stack trace -by loading C<Carp> and calling C<Carp::longmess()> to get it. We turn off -single stepping and tracing during the call to C<Carp::longmess> to avoid -debugging it - we just want to use it. - -If C<dieLevel> is zero, we let the program being debugged handle the -exceptions. If it's 1, you get backtraces for any exception. If it's 2, -the debugger takes over all exception handling, printing a backtrace and -displaying the exception via its C<dbwarn()> routine. - -=cut - -sub dbdie { - local $frame = 0; - local $doret = -2; - local $SIG{__DIE__} = ''; - local $SIG{__WARN__} = ''; - my $i = 0; - my $ineval = 0; - my $sub; - if ( $dieLevel > 2 ) { - local $SIG{__WARN__} = \&dbwarn; - &warn(@_); # Yell no matter what - return; - } - if ( $dieLevel < 2 ) { - die @_ if $^S; # in eval propagate - } - - # The code used to check $^S to see if compiliation of the current thing - # hadn't finished. We don't do it anymore, figuring eval is pretty stable. - eval { require Carp }; - - die( @_, - "\nCannot print stack trace, load with -MCarp option to see stack" ) - unless defined &Carp::longmess; - - # We do not want to debug this chunk (automatic disabling works - # inside DB::DB, but not in Carp). Save $single and $trace, turn them off, - # get the stack trace from Carp::longmess (if possible), restore $signal - # and $trace, and then die with the stack trace. - my ( $mysingle, $mytrace ) = ( $single, $trace ); - $single = 0; - $trace = 0; - my $mess = "@_"; - { - - package Carp; # Do not include us in the list - eval { $mess = Carp::longmess(@_); }; - } - ( $single, $trace ) = ( $mysingle, $mytrace ); - die $mess; -} ## end sub dbdie - -=head2 C<warnlevel()> - -Set the C<$DB::warnLevel> variable that stores the value of the -C<warnLevel> option. Calling C<warnLevel()> with a positive value -results in the debugger taking over all warning handlers. Setting -C<warnLevel> to zero leaves any warning handlers set up by the program -being debugged in place. - -=cut - -sub warnLevel { - if (@_) { - $prevwarn = $SIG{__WARN__} unless $warnLevel; - $warnLevel = shift; - if ($warnLevel) { - $SIG{__WARN__} = \&DB::dbwarn; - } - elsif ($prevwarn) { - $SIG{__WARN__} = $prevwarn; - } - } ## end if (@_) - $warnLevel; -} ## end sub warnLevel - -=head2 C<dielevel> - -Similar to C<warnLevel>. Non-zero values for C<dieLevel> result in the -C<DB::dbdie()> function overriding any other C<die()> handler. Setting it to -zero lets you use your own C<die()> handler. - -=cut - -sub dieLevel { - local $\ = ''; - if (@_) { - $prevdie = $SIG{__DIE__} unless $dieLevel; - $dieLevel = shift; - if ($dieLevel) { - - # Always set it to dbdie() for non-zero values. - $SIG{__DIE__} = \&DB::dbdie; # if $dieLevel < 2; - - # No longer exists, so don't try to use it. - #$SIG{__DIE__} = \&DB::diehard if $dieLevel >= 2; - - # If we've finished initialization, mention that stack dumps - # are enabled, If dieLevel is 1, we won't stack dump if we die - # in an eval(). - print $OUT "Stack dump during die enabled", - ( $dieLevel == 1 ? " outside of evals" : "" ), ".\n" - if $I_m_init; - - # XXX This is probably obsolete, given that diehard() is gone. - print $OUT "Dump printed too.\n" if $dieLevel > 2; - } ## end if ($dieLevel) - - # Put the old one back if there was one. - elsif ($prevdie) { - $SIG{__DIE__} = $prevdie; - print $OUT "Default die handler restored.\n"; - } - } ## end if (@_) - $dieLevel; -} ## end sub dieLevel - -=head2 C<signalLevel> - -Number three in a series: set C<signalLevel> to zero to keep your own -signal handler for C<SIGSEGV> and/or C<SIGBUS>. Otherwise, the debugger -takes over and handles them with C<DB::diesignal()>. - -=cut - -sub signalLevel { - if (@_) { - $prevsegv = $SIG{SEGV} unless $signalLevel; - $prevbus = $SIG{BUS} unless $signalLevel; - $signalLevel = shift; - if ($signalLevel) { - $SIG{SEGV} = \&DB::diesignal; - $SIG{BUS} = \&DB::diesignal; - } - else { - $SIG{SEGV} = $prevsegv; - $SIG{BUS} = $prevbus; - } - } ## end if (@_) - $signalLevel; -} ## end sub signalLevel - -=head1 SUBROUTINE DECODING SUPPORT - -These subroutines are used during the C<x> and C<X> commands to try to -produce as much information as possible about a code reference. They use -L<Devel::Peek> to try to find the glob in which this code reference lives -(if it does) - this allows us to actually code references which correspond -to named subroutines (including those aliased via glob assignment). - -=head2 C<CvGV_name()> - -Wrapper for C<CvGV_name_or_bust>; tries to get the name of a reference -via that routine. If this fails, return the reference again (when the -reference is stringified, it'll come out as C<SOMETHING(0x...)>). - -=cut - -sub CvGV_name { - my $in = shift; - my $name = CvGV_name_or_bust($in); - defined $name ? $name : $in; -} - -=head2 C<CvGV_name_or_bust> I<coderef> - -Calls L<Devel::Peek> to try to find the glob the ref lives in; returns -C<undef> if L<Devel::Peek> can't be loaded, or if C<Devel::Peek::CvGV> can't -find a glob for this ref. - -Returns C<< I<package>::I<glob name> >> if the code ref is found in a glob. - -=cut - -sub CvGV_name_or_bust { - my $in = shift; - return if $skipCvGV; # Backdoor to avoid problems if XS broken... - return unless ref $in; - $in = \&$in; # Hard reference... - eval { require Devel::Peek; 1 } or return; - my $gv = Devel::Peek::CvGV($in) or return; - *$gv{PACKAGE} . '::' . *$gv{NAME}; -} ## end sub CvGV_name_or_bust - -=head2 C<find_sub> - -A utility routine used in various places; finds the file where a subroutine -was defined, and returns that filename and a line-number range. - -Tries to use C<@sub> first; if it can't find it there, it tries building a -reference to the subroutine and uses C<CvGV_name_or_bust> to locate it, -loading it into C<@sub> as a side effect (XXX I think). If it can't find it -this way, it brute-force searches C<%sub>, checking for identical references. - -=cut - -sub find_sub { - my $subr = shift; - $sub{$subr} or do { - return unless defined &$subr; - my $name = CvGV_name_or_bust($subr); - my $data; - $data = $sub{$name} if defined $name; - return $data if defined $data; - - # Old stupid way... - $subr = \&$subr; # Hard reference - my $s; - for ( keys %sub ) { - $s = $_, last if $subr eq \&$_; - } - $sub{$s} if $s; - } ## end do -} ## end sub find_sub - -=head2 C<methods> - -A subroutine that uses the utility function C<methods_via> to find all the -methods in the class corresponding to the current reference and in -C<UNIVERSAL>. - -=cut - -sub methods { - - # Figure out the class - either this is the class or it's a reference - # to something blessed into that class. - my $class = shift; - $class = ref $class if ref $class; - - local %seen; - - # Show the methods that this class has. - methods_via( $class, '', 1 ); - - # Show the methods that UNIVERSAL has. - methods_via( 'UNIVERSAL', 'UNIVERSAL', 0 ); -} ## end sub methods - -=head2 C<methods_via($class, $prefix, $crawl_upward)> - -C<methods_via> does the work of crawling up the C<@ISA> tree and reporting -all the parent class methods. C<$class> is the name of the next class to -try; C<$prefix> is the message prefix, which gets built up as we go up the -C<@ISA> tree to show parentage; C<$crawl_upward> is 1 if we should try to go -higher in the C<@ISA> tree, 0 if we should stop. - -=cut - -sub methods_via { - - # If we've processed this class already, just quit. - my $class = shift; - return if $seen{$class}++; - - # This is a package that is contributing the methods we're about to print. - my $prefix = shift; - my $prepend = $prefix ? "via $prefix: " : ''; - - my $name; - for $name ( - - # Keep if this is a defined subroutine in this class. - grep { defined &{ ${"${class}::"}{$_} } } - - # Extract from all the symbols in this class. - sort keys %{"${class}::"} - ) - { - - # If we printed this already, skip it. - next if $seen{$name}++; - - # Print the new method name. - local $\ = ''; - local $, = ''; - print $DB::OUT "$prepend$name\n"; - } ## end for $name (grep { defined... - - # If the $crawl_upward argument is false, just quit here. - return unless shift; - - # $crawl_upward true: keep going up the tree. - # Find all the classes this one is a subclass of. - for $name ( @{"${class}::ISA"} ) { - - # Set up the new prefix. - $prepend = $prefix ? $prefix . " -> $name" : $name; - - # Crawl up the tree and keep trying to crawl up. - methods_via( $name, $prepend, 1 ); - } -} ## end sub methods_via - -=head2 C<setman> - figure out which command to use to show documentation - -Just checks the contents of C<$^O> and sets the C<$doccmd> global accordingly. - -=cut - -sub setman { - $doccmd = $^O !~ /^(?:MSWin32|VMS|os2|dos|amigaos|riscos|MacOS|NetWare)\z/s - ? "man" # O Happy Day! - : "perldoc"; # Alas, poor unfortunates -} ## end sub setman - -=head2 C<runman> - run the appropriate command to show documentation - -Accepts a man page name; runs the appropriate command to display it (set up -during debugger initialization). Uses C<DB::system> to avoid mucking up the -program's STDIN and STDOUT. - -=cut - -sub runman { - my $page = shift; - unless ($page) { - &system("$doccmd $doccmd"); - return; - } - - # this way user can override, like with $doccmd="man -Mwhatever" - # or even just "man " to disable the path check. - unless ( $doccmd eq 'man' ) { - &system("$doccmd $page"); - return; - } - - $page = 'perl' if lc($page) eq 'help'; - - require Config; - my $man1dir = $Config::Config{'man1dir'}; - my $man3dir = $Config::Config{'man3dir'}; - for ( $man1dir, $man3dir ) { s#/[^/]*\z## if /\S/ } - my $manpath = ''; - $manpath .= "$man1dir:" if $man1dir =~ /\S/; - $manpath .= "$man3dir:" if $man3dir =~ /\S/ && $man1dir ne $man3dir; - chop $manpath if $manpath; - - # harmless if missing, I figure - my $oldpath = $ENV{MANPATH}; - $ENV{MANPATH} = $manpath if $manpath; - my $nopathopt = $^O =~ /dunno what goes here/; - if ( - CORE::system( - $doccmd, - - # I just *know* there are men without -M - ( ( $manpath && !$nopathopt ) ? ( "-M", $manpath ) : () ), - split ' ', $page - ) - ) - { - unless ( $page =~ /^perl\w/ ) { -# do it this way because its easier to slurp in to keep up to date - clunky though. -my @pods = qw( - 5004delta - 5005delta - 561delta - 56delta - 570delta - 571delta - 572delta - 573delta - 58delta - 581delta - 582delta - 583delta - 584delta - 590delta - 591delta - 592delta - aix - amiga - apio - api - apollo - artistic - beos - book - boot - bot - bs2000 - call - ce - cheat - clib - cn - compile - cygwin - data - dbmfilter - debguts - debtut - debug - delta - dgux - diag - doc - dos - dsc - ebcdic - embed - epoc - faq1 - faq2 - faq3 - faq4 - faq5 - faq6 - faq7 - faq8 - faq9 - faq - filter - fork - form - freebsd - func - gpl - guts - hack - hist - hpux - hurd - intern - intro - iol - ipc - irix - jp - ko - lexwarn - locale - lol - machten - macos - macosx - mint - modinstall - modlib - mod - modstyle - mpeix - netware - newmod - number - obj - opentut - op - os2 - os390 - os400 - othrtut - packtut - plan9 - pod - podspec - port - qnx - ref - reftut - re - requick - reref - retut - run - sec - solaris - style - sub - syn - thrtut - tie - toc - todo - tooc - toot - trap - tru64 - tw - unicode - uniintro - util - uts - var - vmesa - vms - vos - win32 - xs - xstut -); - if (grep { $page eq $_ } @pods) { - $page =~ s/^/perl/; - CORE::system( $doccmd, - ( ( $manpath && !$nopathopt ) ? ( "-M", $manpath ) : () ), - $page ); - } ## end if (grep { $page eq $_... - } ## end unless ($page =~ /^perl\w/) - } ## end if (CORE::system($doccmd... - if ( defined $oldpath ) { - $ENV{MANPATH} = $manpath; - } - else { - delete $ENV{MANPATH}; - } -} ## end sub runman - -#use Carp; # This did break, left for debugging - -=head1 DEBUGGER INITIALIZATION - THE SECOND BEGIN BLOCK - -Because of the way the debugger interface to the Perl core is designed, any -debugger package globals that C<DB::sub()> requires have to be defined before -any subroutines can be called. These are defined in the second C<BEGIN> block. - -This block sets things up so that (basically) the world is sane -before the debugger starts executing. We set up various variables that the -debugger has to have set up before the Perl core starts running: - -=over 4 - -=item * - -The debugger's own filehandles (copies of STD and STDOUT for now). - -=item * - -Characters for shell escapes, the recall command, and the history command. - -=item * - -The maximum recursion depth. - -=item * - -The size of a C<w> command's window. - -=item * - -The before-this-line context to be printed in a C<v> (view a window around this line) command. - -=item * - -The fact that we're not in a sub at all right now. - -=item * - -The default SIGINT handler for the debugger. - -=item * - -The appropriate value of the flag in C<$^D> that says the debugger is running - -=item * - -The current debugger recursion level - -=item * - -The list of postponed items and the C<$single> stack (XXX define this) - -=item * - -That we want no return values and no subroutine entry/exit trace. - -=back - -=cut - -# The following BEGIN is very handy if debugger goes havoc, debugging debugger? - -BEGIN { # This does not compile, alas. (XXX eh?) - $IN = \*STDIN; # For bugs before DB::OUT has been opened - $OUT = \*STDERR; # For errors before DB::OUT has been opened - - # Define characters used by command parsing. - $sh = '!'; # Shell escape (does not work) - $rc = ','; # Recall command (does not work) - @hist = ('?'); # Show history (does not work) - @truehist = (); # Can be saved for replay (per session) - - # This defines the point at which you get the 'deep recursion' - # warning. It MUST be defined or the debugger will not load. - $deep = 100; - - # Number of lines around the current one that are shown in the - # 'w' command. - $window = 10; - - # How much before-the-current-line context the 'v' command should - # use in calculating the start of the window it will display. - $preview = 3; - - # We're not in any sub yet, but we need this to be a defined value. - $sub = ''; - - # Set up the debugger's interrupt handler. It simply sets a flag - # ($signal) that DB::DB() will check before each command is executed. - $SIG{INT} = \&DB::catch; - - # The following lines supposedly, if uncommented, allow the debugger to - # debug itself. Perhaps we can try that someday. - # This may be enabled to debug debugger: - #$warnLevel = 1 unless defined $warnLevel; - #$dieLevel = 1 unless defined $dieLevel; - #$signalLevel = 1 unless defined $signalLevel; - - # This is the flag that says "a debugger is running, please call - # DB::DB and DB::sub". We will turn it on forcibly before we try to - # execute anything in the user's context, because we always want to - # get control back. - $db_stop = 0; # Compiler warning ... - $db_stop = 1 << 30; # ... because this is only used in an eval() later. - - # This variable records how many levels we're nested in debugging. Used - # Used in the debugger prompt, and in determining whether it's all over or - # not. - $level = 0; # Level of recursive debugging - - # "Triggers bug (?) in perl if we postpone this until runtime." - # XXX No details on this yet, or whether we should fix the bug instead - # of work around it. Stay tuned. - @postponed = @stack = (0); - - # Used to track the current stack depth using the auto-stacked-variable - # trick. - $stack_depth = 0; # Localized repeatedly; simple way to track $#stack - - # Don't print return values on exiting a subroutine. - $doret = -2; - - # No extry/exit tracing. - $frame = 0; - -} ## end BEGIN - -BEGIN { $^W = $ini_warn; } # Switch warnings back - -=head1 READLINE SUPPORT - COMPLETION FUNCTION - -=head2 db_complete - -C<readline> support - adds command completion to basic C<readline>. - -Returns a list of possible completions to C<readline> when invoked. C<readline> -will print the longest common substring following the text already entered. - -If there is only a single possible completion, C<readline> will use it in full. - -This code uses C<map> and C<grep> heavily to create lists of possible -completion. Think LISP in this section. - -=cut - -sub db_complete { - - # Specific code for b c l V m f O, &blah, $blah, @blah, %blah - # $text is the text to be completed. - # $line is the incoming line typed by the user. - # $start is the start of the text to be completed in the incoming line. - my ( $text, $line, $start ) = @_; - - # Save the initial text. - # The search pattern is current package, ::, extract the next qualifier - # Prefix and pack are set to undef. - my ( $itext, $search, $prefix, $pack ) = - ( $text, "^\Q${'package'}::\E([^:]+)\$" ); - -=head3 C<b postpone|compile> - -=over 4 - -=item * - -Find all the subroutines that might match in this package - -=item * - -Add C<postpone>, C<load>, and C<compile> as possibles (we may be completing the keyword itself) - -=item * - -Include all the rest of the subs that are known - -=item * - -C<grep> out the ones that match the text we have so far - -=item * - -Return this as the list of possible completions - -=back - -=cut - - return sort grep /^\Q$text/, ( keys %sub ), - qw(postpone load compile), # subroutines - ( map { /$search/ ? ($1) : () } keys %sub ) - if ( substr $line, 0, $start ) =~ /^\|*[blc]\s+((postpone|compile)\s+)?$/; - -=head3 C<b load> - -Get all the possible files from C<@INC> as it currently stands and -select the ones that match the text so far. - -=cut - - return sort grep /^\Q$text/, values %INC # files - if ( substr $line, 0, $start ) =~ /^\|*b\s+load\s+$/; - -=head3 C<V> (list variable) and C<m> (list modules) - -There are two entry points for these commands: - -=head4 Unqualified package names - -Get the top-level packages and grab everything that matches the text -so far. For each match, recursively complete the partial packages to -get all possible matching packages. Return this sorted list. - -=cut - - return sort map { ( $_, db_complete( $_ . "::", "V ", 2 ) ) } - grep /^\Q$text/, map { /^(.*)::$/ ? ($1) : () } keys %:: # top-packages - if ( substr $line, 0, $start ) =~ /^\|*[Vm]\s+$/ and $text =~ /^\w*$/; - -=head4 Qualified package names - -Take a partially-qualified package and find all subpackages for it -by getting all the subpackages for the package so far, matching all -the subpackages against the text, and discarding all of them which -start with 'main::'. Return this list. - -=cut - - return sort map { ( $_, db_complete( $_ . "::", "V ", 2 ) ) } - grep !/^main::/, grep /^\Q$text/, - map { /^(.*)::$/ ? ( $prefix . "::$1" ) : () } keys %{ $prefix . '::' } - if ( substr $line, 0, $start ) =~ /^\|*[Vm]\s+$/ - and $text =~ /^(.*[^:])::?(\w*)$/ - and $prefix = $1; - -=head3 C<f> - switch files - -Here, we want to get a fully-qualified filename for the C<f> command. -Possibilities are: - -=over 4 - -=item 1. The original source file itself - -=item 2. A file from C<@INC> - -=item 3. An C<eval> (the debugger gets a C<(eval N)> fake file for each C<eval>). - -=back - -=cut - - if ( $line =~ /^\|*f\s+(.*)/ ) { # Loaded files - # We might possibly want to switch to an eval (which has a "filename" - # like '(eval 9)'), so we may need to clean up the completion text - # before proceeding. - $prefix = length($1) - length($text); - $text = $1; - -=pod - -Under the debugger, source files are represented as C<_E<lt>/fullpath/to/file> -(C<eval>s are C<_E<lt>(eval NNN)>) keys in C<%main::>. We pull all of these -out of C<%main::>, add the initial source file, and extract the ones that -match the completion text so far. - -=cut - - return sort - map { substr $_, 2 + $prefix } grep /^_<\Q$text/, ( keys %main:: ), - $0; - } ## end if ($line =~ /^\|*f\s+(.*)/) - -=head3 Subroutine name completion - -We look through all of the defined subs (the keys of C<%sub>) and -return both all the possible matches to the subroutine name plus -all the matches qualified to the current package. - -=cut - - if ( ( substr $text, 0, 1 ) eq '&' ) { # subroutines - $text = substr $text, 1; - $prefix = "&"; - return sort map "$prefix$_", grep /^\Q$text/, ( keys %sub ), - ( - map { /$search/ ? ($1) : () } - keys %sub - ); - } ## end if ((substr $text, 0, ... - -=head3 Scalar, array, and hash completion: partially qualified package - -Much like the above, except we have to do a little more cleanup: - -=cut - - if ( $text =~ /^[\$@%](.*)::(.*)/ ) { # symbols in a package - -=pod - -=over 4 - -=item * - -Determine the package that the symbol is in. Put it in C<::> (effectively C<main::>) if no package is specified. - -=cut - - $pack = ( $1 eq 'main' ? '' : $1 ) . '::'; - -=pod - -=item * - -Figure out the prefix vs. what needs completing. - -=cut - - $prefix = ( substr $text, 0, 1 ) . $1 . '::'; - $text = $2; - -=pod - -=item * - -Look through all the symbols in the package. C<grep> out all the possible hashes/arrays/scalars, and then C<grep> the possible matches out of those. C<map> the prefix onto all the possibilities. - -=cut - - my @out = map "$prefix$_", grep /^\Q$text/, grep /^_?[a-zA-Z]/, - keys %$pack; - -=pod - -=item * - -If there's only one hit, and it's a package qualifier, and it's not equal to the initial text, re-complete it using the symbol we actually found. - -=cut - - if ( @out == 1 and $out[0] =~ /::$/ and $out[0] ne $itext ) { - return db_complete( $out[0], $line, $start ); - } - - # Return the list of possibles. - return sort @out; - - } ## end if ($text =~ /^[\$@%](.*)::(.*)/) - -=pod - -=back - -=head3 Symbol completion: current package or package C<main>. - -=cut - - if ( $text =~ /^[\$@%]/ ) { # symbols (in $package + packages in main) - -=pod - -=over 4 - -=item * - -If it's C<main>, delete main to just get C<::> leading. - -=cut - - $pack = ( $package eq 'main' ? '' : $package ) . '::'; - -=pod - -=item * - -We set the prefix to the item's sigil, and trim off the sigil to get the text to be completed. - -=cut - - $prefix = substr $text, 0, 1; - $text = substr $text, 1; - -=pod - -=item * - -If the package is C<::> (C<main>), create an empty list; if it's something else, create a list of all the packages known. Append whichever list to a list of all the possible symbols in the current package. C<grep> out the matches to the text entered so far, then C<map> the prefix back onto the symbols. - -=cut - - my @out = map "$prefix$_", grep /^\Q$text/, - ( grep /^_?[a-zA-Z]/, keys %$pack ), - ( $pack eq '::' ? () : ( grep /::$/, keys %:: ) ); - -=item * - -If there's only one hit, it's a package qualifier, and it's not equal to the initial text, recomplete using this symbol. - -=back - -=cut - - if ( @out == 1 and $out[0] =~ /::$/ and $out[0] ne $itext ) { - return db_complete( $out[0], $line, $start ); - } - - # Return the list of possibles. - return sort @out; - } ## end if ($text =~ /^[\$@%]/) - -=head3 Options - -We use C<option_val()> to look up the current value of the option. If there's -only a single value, we complete the command in such a way that it is a -complete command for setting the option in question. If there are multiple -possible values, we generate a command consisting of the option plus a trailing -question mark, which, if executed, will list the current value of the option. - -=cut - - if ( ( substr $line, 0, $start ) =~ /^\|*[oO]\b.*\s$/ ) - { # Options after space - # We look for the text to be matched in the list of possible options, - # and fetch the current value. - my @out = grep /^\Q$text/, @options; - my $val = option_val( $out[0], undef ); - - # Set up a 'query option's value' command. - my $out = '? '; - if ( not defined $val or $val =~ /[\n\r]/ ) { - - # There's really nothing else we can do. - } - - # We have a value. Create a proper option-setting command. - elsif ( $val =~ /\s/ ) { - - # XXX This may be an extraneous variable. - my $found; - - # We'll want to quote the string (because of the embedded - # whtespace), but we want to make sure we don't end up with - # mismatched quote characters. We try several possibilities. - foreach $l ( split //, qq/\"\'\#\|/ ) { - - # If we didn't find this quote character in the value, - # quote it using this quote character. - $out = "$l$val$l ", last if ( index $val, $l ) == -1; - } - } ## end elsif ($val =~ /\s/) - - # Don't need any quotes. - else { - $out = "=$val "; - } - - # If there were multiple possible values, return '? ', which - # makes the command into a query command. If there was just one, - # have readline append that. - $rl_attribs->{completer_terminator_character} = - ( @out == 1 ? $out : '? ' ); - - # Return list of possibilities. - return sort @out; - } ## end if ((substr $line, 0, ... - -=head3 Filename completion - -For entering filenames. We simply call C<readline>'s C<filename_list()> -method with the completion text to get the possible completions. - -=cut - - return $term->filename_list($text); # filenames - -} ## end sub db_complete - -=head1 MISCELLANEOUS SUPPORT FUNCTIONS - -Functions that possibly ought to be somewhere else. - -=head2 end_report - -Say we're done. - -=cut - -sub end_report { - local $\ = ''; - print $OUT "Use `q' to quit or `R' to restart. `h q' for details.\n"; -} - -=head2 clean_ENV - -If we have $ini_pids, save it in the environment; else remove it from the -environment. Used by the C<R> (restart) command. - -=cut - -sub clean_ENV { - if ( defined($ini_pids) ) { - $ENV{PERLDB_PIDS} = $ini_pids; - } - else { - delete( $ENV{PERLDB_PIDS} ); - } -} ## end sub clean_ENV - -# PERLDBf_... flag names from perl.h -our ( %DollarCaretP_flags, %DollarCaretP_flags_r ); - -BEGIN { - %DollarCaretP_flags = ( - PERLDBf_SUB => 0x01, # Debug sub enter/exit - PERLDBf_LINE => 0x02, # Keep line # - PERLDBf_NOOPT => 0x04, # Switch off optimizations - PERLDBf_INTER => 0x08, # Preserve more data - PERLDBf_SUBLINE => 0x10, # Keep subr source lines - PERLDBf_SINGLE => 0x20, # Start with single-step on - PERLDBf_NONAME => 0x40, # For _SUB: no name of the subr - PERLDBf_GOTO => 0x80, # Report goto: call DB::goto - PERLDBf_NAMEEVAL => 0x100, # Informative names for evals - PERLDBf_NAMEANON => 0x200, # Informative names for anon subs - PERLDBf_ASSERTION => 0x400, # Debug assertion subs enter/exit - PERLDB_ALL => 0x33f, # No _NONAME, _GOTO, _ASSERTION - ); - - %DollarCaretP_flags_r = reverse %DollarCaretP_flags; -} - -sub parse_DollarCaretP_flags { - my $flags = shift; - $flags =~ s/^\s+//; - $flags =~ s/\s+$//; - my $acu = 0; - foreach my $f ( split /\s*\|\s*/, $flags ) { - my $value; - if ( $f =~ /^0x([[:xdigit:]]+)$/ ) { - $value = hex $1; - } - elsif ( $f =~ /^(\d+)$/ ) { - $value = int $1; - } - elsif ( $f =~ /^DEFAULT$/i ) { - $value = $DollarCaretP_flags{PERLDB_ALL}; - } - else { - $f =~ /^(?:PERLDBf_)?(.*)$/i; - $value = $DollarCaretP_flags{ 'PERLDBf_' . uc($1) }; - unless ( defined $value ) { - print $OUT ( - "Unrecognized \$^P flag '$f'!\n", - "Acceptable flags are: " - . join( ', ', sort keys %DollarCaretP_flags ), - ", and hexadecimal and decimal numbers.\n" - ); - return undef; - } - } - $acu |= $value; - } - $acu; -} - -sub expand_DollarCaretP_flags { - my $DollarCaretP = shift; - my @bits = ( - map { - my $n = ( 1 << $_ ); - ( $DollarCaretP & $n ) - ? ( $DollarCaretP_flags_r{$n} - || sprintf( '0x%x', $n ) ) - : () - } 0 .. 31 - ); - return @bits ? join( '|', @bits ) : 0; -} - -=over 4 - -=item rerun - -Rerun the current session to: - - rerun current position - - rerun 4 command number 4 - - rerun -4 current command minus 4 (go back 4 steps) - -Whether this always makes sense, in the current context is unknowable, and is -in part left as a useful exersize for the reader. This sub returns the -appropriate arguments to rerun the current session. - -=cut - -sub rerun { - my $i = shift; - my @args; - pop(@truehist); # strim - unless (defined $truehist[$i]) { - print "Unable to return to non-existent command: $i\n"; - } else { - $#truehist = ($i < 0 ? $#truehist + $i : $i > 0 ? $i : $#truehist); - my @temp = @truehist; # store - push(@DB::typeahead, @truehist); # saved - @truehist = @hist = (); # flush - @args = &restart(); # setup - &get_list("PERLDB_HIST"); # clean - &set_list("PERLDB_HIST", @temp); # reset - } - return @args; -} - -=item restart - -Restarting the debugger is a complex operation that occurs in several phases. -First, we try to reconstruct the command line that was used to invoke Perl -and the debugger. - -=cut - -sub restart { - # I may not be able to resurrect you, but here goes ... - print $OUT -"Warning: some settings and command-line options may be lost!\n"; - my ( @script, @flags, $cl ); - - # If warn was on before, turn it on again. - push @flags, '-w' if $ini_warn; - if ( $ini_assertion and @{^ASSERTING} ) { - push @flags, - ( map { /\:\^\(\?\:(.*)\)\$\)/ ? "-A$1" : "-A$_" } - @{^ASSERTING} ); - } - - # Rebuild the -I flags that were on the initial - # command line. - for (@ini_INC) { - push @flags, '-I', $_; - } - - # Turn on taint if it was on before. - push @flags, '-T' if ${^TAINT}; - - # Arrange for setting the old INC: - # Save the current @init_INC in the environment. - set_list( "PERLDB_INC", @ini_INC ); - - # If this was a perl one-liner, go to the "file" - # corresponding to the one-liner read all the lines - # out of it (except for the first one, which is going - # to be added back on again when 'perl -d' runs: that's - # the 'require perl5db.pl;' line), and add them back on - # to the command line to be executed. - if ( $0 eq '-e' ) { - for ( 1 .. $#{'::_<-e'} ) { # The first line is PERL5DB - chomp( $cl = ${'::_<-e'}[$_] ); - push @script, '-e', $cl; - } - } ## end if ($0 eq '-e') - - # Otherwise we just reuse the original name we had - # before. - else { - @script = $0; - } - -=pod - -After the command line has been reconstructed, the next step is to save -the debugger's status in environment variables. The C<DB::set_list> routine -is used to save aggregate variables (both hashes and arrays); scalars are -just popped into environment variables directly. - -=cut - - # If the terminal supported history, grab it and - # save that in the environment. - set_list( "PERLDB_HIST", - $term->Features->{getHistory} - ? $term->GetHistory - : @hist ); - - # Find all the files that were visited during this - # session (i.e., the debugger had magic hashes - # corresponding to them) and stick them in the environment. - my @had_breakpoints = keys %had_breakpoints; - set_list( "PERLDB_VISITED", @had_breakpoints ); - - # Save the debugger options we chose. - set_list( "PERLDB_OPT", %option ); - # set_list( "PERLDB_OPT", options2remember() ); - - # Save the break-on-loads. - set_list( "PERLDB_ON_LOAD", %break_on_load ); - -=pod - -The most complex part of this is the saving of all of the breakpoints. They -can live in an awful lot of places, and we have to go through all of them, -find the breakpoints, and then save them in the appropriate environment -variable via C<DB::set_list>. - -=cut - - # Go through all the breakpoints and make sure they're - # still valid. - my @hard; - for ( 0 .. $#had_breakpoints ) { - - # We were in this file. - my $file = $had_breakpoints[$_]; - - # Grab that file's magic line hash. - *dbline = $main::{ '_<' . $file }; - - # Skip out if it doesn't exist, or if the breakpoint - # is in a postponed file (we'll do postponed ones - # later). - next unless %dbline or $postponed_file{$file}; - - # In an eval. This is a little harder, so we'll - # do more processing on that below. - ( push @hard, $file ), next - if $file =~ /^\(\w*eval/; - - # XXX I have no idea what this is doing. Yet. - my @add; - @add = %{ $postponed_file{$file} } - if $postponed_file{$file}; - - # Save the list of all the breakpoints for this file. - set_list( "PERLDB_FILE_$_", %dbline, @add ); - } ## end for (0 .. $#had_breakpoints) - - # The breakpoint was inside an eval. This is a little - # more difficult. XXX and I don't understand it. - for (@hard) { - # Get over to the eval in question. - *dbline = $main::{ '_<' . $_ }; - my ( $quoted, $sub, %subs, $line ) = quotemeta $_; - for $sub ( keys %sub ) { - next unless $sub{$sub} =~ /^$quoted:(\d+)-(\d+)$/; - $subs{$sub} = [ $1, $2 ]; - } - unless (%subs) { - print $OUT - "No subroutines in $_, ignoring breakpoints.\n"; - next; - } - LINES: for $line ( keys %dbline ) { - - # One breakpoint per sub only: - my ( $offset, $sub, $found ); - SUBS: for $sub ( keys %subs ) { - if ( - $subs{$sub}->[1] >= - $line # Not after the subroutine - and ( - not defined $offset # Not caught - or $offset < 0 - ) - ) - { # or badly caught - $found = $sub; - $offset = $line - $subs{$sub}->[0]; - $offset = "+$offset", last SUBS - if $offset >= 0; - } ## end if ($subs{$sub}->[1] >=... - } ## end for $sub (keys %subs) - if ( defined $offset ) { - $postponed{$found} = - "break $offset if $dbline{$line}"; - } - else { - print $OUT -"Breakpoint in $_:$line ignored: after all the subroutines.\n"; - } - } ## end for $line (keys %dbline) - } ## end for (@hard) - - # Save the other things that don't need to be - # processed. - set_list( "PERLDB_POSTPONE", %postponed ); - set_list( "PERLDB_PRETYPE", @$pretype ); - set_list( "PERLDB_PRE", @$pre ); - set_list( "PERLDB_POST", @$post ); - set_list( "PERLDB_TYPEAHEAD", @typeahead ); - - # We are oficially restarting. - $ENV{PERLDB_RESTART} = 1; - - # We are junking all child debuggers. - delete $ENV{PERLDB_PIDS}; # Restore ini state - - # Set this back to the initial pid. - $ENV{PERLDB_PIDS} = $ini_pids if defined $ini_pids; - -=pod - -After all the debugger status has been saved, we take the command we built up -and then return it, so we can C<exec()> it. The debugger will spot the -C<PERLDB_RESTART> environment variable and realize it needs to reload its state -from the environment. - -=cut - - # And run Perl again. Add the "-d" flag, all the - # flags we built up, the script (whether a one-liner - # or a file), add on the -emacs flag for a slave editor, - # and then the old arguments. - - return ($^X, '-d', @flags, @script, ($slave_editor ? '-emacs' : ()), @ARGS); - -}; # end restart - -=back - -=head1 END PROCESSING - THE C<END> BLOCK - -Come here at the very end of processing. We want to go into a -loop where we allow the user to enter commands and interact with the -debugger, but we don't want anything else to execute. - -First we set the C<$finished> variable, so that some commands that -shouldn't be run after the end of program quit working. - -We then figure out whether we're truly done (as in the user entered a C<q> -command, or we finished execution while running nonstop). If we aren't, -we set C<$single> to 1 (causing the debugger to get control again). - -We then call C<DB::fake::at_exit()>, which returns the C<Use 'q' to quit ...> -message and returns control to the debugger. Repeat. - -When the user finally enters a C<q> command, C<$fall_off_end> is set to -1 and the C<END> block simply exits with C<$single> set to 0 (don't -break, run to completion.). - -=cut - -END { - $finished = 1 if $inhibit_exit; # So that some commands may be disabled. - $fall_off_end = 1 unless $inhibit_exit; - - # Do not stop in at_exit() and destructors on exit: - $DB::single = !$fall_off_end && !$runnonstop; - DB::fake::at_exit() unless $fall_off_end or $runnonstop; -} ## end END - -=head1 PRE-5.8 COMMANDS - -Some of the commands changed function quite a bit in the 5.8 command -realignment, so much so that the old code had to be replaced completely. -Because we wanted to retain the option of being able to go back to the -former command set, we moved the old code off to this section. - -There's an awful lot of duplicated code here. We've duplicated the -comments to keep things clear. - -=head2 Null command - -Does nothing. Used to I<turn off> commands. - -=cut - -sub cmd_pre580_null { - - # do nothing... -} - -=head2 Old C<a> command. - -This version added actions if you supplied them, and deleted them -if you didn't. - -=cut - -sub cmd_pre580_a { - my $xcmd = shift; - my $cmd = shift; - - # Argument supplied. Add the action. - if ( $cmd =~ /^(\d*)\s*(.*)/ ) { - - # If the line isn't there, use the current line. - $i = $1 || $line; - $j = $2; - - # If there is an action ... - if ( length $j ) { - - # ... but the line isn't breakable, skip it. - if ( $dbline[$i] == 0 ) { - print $OUT "Line $i may not have an action.\n"; - } - else { - - # ... and the line is breakable: - # Mark that there's an action in this file. - $had_breakpoints{$filename} |= 2; - - # Delete any current action. - $dbline{$i} =~ s/\0[^\0]*//; - - # Add the new action, continuing the line as needed. - $dbline{$i} .= "\0" . action($j); - } - } ## end if (length $j) - - # No action supplied. - else { - - # Delete the action. - $dbline{$i} =~ s/\0[^\0]*//; - - # Mark as having no break or action if nothing's left. - delete $dbline{$i} if $dbline{$i} eq ''; - } - } ## end if ($cmd =~ /^(\d*)\s*(.*)/) -} ## end sub cmd_pre580_a - -=head2 Old C<b> command - -Add breakpoints. - -=cut - -sub cmd_pre580_b { - my $xcmd = shift; - my $cmd = shift; - my $dbline = shift; - - # Break on load. - if ( $cmd =~ /^load\b\s*(.*)/ ) { - my $file = $1; - $file =~ s/\s+$//; - &cmd_b_load($file); - } - - # b compile|postpone <some sub> [<condition>] - # The interpreter actually traps this one for us; we just put the - # necessary condition in the %postponed hash. - elsif ( $cmd =~ /^(postpone|compile)\b\s*([':A-Za-z_][':\w]*)\s*(.*)/ ) { - - # Capture the condition if there is one. Make it true if none. - my $cond = length $3 ? $3 : '1'; - - # Save the sub name and set $break to 1 if $1 was 'postpone', 0 - # if it was 'compile'. - my ( $subname, $break ) = ( $2, $1 eq 'postpone' ); - - # De-Perl4-ify the name - ' separators to ::. - $subname =~ s/\'/::/g; - - # Qualify it into the current package unless it's already qualified. - $subname = "${'package'}::" . $subname - unless $subname =~ /::/; - - # Add main if it starts with ::. - $subname = "main" . $subname if substr( $subname, 0, 2 ) eq "::"; - - # Save the break type for this sub. - $postponed{$subname} = $break ? "break +0 if $cond" : "compile"; - } ## end elsif ($cmd =~ ... - - # b <sub name> [<condition>] - elsif ( $cmd =~ /^([':A-Za-z_][':\w]*(?:\[.*\])?)\s*(.*)/ ) { - my $subname = $1; - my $cond = length $2 ? $2 : '1'; - &cmd_b_sub( $subname, $cond ); - } - - # b <line> [<condition>]. - elsif ( $cmd =~ /^(\d*)\s*(.*)/ ) { - my $i = $1 || $dbline; - my $cond = length $2 ? $2 : '1'; - &cmd_b_line( $i, $cond ); - } -} ## end sub cmd_pre580_b - -=head2 Old C<D> command. - -Delete all breakpoints unconditionally. - -=cut - -sub cmd_pre580_D { - my $xcmd = shift; - my $cmd = shift; - if ( $cmd =~ /^\s*$/ ) { - print $OUT "Deleting all breakpoints...\n"; - - # %had_breakpoints lists every file that had at least one - # breakpoint in it. - my $file; - for $file ( keys %had_breakpoints ) { - - # Switch to the desired file temporarily. - local *dbline = $main::{ '_<' . $file }; - - my $max = $#dbline; - my $was; - - # For all lines in this file ... - for ( $i = 1 ; $i <= $max ; $i++ ) { - - # If there's a breakpoint or action on this line ... - if ( defined $dbline{$i} ) { - - # ... remove the breakpoint. - $dbline{$i} =~ s/^[^\0]+//; - if ( $dbline{$i} =~ s/^\0?$// ) { - - # Remove the entry altogether if no action is there. - delete $dbline{$i}; - } - } ## end if (defined $dbline{$i... - } ## end for ($i = 1 ; $i <= $max... - - # If, after we turn off the "there were breakpoints in this file" - # bit, the entry in %had_breakpoints for this file is zero, - # we should remove this file from the hash. - if ( not $had_breakpoints{$file} &= ~1 ) { - delete $had_breakpoints{$file}; - } - } ## end for $file (keys %had_breakpoints) - - # Kill off all the other breakpoints that are waiting for files that - # haven't been loaded yet. - undef %postponed; - undef %postponed_file; - undef %break_on_load; - } ## end if ($cmd =~ /^\s*$/) -} ## end sub cmd_pre580_D - -=head2 Old C<h> command - -Print help. Defaults to printing the long-form help; the 5.8 version -prints the summary by default. - -=cut - -sub cmd_pre580_h { - my $xcmd = shift; - my $cmd = shift; - - # Print the *right* help, long format. - if ( $cmd =~ /^\s*$/ ) { - print_help($pre580_help); - } - - # 'h h' - explicitly-requested summary. - elsif ( $cmd =~ /^h\s*/ ) { - print_help($pre580_summary); - } - - # Find and print a command's help. - elsif ( $cmd =~ /^h\s+(\S.*)$/ ) { - my $asked = $1; # for proper errmsg - my $qasked = quotemeta($asked); # for searching - # XXX: finds CR but not <CR> - if ( - $pre580_help =~ /^ - <? # Optional '<' - (?:[IB]<) # Optional markup - $qasked # The command name - /mx - ) - { - - while ( - $pre580_help =~ /^ - ( # The command help: - <? # Optional '<' - (?:[IB]<) # Optional markup - $qasked # The command name - ([\s\S]*?) # Lines starting with tabs - \n # Final newline - ) - (?!\s)/mgx - ) # Line not starting with space - # (Next command's help) - { - print_help($1); - } - } ## end if ($pre580_help =~ /^<?(?:[IB]<)$qasked/m) - - # Help not found. - else { - print_help("B<$asked> is not a debugger command.\n"); - } - } ## end elsif ($cmd =~ /^h\s+(\S.*)$/) -} ## end sub cmd_pre580_h - -=head2 Old C<W> command - -C<W E<lt>exprE<gt>> adds a watch expression, C<W> deletes them all. - -=cut - -sub cmd_pre580_W { - my $xcmd = shift; - my $cmd = shift; - - # Delete all watch expressions. - if ( $cmd =~ /^$/ ) { - - # No watching is going on. - $trace &= ~2; - - # Kill all the watch expressions and values. - @to_watch = @old_watch = (); - } - - # Add a watch expression. - elsif ( $cmd =~ /^(.*)/s ) { - - # add it to the list to be watched. - push @to_watch, $1; - - # Get the current value of the expression. - # Doesn't handle expressions returning list values! - $evalarg = $1; - my ($val) = &eval; - $val = ( defined $val ) ? "'$val'" : 'undef'; - - # Save it. - push @old_watch, $val; - - # We're watching stuff. - $trace |= 2; - - } ## end elsif ($cmd =~ /^(.*)/s) -} ## end sub cmd_pre580_W - -=head1 PRE-AND-POST-PROMPT COMMANDS AND ACTIONS - -The debugger used to have a bunch of nearly-identical code to handle -the pre-and-post-prompt action commands. C<cmd_pre590_prepost> and -C<cmd_prepost> unify all this into one set of code to handle the -appropriate actions. - -=head2 C<cmd_pre590_prepost> - -A small wrapper around C<cmd_prepost>; it makes sure that the default doesn't -do something destructive. In pre 5.8 debuggers, the default action was to -delete all the actions. - -=cut - -sub cmd_pre590_prepost { - my $cmd = shift; - my $line = shift || '*'; - my $dbline = shift; - - return &cmd_prepost( $cmd, $line, $dbline ); -} ## end sub cmd_pre590_prepost - -=head2 C<cmd_prepost> - -Actually does all the handling for C<E<lt>>, C<E<gt>>, C<{{>, C<{>, etc. -Since the lists of actions are all held in arrays that are pointed to by -references anyway, all we have to do is pick the right array reference and -then use generic code to all, delete, or list actions. - -=cut - -sub cmd_prepost { - my $cmd = shift; - - # No action supplied defaults to 'list'. - my $line = shift || '?'; - - # Figure out what to put in the prompt. - my $which = ''; - - # Make sure we have some array or another to address later. - # This means that if ssome reason the tests fail, we won't be - # trying to stash actions or delete them from the wrong place. - my $aref = []; - - # < - Perl code to run before prompt. - if ( $cmd =~ /^\</o ) { - $which = 'pre-perl'; - $aref = $pre; - } - - # > - Perl code to run after prompt. - elsif ( $cmd =~ /^\>/o ) { - $which = 'post-perl'; - $aref = $post; - } - - # { - first check for properly-balanced braces. - elsif ( $cmd =~ /^\{/o ) { - if ( $cmd =~ /^\{.*\}$/o && unbalanced( substr( $cmd, 1 ) ) ) { - print $OUT -"$cmd is now a debugger command\nuse `;$cmd' if you mean Perl code\n"; - } - - # Properly balanced. Pre-prompt debugger actions. - else { - $which = 'pre-debugger'; - $aref = $pretype; - } - } ## end elsif ( $cmd =~ /^\{/o ) - - # Did we find something that makes sense? - unless ($which) { - print $OUT "Confused by command: $cmd\n"; - } - - # Yes. - else { - - # List actions. - if ( $line =~ /^\s*\?\s*$/o ) { - unless (@$aref) { - - # Nothing there. Complain. - print $OUT "No $which actions.\n"; - } - else { - - # List the actions in the selected list. - print $OUT "$which commands:\n"; - foreach my $action (@$aref) { - print $OUT "\t$cmd -- $action\n"; - } - } ## end else - } ## end if ( $line =~ /^\s*\?\s*$/o) - - # Might be a delete. - else { - if ( length($cmd) == 1 ) { - if ( $line =~ /^\s*\*\s*$/o ) { - - # It's a delete. Get rid of the old actions in the - # selected list.. - @$aref = (); - print $OUT "All $cmd actions cleared.\n"; - } - else { - - # Replace all the actions. (This is a <, >, or {). - @$aref = action($line); - } - } ## end if ( length($cmd) == 1) - elsif ( length($cmd) == 2 ) { - - # Add the action to the line. (This is a <<, >>, or {{). - push @$aref, action($line); - } - else { - - # <<<, >>>>, {{{{{{ ... something not a command. - print $OUT - "Confused by strange length of $which command($cmd)...\n"; - } - } ## end else [ if ( $line =~ /^\s*\?\s*$/o) - } ## end else -} ## end sub cmd_prepost - -=head1 C<DB::fake> - -Contains the C<at_exit> routine that the debugger uses to issue the -C<Debugged program terminated ...> message after the program completes. See -the C<END> block documentation for more details. - -=cut - -package DB::fake; - -sub at_exit { - "Debugged program terminated. Use `q' to quit or `R' to restart."; -} - -package DB; # Do not trace this 1; below! - -1; - diff --git a/tests/examplefiles/perlfunc.1 b/tests/examplefiles/perlfunc.1 index 01413c99..5f80f0d0 100644 --- a/tests/examplefiles/perlfunc.1 +++ b/tests/examplefiles/perlfunc.1 @@ -853,2518 +853,4 @@ If \s-1VARIABLE\s0 is omitted, it chomps \f(CW$_\fR. Example: .Sp If \s-1VARIABLE\s0 is a hash, it chomps the hash's values, but not its keys. .Sp -You can actually chomp anything that's an lvalue, including an assignment: -.Sp -.Vb 2 -\& chomp($cwd = `pwd`); -\& chomp($answer = <STDIN>); -.Ve -.Sp -If you chomp a list, each element is chomped, and the total number of -characters removed is returned. -.Sp -If the \f(CW\*(C`encoding\*(C'\fR pragma is in scope then the lengths returned are -calculated from the length of \f(CW$/\fR in Unicode characters, which is not -always the same as the length of \f(CW$/\fR in the native encoding. -.Sp -Note that parentheses are necessary when you're chomping anything -that is not a simple variable. This is because \f(CW\*(C`chomp $cwd = `pwd`;\*(C'\fR -is interpreted as \f(CW\*(C`(chomp $cwd) = `pwd`;\*(C'\fR, rather than as -\&\f(CW\*(C`chomp( $cwd = `pwd` )\*(C'\fR which you might expect. Similarly, -\&\f(CW\*(C`chomp $a, $b\*(C'\fR is interpreted as \f(CW\*(C`chomp($a), $b\*(C'\fR rather than -as \f(CW\*(C`chomp($a, $b)\*(C'\fR. -.IP "chop \s-1VARIABLE\s0" 8 -.IX Xref "chop" -.IX Item "chop VARIABLE" -.PD 0 -.IP "chop( \s-1LIST\s0 )" 8 -.IX Item "chop( LIST )" -.IP "chop" 8 -.IX Item "chop" -.PD -Chops off the last character of a string and returns the character -chopped. It is much more efficient than \f(CW\*(C`s/.$//s\*(C'\fR because it neither -scans nor copies the string. If \s-1VARIABLE\s0 is omitted, chops \f(CW$_\fR. -If \s-1VARIABLE\s0 is a hash, it chops the hash's values, but not its keys. -.Sp -You can actually chop anything that's an lvalue, including an assignment. -.Sp -If you chop a list, each element is chopped. Only the value of the -last \f(CW\*(C`chop\*(C'\fR is returned. -.Sp -Note that \f(CW\*(C`chop\*(C'\fR returns the last character. To return all but the last -character, use \f(CW\*(C`substr($string, 0, \-1)\*(C'\fR. -.Sp -See also \*(L"chomp\*(R". -.IP "chown \s-1LIST\s0" 8 -.IX Xref "chown owner user group" -.IX Item "chown LIST" -Changes the owner (and group) of a list of files. The first two -elements of the list must be the \fInumeric\fR uid and gid, in that -order. A value of \-1 in either position is interpreted by most -systems to leave that value unchanged. Returns the number of files -successfully changed. -.Sp -.Vb 2 -\& $cnt = chown $uid, $gid, 'foo', 'bar'; -\& chown $uid, $gid, @filenames; -.Ve -.Sp -On systems that support fchown, you might pass file handles among the -files. On systems that don't support fchown, passing file handles -produces a fatal error at run time. -.Sp -Here's an example that looks up nonnumeric uids in the passwd file: -.Sp -.Vb 4 -\& print "User: "; -\& chomp($user = <STDIN>); -\& print "Files: "; -\& chomp($pattern = <STDIN>); -.Ve -.Sp -.Vb 2 -\& ($login,$pass,$uid,$gid) = getpwnam($user) -\& or die "$user not in passwd file"; -.Ve -.Sp -.Vb 2 -\& @ary = glob($pattern); # expand filenames -\& chown $uid, $gid, @ary; -.Ve -.Sp -On most systems, you are not allowed to change the ownership of the -file unless you're the superuser, although you should be able to change -the group to any of your secondary groups. On insecure systems, these -restrictions may be relaxed, but this is not a portable assumption. -On \s-1POSIX\s0 systems, you can detect this condition this way: -.Sp -.Vb 2 -\& use POSIX qw(sysconf _PC_CHOWN_RESTRICTED); -\& $can_chown_giveaway = not sysconf(_PC_CHOWN_RESTRICTED); -.Ve -.IP "chr \s-1NUMBER\s0" 8 -.IX Xref "chr character ASCII Unicode" -.IX Item "chr NUMBER" -.PD 0 -.IP "chr" 8 -.IX Item "chr" -.PD -Returns the character represented by that \s-1NUMBER\s0 in the character set. -For example, \f(CW\*(C`chr(65)\*(C'\fR is \f(CW"A"\fR in either \s-1ASCII\s0 or Unicode, and -chr(0x263a) is a Unicode smiley face. Note that characters from 128 -to 255 (inclusive) are by default not encoded in \s-1UTF\-8\s0 Unicode for -backward compatibility reasons (but see encoding). -.Sp -If \s-1NUMBER\s0 is omitted, uses \f(CW$_\fR. -.Sp -For the reverse, use \*(L"ord\*(R". -.Sp -Note that under the \f(CW\*(C`bytes\*(C'\fR pragma the \s-1NUMBER\s0 is masked to -the low eight bits. -.Sp -See perlunicode and encoding for more about Unicode. -.IP "chroot \s-1FILENAME\s0" 8 -.IX Xref "chroot root" -.IX Item "chroot FILENAME" -.PD 0 -.IP "chroot" 8 -.IX Item "chroot" -.PD -This function works like the system call by the same name: it makes the -named directory the new root directory for all further pathnames that -begin with a \f(CW\*(C`/\*(C'\fR by your process and all its children. (It doesn't -change your current working directory, which is unaffected.) For security -reasons, this call is restricted to the superuser. If \s-1FILENAME\s0 is -omitted, does a \f(CW\*(C`chroot\*(C'\fR to \f(CW$_\fR. -.IP "close \s-1FILEHANDLE\s0" 8 -.IX Xref "close" -.IX Item "close FILEHANDLE" -.PD 0 -.IP "close" 8 -.IX Item "close" -.PD -Closes the file or pipe associated with the file handle, returning -true only if \s-1IO\s0 buffers are successfully flushed and closes the system -file descriptor. Closes the currently selected filehandle if the -argument is omitted. -.Sp -You don't have to close \s-1FILEHANDLE\s0 if you are immediately going to do -another \f(CW\*(C`open\*(C'\fR on it, because \f(CW\*(C`open\*(C'\fR will close it for you. (See -\&\f(CW\*(C`open\*(C'\fR.) However, an explicit \f(CW\*(C`close\*(C'\fR on an input file resets the line -counter (\f(CW$.\fR), while the implicit close done by \f(CW\*(C`open\*(C'\fR does not. -.Sp -If the file handle came from a piped open, \f(CW\*(C`close\*(C'\fR will additionally -return false if one of the other system calls involved fails, or if the -program exits with non-zero status. (If the only problem was that the -program exited non\-zero, \f(CW$!\fR will be set to \f(CW0\fR.) Closing a pipe -also waits for the process executing on the pipe to complete, in case you -want to look at the output of the pipe afterwards, and -implicitly puts the exit status value of that command into \f(CW$?\fR. -.Sp -Prematurely closing the read end of a pipe (i.e. before the process -writing to it at the other end has closed it) will result in a -\&\s-1SIGPIPE\s0 being delivered to the writer. If the other end can't -handle that, be sure to read all the data before closing the pipe. -.Sp -Example: -.Sp -.Vb 8 -\& open(OUTPUT, '|sort >foo') # pipe to sort -\& or die "Can't start sort: $!"; -\& #... # print stuff to output -\& close OUTPUT # wait for sort to finish -\& or warn $! ? "Error closing sort pipe: $!" -\& : "Exit status $? from sort"; -\& open(INPUT, 'foo') # get sort's results -\& or die "Can't open 'foo' for input: $!"; -.Ve -.Sp -\&\s-1FILEHANDLE\s0 may be an expression whose value can be used as an indirect -filehandle, usually the real filehandle name. -.IP "closedir \s-1DIRHANDLE\s0" 8 -.IX Xref "closedir" -.IX Item "closedir DIRHANDLE" -Closes a directory opened by \f(CW\*(C`opendir\*(C'\fR and returns the success of that -system call. -.IP "connect \s-1SOCKET\s0,NAME" 8 -.IX Xref "connect" -.IX Item "connect SOCKET,NAME" -Attempts to connect to a remote socket, just as the connect system call -does. Returns true if it succeeded, false otherwise. \s-1NAME\s0 should be a -packed address of the appropriate type for the socket. See the examples in -\&\*(L"Sockets: Client/Server Communication\*(R" in perlipc. -.IP "continue \s-1BLOCK\s0" 8 -.IX Xref "continue" -.IX Item "continue BLOCK" -\&\f(CW\*(C`continue\*(C'\fR is actually a flow control statement rather than a function. If -there is a \f(CW\*(C`continue\*(C'\fR \s-1BLOCK\s0 attached to a \s-1BLOCK\s0 (typically in a \f(CW\*(C`while\*(C'\fR or -\&\f(CW\*(C`foreach\*(C'\fR), it is always executed just before the conditional is about to -be evaluated again, just like the third part of a \f(CW\*(C`for\*(C'\fR loop in C. Thus -it can be used to increment a loop variable, even when the loop has been -continued via the \f(CW\*(C`next\*(C'\fR statement (which is similar to the C \f(CW\*(C`continue\*(C'\fR -statement). -.Sp -\&\f(CW\*(C`last\*(C'\fR, \f(CW\*(C`next\*(C'\fR, or \f(CW\*(C`redo\*(C'\fR may appear within a \f(CW\*(C`continue\*(C'\fR -block. \f(CW\*(C`last\*(C'\fR and \f(CW\*(C`redo\*(C'\fR will behave as if they had been executed within -the main block. So will \f(CW\*(C`next\*(C'\fR, but since it will execute a \f(CW\*(C`continue\*(C'\fR -block, it may be more entertaining. -.Sp -.Vb 9 -\& while (EXPR) { -\& ### redo always comes here -\& do_something; -\& } continue { -\& ### next always comes here -\& do_something_else; -\& # then back the top to re-check EXPR -\& } -\& ### last always comes here -.Ve -.Sp -Omitting the \f(CW\*(C`continue\*(C'\fR section is semantically equivalent to using an -empty one, logically enough. In that case, \f(CW\*(C`next\*(C'\fR goes directly back -to check the condition at the top of the loop. -.IP "cos \s-1EXPR\s0" 8 -.IX Xref "cos cosine acos arccosine" -.IX Item "cos EXPR" -.PD 0 -.IP "cos" 8 -.IX Item "cos" -.PD -Returns the cosine of \s-1EXPR\s0 (expressed in radians). If \s-1EXPR\s0 is omitted, -takes cosine of \f(CW$_\fR. -.Sp -For the inverse cosine operation, you may use the \f(CW\*(C`Math::Trig::acos()\*(C'\fR -function, or use this relation: -.Sp -.Vb 1 -\& sub acos { atan2( sqrt(1 - $_[0] * $_[0]), $_[0] ) } -.Ve -.IP "crypt \s-1PLAINTEXT\s0,SALT" 8 -.IX Xref "crypt digest hash salt plaintext password decrypt cryptography passwd" -.IX Item "crypt PLAINTEXT,SALT" -Creates a digest string exactly like the \fIcrypt\fR\|(3) function in the C -library (assuming that you actually have a version there that has not -been extirpated as a potential munitions). -.Sp -\&\fIcrypt()\fR is a one-way hash function. The \s-1PLAINTEXT\s0 and \s-1SALT\s0 is turned -into a short string, called a digest, which is returned. The same -\&\s-1PLAINTEXT\s0 and \s-1SALT\s0 will always return the same string, but there is no -(known) way to get the original \s-1PLAINTEXT\s0 from the hash. Small -changes in the \s-1PLAINTEXT\s0 or \s-1SALT\s0 will result in large changes in the -digest. -.Sp -There is no decrypt function. This function isn't all that useful for -cryptography (for that, look for \fICrypt\fR modules on your nearby \s-1CPAN\s0 -mirror) and the name \*(L"crypt\*(R" is a bit of a misnomer. Instead it is -primarily used to check if two pieces of text are the same without -having to transmit or store the text itself. An example is checking -if a correct password is given. The digest of the password is stored, -not the password itself. The user types in a password that is -\&\fIcrypt()\fR'd with the same salt as the stored digest. If the two digests -match the password is correct. -.Sp -When verifying an existing digest string you should use the digest as -the salt (like \f(CW\*(C`crypt($plain, $digest) eq $digest\*(C'\fR). The \s-1SALT\s0 used -to create the digest is visible as part of the digest. This ensures -\&\fIcrypt()\fR will hash the new string with the same salt as the digest. -This allows your code to work with the standard crypt and -with more exotic implementations. In other words, do not assume -anything about the returned string itself, or how many bytes in the -digest matter. -.Sp -Traditionally the result is a string of 13 bytes: two first bytes of -the salt, followed by 11 bytes from the set \f(CW\*(C`[./0\-9A\-Za\-z]\*(C'\fR, and only -the first eight bytes of the digest string mattered, but alternative -hashing schemes (like \s-1MD5\s0), higher level security schemes (like C2), -and implementations on non-UNIX platforms may produce different -strings. -.Sp -When choosing a new salt create a random two character string whose -characters come from the set \f(CW\*(C`[./0\-9A\-Za\-z]\*(C'\fR (like \f(CW\*(C`join '', ('.', -\&'/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]\*(C'\fR). This set of -characters is just a recommendation; the characters allowed in -the salt depend solely on your system's crypt library, and Perl can't -restrict what salts \f(CW\*(C`crypt()\*(C'\fR accepts. -.Sp -Here's an example that makes sure that whoever runs this program knows -their password: -.Sp -.Vb 1 -\& $pwd = (getpwuid($<))[1]; -.Ve -.Sp -.Vb 5 -\& system "stty -echo"; -\& print "Password: "; -\& chomp($word = <STDIN>); -\& print "\en"; -\& system "stty echo"; -.Ve -.Sp -.Vb 5 -\& if (crypt($word, $pwd) ne $pwd) { -\& die "Sorry...\en"; -\& } else { -\& print "ok\en"; -\& } -.Ve -.Sp -Of course, typing in your own password to whoever asks you -for it is unwise. -.Sp -The crypt function is unsuitable for hashing large quantities -of data, not least of all because you can't get the information -back. Look at the Digest module for more robust algorithms. -.Sp -If using \fIcrypt()\fR on a Unicode string (which \fIpotentially\fR has -characters with codepoints above 255), Perl tries to make sense -of the situation by trying to downgrade (a copy of the string) -the string back to an eight-bit byte string before calling \fIcrypt()\fR -(on that copy). If that works, good. If not, \fIcrypt()\fR dies with -\&\f(CW\*(C`Wide character in crypt\*(C'\fR. -.IP "dbmclose \s-1HASH\s0" 8 -.IX Xref "dbmclose" -.IX Item "dbmclose HASH" -[This function has been largely superseded by the \f(CW\*(C`untie\*(C'\fR function.] -.Sp -Breaks the binding between a \s-1DBM\s0 file and a hash. -.IP "dbmopen \s-1HASH\s0,DBNAME,MASK" 8 -.IX Xref "dbmopen dbm ndbm sdbm gdbm" -.IX Item "dbmopen HASH,DBNAME,MASK" -[This function has been largely superseded by the \f(CW\*(C`tie\*(C'\fR function.] -.Sp -This binds a \fIdbm\fR\|(3), \fIndbm\fR\|(3), \fIsdbm\fR\|(3), \fIgdbm\fR\|(3), or Berkeley \s-1DB\s0 file to a -hash. \s-1HASH\s0 is the name of the hash. (Unlike normal \f(CW\*(C`open\*(C'\fR, the first -argument is \fInot\fR a filehandle, even though it looks like one). \s-1DBNAME\s0 -is the name of the database (without the \fI.dir\fR or \fI.pag\fR extension if -any). If the database does not exist, it is created with protection -specified by \s-1MASK\s0 (as modified by the \f(CW\*(C`umask\*(C'\fR). If your system supports -only the older \s-1DBM\s0 functions, you may perform only one \f(CW\*(C`dbmopen\*(C'\fR in your -program. In older versions of Perl, if your system had neither \s-1DBM\s0 nor -ndbm, calling \f(CW\*(C`dbmopen\*(C'\fR produced a fatal error; it now falls back to -\&\fIsdbm\fR\|(3). -.Sp -If you don't have write access to the \s-1DBM\s0 file, you can only read hash -variables, not set them. If you want to test whether you can write, -either use file tests or try setting a dummy hash entry inside an \f(CW\*(C`eval\*(C'\fR, -which will trap the error. -.Sp -Note that functions such as \f(CW\*(C`keys\*(C'\fR and \f(CW\*(C`values\*(C'\fR may return huge lists -when used on large \s-1DBM\s0 files. You may prefer to use the \f(CW\*(C`each\*(C'\fR -function to iterate over large \s-1DBM\s0 files. Example: -.Sp -.Vb 6 -\& # print out history file offsets -\& dbmopen(%HIST,'/usr/lib/news/history',0666); -\& while (($key,$val) = each %HIST) { -\& print $key, ' = ', unpack('L',$val), "\en"; -\& } -\& dbmclose(%HIST); -.Ve -.Sp -See also AnyDBM_File for a more general description of the pros and -cons of the various dbm approaches, as well as DB_File for a particularly -rich implementation. -.Sp -You can control which \s-1DBM\s0 library you use by loading that library -before you call \fIdbmopen()\fR: -.Sp -.Vb 3 -\& use DB_File; -\& dbmopen(%NS_Hist, "$ENV{HOME}/.netscape/history.db") -\& or die "Can't open netscape history file: $!"; -.Ve -.IP "defined \s-1EXPR\s0" 8 -.IX Xref "defined undef undefined" -.IX Item "defined EXPR" -.PD 0 -.IP "defined" 8 -.IX Item "defined" -.PD -Returns a Boolean value telling whether \s-1EXPR\s0 has a value other than -the undefined value \f(CW\*(C`undef\*(C'\fR. If \s-1EXPR\s0 is not present, \f(CW$_\fR will be -checked. -.Sp -Many operations return \f(CW\*(C`undef\*(C'\fR to indicate failure, end of file, -system error, uninitialized variable, and other exceptional -conditions. This function allows you to distinguish \f(CW\*(C`undef\*(C'\fR from -other values. (A simple Boolean test will not distinguish among -\&\f(CW\*(C`undef\*(C'\fR, zero, the empty string, and \f(CW"0"\fR, which are all equally -false.) Note that since \f(CW\*(C`undef\*(C'\fR is a valid scalar, its presence -doesn't \fInecessarily\fR indicate an exceptional condition: \f(CW\*(C`pop\*(C'\fR -returns \f(CW\*(C`undef\*(C'\fR when its argument is an empty array, \fIor\fR when the -element to return happens to be \f(CW\*(C`undef\*(C'\fR. -.Sp -You may also use \f(CW\*(C`defined(&func)\*(C'\fR to check whether subroutine \f(CW&func\fR -has ever been defined. The return value is unaffected by any forward -declarations of \f(CW&func\fR. Note that a subroutine which is not defined -may still be callable: its package may have an \f(CW\*(C`AUTOLOAD\*(C'\fR method that -makes it spring into existence the first time that it is called \*(-- see -perlsub. -.Sp -Use of \f(CW\*(C`defined\*(C'\fR on aggregates (hashes and arrays) is deprecated. It -used to report whether memory for that aggregate has ever been -allocated. This behavior may disappear in future versions of Perl. -You should instead use a simple test for size: -.Sp -.Vb 2 -\& if (@an_array) { print "has array elements\en" } -\& if (%a_hash) { print "has hash members\en" } -.Ve -.Sp -When used on a hash element, it tells you whether the value is defined, -not whether the key exists in the hash. Use \*(L"exists\*(R" for the latter -purpose. -.Sp -Examples: -.Sp -.Vb 6 -\& print if defined $switch{'D'}; -\& print "$val\en" while defined($val = pop(@ary)); -\& die "Can't readlink $sym: $!" -\& unless defined($value = readlink $sym); -\& sub foo { defined &$bar ? &$bar(@_) : die "No bar"; } -\& $debugging = 0 unless defined $debugging; -.Ve -.Sp -Note: Many folks tend to overuse \f(CW\*(C`defined\*(C'\fR, and then are surprised to -discover that the number \f(CW0\fR and \f(CW""\fR (the zero-length string) are, in fact, -defined values. For example, if you say -.Sp -.Vb 1 -\& "ab" =~ /a(.*)b/; -.Ve -.Sp -The pattern match succeeds, and \f(CW$1\fR is defined, despite the fact that it -matched \*(L"nothing\*(R". It didn't really fail to match anything. Rather, it -matched something that happened to be zero characters long. This is all -very above-board and honest. When a function returns an undefined value, -it's an admission that it couldn't give you an honest answer. So you -should use \f(CW\*(C`defined\*(C'\fR only when you're questioning the integrity of what -you're trying to do. At other times, a simple comparison to \f(CW0\fR or \f(CW""\fR is -what you want. -.Sp -See also \*(L"undef\*(R", \*(L"exists\*(R", \*(L"ref\*(R". -.IP "delete \s-1EXPR\s0" 8 -.IX Xref "delete" -.IX Item "delete EXPR" -Given an expression that specifies a hash element, array element, hash slice, -or array slice, deletes the specified element(s) from the hash or array. -In the case of an array, if the array elements happen to be at the end, -the size of the array will shrink to the highest element that tests -true for \fIexists()\fR (or 0 if no such element exists). -.Sp -Returns a list with the same number of elements as the number of elements -for which deletion was attempted. Each element of that list consists of -either the value of the element deleted, or the undefined value. In scalar -context, this means that you get the value of the last element deleted (or -the undefined value if that element did not exist). -.Sp -.Vb 4 -\& %hash = (foo => 11, bar => 22, baz => 33); -\& $scalar = delete $hash{foo}; # $scalar is 11 -\& $scalar = delete @hash{qw(foo bar)}; # $scalar is 22 -\& @array = delete @hash{qw(foo bar baz)}; # @array is (undef,undef,33) -.Ve -.Sp -Deleting from \f(CW%ENV\fR modifies the environment. Deleting from -a hash tied to a \s-1DBM\s0 file deletes the entry from the \s-1DBM\s0 file. Deleting -from a \f(CW\*(C`tie\*(C'\fRd hash or array may not necessarily return anything. -.Sp -Deleting an array element effectively returns that position of the array -to its initial, uninitialized state. Subsequently testing for the same -element with \fIexists()\fR will return false. Also, deleting array elements -in the middle of an array will not shift the index of the elements -after them down. Use \fIsplice()\fR for that. See \*(L"exists\*(R". -.Sp -The following (inefficiently) deletes all the values of \f(CW%HASH\fR and \f(CW@ARRAY:\fR -.Sp -.Vb 3 -\& foreach $key (keys %HASH) { -\& delete $HASH{$key}; -\& } -.Ve -.Sp -.Vb 3 -\& foreach $index (0 .. $#ARRAY) { -\& delete $ARRAY[$index]; -\& } -.Ve -.Sp -And so do these: -.Sp -.Vb 1 -\& delete @HASH{keys %HASH}; -.Ve -.Sp -.Vb 1 -\& delete @ARRAY[0 .. $#ARRAY]; -.Ve -.Sp -But both of these are slower than just assigning the empty list -or undefining \f(CW%HASH\fR or \f(CW@ARRAY:\fR -.Sp -.Vb 2 -\& %HASH = (); # completely empty %HASH -\& undef %HASH; # forget %HASH ever existed -.Ve -.Sp -.Vb 2 -\& @ARRAY = (); # completely empty @ARRAY -\& undef @ARRAY; # forget @ARRAY ever existed -.Ve -.Sp -Note that the \s-1EXPR\s0 can be arbitrarily complicated as long as the final -operation is a hash element, array element, hash slice, or array slice -lookup: -.Sp -.Vb 2 -\& delete $ref->[$x][$y]{$key}; -\& delete @{$ref->[$x][$y]}{$key1, $key2, @morekeys}; -.Ve -.Sp -.Vb 2 -\& delete $ref->[$x][$y][$index]; -\& delete @{$ref->[$x][$y]}[$index1, $index2, @moreindices]; -.Ve -.IP "die \s-1LIST\s0" 8 -.IX Xref "die throw exception raise $@ abort" -.IX Item "die LIST" -Outside an \f(CW\*(C`eval\*(C'\fR, prints the value of \s-1LIST\s0 to \f(CW\*(C`STDERR\*(C'\fR and -exits with the current value of \f(CW$!\fR (errno). If \f(CW$!\fR is \f(CW0\fR, -exits with the value of \f(CW\*(C`($? >> 8)\*(C'\fR (backtick `command` -status). If \f(CW\*(C`($? >> 8)\*(C'\fR is \f(CW0\fR, exits with \f(CW255\fR. Inside -an \f(CW\*(C`eval(),\*(C'\fR the error message is stuffed into \f(CW$@\fR and the -\&\f(CW\*(C`eval\*(C'\fR is terminated with the undefined value. This makes -\&\f(CW\*(C`die\*(C'\fR the way to raise an exception. -.Sp -Equivalent examples: -.Sp -.Vb 2 -\& die "Can't cd to spool: $!\en" unless chdir '/usr/spool/news'; -\& chdir '/usr/spool/news' or die "Can't cd to spool: $!\en" -.Ve -.Sp -If the last element of \s-1LIST\s0 does not end in a newline, the current -script line number and input line number (if any) are also printed, -and a newline is supplied. Note that the \*(L"input line number\*(R" (also -known as \*(L"chunk\*(R") is subject to whatever notion of \*(L"line\*(R" happens to -be currently in effect, and is also available as the special variable -\&\f(CW$.\fR. See \*(L"$/\*(R" in perlvar and \*(L"$.\*(R" in perlvar. -.Sp -Hint: sometimes appending \f(CW", stopped"\fR to your message will cause it -to make better sense when the string \f(CW"at foo line 123"\fR is appended. -Suppose you are running script \*(L"canasta\*(R". -.Sp -.Vb 2 -\& die "/etc/games is no good"; -\& die "/etc/games is no good, stopped"; -.Ve -.Sp -produce, respectively -.Sp -.Vb 2 -\& /etc/games is no good at canasta line 123. -\& /etc/games is no good, stopped at canasta line 123. -.Ve -.Sp -See also \fIexit()\fR, \fIwarn()\fR, and the Carp module. -.Sp -If \s-1LIST\s0 is empty and \f(CW$@\fR already contains a value (typically from a -previous eval) that value is reused after appending \f(CW"\et...propagated"\fR. -This is useful for propagating exceptions: -.Sp -.Vb 2 -\& eval { ... }; -\& die unless $@ =~ /Expected exception/; -.Ve -.Sp -If \s-1LIST\s0 is empty and \f(CW$@\fR contains an object reference that has a -\&\f(CW\*(C`PROPAGATE\*(C'\fR method, that method will be called with additional file -and line number parameters. The return value replaces the value in -\&\f(CW$@\fR. i.e. as if \f(CW\*(C`$@ = eval { $@\->PROPAGATE(_\|_FILE_\|_, _\|_LINE_\|_) };\*(C'\fR -were called. -.Sp -If \f(CW$@\fR is empty then the string \f(CW"Died"\fR is used. -.Sp -\&\fIdie()\fR can also be called with a reference argument. If this happens to be -trapped within an \fIeval()\fR, $@ contains the reference. This behavior permits -a more elaborate exception handling implementation using objects that -maintain arbitrary state about the nature of the exception. Such a scheme -is sometimes preferable to matching particular string values of $@ using -regular expressions. Here's an example: -.Sp -.Vb 1 -\& use Scalar::Util 'blessed'; -.Ve -.Sp -.Vb 9 -\& eval { ... ; die Some::Module::Exception->new( FOO => "bar" ) }; -\& if ($@) { -\& if (blessed($@) && $@->isa("Some::Module::Exception")) { -\& # handle Some::Module::Exception -\& } -\& else { -\& # handle all other possible exceptions -\& } -\& } -.Ve -.Sp -Because perl will stringify uncaught exception messages before displaying -them, you may want to overload stringification operations on such custom -exception objects. See overload for details about that. -.Sp -You can arrange for a callback to be run just before the \f(CW\*(C`die\*(C'\fR -does its deed, by setting the \f(CW$SIG{_\|_DIE_\|_}\fR hook. The associated -handler will be called with the error text and can change the error -message, if it sees fit, by calling \f(CW\*(C`die\*(C'\fR again. See -\&\*(L"$SIG{expr}\*(R" in perlvar for details on setting \f(CW%SIG\fR entries, and -\&\*(L"eval \s-1BLOCK\s0\*(R" for some examples. Although this feature was -to be run only right before your program was to exit, this is not -currently the case\*(--the \f(CW$SIG{_\|_DIE_\|_}\fR hook is currently called -even inside \fIeval()\fRed blocks/strings! If one wants the hook to do -nothing in such situations, put -.Sp -.Vb 1 -\& die @_ if $^S; -.Ve -.Sp -as the first line of the handler (see \*(L"$^S\*(R" in perlvar). Because -this promotes strange action at a distance, this counterintuitive -behavior may be fixed in a future release. -.IP "do \s-1BLOCK\s0" 8 -.IX Xref "do block" -.IX Item "do BLOCK" -Not really a function. Returns the value of the last command in the -sequence of commands indicated by \s-1BLOCK\s0. When modified by the \f(CW\*(C`while\*(C'\fR or -\&\f(CW\*(C`until\*(C'\fR loop modifier, executes the \s-1BLOCK\s0 once before testing the loop -condition. (On other statements the loop modifiers test the conditional -first.) -.Sp -\&\f(CW\*(C`do BLOCK\*(C'\fR does \fInot\fR count as a loop, so the loop control statements -\&\f(CW\*(C`next\*(C'\fR, \f(CW\*(C`last\*(C'\fR, or \f(CW\*(C`redo\*(C'\fR cannot be used to leave or restart the block. -See perlsyn for alternative strategies. -.IP "do \s-1SUBROUTINE\s0(\s-1LIST\s0)" 8 -.IX Xref "do" -.IX Item "do SUBROUTINE(LIST)" -This form of subroutine call is deprecated. See perlsub. -.IP "do \s-1EXPR\s0" 8 -.IX Xref "do" -.IX Item "do EXPR" -Uses the value of \s-1EXPR\s0 as a filename and executes the contents of the -file as a Perl script. -.Sp -.Vb 1 -\& do 'stat.pl'; -.Ve -.Sp -is just like -.Sp -.Vb 1 -\& eval `cat stat.pl`; -.Ve -.Sp -except that it's more efficient and concise, keeps track of the current -filename for error messages, searches the \f(CW@INC\fR directories, and updates -\&\f(CW%INC\fR if the file is found. See \*(L"Predefined Names\*(R" in perlvar for these -variables. It also differs in that code evaluated with \f(CW\*(C`do FILENAME\*(C'\fR -cannot see lexicals in the enclosing scope; \f(CW\*(C`eval STRING\*(C'\fR does. It's the -same, however, in that it does reparse the file every time you call it, -so you probably don't want to do this inside a loop. -.Sp -If \f(CW\*(C`do\*(C'\fR cannot read the file, it returns undef and sets \f(CW$!\fR to the -error. If \f(CW\*(C`do\*(C'\fR can read the file but cannot compile it, it -returns undef and sets an error message in \f(CW$@\fR. If the file is -successfully compiled, \f(CW\*(C`do\*(C'\fR returns the value of the last expression -evaluated. -.Sp -Note that inclusion of library modules is better done with the -\&\f(CW\*(C`use\*(C'\fR and \f(CW\*(C`require\*(C'\fR operators, which also do automatic error checking -and raise an exception if there's a problem. -.Sp -You might like to use \f(CW\*(C`do\*(C'\fR to read in a program configuration -file. Manual error checking can be done this way: -.Sp -.Vb 10 -\& # read in config files: system first, then user -\& for $file ("/share/prog/defaults.rc", -\& "$ENV{HOME}/.someprogrc") -\& { -\& unless ($return = do $file) { -\& warn "couldn't parse $file: $@" if $@; -\& warn "couldn't do $file: $!" unless defined $return; -\& warn "couldn't run $file" unless $return; -\& } -\& } -.Ve -.IP "dump \s-1LABEL\s0" 8 -.IX Xref "dump core undump" -.IX Item "dump LABEL" -.PD 0 -.IP "dump" 8 -.IX Item "dump" -.PD -This function causes an immediate core dump. See also the \fB\-u\fR -command-line switch in perlrun, which does the same thing. -Primarily this is so that you can use the \fBundump\fR program (not -supplied) to turn your core dump into an executable binary after -having initialized all your variables at the beginning of the -program. When the new binary is executed it will begin by executing -a \f(CW\*(C`goto LABEL\*(C'\fR (with all the restrictions that \f(CW\*(C`goto\*(C'\fR suffers). -Think of it as a goto with an intervening core dump and reincarnation. -If \f(CW\*(C`LABEL\*(C'\fR is omitted, restarts the program from the top. -.Sp -\&\fB\s-1WARNING\s0\fR: Any files opened at the time of the dump will \fInot\fR -be open any more when the program is reincarnated, with possible -resulting confusion on the part of Perl. -.Sp -This function is now largely obsolete, partly because it's very -hard to convert a core file into an executable, and because the -real compiler backends for generating portable bytecode and compilable -C code have superseded it. That's why you should now invoke it as -\&\f(CW\*(C`CORE::dump()\*(C'\fR, if you don't want to be warned against a possible -typo. -.Sp -If you're looking to use dump to speed up your program, consider -generating bytecode or native C code as described in perlcc. If -you're just trying to accelerate a \s-1CGI\s0 script, consider using the -\&\f(CW\*(C`mod_perl\*(C'\fR extension to \fBApache\fR, or the \s-1CPAN\s0 module, CGI::Fast. -You might also consider autoloading or selfloading, which at least -make your program \fIappear\fR to run faster. -.IP "each \s-1HASH\s0" 8 -.IX Xref "each hash, iterator" -.IX Item "each HASH" -When called in list context, returns a 2\-element list consisting of the -key and value for the next element of a hash, so that you can iterate over -it. When called in scalar context, returns only the key for the next -element in the hash. -.Sp -Entries are returned in an apparently random order. The actual random -order is subject to change in future versions of perl, but it is -guaranteed to be in the same order as either the \f(CW\*(C`keys\*(C'\fR or \f(CW\*(C`values\*(C'\fR -function would produce on the same (unmodified) hash. Since Perl -5.8.1 the ordering is different even between different runs of Perl -for security reasons (see \*(L"Algorithmic Complexity Attacks\*(R" in perlsec). -.Sp -When the hash is entirely read, a null array is returned in list context -(which when assigned produces a false (\f(CW0\fR) value), and \f(CW\*(C`undef\*(C'\fR in -scalar context. The next call to \f(CW\*(C`each\*(C'\fR after that will start iterating -again. There is a single iterator for each hash, shared by all \f(CW\*(C`each\*(C'\fR, -\&\f(CW\*(C`keys\*(C'\fR, and \f(CW\*(C`values\*(C'\fR function calls in the program; it can be reset by -reading all the elements from the hash, or by evaluating \f(CW\*(C`keys HASH\*(C'\fR or -\&\f(CW\*(C`values HASH\*(C'\fR. If you add or delete elements of a hash while you're -iterating over it, you may get entries skipped or duplicated, so -don't. Exception: It is always safe to delete the item most recently -returned by \f(CW\*(C`each()\*(C'\fR, which means that the following code will work: -.Sp -.Vb 4 -\& while (($key, $value) = each %hash) { -\& print $key, "\en"; -\& delete $hash{$key}; # This is safe -\& } -.Ve -.Sp -The following prints out your environment like the \fIprintenv\fR\|(1) program, -only in a different order: -.Sp -.Vb 3 -\& while (($key,$value) = each %ENV) { -\& print "$key=$value\en"; -\& } -.Ve -.Sp -See also \f(CW\*(C`keys\*(C'\fR, \f(CW\*(C`values\*(C'\fR and \f(CW\*(C`sort\*(C'\fR. -.IP "eof \s-1FILEHANDLE\s0" 8 -.IX Xref "eof end of file end-of-file" -.IX Item "eof FILEHANDLE" -.PD 0 -.IP "eof ()" 8 -.IX Item "eof ()" -.IP "eof" 8 -.IX Item "eof" -.PD -Returns 1 if the next read on \s-1FILEHANDLE\s0 will return end of file, or if -\&\s-1FILEHANDLE\s0 is not open. \s-1FILEHANDLE\s0 may be an expression whose value -gives the real filehandle. (Note that this function actually -reads a character and then \f(CW\*(C`ungetc\*(C'\fRs it, so isn't very useful in an -interactive context.) Do not read from a terminal file (or call -\&\f(CW\*(C`eof(FILEHANDLE)\*(C'\fR on it) after end-of-file is reached. File types such -as terminals may lose the end-of-file condition if you do. -.Sp -An \f(CW\*(C`eof\*(C'\fR without an argument uses the last file read. Using \f(CW\*(C`eof()\*(C'\fR -with empty parentheses is very different. It refers to the pseudo file -formed from the files listed on the command line and accessed via the -\&\f(CW\*(C`<>\*(C'\fR operator. Since \f(CW\*(C`<>\*(C'\fR isn't explicitly opened, -as a normal filehandle is, an \f(CW\*(C`eof()\*(C'\fR before \f(CW\*(C`<>\*(C'\fR has been -used will cause \f(CW@ARGV\fR to be examined to determine if input is -available. Similarly, an \f(CW\*(C`eof()\*(C'\fR after \f(CW\*(C`<>\*(C'\fR has returned -end-of-file will assume you are processing another \f(CW@ARGV\fR list, -and if you haven't set \f(CW@ARGV\fR, will read input from \f(CW\*(C`STDIN\*(C'\fR; -see \*(L"I/O Operators\*(R" in perlop. -.Sp -In a \f(CW\*(C`while (<>)\*(C'\fR loop, \f(CW\*(C`eof\*(C'\fR or \f(CW\*(C`eof(ARGV)\*(C'\fR can be used to -detect the end of each file, \f(CW\*(C`eof()\*(C'\fR will only detect the end of the -last file. Examples: -.Sp -.Vb 7 -\& # reset line numbering on each input file -\& while (<>) { -\& next if /^\es*#/; # skip comments -\& print "$.\et$_"; -\& } continue { -\& close ARGV if eof; # Not eof()! -\& } -.Ve -.Sp -.Vb 8 -\& # insert dashes just before last line of last file -\& while (<>) { -\& if (eof()) { # check for end of last file -\& print "--------------\en"; -\& } -\& print; -\& last if eof(); # needed if we're reading from a terminal -\& } -.Ve -.Sp -Practical hint: you almost never need to use \f(CW\*(C`eof\*(C'\fR in Perl, because the -input operators typically return \f(CW\*(C`undef\*(C'\fR when they run out of data, or if -there was an error. -.IP "eval \s-1EXPR\s0" 8 -.IX Xref "eval try catch evaluate parse execute" -.IX Item "eval EXPR" -.PD 0 -.IP "eval \s-1BLOCK\s0" 8 -.IX Item "eval BLOCK" -.IP "eval" 8 -.IX Item "eval" -.PD -In the first form, the return value of \s-1EXPR\s0 is parsed and executed as if it -were a little Perl program. The value of the expression (which is itself -determined within scalar context) is first parsed, and if there weren't any -errors, executed in the lexical context of the current Perl program, so -that any variable settings or subroutine and format definitions remain -afterwards. Note that the value is parsed every time the \f(CW\*(C`eval\*(C'\fR executes. -If \s-1EXPR\s0 is omitted, evaluates \f(CW$_\fR. This form is typically used to -delay parsing and subsequent execution of the text of \s-1EXPR\s0 until run time. -.Sp -In the second form, the code within the \s-1BLOCK\s0 is parsed only once\*(--at the -same time the code surrounding the \f(CW\*(C`eval\*(C'\fR itself was parsed\*(--and executed -within the context of the current Perl program. This form is typically -used to trap exceptions more efficiently than the first (see below), while -also providing the benefit of checking the code within \s-1BLOCK\s0 at compile -time. -.Sp -The final semicolon, if any, may be omitted from the value of \s-1EXPR\s0 or within -the \s-1BLOCK\s0. -.Sp -In both forms, the value returned is the value of the last expression -evaluated inside the mini\-program; a return statement may be also used, just -as with subroutines. The expression providing the return value is evaluated -in void, scalar, or list context, depending on the context of the \f(CW\*(C`eval\*(C'\fR -itself. See \*(L"wantarray\*(R" for more on how the evaluation context can be -determined. -.Sp -If there is a syntax error or runtime error, or a \f(CW\*(C`die\*(C'\fR statement is -executed, an undefined value is returned by \f(CW\*(C`eval\*(C'\fR, and \f(CW$@\fR is set to the -error message. If there was no error, \f(CW$@\fR is guaranteed to be a null -string. Beware that using \f(CW\*(C`eval\*(C'\fR neither silences perl from printing -warnings to \s-1STDERR\s0, nor does it stuff the text of warning messages into \f(CW$@\fR. -To do either of those, you have to use the \f(CW$SIG{_\|_WARN_\|_}\fR facility, or -turn off warnings inside the \s-1BLOCK\s0 or \s-1EXPR\s0 using \f(CW\*(C`no\ warnings\ 'all'\*(C'\fR. -See \*(L"warn\*(R", perlvar, warnings and perllexwarn. -.Sp -Note that, because \f(CW\*(C`eval\*(C'\fR traps otherwise-fatal errors, it is useful for -determining whether a particular feature (such as \f(CW\*(C`socket\*(C'\fR or \f(CW\*(C`symlink\*(C'\fR) -is implemented. It is also Perl's exception trapping mechanism, where -the die operator is used to raise exceptions. -.Sp -If the code to be executed doesn't vary, you may use the eval-BLOCK -form to trap run-time errors without incurring the penalty of -recompiling each time. The error, if any, is still returned in \f(CW$@\fR. -Examples: -.Sp -.Vb 2 -\& # make divide-by-zero nonfatal -\& eval { $answer = $a / $b; }; warn $@ if $@; -.Ve -.Sp -.Vb 2 -\& # same thing, but less efficient -\& eval '$answer = $a / $b'; warn $@ if $@; -.Ve -.Sp -.Vb 2 -\& # a compile-time error -\& eval { $answer = }; # WRONG -.Ve -.Sp -.Vb 2 -\& # a run-time error -\& eval '$answer ='; # sets $@ -.Ve -.Sp -Using the \f(CW\*(C`eval{}\*(C'\fR form as an exception trap in libraries does have some -issues. Due to the current arguably broken state of \f(CW\*(C`_\|_DIE_\|_\*(C'\fR hooks, you -may wish not to trigger any \f(CW\*(C`_\|_DIE_\|_\*(C'\fR hooks that user code may have installed. -You can use the \f(CW\*(C`local $SIG{_\|_DIE_\|_}\*(C'\fR construct for this purpose, -as shown in this example: -.Sp -.Vb 3 -\& # a very private exception trap for divide-by-zero -\& eval { local $SIG{'__DIE__'}; $answer = $a / $b; }; -\& warn $@ if $@; -.Ve -.Sp -This is especially significant, given that \f(CW\*(C`_\|_DIE_\|_\*(C'\fR hooks can call -\&\f(CW\*(C`die\*(C'\fR again, which has the effect of changing their error messages: -.Sp -.Vb 7 -\& # __DIE__ hooks may modify error messages -\& { -\& local $SIG{'__DIE__'} = -\& sub { (my $x = $_[0]) =~ s/foo/bar/g; die $x }; -\& eval { die "foo lives here" }; -\& print $@ if $@; # prints "bar lives here" -\& } -.Ve -.Sp -Because this promotes action at a distance, this counterintuitive behavior -may be fixed in a future release. -.Sp -With an \f(CW\*(C`eval\*(C'\fR, you should be especially careful to remember what's -being looked at when: -.Sp -.Vb 2 -\& eval $x; # CASE 1 -\& eval "$x"; # CASE 2 -.Ve -.Sp -.Vb 2 -\& eval '$x'; # CASE 3 -\& eval { $x }; # CASE 4 -.Ve -.Sp -.Vb 2 -\& eval "\e$$x++"; # CASE 5 -\& $$x++; # CASE 6 -.Ve -.Sp -Cases 1 and 2 above behave identically: they run the code contained in -the variable \f(CW$x\fR. (Although case 2 has misleading double quotes making -the reader wonder what else might be happening (nothing is).) Cases 3 -and 4 likewise behave in the same way: they run the code \f(CW'$x'\fR, which -does nothing but return the value of \f(CW$x\fR. (Case 4 is preferred for -purely visual reasons, but it also has the advantage of compiling at -compile-time instead of at run\-time.) Case 5 is a place where -normally you \fIwould\fR like to use double quotes, except that in this -particular situation, you can just use symbolic references instead, as -in case 6. -.Sp -\&\f(CW\*(C`eval BLOCK\*(C'\fR does \fInot\fR count as a loop, so the loop control statements -\&\f(CW\*(C`next\*(C'\fR, \f(CW\*(C`last\*(C'\fR, or \f(CW\*(C`redo\*(C'\fR cannot be used to leave or restart the block. -.Sp -Note that as a very special case, an \f(CW\*(C`eval ''\*(C'\fR executed within the \f(CW\*(C`DB\*(C'\fR -package doesn't see the usual surrounding lexical scope, but rather the -scope of the first non-DB piece of code that called it. You don't normally -need to worry about this unless you are writing a Perl debugger. -.IP "exec \s-1LIST\s0" 8 -.IX Xref "exec execute" -.IX Item "exec LIST" -.PD 0 -.IP "exec \s-1PROGRAM\s0 \s-1LIST\s0" 8 -.IX Item "exec PROGRAM LIST" -.PD -The \f(CW\*(C`exec\*(C'\fR function executes a system command \fIand never returns\fR\-\- -use \f(CW\*(C`system\*(C'\fR instead of \f(CW\*(C`exec\*(C'\fR if you want it to return. It fails and -returns false only if the command does not exist \fIand\fR it is executed -directly instead of via your system's command shell (see below). -.Sp -Since it's a common mistake to use \f(CW\*(C`exec\*(C'\fR instead of \f(CW\*(C`system\*(C'\fR, Perl -warns you if there is a following statement which isn't \f(CW\*(C`die\*(C'\fR, \f(CW\*(C`warn\*(C'\fR, -or \f(CW\*(C`exit\*(C'\fR (if \f(CW\*(C`\-w\*(C'\fR is set \- but you always do that). If you -\&\fIreally\fR want to follow an \f(CW\*(C`exec\*(C'\fR with some other statement, you -can use one of these styles to avoid the warning: -.Sp -.Vb 2 -\& exec ('foo') or print STDERR "couldn't exec foo: $!"; -\& { exec ('foo') }; print STDERR "couldn't exec foo: $!"; -.Ve -.Sp -If there is more than one argument in \s-1LIST\s0, or if \s-1LIST\s0 is an array -with more than one value, calls \fIexecvp\fR\|(3) with the arguments in \s-1LIST\s0. -If there is only one scalar argument or an array with one element in it, -the argument is checked for shell metacharacters, and if there are any, -the entire argument is passed to the system's command shell for parsing -(this is \f(CW\*(C`/bin/sh \-c\*(C'\fR on Unix platforms, but varies on other platforms). -If there are no shell metacharacters in the argument, it is split into -words and passed directly to \f(CW\*(C`execvp\*(C'\fR, which is more efficient. -Examples: -.Sp -.Vb 2 -\& exec '/bin/echo', 'Your arguments are: ', @ARGV; -\& exec "sort $outfile | uniq"; -.Ve -.Sp -If you don't really want to execute the first argument, but want to lie -to the program you are executing about its own name, you can specify -the program you actually want to run as an \*(L"indirect object\*(R" (without a -comma) in front of the \s-1LIST\s0. (This always forces interpretation of the -\&\s-1LIST\s0 as a multivalued list, even if there is only a single scalar in -the list.) Example: -.Sp -.Vb 2 -\& $shell = '/bin/csh'; -\& exec $shell '-sh'; # pretend it's a login shell -.Ve -.Sp -or, more directly, -.Sp -.Vb 1 -\& exec {'/bin/csh'} '-sh'; # pretend it's a login shell -.Ve -.Sp -When the arguments get executed via the system shell, results will -be subject to its quirks and capabilities. See \*(L"`STRING`\*(R" in perlop -for details. -.Sp -Using an indirect object with \f(CW\*(C`exec\*(C'\fR or \f(CW\*(C`system\*(C'\fR is also more -secure. This usage (which also works fine with \fIsystem()\fR) forces -interpretation of the arguments as a multivalued list, even if the -list had just one argument. That way you're safe from the shell -expanding wildcards or splitting up words with whitespace in them. -.Sp -.Vb 1 -\& @args = ( "echo surprise" ); -.Ve -.Sp -.Vb 3 -\& exec @args; # subject to shell escapes -\& # if @args == 1 -\& exec { $args[0] } @args; # safe even with one-arg list -.Ve -.Sp -The first version, the one without the indirect object, ran the \fIecho\fR -program, passing it \f(CW"surprise"\fR an argument. The second version -didn't\*(--it tried to run a program literally called \fI\*(L"echo surprise\*(R"\fR, -didn't find it, and set \f(CW$?\fR to a non-zero value indicating failure. -.Sp -Beginning with v5.6.0, Perl will attempt to flush all files opened for -output before the exec, but this may not be supported on some platforms -(see perlport). To be safe, you may need to set \f(CW$|\fR ($AUTOFLUSH -in English) or call the \f(CW\*(C`autoflush()\*(C'\fR method of \f(CW\*(C`IO::Handle\*(C'\fR on any -open handles in order to avoid lost output. -.Sp -Note that \f(CW\*(C`exec\*(C'\fR will not call your \f(CW\*(C`END\*(C'\fR blocks, nor will it call -any \f(CW\*(C`DESTROY\*(C'\fR methods in your objects. -.IP "exists \s-1EXPR\s0" 8 -.IX Xref "exists autovivification" -.IX Item "exists EXPR" -Given an expression that specifies a hash element or array element, -returns true if the specified element in the hash or array has ever -been initialized, even if the corresponding value is undefined. The -element is not autovivified if it doesn't exist. -.Sp -.Vb 3 -\& print "Exists\en" if exists $hash{$key}; -\& print "Defined\en" if defined $hash{$key}; -\& print "True\en" if $hash{$key}; -.Ve -.Sp -.Vb 3 -\& print "Exists\en" if exists $array[$index]; -\& print "Defined\en" if defined $array[$index]; -\& print "True\en" if $array[$index]; -.Ve -.Sp -A hash or array element can be true only if it's defined, and defined if -it exists, but the reverse doesn't necessarily hold true. -.Sp -Given an expression that specifies the name of a subroutine, -returns true if the specified subroutine has ever been declared, even -if it is undefined. Mentioning a subroutine name for exists or defined -does not count as declaring it. Note that a subroutine which does not -exist may still be callable: its package may have an \f(CW\*(C`AUTOLOAD\*(C'\fR -method that makes it spring into existence the first time that it is -called \*(-- see perlsub. -.Sp -.Vb 2 -\& print "Exists\en" if exists &subroutine; -\& print "Defined\en" if defined &subroutine; -.Ve -.Sp -Note that the \s-1EXPR\s0 can be arbitrarily complicated as long as the final -operation is a hash or array key lookup or subroutine name: -.Sp -.Vb 2 -\& if (exists $ref->{A}->{B}->{$key}) { } -\& if (exists $hash{A}{B}{$key}) { } -.Ve -.Sp -.Vb 2 -\& if (exists $ref->{A}->{B}->[$ix]) { } -\& if (exists $hash{A}{B}[$ix]) { } -.Ve -.Sp -.Vb 1 -\& if (exists &{$ref->{A}{B}{$key}}) { } -.Ve -.Sp -Although the deepest nested array or hash will not spring into existence -just because its existence was tested, any intervening ones will. -Thus \f(CW\*(C`$ref\->{"A"}\*(C'\fR and \f(CW\*(C`$ref\->{"A"}\->{"B"}\*(C'\fR will spring -into existence due to the existence test for the \f(CW$key\fR element above. -This happens anywhere the arrow operator is used, including even: -.Sp -.Vb 3 -\& undef $ref; -\& if (exists $ref->{"Some key"}) { } -\& print $ref; # prints HASH(0x80d3d5c) -.Ve -.Sp -This surprising autovivification in what does not at first\*(--or even -second\*(--glance appear to be an lvalue context may be fixed in a future -release. -.Sp -See \*(L"Pseudo\-hashes: Using an array as a hash\*(R" in perlref for specifics -on how \fIexists()\fR acts when used on a pseudo\-hash. -.Sp -Use of a subroutine call, rather than a subroutine name, as an argument -to \fIexists()\fR is an error. -.Sp -.Vb 2 -\& exists ⊂ # OK -\& exists &sub(); # Error -.Ve -.IP "exit \s-1EXPR\s0" 8 -.IX Xref "exit terminate abort" -.IX Item "exit EXPR" -.PD 0 -.IP "exit" 8 -.IX Item "exit" -.PD -Evaluates \s-1EXPR\s0 and exits immediately with that value. Example: -.Sp -.Vb 2 -\& $ans = <STDIN>; -\& exit 0 if $ans =~ /^[Xx]/; -.Ve -.Sp -See also \f(CW\*(C`die\*(C'\fR. If \s-1EXPR\s0 is omitted, exits with \f(CW0\fR status. The only -universally recognized values for \s-1EXPR\s0 are \f(CW0\fR for success and \f(CW1\fR -for error; other values are subject to interpretation depending on the -environment in which the Perl program is running. For example, exiting -69 (\s-1EX_UNAVAILABLE\s0) from a \fIsendmail\fR incoming-mail filter will cause -the mailer to return the item undelivered, but that's not true everywhere. -.Sp -Don't use \f(CW\*(C`exit\*(C'\fR to abort a subroutine if there's any chance that -someone might want to trap whatever error happened. Use \f(CW\*(C`die\*(C'\fR instead, -which can be trapped by an \f(CW\*(C`eval\*(C'\fR. -.Sp -The \fIexit()\fR function does not always exit immediately. It calls any -defined \f(CW\*(C`END\*(C'\fR routines first, but these \f(CW\*(C`END\*(C'\fR routines may not -themselves abort the exit. Likewise any object destructors that need to -be called are called before the real exit. If this is a problem, you -can call \f(CW\*(C`POSIX:_exit($status)\*(C'\fR to avoid \s-1END\s0 and destructor processing. -See perlmod for details. -.IP "exp \s-1EXPR\s0" 8 -.IX Xref "exp exponential antilog antilogarithm e" -.IX Item "exp EXPR" -.PD 0 -.IP "exp" 8 -.IX Item "exp" -.PD -Returns \fIe\fR (the natural logarithm base) to the power of \s-1EXPR\s0. -If \s-1EXPR\s0 is omitted, gives \f(CW\*(C`exp($_)\*(C'\fR. -.IP "fcntl \s-1FILEHANDLE\s0,FUNCTION,SCALAR" 8 -.IX Xref "fcntl" -.IX Item "fcntl FILEHANDLE,FUNCTION,SCALAR" -Implements the \fIfcntl\fR\|(2) function. You'll probably have to say -.Sp -.Vb 1 -\& use Fcntl; -.Ve -.Sp -first to get the correct constant definitions. Argument processing and -value return works just like \f(CW\*(C`ioctl\*(C'\fR below. -For example: -.Sp -.Vb 3 -\& use Fcntl; -\& fcntl($filehandle, F_GETFL, $packed_return_buffer) -\& or die "can't fcntl F_GETFL: $!"; -.Ve -.Sp -You don't have to check for \f(CW\*(C`defined\*(C'\fR on the return from \f(CW\*(C`fcntl\*(C'\fR. -Like \f(CW\*(C`ioctl\*(C'\fR, it maps a \f(CW0\fR return from the system call into -\&\f(CW"0 but true"\fR in Perl. This string is true in boolean context and \f(CW0\fR -in numeric context. It is also exempt from the normal \fB\-w\fR warnings -on improper numeric conversions. -.Sp -Note that \f(CW\*(C`fcntl\*(C'\fR will produce a fatal error if used on a machine that -doesn't implement \fIfcntl\fR\|(2). See the Fcntl module or your \fIfcntl\fR\|(2) -manpage to learn what functions are available on your system. -.Sp -Here's an example of setting a filehandle named \f(CW\*(C`REMOTE\*(C'\fR to be -non-blocking at the system level. You'll have to negotiate \f(CW$|\fR -on your own, though. -.Sp -.Vb 1 -\& use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK); -.Ve -.Sp -.Vb 2 -\& $flags = fcntl(REMOTE, F_GETFL, 0) -\& or die "Can't get flags for the socket: $!\en"; -.Ve -.Sp -.Vb 2 -\& $flags = fcntl(REMOTE, F_SETFL, $flags | O_NONBLOCK) -\& or die "Can't set flags for the socket: $!\en"; -.Ve -.IP "fileno \s-1FILEHANDLE\s0" 8 -.IX Xref "fileno" -.IX Item "fileno FILEHANDLE" -Returns the file descriptor for a filehandle, or undefined if the -filehandle is not open. This is mainly useful for constructing -bitmaps for \f(CW\*(C`select\*(C'\fR and low-level \s-1POSIX\s0 tty-handling operations. -If \s-1FILEHANDLE\s0 is an expression, the value is taken as an indirect -filehandle, generally its name. -.Sp -You can use this to find out whether two handles refer to the -same underlying descriptor: -.Sp -.Vb 3 -\& if (fileno(THIS) == fileno(THAT)) { -\& print "THIS and THAT are dups\en"; -\& } -.Ve -.Sp -(Filehandles connected to memory objects via new features of \f(CW\*(C`open\*(C'\fR may -return undefined even though they are open.) -.IP "flock \s-1FILEHANDLE\s0,OPERATION" 8 -.IX Xref "flock lock locking" -.IX Item "flock FILEHANDLE,OPERATION" -Calls \fIflock\fR\|(2), or an emulation of it, on \s-1FILEHANDLE\s0. Returns true -for success, false on failure. Produces a fatal error if used on a -machine that doesn't implement \fIflock\fR\|(2), \fIfcntl\fR\|(2) locking, or \fIlockf\fR\|(3). -\&\f(CW\*(C`flock\*(C'\fR is Perl's portable file locking interface, although it locks -only entire files, not records. -.Sp -Two potentially non-obvious but traditional \f(CW\*(C`flock\*(C'\fR semantics are -that it waits indefinitely until the lock is granted, and that its locks -\&\fBmerely advisory\fR. Such discretionary locks are more flexible, but offer -fewer guarantees. This means that programs that do not also use \f(CW\*(C`flock\*(C'\fR -may modify files locked with \f(CW\*(C`flock\*(C'\fR. See perlport, -your port's specific documentation, or your system-specific local manpages -for details. It's best to assume traditional behavior if you're writing -portable programs. (But if you're not, you should as always feel perfectly -free to write for your own system's idiosyncrasies (sometimes called -\&\*(L"features\*(R"). Slavish adherence to portability concerns shouldn't get -in the way of your getting your job done.) -.Sp -\&\s-1OPERATION\s0 is one of \s-1LOCK_SH\s0, \s-1LOCK_EX\s0, or \s-1LOCK_UN\s0, possibly combined with -\&\s-1LOCK_NB\s0. These constants are traditionally valued 1, 2, 8 and 4, but -you can use the symbolic names if you import them from the Fcntl module, -either individually, or as a group using the ':flock' tag. \s-1LOCK_SH\s0 -requests a shared lock, \s-1LOCK_EX\s0 requests an exclusive lock, and \s-1LOCK_UN\s0 -releases a previously requested lock. If \s-1LOCK_NB\s0 is bitwise\-or'ed with -\&\s-1LOCK_SH\s0 or \s-1LOCK_EX\s0 then \f(CW\*(C`flock\*(C'\fR will return immediately rather than blocking -waiting for the lock (check the return status to see if you got it). -.Sp -To avoid the possibility of miscoordination, Perl now flushes \s-1FILEHANDLE\s0 -before locking or unlocking it. -.Sp -Note that the emulation built with \fIlockf\fR\|(3) doesn't provide shared -locks, and it requires that \s-1FILEHANDLE\s0 be open with write intent. These -are the semantics that \fIlockf\fR\|(3) implements. Most if not all systems -implement \fIlockf\fR\|(3) in terms of \fIfcntl\fR\|(2) locking, though, so the -differing semantics shouldn't bite too many people. -.Sp -Note that the \fIfcntl\fR\|(2) emulation of \fIflock\fR\|(3) requires that \s-1FILEHANDLE\s0 -be open with read intent to use \s-1LOCK_SH\s0 and requires that it be open -with write intent to use \s-1LOCK_EX\s0. -.Sp -Note also that some versions of \f(CW\*(C`flock\*(C'\fR cannot lock things over the -network; you would need to use the more system-specific \f(CW\*(C`fcntl\*(C'\fR for -that. If you like you can force Perl to ignore your system's \fIflock\fR\|(2) -function, and so provide its own \fIfcntl\fR\|(2)\-based emulation, by passing -the switch \f(CW\*(C`\-Ud_flock\*(C'\fR to the \fIConfigure\fR program when you configure -perl. -.Sp -Here's a mailbox appender for \s-1BSD\s0 systems. -.Sp -.Vb 1 -\& use Fcntl ':flock'; # import LOCK_* constants -.Ve -.Sp -.Vb 6 -\& sub lock { -\& flock(MBOX,LOCK_EX); -\& # and, in case someone appended -\& # while we were waiting... -\& seek(MBOX, 0, 2); -\& } -.Ve -.Sp -.Vb 3 -\& sub unlock { -\& flock(MBOX,LOCK_UN); -\& } -.Ve -.Sp -.Vb 2 -\& open(MBOX, ">>/usr/spool/mail/$ENV{'USER'}") -\& or die "Can't open mailbox: $!"; -.Ve -.Sp -.Vb 3 -\& lock(); -\& print MBOX $msg,"\en\en"; -\& unlock(); -.Ve -.Sp -On systems that support a real \fIflock()\fR, locks are inherited across \fIfork()\fR -calls, whereas those that must resort to the more capricious \fIfcntl()\fR -function lose the locks, making it harder to write servers. -.Sp -See also DB_File for other \fIflock()\fR examples. -.IP "fork" 8 -.IX Xref "fork child parent" -.IX Item "fork" -Does a \fIfork\fR\|(2) system call to create a new process running the -same program at the same point. It returns the child pid to the -parent process, \f(CW0\fR to the child process, or \f(CW\*(C`undef\*(C'\fR if the fork is -unsuccessful. File descriptors (and sometimes locks on those descriptors) -are shared, while everything else is copied. On most systems supporting -\&\fIfork()\fR, great care has gone into making it extremely efficient (for -example, using copy-on-write technology on data pages), making it the -dominant paradigm for multitasking over the last few decades. -.Sp -Beginning with v5.6.0, Perl will attempt to flush all files opened for -output before forking the child process, but this may not be supported -on some platforms (see perlport). To be safe, you may need to set -\&\f(CW$|\fR ($AUTOFLUSH in English) or call the \f(CW\*(C`autoflush()\*(C'\fR method of -\&\f(CW\*(C`IO::Handle\*(C'\fR on any open handles in order to avoid duplicate output. -.Sp -If you \f(CW\*(C`fork\*(C'\fR without ever waiting on your children, you will -accumulate zombies. On some systems, you can avoid this by setting -\&\f(CW$SIG{CHLD}\fR to \f(CW"IGNORE"\fR. See also perlipc for more examples of -forking and reaping moribund children. -.Sp -Note that if your forked child inherits system file descriptors like -\&\s-1STDIN\s0 and \s-1STDOUT\s0 that are actually connected by a pipe or socket, even -if you exit, then the remote server (such as, say, a \s-1CGI\s0 script or a -backgrounded job launched from a remote shell) won't think you're done. -You should reopen those to \fI/dev/null\fR if it's any issue. -.IP "format" 8 -.IX Xref "format" -.IX Item "format" -Declare a picture format for use by the \f(CW\*(C`write\*(C'\fR function. For -example: -.Sp -.Vb 4 -\& format Something = -\& Test: @<<<<<<<< @||||| @>>>>> -\& $str, $%, '$' . int($num) -\& . -.Ve -.Sp -.Vb 4 -\& $str = "widget"; -\& $num = $cost/$quantity; -\& $~ = 'Something'; -\& write; -.Ve -.Sp -See perlform for many details and examples. -.IP "formline \s-1PICTURE\s0,LIST" 8 -.IX Xref "formline" -.IX Item "formline PICTURE,LIST" -This is an internal function used by \f(CW\*(C`format\*(C'\fRs, though you may call it, -too. It formats (see perlform) a list of values according to the -contents of \s-1PICTURE\s0, placing the output into the format output -accumulator, \f(CW$^A\fR (or \f(CW$ACCUMULATOR\fR in English). -Eventually, when a \f(CW\*(C`write\*(C'\fR is done, the contents of -\&\f(CW$^A\fR are written to some filehandle. You could also read \f(CW$^A\fR -and then set \f(CW$^A\fR back to \f(CW""\fR. Note that a format typically -does one \f(CW\*(C`formline\*(C'\fR per line of form, but the \f(CW\*(C`formline\*(C'\fR function itself -doesn't care how many newlines are embedded in the \s-1PICTURE\s0. This means -that the \f(CW\*(C`~\*(C'\fR and \f(CW\*(C`~~\*(C'\fR tokens will treat the entire \s-1PICTURE\s0 as a single line. -You may therefore need to use multiple formlines to implement a single -record format, just like the format compiler. -.Sp -Be careful if you put double quotes around the picture, because an \f(CW\*(C`@\*(C'\fR -character may be taken to mean the beginning of an array name. -\&\f(CW\*(C`formline\*(C'\fR always returns true. See perlform for other examples. -.IP "getc \s-1FILEHANDLE\s0" 8 -.IX Xref "getc getchar" -.IX Item "getc FILEHANDLE" -.PD 0 -.IP "getc" 8 -.IX Item "getc" -.PD -Returns the next character from the input file attached to \s-1FILEHANDLE\s0, -or the undefined value at end of file, or if there was an error (in -the latter case \f(CW$!\fR is set). If \s-1FILEHANDLE\s0 is omitted, reads from -\&\s-1STDIN\s0. This is not particularly efficient. However, it cannot be -used by itself to fetch single characters without waiting for the user -to hit enter. For that, try something more like: -.Sp -.Vb 6 -\& if ($BSD_STYLE) { -\& system "stty cbreak </dev/tty >/dev/tty 2>&1"; -\& } -\& else { -\& system "stty", '-icanon', 'eol', "\e001"; -\& } -.Ve -.Sp -.Vb 1 -\& $key = getc(STDIN); -.Ve -.Sp -.Vb 7 -\& if ($BSD_STYLE) { -\& system "stty -cbreak </dev/tty >/dev/tty 2>&1"; -\& } -\& else { -\& system "stty", 'icanon', 'eol', '^@'; # ASCII null -\& } -\& print "\en"; -.Ve -.Sp -Determination of whether \f(CW$BSD_STYLE\fR should be set -is left as an exercise to the reader. -.Sp -The \f(CW\*(C`POSIX::getattr\*(C'\fR function can do this more portably on -systems purporting \s-1POSIX\s0 compliance. See also the \f(CW\*(C`Term::ReadKey\*(C'\fR -module from your nearest \s-1CPAN\s0 site; details on \s-1CPAN\s0 can be found on -\&\*(L"\s-1CPAN\s0\*(R" in perlmodlib. -.IP "getlogin" 8 -.IX Xref "getlogin login" -.IX Item "getlogin" -This implements the C library function of the same name, which on most -systems returns the current login from \fI/etc/utmp\fR, if any. If null, -use \f(CW\*(C`getpwuid\*(C'\fR. -.Sp -.Vb 1 -\& $login = getlogin || getpwuid($<) || "Kilroy"; -.Ve -.Sp -Do not consider \f(CW\*(C`getlogin\*(C'\fR for authentication: it is not as -secure as \f(CW\*(C`getpwuid\*(C'\fR. -.IP "getpeername \s-1SOCKET\s0" 8 -.IX Xref "getpeername peer" -.IX Item "getpeername SOCKET" -Returns the packed sockaddr address of other end of the \s-1SOCKET\s0 connection. -.Sp -.Vb 5 -\& use Socket; -\& $hersockaddr = getpeername(SOCK); -\& ($port, $iaddr) = sockaddr_in($hersockaddr); -\& $herhostname = gethostbyaddr($iaddr, AF_INET); -\& $herstraddr = inet_ntoa($iaddr); -.Ve -.IP "getpgrp \s-1PID\s0" 8 -.IX Xref "getpgrp group" -.IX Item "getpgrp PID" -Returns the current process group for the specified \s-1PID\s0. Use -a \s-1PID\s0 of \f(CW0\fR to get the current process group for the -current process. Will raise an exception if used on a machine that -doesn't implement \fIgetpgrp\fR\|(2). If \s-1PID\s0 is omitted, returns process -group of current process. Note that the \s-1POSIX\s0 version of \f(CW\*(C`getpgrp\*(C'\fR -does not accept a \s-1PID\s0 argument, so only \f(CW\*(C`PID==0\*(C'\fR is truly portable. -.IP "getppid" 8 -.IX Xref "getppid parent pid" -.IX Item "getppid" -Returns the process id of the parent process. -.Sp -Note for Linux users: on Linux, the C functions \f(CW\*(C`getpid()\*(C'\fR and -\&\f(CW\*(C`getppid()\*(C'\fR return different values from different threads. In order to -be portable, this behavior is not reflected by the perl-level function -\&\f(CW\*(C`getppid()\*(C'\fR, that returns a consistent value across threads. If you want -to call the underlying \f(CW\*(C`getppid()\*(C'\fR, you may use the \s-1CPAN\s0 module -\&\f(CW\*(C`Linux::Pid\*(C'\fR. -.IP "getpriority \s-1WHICH\s0,WHO" 8 -.IX Xref "getpriority priority nice" -.IX Item "getpriority WHICH,WHO" -Returns the current priority for a process, a process group, or a user. -(See \fIgetpriority\fR\|(2).) Will raise a fatal exception if used on a -machine that doesn't implement \fIgetpriority\fR\|(2). -.IP "getpwnam \s-1NAME\s0" 8 -.IX Xref "getpwnam getgrnam gethostbyname getnetbyname getprotobyname getpwuid getgrgid getservbyname gethostbyaddr getnetbyaddr getprotobynumber getservbyport getpwent getgrent gethostent getnetent getprotoent getservent setpwent setgrent sethostent setnetent setprotoent setservent endpwent endgrent endhostent endnetent endprotoent endservent" -.IX Item "getpwnam NAME" -.PD 0 -.IP "getgrnam \s-1NAME\s0" 8 -.IX Item "getgrnam NAME" -.IP "gethostbyname \s-1NAME\s0" 8 -.IX Item "gethostbyname NAME" -.IP "getnetbyname \s-1NAME\s0" 8 -.IX Item "getnetbyname NAME" -.IP "getprotobyname \s-1NAME\s0" 8 -.IX Item "getprotobyname NAME" -.IP "getpwuid \s-1UID\s0" 8 -.IX Item "getpwuid UID" -.IP "getgrgid \s-1GID\s0" 8 -.IX Item "getgrgid GID" -.IP "getservbyname \s-1NAME\s0,PROTO" 8 -.IX Item "getservbyname NAME,PROTO" -.IP "gethostbyaddr \s-1ADDR\s0,ADDRTYPE" 8 -.IX Item "gethostbyaddr ADDR,ADDRTYPE" -.IP "getnetbyaddr \s-1ADDR\s0,ADDRTYPE" 8 -.IX Item "getnetbyaddr ADDR,ADDRTYPE" -.IP "getprotobynumber \s-1NUMBER\s0" 8 -.IX Item "getprotobynumber NUMBER" -.IP "getservbyport \s-1PORT\s0,PROTO" 8 -.IX Item "getservbyport PORT,PROTO" -.IP "getpwent" 8 -.IX Item "getpwent" -.IP "getgrent" 8 -.IX Item "getgrent" -.IP "gethostent" 8 -.IX Item "gethostent" -.IP "getnetent" 8 -.IX Item "getnetent" -.IP "getprotoent" 8 -.IX Item "getprotoent" -.IP "getservent" 8 -.IX Item "getservent" -.IP "setpwent" 8 -.IX Item "setpwent" -.IP "setgrent" 8 -.IX Item "setgrent" -.IP "sethostent \s-1STAYOPEN\s0" 8 -.IX Item "sethostent STAYOPEN" -.IP "setnetent \s-1STAYOPEN\s0" 8 -.IX Item "setnetent STAYOPEN" -.IP "setprotoent \s-1STAYOPEN\s0" 8 -.IX Item "setprotoent STAYOPEN" -.IP "setservent \s-1STAYOPEN\s0" 8 -.IX Item "setservent STAYOPEN" -.IP "endpwent" 8 -.IX Item "endpwent" -.IP "endgrent" 8 -.IX Item "endgrent" -.IP "endhostent" 8 -.IX Item "endhostent" -.IP "endnetent" 8 -.IX Item "endnetent" -.IP "endprotoent" 8 -.IX Item "endprotoent" -.IP "endservent" 8 -.IX Item "endservent" -.PD -These routines perform the same functions as their counterparts in the -system library. In list context, the return values from the -various get routines are as follows: -.Sp -.Vb 7 -\& ($name,$passwd,$uid,$gid, -\& $quota,$comment,$gcos,$dir,$shell,$expire) = getpw* -\& ($name,$passwd,$gid,$members) = getgr* -\& ($name,$aliases,$addrtype,$length,@addrs) = gethost* -\& ($name,$aliases,$addrtype,$net) = getnet* -\& ($name,$aliases,$proto) = getproto* -\& ($name,$aliases,$port,$proto) = getserv* -.Ve -.Sp -(If the entry doesn't exist you get a null list.) -.Sp -The exact meaning of the \f(CW$gcos\fR field varies but it usually contains -the real name of the user (as opposed to the login name) and other -information pertaining to the user. Beware, however, that in many -system users are able to change this information and therefore it -cannot be trusted and therefore the \f(CW$gcos\fR is tainted (see -perlsec). The \f(CW$passwd\fR and \f(CW$shell\fR, user's encrypted password and -login shell, are also tainted, because of the same reason. -.Sp -In scalar context, you get the name, unless the function was a -lookup by name, in which case you get the other thing, whatever it is. -(If the entry doesn't exist you get the undefined value.) For example: -.Sp -.Vb 7 -\& $uid = getpwnam($name); -\& $name = getpwuid($num); -\& $name = getpwent(); -\& $gid = getgrnam($name); -\& $name = getgrgid($num); -\& $name = getgrent(); -\& #etc. -.Ve -.Sp -In \fIgetpw*()\fR the fields \f(CW$quota\fR, \f(CW$comment\fR, and \f(CW$expire\fR are special -cases in the sense that in many systems they are unsupported. If the -\&\f(CW$quota\fR is unsupported, it is an empty scalar. If it is supported, it -usually encodes the disk quota. If the \f(CW$comment\fR field is unsupported, -it is an empty scalar. If it is supported it usually encodes some -administrative comment about the user. In some systems the \f(CW$quota\fR -field may be \f(CW$change\fR or \f(CW$age\fR, fields that have to do with password -aging. In some systems the \f(CW$comment\fR field may be \f(CW$class\fR. The \f(CW$expire\fR -field, if present, encodes the expiration period of the account or the -password. For the availability and the exact meaning of these fields -in your system, please consult your \fIgetpwnam\fR\|(3) documentation and your -\&\fIpwd.h\fR file. You can also find out from within Perl what your -\&\f(CW$quota\fR and \f(CW$comment\fR fields mean and whether you have the \f(CW$expire\fR field -by using the \f(CW\*(C`Config\*(C'\fR module and the values \f(CW\*(C`d_pwquota\*(C'\fR, \f(CW\*(C`d_pwage\*(C'\fR, -\&\f(CW\*(C`d_pwchange\*(C'\fR, \f(CW\*(C`d_pwcomment\*(C'\fR, and \f(CW\*(C`d_pwexpire\*(C'\fR. Shadow password -files are only supported if your vendor has implemented them in the -intuitive fashion that calling the regular C library routines gets the -shadow versions if you're running under privilege or if there exists -the \fIshadow\fR\|(3) functions as found in System V (this includes Solaris -and Linux.) Those systems that implement a proprietary shadow password -facility are unlikely to be supported. -.Sp -The \f(CW$members\fR value returned by \fIgetgr*()\fR is a space separated list of -the login names of the members of the group. -.Sp -For the \fIgethost*()\fR functions, if the \f(CW\*(C`h_errno\*(C'\fR variable is supported in -C, it will be returned to you via \f(CW$?\fR if the function call fails. The -\&\f(CW@addrs\fR value returned by a successful call is a list of the raw -addresses returned by the corresponding system library call. In the -Internet domain, each address is four bytes long and you can unpack it -by saying something like: -.Sp -.Vb 1 -\& ($a,$b,$c,$d) = unpack('C4',$addr[0]); -.Ve -.Sp -The Socket library makes this slightly easier: -.Sp -.Vb 3 -\& use Socket; -\& $iaddr = inet_aton("127.1"); # or whatever address -\& $name = gethostbyaddr($iaddr, AF_INET); -.Ve -.Sp -.Vb 2 -\& # or going the other way -\& $straddr = inet_ntoa($iaddr); -.Ve -.Sp -If you get tired of remembering which element of the return list -contains which return value, by-name interfaces are provided -in standard modules: \f(CW\*(C`File::stat\*(C'\fR, \f(CW\*(C`Net::hostent\*(C'\fR, \f(CW\*(C`Net::netent\*(C'\fR, -\&\f(CW\*(C`Net::protoent\*(C'\fR, \f(CW\*(C`Net::servent\*(C'\fR, \f(CW\*(C`Time::gmtime\*(C'\fR, \f(CW\*(C`Time::localtime\*(C'\fR, -and \f(CW\*(C`User::grent\*(C'\fR. These override the normal built\-ins, supplying -versions that return objects with the appropriate names -for each field. For example: -.Sp -.Vb 3 -\& use File::stat; -\& use User::pwent; -\& $is_his = (stat($filename)->uid == pwent($whoever)->uid); -.Ve -.Sp -Even though it looks like they're the same method calls (uid), -they aren't, because a \f(CW\*(C`File::stat\*(C'\fR object is different from -a \f(CW\*(C`User::pwent\*(C'\fR object. -.IP "getsockname \s-1SOCKET\s0" 8 -.IX Xref "getsockname" -.IX Item "getsockname SOCKET" -Returns the packed sockaddr address of this end of the \s-1SOCKET\s0 connection, -in case you don't know the address because you have several different -IPs that the connection might have come in on. -.Sp -.Vb 6 -\& use Socket; -\& $mysockaddr = getsockname(SOCK); -\& ($port, $myaddr) = sockaddr_in($mysockaddr); -\& printf "Connect to %s [%s]\en", -\& scalar gethostbyaddr($myaddr, AF_INET), -\& inet_ntoa($myaddr); -.Ve -.IP "getsockopt \s-1SOCKET\s0,LEVEL,OPTNAME" 8 -.IX Xref "getsockopt" -.IX Item "getsockopt SOCKET,LEVEL,OPTNAME" -Queries the option named \s-1OPTNAME\s0 associated with \s-1SOCKET\s0 at a given \s-1LEVEL\s0. -Options may exist at multiple protocol levels depending on the socket -type, but at least the uppermost socket level \s-1SOL_SOCKET\s0 (defined in the -\&\f(CW\*(C`Socket\*(C'\fR module) will exist. To query options at another level the -protocol number of the appropriate protocol controlling the option -should be supplied. For example, to indicate that an option is to be -interpreted by the \s-1TCP\s0 protocol, \s-1LEVEL\s0 should be set to the protocol -number of \s-1TCP\s0, which you can get using getprotobyname. -.Sp -The call returns a packed string representing the requested socket option, -or \f(CW\*(C`undef\*(C'\fR if there is an error (the error reason will be in $!). What -exactly is in the packed string depends in the \s-1LEVEL\s0 and \s-1OPTNAME\s0, consult -your system documentation for details. A very common case however is that -the option is an integer, in which case the result will be a packed -integer which you can decode using unpack with the \f(CW\*(C`i\*(C'\fR (or \f(CW\*(C`I\*(C'\fR) format. -.Sp -An example testing if Nagle's algorithm is turned on on a socket: -.Sp -.Vb 1 -\& use Socket qw(:all); -.Ve -.Sp -.Vb 7 -\& defined(my $tcp = getprotobyname("tcp")) -\& or die "Could not determine the protocol number for tcp"; -\& # my $tcp = IPPROTO_TCP; # Alternative -\& my $packed = getsockopt($socket, $tcp, TCP_NODELAY) -\& or die "Could not query TCP_NODELAY socket option: $!"; -\& my $nodelay = unpack("I", $packed); -\& print "Nagle's algorithm is turned ", $nodelay ? "off\en" : "on\en"; -.Ve -.IP "glob \s-1EXPR\s0" 8 -.IX Xref "glob wildcard filename, expansion expand" -.IX Item "glob EXPR" -.PD 0 -.IP "glob" 8 -.IX Item "glob" -.PD -In list context, returns a (possibly empty) list of filename expansions on -the value of \s-1EXPR\s0 such as the standard Unix shell \fI/bin/csh\fR would do. In -scalar context, glob iterates through such filename expansions, returning -undef when the list is exhausted. This is the internal function -implementing the \f(CW\*(C`<*.c>\*(C'\fR operator, but you can use it directly. If -\&\s-1EXPR\s0 is omitted, \f(CW$_\fR is used. The \f(CW\*(C`<*.c>\*(C'\fR operator is discussed in -more detail in \*(L"I/O Operators\*(R" in perlop. -.Sp -Beginning with v5.6.0, this operator is implemented using the standard -\&\f(CW\*(C`File::Glob\*(C'\fR extension. See File::Glob for details. -.IP "gmtime \s-1EXPR\s0" 8 -.IX Xref "gmtime UTC Greenwich" -.IX Item "gmtime EXPR" -.PD 0 -.IP "gmtime" 8 -.IX Item "gmtime" -.PD -Converts a time as returned by the time function to an 9\-element list -with the time localized for the standard Greenwich time zone. -Typically used as follows: -.Sp -.Vb 3 -\& # 0 1 2 3 4 5 6 7 8 -\& ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = -\& gmtime(time); -.Ve -.Sp -All list elements are numeric, and come straight out of the C `struct -tm'. \f(CW$sec\fR, \f(CW$min\fR, and \f(CW$hour\fR are the seconds, minutes, and hours of the -specified time. \f(CW$mday\fR is the day of the month, and \f(CW$mon\fR is the month -itself, in the range \f(CW0..11\fR with 0 indicating January and 11 -indicating December. \f(CW$year\fR is the number of years since 1900. That -is, \f(CW$year\fR is \f(CW123\fR in year 2023. \f(CW$wday\fR is the day of the week, with -0 indicating Sunday and 3 indicating Wednesday. \f(CW$yday\fR is the day of -the year, in the range \f(CW0..364\fR (or \f(CW0..365\fR in leap years). \f(CW$isdst\fR -is always \f(CW0\fR. -.Sp -Note that the \f(CW$year\fR element is \fInot\fR simply the last two digits of -the year. If you assume it is then you create non\-Y2K\-compliant -programs\*(--and you wouldn't want to do that, would you? -.Sp -The proper way to get a complete 4\-digit year is simply: -.Sp -.Vb 1 -\& $year += 1900; -.Ve -.Sp -And to get the last two digits of the year (e.g., '01' in 2001) do: -.Sp -.Vb 1 -\& $year = sprintf("%02d", $year % 100); -.Ve -.Sp -If \s-1EXPR\s0 is omitted, \f(CW\*(C`gmtime()\*(C'\fR uses the current time (\f(CW\*(C`gmtime(time)\*(C'\fR). -.Sp -In scalar context, \f(CW\*(C`gmtime()\*(C'\fR returns the \fIctime\fR\|(3) value: -.Sp -.Vb 1 -\& $now_string = gmtime; # e.g., "Thu Oct 13 04:54:34 1994" -.Ve -.Sp -If you need local time instead of \s-1GMT\s0 use the \*(L"localtime\*(R" builtin. -See also the \f(CW\*(C`timegm\*(C'\fR function provided by the \f(CW\*(C`Time::Local\*(C'\fR module, -and the \fIstrftime\fR\|(3) and \fImktime\fR\|(3) functions available via the \s-1POSIX\s0 module. -.Sp -This scalar value is \fBnot\fR locale dependent (see perllocale), but is -instead a Perl builtin. To get somewhat similar but locale dependent date -strings, see the example in \*(L"localtime\*(R". -.Sp -See \*(L"gmtime\*(R" in perlport for portability concerns. -.IP "goto \s-1LABEL\s0" 8 -.IX Xref "goto jump jmp" -.IX Item "goto LABEL" -.PD 0 -.IP "goto \s-1EXPR\s0" 8 -.IX Item "goto EXPR" -.IP "goto &NAME" 8 -.IX Item "goto &NAME" -.PD -The \f(CW\*(C`goto\-LABEL\*(C'\fR form finds the statement labeled with \s-1LABEL\s0 and resumes -execution there. It may not be used to go into any construct that -requires initialization, such as a subroutine or a \f(CW\*(C`foreach\*(C'\fR loop. It -also can't be used to go into a construct that is optimized away, -or to get out of a block or subroutine given to \f(CW\*(C`sort\*(C'\fR. -It can be used to go almost anywhere else within the dynamic scope, -including out of subroutines, but it's usually better to use some other -construct such as \f(CW\*(C`last\*(C'\fR or \f(CW\*(C`die\*(C'\fR. The author of Perl has never felt the -need to use this form of \f(CW\*(C`goto\*(C'\fR (in Perl, that is\*(--C is another matter). -(The difference being that C does not offer named loops combined with -loop control. Perl does, and this replaces most structured uses of \f(CW\*(C`goto\*(C'\fR -in other languages.) -.Sp -The \f(CW\*(C`goto\-EXPR\*(C'\fR form expects a label name, whose scope will be resolved -dynamically. This allows for computed \f(CW\*(C`goto\*(C'\fRs per \s-1FORTRAN\s0, but isn't -necessarily recommended if you're optimizing for maintainability: -.Sp -.Vb 1 -\& goto ("FOO", "BAR", "GLARCH")[$i]; -.Ve -.Sp -The \f(CW\*(C`goto\-&NAME\*(C'\fR form is quite different from the other forms of -\&\f(CW\*(C`goto\*(C'\fR. In fact, it isn't a goto in the normal sense at all, and -doesn't have the stigma associated with other gotos. Instead, it -exits the current subroutine (losing any changes set by \fIlocal()\fR) and -immediately calls in its place the named subroutine using the current -value of \f(CW@_\fR. This is used by \f(CW\*(C`AUTOLOAD\*(C'\fR subroutines that wish to -load another subroutine and then pretend that the other subroutine had -been called in the first place (except that any modifications to \f(CW@_\fR -in the current subroutine are propagated to the other subroutine.) -After the \f(CW\*(C`goto\*(C'\fR, not even \f(CW\*(C`caller\*(C'\fR will be able to tell that this -routine was called first. -.Sp -\&\s-1NAME\s0 needn't be the name of a subroutine; it can be a scalar variable -containing a code reference, or a block that evaluates to a code -reference. -.IP "grep \s-1BLOCK\s0 \s-1LIST\s0" 8 -.IX Xref "grep" -.IX Item "grep BLOCK LIST" -.PD 0 -.IP "grep \s-1EXPR\s0,LIST" 8 -.IX Item "grep EXPR,LIST" -.PD -This is similar in spirit to, but not the same as, \fIgrep\fR\|(1) and its -relatives. In particular, it is not limited to using regular expressions. -.Sp -Evaluates the \s-1BLOCK\s0 or \s-1EXPR\s0 for each element of \s-1LIST\s0 (locally setting -\&\f(CW$_\fR to each element) and returns the list value consisting of those -elements for which the expression evaluated to true. In scalar -context, returns the number of times the expression was true. -.Sp -.Vb 1 -\& @foo = grep(!/^#/, @bar); # weed out comments -.Ve -.Sp -or equivalently, -.Sp -.Vb 1 -\& @foo = grep {!/^#/} @bar; # weed out comments -.Ve -.Sp -Note that \f(CW$_\fR is an alias to the list value, so it can be used to -modify the elements of the \s-1LIST\s0. While this is useful and supported, -it can cause bizarre results if the elements of \s-1LIST\s0 are not variables. -Similarly, grep returns aliases into the original list, much as a for -loop's index variable aliases the list elements. That is, modifying an -element of a list returned by grep (for example, in a \f(CW\*(C`foreach\*(C'\fR, \f(CW\*(C`map\*(C'\fR -or another \f(CW\*(C`grep\*(C'\fR) actually modifies the element in the original list. -This is usually something to be avoided when writing clear code. -.Sp -See also \*(L"map\*(R" for a list composed of the results of the \s-1BLOCK\s0 or \s-1EXPR\s0. -.IP "hex \s-1EXPR\s0" 8 -.IX Xref "hex hexadecimal" -.IX Item "hex EXPR" -.PD 0 -.IP "hex" 8 -.IX Item "hex" -.PD -Interprets \s-1EXPR\s0 as a hex string and returns the corresponding value. -(To convert strings that might start with either \f(CW0\fR, \f(CW\*(C`0x\*(C'\fR, or \f(CW\*(C`0b\*(C'\fR, see -\&\*(L"oct\*(R".) If \s-1EXPR\s0 is omitted, uses \f(CW$_\fR. -.Sp -.Vb 2 -\& print hex '0xAf'; # prints '175' -\& print hex 'aF'; # same -.Ve -.Sp -Hex strings may only represent integers. Strings that would cause -integer overflow trigger a warning. Leading whitespace is not stripped, -unlike \fIoct()\fR. To present something as hex, look into \*(L"printf\*(R", -\&\*(L"sprintf\*(R", or \*(L"unpack\*(R". -.IP "import \s-1LIST\s0" 8 -.IX Xref "import" -.IX Item "import LIST" -There is no builtin \f(CW\*(C`import\*(C'\fR function. It is just an ordinary -method (subroutine) defined (or inherited) by modules that wish to export -names to another module. The \f(CW\*(C`use\*(C'\fR function calls the \f(CW\*(C`import\*(C'\fR method -for the package used. See also \*(L"use\*(R", perlmod, and Exporter. -.IP "index \s-1STR\s0,SUBSTR,POSITION" 8 -.IX Xref "index indexOf InStr" -.IX Item "index STR,SUBSTR,POSITION" -.PD 0 -.IP "index \s-1STR\s0,SUBSTR" 8 -.IX Item "index STR,SUBSTR" -.PD -The index function searches for one string within another, but without -the wildcard-like behavior of a full regular-expression pattern match. -It returns the position of the first occurrence of \s-1SUBSTR\s0 in \s-1STR\s0 at -or after \s-1POSITION\s0. If \s-1POSITION\s0 is omitted, starts searching from the -beginning of the string. \s-1POSITION\s0 before the beginning of the string -or after its end is treated as if it were the beginning or the end, -respectively. \s-1POSITION\s0 and the return value are based at \f(CW0\fR (or whatever -you've set the \f(CW$[\fR variable to\*(--but don't do that). If the substring -is not found, \f(CW\*(C`index\*(C'\fR returns one less than the base, ordinarily \f(CW\*(C`\-1\*(C'\fR. -.IP "int \s-1EXPR\s0" 8 -.IX Xref "int integer truncate trunc" -.IX Item "int EXPR" -.PD 0 -.IP "int" 8 -.IX Item "int" -.PD -Returns the integer portion of \s-1EXPR\s0. If \s-1EXPR\s0 is omitted, uses \f(CW$_\fR. -You should not use this function for rounding: one because it truncates -towards \f(CW0\fR, and two because machine representations of floating point -numbers can sometimes produce counterintuitive results. For example, -\&\f(CW\*(C`int(\-6.725/0.025)\*(C'\fR produces \-268 rather than the correct \-269; that's -because it's really more like \-268.99999999999994315658 instead. Usually, -the \f(CW\*(C`sprintf\*(C'\fR, \f(CW\*(C`printf\*(C'\fR, or the \f(CW\*(C`POSIX::floor\*(C'\fR and \f(CW\*(C`POSIX::ceil\*(C'\fR -functions will serve you better than will \fIint()\fR. -.IP "ioctl \s-1FILEHANDLE\s0,FUNCTION,SCALAR" 8 -.IX Xref "ioctl" -.IX Item "ioctl FILEHANDLE,FUNCTION,SCALAR" -Implements the \fIioctl\fR\|(2) function. You'll probably first have to say -.Sp -.Vb 1 -\& require "sys/ioctl.ph"; # probably in $Config{archlib}/sys/ioctl.ph -.Ve -.Sp -to get the correct function definitions. If \fIsys/ioctl.ph\fR doesn't -exist or doesn't have the correct definitions you'll have to roll your -own, based on your C header files such as \fI<sys/ioctl.h>\fR. -(There is a Perl script called \fBh2ph\fR that comes with the Perl kit that -may help you in this, but it's nontrivial.) \s-1SCALAR\s0 will be read and/or -written depending on the FUNCTION\*(--a pointer to the string value of \s-1SCALAR\s0 -will be passed as the third argument of the actual \f(CW\*(C`ioctl\*(C'\fR call. (If \s-1SCALAR\s0 -has no string value but does have a numeric value, that value will be -passed rather than a pointer to the string value. To guarantee this to be -true, add a \f(CW0\fR to the scalar before using it.) The \f(CW\*(C`pack\*(C'\fR and \f(CW\*(C`unpack\*(C'\fR -functions may be needed to manipulate the values of structures used by -\&\f(CW\*(C`ioctl\*(C'\fR. -.Sp -The return value of \f(CW\*(C`ioctl\*(C'\fR (and \f(CW\*(C`fcntl\*(C'\fR) is as follows: -.Sp -.Vb 4 -\& if OS returns: then Perl returns: -\& -1 undefined value -\& 0 string "0 but true" -\& anything else that number -.Ve -.Sp -Thus Perl returns true on success and false on failure, yet you can -still easily determine the actual value returned by the operating -system: -.Sp -.Vb 2 -\& $retval = ioctl(...) || -1; -\& printf "System returned %d\en", $retval; -.Ve -.Sp -The special string \f(CW"0 but true"\fR is exempt from \fB\-w\fR complaints -about improper numeric conversions. -.IP "join \s-1EXPR\s0,LIST" 8 -.IX Xref "join" -.IX Item "join EXPR,LIST" -Joins the separate strings of \s-1LIST\s0 into a single string with fields -separated by the value of \s-1EXPR\s0, and returns that new string. Example: -.Sp -.Vb 1 -\& $rec = join(':', $login,$passwd,$uid,$gid,$gcos,$home,$shell); -.Ve -.Sp -Beware that unlike \f(CW\*(C`split\*(C'\fR, \f(CW\*(C`join\*(C'\fR doesn't take a pattern as its -first argument. Compare \*(L"split\*(R". -.IP "keys \s-1HASH\s0" 8 -.IX Xref "keys key" -.IX Item "keys HASH" -Returns a list consisting of all the keys of the named hash. -(In scalar context, returns the number of keys.) -.Sp -The keys are returned in an apparently random order. The actual -random order is subject to change in future versions of perl, but it -is guaranteed to be the same order as either the \f(CW\*(C`values\*(C'\fR or \f(CW\*(C`each\*(C'\fR -function produces (given that the hash has not been modified). Since -Perl 5.8.1 the ordering is different even between different runs of -Perl for security reasons (see \*(L"Algorithmic Complexity Attacks\*(R" in perlsec). -.Sp -As a side effect, calling \fIkeys()\fR resets the \s-1HASH\s0's internal iterator -(see \*(L"each\*(R"). In particular, calling \fIkeys()\fR in void context resets -the iterator with no other overhead. -.Sp -Here is yet another way to print your environment: -.Sp -.Vb 5 -\& @keys = keys %ENV; -\& @values = values %ENV; -\& while (@keys) { -\& print pop(@keys), '=', pop(@values), "\en"; -\& } -.Ve -.Sp -or how about sorted by key: -.Sp -.Vb 3 -\& foreach $key (sort(keys %ENV)) { -\& print $key, '=', $ENV{$key}, "\en"; -\& } -.Ve -.Sp -The returned values are copies of the original keys in the hash, so -modifying them will not affect the original hash. Compare \*(L"values\*(R". -.Sp -To sort a hash by value, you'll need to use a \f(CW\*(C`sort\*(C'\fR function. -Here's a descending numeric sort of a hash by its values: -.Sp -.Vb 3 -\& foreach $key (sort { $hash{$b} <=> $hash{$a} } keys %hash) { -\& printf "%4d %s\en", $hash{$key}, $key; -\& } -.Ve -.Sp -As an lvalue \f(CW\*(C`keys\*(C'\fR allows you to increase the number of hash buckets -allocated for the given hash. This can gain you a measure of efficiency if -you know the hash is going to get big. (This is similar to pre-extending -an array by assigning a larger number to $#array.) If you say -.Sp -.Vb 1 -\& keys %hash = 200; -.Ve -.Sp -then \f(CW%hash\fR will have at least 200 buckets allocated for it\-\-256 of them, -in fact, since it rounds up to the next power of two. These -buckets will be retained even if you do \f(CW\*(C`%hash = ()\*(C'\fR, use \f(CW\*(C`undef -%hash\*(C'\fR if you want to free the storage while \f(CW%hash\fR is still in scope. -You can't shrink the number of buckets allocated for the hash using -\&\f(CW\*(C`keys\*(C'\fR in this way (but you needn't worry about doing this by accident, -as trying has no effect). -.Sp -See also \f(CW\*(C`each\*(C'\fR, \f(CW\*(C`values\*(C'\fR and \f(CW\*(C`sort\*(C'\fR. -.IP "kill \s-1SIGNAL\s0, \s-1LIST\s0" 8 -.IX Xref "kill signal" -.IX Item "kill SIGNAL, LIST" -Sends a signal to a list of processes. Returns the number of -processes successfully signaled (which is not necessarily the -same as the number actually killed). -.Sp -.Vb 2 -\& $cnt = kill 1, $child1, $child2; -\& kill 9, @goners; -.Ve -.Sp -If \s-1SIGNAL\s0 is zero, no signal is sent to the process. This is a -useful way to check that a child process is alive and hasn't changed -its \s-1UID\s0. See perlport for notes on the portability of this -construct. -.Sp -Unlike in the shell, if \s-1SIGNAL\s0 is negative, it kills -process groups instead of processes. (On System V, a negative \fI\s-1PROCESS\s0\fR -number will also kill process groups, but that's not portable.) That -means you usually want to use positive not negative signals. You may also -use a signal name in quotes. -.Sp -See \*(L"Signals\*(R" in perlipc for more details. -.IP "last \s-1LABEL\s0" 8 -.IX Xref "last break" -.IX Item "last LABEL" -.PD 0 -.IP "last" 8 -.IX Item "last" -.PD -The \f(CW\*(C`last\*(C'\fR command is like the \f(CW\*(C`break\*(C'\fR statement in C (as used in -loops); it immediately exits the loop in question. If the \s-1LABEL\s0 is -omitted, the command refers to the innermost enclosing loop. The -\&\f(CW\*(C`continue\*(C'\fR block, if any, is not executed: -.Sp -.Vb 4 -\& LINE: while (<STDIN>) { -\& last LINE if /^$/; # exit when done with header -\& #... -\& } -.Ve -.Sp -\&\f(CW\*(C`last\*(C'\fR cannot be used to exit a block which returns a value such as -\&\f(CW\*(C`eval {}\*(C'\fR, \f(CW\*(C`sub {}\*(C'\fR or \f(CW\*(C`do {}\*(C'\fR, and should not be used to exit -a \fIgrep()\fR or \fImap()\fR operation. -.Sp -Note that a block by itself is semantically identical to a loop -that executes once. Thus \f(CW\*(C`last\*(C'\fR can be used to effect an early -exit out of such a block. -.Sp -See also \*(L"continue\*(R" for an illustration of how \f(CW\*(C`last\*(C'\fR, \f(CW\*(C`next\*(C'\fR, and -\&\f(CW\*(C`redo\*(C'\fR work. -.IP "lc \s-1EXPR\s0" 8 -.IX Xref "lc lowercase" -.IX Item "lc EXPR" -.PD 0 -.IP "lc" 8 -.IX Item "lc" -.PD -Returns a lowercased version of \s-1EXPR\s0. This is the internal function -implementing the \f(CW\*(C`\eL\*(C'\fR escape in double-quoted strings. Respects -current \s-1LC_CTYPE\s0 locale if \f(CW\*(C`use locale\*(C'\fR in force. See perllocale -and perlunicode for more details about locale and Unicode support. -.Sp -If \s-1EXPR\s0 is omitted, uses \f(CW$_\fR. -.IP "lcfirst \s-1EXPR\s0" 8 -.IX Xref "lcfirst lowercase" -.IX Item "lcfirst EXPR" -.PD 0 -.IP "lcfirst" 8 -.IX Item "lcfirst" -.PD -Returns the value of \s-1EXPR\s0 with the first character lowercased. This -is the internal function implementing the \f(CW\*(C`\el\*(C'\fR escape in -double-quoted strings. Respects current \s-1LC_CTYPE\s0 locale if \f(CW\*(C`use -locale\*(C'\fR in force. See perllocale and perlunicode for more -details about locale and Unicode support. -.Sp -If \s-1EXPR\s0 is omitted, uses \f(CW$_\fR. -.IP "length \s-1EXPR\s0" 8 -.IX Xref "length size" -.IX Item "length EXPR" -.PD 0 -.IP "length" 8 -.IX Item "length" -.PD -Returns the length in \fIcharacters\fR of the value of \s-1EXPR\s0. If \s-1EXPR\s0 is -omitted, returns length of \f(CW$_\fR. Note that this cannot be used on -an entire array or hash to find out how many elements these have. -For that, use \f(CW\*(C`scalar @array\*(C'\fR and \f(CW\*(C`scalar keys %hash\*(C'\fR respectively. -.Sp -Note the \fIcharacters\fR: if the \s-1EXPR\s0 is in Unicode, you will get the -number of characters, not the number of bytes. To get the length -in bytes, use \f(CW\*(C`do { use bytes; length(EXPR) }\*(C'\fR, see bytes. -.IP "link \s-1OLDFILE\s0,NEWFILE" 8 -.IX Xref "link" -.IX Item "link OLDFILE,NEWFILE" -Creates a new filename linked to the old filename. Returns true for -success, false otherwise. -.IP "listen \s-1SOCKET\s0,QUEUESIZE" 8 -.IX Xref "listen" -.IX Item "listen SOCKET,QUEUESIZE" -Does the same thing that the listen system call does. Returns true if -it succeeded, false otherwise. See the example in -\&\*(L"Sockets: Client/Server Communication\*(R" in perlipc. -.IP "local \s-1EXPR\s0" 8 -.IX Xref "local" -.IX Item "local EXPR" -You really probably want to be using \f(CW\*(C`my\*(C'\fR instead, because \f(CW\*(C`local\*(C'\fR isn't -what most people think of as \*(L"local\*(R". See -\&\*(L"Private Variables via \fImy()\fR\*(R" in perlsub for details. -.Sp -A local modifies the listed variables to be local to the enclosing -block, file, or eval. If more than one value is listed, the list must -be placed in parentheses. See \*(L"Temporary Values via \fIlocal()\fR\*(R" in perlsub -for details, including issues with tied arrays and hashes. -.IP "localtime \s-1EXPR\s0" 8 -.IX Xref "localtime" -.IX Item "localtime EXPR" -.PD 0 -.IP "localtime" 8 -.IX Item "localtime" -.PD -Converts a time as returned by the time function to a 9\-element list -with the time analyzed for the local time zone. Typically used as -follows: -.Sp -.Vb 3 -\& # 0 1 2 3 4 5 6 7 8 -\& ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = -\& localtime(time); -.Ve -.Sp -All list elements are numeric, and come straight out of the C `struct -tm'. \f(CW$sec\fR, \f(CW$min\fR, and \f(CW$hour\fR are the seconds, minutes, and hours -of the specified time. -.Sp -\&\f(CW$mday\fR is the day of the month, and \f(CW$mon\fR is the month itself, in -the range \f(CW0..11\fR with 0 indicating January and 11 indicating December. -This makes it easy to get a month name from a list: -.Sp -.Vb 3 -\& my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); -\& print "$abbr[$mon] $mday"; -\& # $mon=9, $mday=18 gives "Oct 18" -.Ve -.Sp -\&\f(CW$year\fR is the number of years since 1900, not just the last two digits -of the year. That is, \f(CW$year\fR is \f(CW123\fR in year 2023. The proper way -to get a complete 4\-digit year is simply: -.Sp -.Vb 1 -\& $year += 1900; -.Ve -.Sp -To get the last two digits of the year (e.g., '01' in 2001) do: -.Sp -.Vb 1 -\& $year = sprintf("%02d", $year % 100); -.Ve -.Sp -\&\f(CW$wday\fR is the day of the week, with 0 indicating Sunday and 3 indicating -Wednesday. \f(CW$yday\fR is the day of the year, in the range \f(CW0..364\fR -(or \f(CW0..365\fR in leap years.) -.Sp -\&\f(CW$isdst\fR is true if the specified time occurs during Daylight Saving -Time, false otherwise. -.Sp -If \s-1EXPR\s0 is omitted, \f(CW\*(C`localtime()\*(C'\fR uses the current time (\f(CW\*(C`localtime(time)\*(C'\fR). -.Sp -In scalar context, \f(CW\*(C`localtime()\*(C'\fR returns the \fIctime\fR\|(3) value: -.Sp -.Vb 1 -\& $now_string = localtime; # e.g., "Thu Oct 13 04:54:34 1994" -.Ve -.Sp -This scalar value is \fBnot\fR locale dependent but is a Perl builtin. For \s-1GMT\s0 -instead of local time use the \*(L"gmtime\*(R" builtin. See also the -\&\f(CW\*(C`Time::Local\*(C'\fR module (to convert the second, minutes, hours, ... back to -the integer value returned by \fItime()\fR), and the \s-1POSIX\s0 module's \fIstrftime\fR\|(3) -and \fImktime\fR\|(3) functions. -.Sp -To get somewhat similar but locale dependent date strings, set up your -locale environment variables appropriately (please see perllocale) and -try for example: -.Sp -.Vb 4 -\& use POSIX qw(strftime); -\& $now_string = strftime "%a %b %e %H:%M:%S %Y", localtime; -\& # or for GMT formatted appropriately for your locale: -\& $now_string = strftime "%a %b %e %H:%M:%S %Y", gmtime; -.Ve -.Sp -Note that the \f(CW%a\fR and \f(CW%b\fR, the short forms of the day of the week -and the month of the year, may not necessarily be three characters wide. -.Sp -See \*(L"localtime\*(R" in perlport for portability concerns. -.IP "lock \s-1THING\s0" 8 -.IX Xref "lock" -.IX Item "lock THING" -This function places an advisory lock on a shared variable, or referenced -object contained in \fI\s-1THING\s0\fR until the lock goes out of scope. -.Sp -\&\fIlock()\fR is a \*(L"weak keyword\*(R" : this means that if you've defined a function -by this name (before any calls to it), that function will be called -instead. (However, if you've said \f(CW\*(C`use threads\*(C'\fR, \fIlock()\fR is always a -keyword.) See threads. -.IP "log \s-1EXPR\s0" 8 -.IX Xref "log logarithm e ln base" -.IX Item "log EXPR" -.PD 0 -.IP "log" 8 -.IX Item "log" -.PD -Returns the natural logarithm (base \fIe\fR) of \s-1EXPR\s0. If \s-1EXPR\s0 is omitted, -returns log of \f(CW$_\fR. To get the log of another base, use basic algebra: -The base-N log of a number is equal to the natural log of that number -divided by the natural log of N. For example: -.Sp -.Vb 4 -\& sub log10 { -\& my $n = shift; -\& return log($n)/log(10); -\& } -.Ve -.Sp -See also \*(L"exp\*(R" for the inverse operation. -.IP "lstat \s-1EXPR\s0" 8 -.IX Xref "lstat" -.IX Item "lstat EXPR" -.PD 0 -.IP "lstat" 8 -.IX Item "lstat" -.PD -Does the same thing as the \f(CW\*(C`stat\*(C'\fR function (including setting the -special \f(CW\*(C`_\*(C'\fR filehandle) but stats a symbolic link instead of the file -the symbolic link points to. If symbolic links are unimplemented on -your system, a normal \f(CW\*(C`stat\*(C'\fR is done. For much more detailed -information, please see the documentation for \*(L"stat\*(R". -.Sp -If \s-1EXPR\s0 is omitted, stats \f(CW$_\fR. -.IP "m//" 8 -.IX Item "m//" -The match operator. See perlop. -.IP "map \s-1BLOCK\s0 \s-1LIST\s0" 8 -.IX Xref "map" -.IX Item "map BLOCK LIST" -.PD 0 -.IP "map \s-1EXPR\s0,LIST" 8 -.IX Item "map EXPR,LIST" -.PD -Evaluates the \s-1BLOCK\s0 or \s-1EXPR\s0 for each element of \s-1LIST\s0 (locally setting -\&\f(CW$_\fR to each element) and returns the list value composed of the -results of each such evaluation. In scalar context, returns the -total number of elements so generated. Evaluates \s-1BLOCK\s0 or \s-1EXPR\s0 in -list context, so each element of \s-1LIST\s0 may produce zero, one, or -more elements in the returned value. -.Sp -.Vb 1 -\& @chars = map(chr, @nums); -.Ve -.Sp -translates a list of numbers to the corresponding characters. And -.Sp -.Vb 1 -\& %hash = map { getkey($_) => $_ } @array; -.Ve -.Sp -is just a funny way to write -.Sp -.Vb 4 -\& %hash = (); -\& foreach $_ (@array) { -\& $hash{getkey($_)} = $_; -\& } -.Ve -.Sp -Note that \f(CW$_\fR is an alias to the list value, so it can be used to -modify the elements of the \s-1LIST\s0. While this is useful and supported, -it can cause bizarre results if the elements of \s-1LIST\s0 are not variables. -Using a regular \f(CW\*(C`foreach\*(C'\fR loop for this purpose would be clearer in -most cases. See also \*(L"grep\*(R" for an array composed of those items of -the original list for which the \s-1BLOCK\s0 or \s-1EXPR\s0 evaluates to true. -.Sp -\&\f(CW\*(C`{\*(C'\fR starts both hash references and blocks, so \f(CW\*(C`map { ...\*(C'\fR could be either -the start of map \s-1BLOCK\s0 \s-1LIST\s0 or map \s-1EXPR\s0, \s-1LIST\s0. Because perl doesn't look -ahead for the closing \f(CW\*(C`}\*(C'\fR it has to take a guess at which its dealing with -based what it finds just after the \f(CW\*(C`{\*(C'\fR. Usually it gets it right, but if it -doesn't it won't realize something is wrong until it gets to the \f(CW\*(C`}\*(C'\fR and -encounters the missing (or unexpected) comma. The syntax error will be -reported close to the \f(CW\*(C`}\*(C'\fR but you'll need to change something near the \f(CW\*(C`{\*(C'\fR -such as using a unary \f(CW\*(C`+\*(C'\fR to give perl some help: -.Sp -.Vb 5 -\& %hash = map { "\eL$_", 1 } @array # perl guesses EXPR. wrong -\& %hash = map { +"\eL$_", 1 } @array # perl guesses BLOCK. right -\& %hash = map { ("\eL$_", 1) } @array # this also works -\& %hash = map { lc($_), 1 } @array # as does this. -\& %hash = map +( lc($_), 1 ), @array # this is EXPR and works! -.Ve -.Sp -.Vb 1 -\& %hash = map ( lc($_), 1 ), @array # evaluates to (1, @array) -.Ve -.Sp -or to force an anon hash constructor use \f(CW\*(C`+{\*(C'\fR -.Sp -.Vb 1 -\& @hashes = map +{ lc($_), 1 }, @array # EXPR, so needs , at end -.Ve -.Sp -and you get list of anonymous hashes each with only 1 entry. -.IP "mkdir \s-1FILENAME\s0,MASK" 8 -.IX Xref "mkdir md directory, create" -.IX Item "mkdir FILENAME,MASK" -.PD 0 -.IP "mkdir \s-1FILENAME\s0" 8 -.IX Item "mkdir FILENAME" -.PD -Creates the directory specified by \s-1FILENAME\s0, with permissions -specified by \s-1MASK\s0 (as modified by \f(CW\*(C`umask\*(C'\fR). If it succeeds it -returns true, otherwise it returns false and sets \f(CW$!\fR (errno). -If omitted, \s-1MASK\s0 defaults to 0777. -.Sp -In general, it is better to create directories with permissive \s-1MASK\s0, -and let the user modify that with their \f(CW\*(C`umask\*(C'\fR, than it is to supply -a restrictive \s-1MASK\s0 and give the user no way to be more permissive. -The exceptions to this rule are when the file or directory should be -kept private (mail files, for instance). The \fIperlfunc\fR\|(1) entry on -\&\f(CW\*(C`umask\*(C'\fR discusses the choice of \s-1MASK\s0 in more detail. -.Sp -Note that according to the \s-1POSIX\s0 1003.1\-1996 the \s-1FILENAME\s0 may have any -number of trailing slashes. Some operating and filesystems do not get -this right, so Perl automatically removes all trailing slashes to keep -everyone happy. -.IP "msgctl \s-1ID\s0,CMD,ARG" 8 -.IX Xref "msgctl" -.IX Item "msgctl ID,CMD,ARG" -Calls the System V \s-1IPC\s0 function \fImsgctl\fR\|(2). You'll probably have to say -.Sp -.Vb 1 -\& use IPC::SysV; -.Ve -.Sp -first to get the correct constant definitions. If \s-1CMD\s0 is \f(CW\*(C`IPC_STAT\*(C'\fR, -then \s-1ARG\s0 must be a variable that will hold the returned \f(CW\*(C`msqid_ds\*(C'\fR -structure. Returns like \f(CW\*(C`ioctl\*(C'\fR: the undefined value for error, -\&\f(CW"0 but true"\fR for zero, or the actual return value otherwise. See also -\&\*(L"SysV \s-1IPC\s0\*(R" in perlipc, \f(CW\*(C`IPC::SysV\*(C'\fR, and \f(CW\*(C`IPC::Semaphore\*(C'\fR documentation. -.IP "msgget \s-1KEY\s0,FLAGS" 8 -.IX Xref "msgget" -.IX Item "msgget KEY,FLAGS" -Calls the System V \s-1IPC\s0 function \fImsgget\fR\|(2). Returns the message queue -id, or the undefined value if there is an error. See also -\&\*(L"SysV \s-1IPC\s0\*(R" in perlipc and \f(CW\*(C`IPC::SysV\*(C'\fR and \f(CW\*(C`IPC::Msg\*(C'\fR documentation. -.IP "msgrcv \s-1ID\s0,VAR,SIZE,TYPE,FLAGS" 8 -.IX Xref "msgrcv" -.IX Item "msgrcv ID,VAR,SIZE,TYPE,FLAGS" -Calls the System V \s-1IPC\s0 function msgrcv to receive a message from -message queue \s-1ID\s0 into variable \s-1VAR\s0 with a maximum message size of -\&\s-1SIZE\s0. Note that when a message is received, the message type as a -native long integer will be the first thing in \s-1VAR\s0, followed by the -actual message. This packing may be opened with \f(CW\*(C`unpack("l! a*")\*(C'\fR. -Taints the variable. Returns true if successful, or false if there is -an error. See also \*(L"SysV \s-1IPC\s0\*(R" in perlipc, \f(CW\*(C`IPC::SysV\*(C'\fR, and -\&\f(CW\*(C`IPC::SysV::Msg\*(C'\fR documentation. -.IP "msgsnd \s-1ID\s0,MSG,FLAGS" 8 -.IX Xref "msgsnd" -.IX Item "msgsnd ID,MSG,FLAGS" -Calls the System V \s-1IPC\s0 function msgsnd to send the message \s-1MSG\s0 to the -message queue \s-1ID\s0. \s-1MSG\s0 must begin with the native long integer message -type, and be followed by the length of the actual message, and finally -the message itself. This kind of packing can be achieved with -\&\f(CW\*(C`pack("l! a*", $type, $message)\*(C'\fR. Returns true if successful, -or false if there is an error. See also \f(CW\*(C`IPC::SysV\*(C'\fR -and \f(CW\*(C`IPC::SysV::Msg\*(C'\fR documentation. -.IP "my \s-1EXPR\s0" 8 -.IX Xref "my" -.IX Item "my EXPR" -.PD 0 -.IP "my \s-1TYPE\s0 \s-1EXPR\s0" 8 -.IX Item "my TYPE EXPR" -.IP "my \s-1EXPR\s0 : \s-1ATTRS\s0" 8 -.IX Item "my EXPR : ATTRS" -.IP "my \s-1TYPE\s0 \s-1EXPR\s0 : \s-1ATTRS\s0" 8 -.IX Item "my TYPE EXPR : ATTRS" -.PD -A \f(CW\*(C`my\*(C'\fR declares the listed variables to be local (lexically) to the -enclosing block, file, or \f(CW\*(C`eval\*(C'\fR. If more than one value is listed, -the list must be placed in parentheses. -.Sp -The exact semantics and interface of \s-1TYPE\s0 and \s-1ATTRS\s0 are still -evolving. \s-1TYPE\s0 is currently bound to the use of \f(CW\*(C`fields\*(C'\fR pragma, -and attributes are handled using the \f(CW\*(C`attributes\*(C'\fR pragma, or starting -from Perl 5.8.0 also via the \f(CW\*(C`Attribute::Handlers\*(C'\fR module. See -\&\*(L"Private Variables via \fImy()\fR\*(R" in perlsub for details, and fields, -attributes, and Attribute::Handlers. -.IP "next \s-1LABEL\s0" 8 -.IX Xref "next continue" -.IX Item "next LABEL" -.PD 0 -.IP "next" 8 -.IX Item "next" -.PD -The \f(CW\*(C`next\*(C'\fR command is like the \f(CW\*(C`continue\*(C'\fR statement in C; it starts -the next iteration of the loop: -.Sp -.Vb 4 -\& LINE: while (<STDIN>) { -\& next LINE if /^#/; # discard comments -\& #... -\& } -.Ve -.Sp -Note that if there were a \f(CW\*(C`continue\*(C'\fR block on the above, it would get -executed even on discarded lines. If the \s-1LABEL\s0 is omitted, the command -refers to the innermost enclosing loop. -.Sp -\&\f(CW\*(C`next\*(C'\fR cannot be used to exit a block which returns a value such as -\&\f(CW\*(C`eval {}\*(C'\fR, \f(CW\*(C`sub {}\*(C'\fR or \f(CW\*(C`do {}\*(C'\fR, and should not be used to exit -a \fIgrep()\fR or \fImap()\fR operation. -.Sp -Note that a block by itself is semantically identical to a loop -that executes once. Thus \f(CW\*(C`next\*(C'\fR will exit such a block early. -.Sp -See also \*(L"continue\*(R" for an illustration of how \f(CW\*(C`last\*(C'\fR, \f(CW\*(C`next\*(C'\fR, and -\&\f(CW\*(C`redo\*(C'\fR work. -.IP "no Module \s-1VERSION\s0 \s-1LIST\s0" 8 -.IX Xref "no" -.IX Item "no Module VERSION LIST" -.PD 0 -.IP "no Module \s-1VERSION\s0" 8 -.IX Item "no Module VERSION" -.IP "no Module \s-1LIST\s0" 8 -.IX Item "no Module LIST" -.IP "no Module" 8 -.IX Item "no Module" -.PD -See the \f(CW\*(C`use\*(C'\fR function, which \f(CW\*(C`no\*(C'\fR is the opposite of. -.IP "oct \s-1EXPR\s0" 8 -.IX Xref "oct octal hex hexadecimal binary bin" -.IX Item "oct EXPR" -.PD 0 -.IP "oct" 8 -.IX Item "oct" -.PD -Interprets \s-1EXPR\s0 as an octal string and returns the corresponding -value. (If \s-1EXPR\s0 happens to start off with \f(CW\*(C`0x\*(C'\fR, interprets it as a -hex string. If \s-1EXPR\s0 starts off with \f(CW\*(C`0b\*(C'\fR, it is interpreted as a -binary string. Leading whitespace is ignored in all three cases.) -The following will handle decimal, binary, octal, and hex in the standard -Perl or C notation: -.Sp -.Vb 1 -\& $val = oct($val) if $val =~ /^0/; -.Ve -.Sp -If \s-1EXPR\s0 is omitted, uses \f(CW$_\fR. To go the other way (produce a number -in octal), use \fIsprintf()\fR or \fIprintf()\fR: -.Sp -.Vb 2 -\& $perms = (stat("filename"))[2] & 07777; -\& $oct_perms = sprintf "%lo", $perms; -.Ve -.Sp -The \fIoct()\fR function is commonly used when a string such as \f(CW644\fR needs -to be converted into a file mode, for example. (Although perl will -automatically convert strings into numbers as needed, this automatic -conversion assumes base 10.) -.IP "open \s-1FILEHANDLE\s0,EXPR" 8 -.IX Xref "open pipe file, open fopen" -.IX Item "open FILEHANDLE,EXPR" -.PD 0 -.IP "open \s-1FILEHANDLE\s0,MODE,EXPR" 8 -.IX Item "open FILEHANDLE,MODE,EXPR" -.IP "open \s-1FILEHANDLE\s0,MODE,EXPR,LIST" 8 -.IX Item "open FILEHANDLE,MODE,EXPR,LIST" -.IP "open \s-1FILEHANDLE\s0,MODE,REFERENCE" 8 -.IX Item "open FILEHANDLE,MODE,REFERENCE" -.IP "open \s-1FILEHANDLE\s0" 8 -.IX Item "open FILEHANDLE" -.PD diff --git a/tests/examplefiles/phpcomplete.vim b/tests/examplefiles/phpcomplete.vim index e5d910e3..17d74fd8 100644 --- a/tests/examplefiles/phpcomplete.vim +++ b/tests/examplefiles/phpcomplete.vim @@ -564,4585 +564,4 @@ function! phpcomplete#CompletePHP(findstart, base) endif endfunction - -function! phpcomplete#GetClassName(scontext) " {{{ - " Get class name - " Class name can be detected in few ways: - " @var $myVar class - " line above - " or line in tags file - - let object = matchstr(a:scontext, '\zs[a-zA-Z_0-9\x7f-\xff]\+\ze->') - let i = 1 - while i < line('.') - let line = getline(line('.')-i) - if line =~ '^\s*\*\/\?\s*$' - let i += 1 - continue - else - if line =~ '@var\s\+\$'.object.'\s\+[a-zA-Z_0-9\x7f-\xff]\+' - let classname = matchstr(line, '@var\s\+\$'.object.'\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+') - return classname - else - break - endif - endif - endwhile - - " OK, first way failed, now check tags file(s) - let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")')) - exe 'silent! vimgrep /^'.object.'.*\$'.object.'.*=\s*new\s\+.*\tv\(\t\|$\)/j '.fnames - let qflist = getqflist() - if len(qflist) == 0 - return '' - else - " In all properly managed projects it should be one item list, even if it - " *is* longer we cannot solve conflicts, assume it is first element - let classname = matchstr(qflist[0]['text'], '=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze') - return classname - endif - -endfunction -" }}} -function! phpcomplete#GetClassLocation(classname) " {{{ - " Check classname may be name of built in object - if !exists("g:php_omni_bi_classes") - let g:php_omni_bi_classes = {} - for i in keys(g:php_builtin_object_functions) - let g:php_omni_bi_classes[substitute(i, '::.*$', '', '')] = '' - endfor - endif - if has_key(g:php_omni_bi_classes, a:classname) - return 'VIMPHP_BUILTINOBJECT' - endif - - " Get class location - for fname in tagfiles() - let fhead = fnamemodify(fname, ":h") - if fhead != '' - let psep = '/' " Note: slash is potential problem! - let fhead .= psep - endif - let fname = escape(fname, " \\") - exe 'silent! vimgrep /^'.a:classname.'.*\tc\(\t\|$\)/j '.fname - let qflist = getqflist() - " As in GetClassName we can manage only one element if it exists - if len(qflist) > 0 - let classlocation = matchstr(qflist[0]['text'], '\t\zs\f\+\ze\t') - else - return '' - endif - " And only one class location - if classlocation != '' - let classlocation = fhead.classlocation - return classlocation - else - return '' - endif - endfor - -endfunction -" }}} - -function! phpcomplete#GetClassContents(file, name) " {{{ - let cfile = join(a:file, "\n") - " We use new buffer and (later) normal! because - " this is the most efficient way. The other way - " is to go through the looong string looking for - " matching {} - below 1new - 0put =cfile - call search('class\s\+'.a:name) - let cfline = line('.') - " Catch extends - if getline('.') =~ 'extends' - let extends_class = matchstr(getline('.'), - \ 'class\s\+'.a:name.'\s\+extends\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze') - else - let extends_class = '' - endif - call search('{') - normal! % - let classc = getline(cfline, ".") - let classcontent = join(classc, "\n") - - bw! % - if extends_class != '' - let classlocation = phpcomplete#GetClassLocation(extends_class) - if filereadable(classlocation) - let classfile = readfile(classlocation) - let classcontent .= "\n".phpcomplete#GetClassContents(classfile, extends_class) - endif - endif - - return classcontent -endfunction -" }}} - -function! phpcomplete#LoadData() " {{{ -" Keywords/reserved words, all other special things {{{ -" Later it is possible to add some help to values, or type of -" defined variable -let g:php_keywords = { -\ 'PHP_SELF':'', -\ 'argv':'', -\ 'argc':'', -\ 'GATEWAY_INTERFACE':'', -\ 'SERVER_ADDR':'', -\ 'SERVER_NAME':'', -\ 'SERVER_SOFTWARE':'', -\ 'SERVER_PROTOCOL':'', -\ 'REQUEST_METHOD':'', -\ 'REQUEST_TIME':'', -\ 'QUERY_STRING':'', -\ 'DOCUMENT_ROOT':'', -\ 'HTTP_ACCEPT':'', -\ 'HTTP_ACCEPT_CHARSET':'', -\ 'HTTP_ACCEPT_ENCODING':'', -\ 'HTTP_ACCEPT_LANGUAGE':'', -\ 'HTTP_CONNECTION':'', -\ 'HTTP_POST':'', -\ 'HTTP_REFERER':'', -\ 'HTTP_USER_AGENT':'', -\ 'HTTPS':'', -\ 'REMOTE_ADDR':'', -\ 'REMOTE_HOST':'', -\ 'REMOTE_PORT':'', -\ 'SCRIPT_FILENAME':'', -\ 'SERVER_ADMIN':'', -\ 'SERVER_PORT':'', -\ 'SERVER_SIGNATURE':'', -\ 'PATH_TRANSLATED':'', -\ 'SCRIPT_NAME':'', -\ 'REQUEST_URI':'', -\ 'PHP_AUTH_DIGEST':'', -\ 'PHP_AUTH_USER':'', -\ 'PHP_AUTH_PW':'', -\ 'AUTH_TYPE':'', -\ 'and':'', -\ 'or':'', -\ 'xor':'', -\ '__FILE__':'', -\ 'exception':'', -\ '__LINE__':'', -\ 'as':'', -\ 'break':'', -\ 'case':'', -\ 'class':'', -\ 'const':'', -\ 'continue':'', -\ 'declare':'', -\ 'default':'', -\ 'do':'', -\ 'echo':'', -\ 'else':'', -\ 'elseif':'', -\ 'enddeclare':'', -\ 'endfor':'', -\ 'endforeach':'', -\ 'endif':'', -\ 'endswitch':'', -\ 'endwhile':'', -\ 'extends':'', -\ 'for':'', -\ 'foreach':'', -\ 'function':'', -\ 'global':'', -\ 'if':'', -\ 'new':'', -\ 'static':'', -\ 'switch':'', -\ 'use':'', -\ 'var':'', -\ 'while':'', -\ '__FUNCTION__':'', -\ '__CLASS__':'', -\ '__METHOD__':'', -\ 'final':'', -\ 'php_user_filter':'', -\ 'interface':'', -\ 'implements':'', -\ 'public':'', -\ 'private':'', -\ 'protected':'', -\ 'abstract':'', -\ 'clone':'', -\ 'try':'', -\ 'catch':'', -\ 'throw':'', -\ 'cfunction':'', -\ 'old_function':'', -\ 'this':'', -\ 'PHP_VERSION': '', -\ 'PHP_OS': '', -\ 'PHP_SAPI': '', -\ 'PHP_EOL': '', -\ 'PHP_INT_MAX': '', -\ 'PHP_INT_SIZE': '', -\ 'DEFAULT_INCLUDE_PATH': '', -\ 'PEAR_INSTALL_DIR': '', -\ 'PEAR_EXTENSION_DIR': '', -\ 'PHP_EXTENSION_DIR': '', -\ 'PHP_PREFIX': '', -\ 'PHP_BINDIR': '', -\ 'PHP_LIBDIR': '', -\ 'PHP_DATADIR': '', -\ 'PHP_SYSCONFDIR': '', -\ 'PHP_LOCALSTATEDIR': '', -\ 'PHP_CONFIG_FILE_PATH': '', -\ 'PHP_CONFIG_FILE_SCAN_DIR': '', -\ 'PHP_SHLIB_SUFFIX': '', -\ 'PHP_OUTPUT_HANDLER_START': '', -\ 'PHP_OUTPUT_HANDLER_CONT': '', -\ 'PHP_OUTPUT_HANDLER_END': '', -\ 'E_ERROR': '', -\ 'E_WARNING': '', -\ 'E_PARSE': '', -\ 'E_NOTICE': '', -\ 'E_CORE_ERROR': '', -\ 'E_CORE_WARNING': '', -\ 'E_COMPILE_ERROR': '', -\ 'E_COMPILE_WARNING': '', -\ 'E_USER_ERROR': '', -\ 'E_USER_WARNING': '', -\ 'E_USER_NOTICE': '', -\ 'E_ALL': '', -\ 'E_STRICT': '', -\ '__COMPILER_HALT_OFFSET__': '', -\ 'EXTR_OVERWRITE': '', -\ 'EXTR_SKIP': '', -\ 'EXTR_PREFIX_SAME': '', -\ 'EXTR_PREFIX_ALL': '', -\ 'EXTR_PREFIX_INVALID': '', -\ 'EXTR_PREFIX_IF_EXISTS': '', -\ 'EXTR_IF_EXISTS': '', -\ 'SORT_ASC': '', -\ 'SORT_DESC': '', -\ 'SORT_REGULAR': '', -\ 'SORT_NUMERIC': '', -\ 'SORT_STRING': '', -\ 'CASE_LOWER': '', -\ 'CASE_UPPER': '', -\ 'COUNT_NORMAL': '', -\ 'COUNT_RECURSIVE': '', -\ 'ASSERT_ACTIVE': '', -\ 'ASSERT_CALLBACK': '', -\ 'ASSERT_BAIL': '', -\ 'ASSERT_WARNING': '', -\ 'ASSERT_QUIET_EVAL': '', -\ 'CONNECTION_ABORTED': '', -\ 'CONNECTION_NORMAL': '', -\ 'CONNECTION_TIMEOUT': '', -\ 'INI_USER': '', -\ 'INI_PERDIR': '', -\ 'INI_SYSTEM': '', -\ 'INI_ALL': '', -\ 'M_E': '', -\ 'M_LOG2E': '', -\ 'M_LOG10E': '', -\ 'M_LN2': '', -\ 'M_LN10': '', -\ 'M_PI': '', -\ 'M_PI_2': '', -\ 'M_PI_4': '', -\ 'M_1_PI': '', -\ 'M_2_PI': '', -\ 'M_2_SQRTPI': '', -\ 'M_SQRT2': '', -\ 'M_SQRT1_2': '', -\ 'CRYPT_SALT_LENGTH': '', -\ 'CRYPT_STD_DES': '', -\ 'CRYPT_EXT_DES': '', -\ 'CRYPT_MD5': '', -\ 'CRYPT_BLOWFISH': '', -\ 'DIRECTORY_SEPARATOR': '', -\ 'SEEK_SET': '', -\ 'SEEK_CUR': '', -\ 'SEEK_END': '', -\ 'LOCK_SH': '', -\ 'LOCK_EX': '', -\ 'LOCK_UN': '', -\ 'LOCK_NB': '', -\ 'HTML_SPECIALCHARS': '', -\ 'HTML_ENTITIES': '', -\ 'ENT_COMPAT': '', -\ 'ENT_QUOTES': '', -\ 'ENT_NOQUOTES': '', -\ 'INFO_GENERAL': '', -\ 'INFO_CREDITS': '', -\ 'INFO_CONFIGURATION': '', -\ 'INFO_MODULES': '', -\ 'INFO_ENVIRONMENT': '', -\ 'INFO_VARIABLES': '', -\ 'INFO_LICENSE': '', -\ 'INFO_ALL': '', -\ 'CREDITS_GROUP': '', -\ 'CREDITS_GENERAL': '', -\ 'CREDITS_SAPI': '', -\ 'CREDITS_MODULES': '', -\ 'CREDITS_DOCS': '', -\ 'CREDITS_FULLPAGE': '', -\ 'CREDITS_QA': '', -\ 'CREDITS_ALL': '', -\ 'STR_PAD_LEFT': '', -\ 'STR_PAD_RIGHT': '', -\ 'STR_PAD_BOTH': '', -\ 'PATHINFO_DIRNAME': '', -\ 'PATHINFO_BASENAME': '', -\ 'PATHINFO_EXTENSION': '', -\ 'PATH_SEPARATOR': '', -\ 'CHAR_MAX': '', -\ 'LC_CTYPE': '', -\ 'LC_NUMERIC': '', -\ 'LC_TIME': '', -\ 'LC_COLLATE': '', -\ 'LC_MONETARY': '', -\ 'LC_ALL': '', -\ 'LC_MESSAGES': '', -\ 'ABDAY_1': '', -\ 'ABDAY_2': '', -\ 'ABDAY_3': '', -\ 'ABDAY_4': '', -\ 'ABDAY_5': '', -\ 'ABDAY_6': '', -\ 'ABDAY_7': '', -\ 'DAY_1': '', -\ 'DAY_2': '', -\ 'DAY_3': '', -\ 'DAY_4': '', -\ 'DAY_5': '', -\ 'DAY_6': '', -\ 'DAY_7': '', -\ 'ABMON_1': '', -\ 'ABMON_2': '', -\ 'ABMON_3': '', -\ 'ABMON_4': '', -\ 'ABMON_5': '', -\ 'ABMON_6': '', -\ 'ABMON_7': '', -\ 'ABMON_8': '', -\ 'ABMON_9': '', -\ 'ABMON_10': '', -\ 'ABMON_11': '', -\ 'ABMON_12': '', -\ 'MON_1': '', -\ 'MON_2': '', -\ 'MON_3': '', -\ 'MON_4': '', -\ 'MON_5': '', -\ 'MON_6': '', -\ 'MON_7': '', -\ 'MON_8': '', -\ 'MON_9': '', -\ 'MON_10': '', -\ 'MON_11': '', -\ 'MON_12': '', -\ 'AM_STR': '', -\ 'PM_STR': '', -\ 'D_T_FMT': '', -\ 'D_FMT': '', -\ 'T_FMT': '', -\ 'T_FMT_AMPM': '', -\ 'ERA': '', -\ 'ERA_YEAR': '', -\ 'ERA_D_T_FMT': '', -\ 'ERA_D_FMT': '', -\ 'ERA_T_FMT': '', -\ 'ALT_DIGITS': '', -\ 'INT_CURR_SYMBOL': '', -\ 'CURRENCY_SYMBOL': '', -\ 'CRNCYSTR': '', -\ 'MON_DECIMAL_POINT': '', -\ 'MON_THOUSANDS_SEP': '', -\ 'MON_GROUPING': '', -\ 'POSITIVE_SIGN': '', -\ 'NEGATIVE_SIGN': '', -\ 'INT_FRAC_DIGITS': '', -\ 'FRAC_DIGITS': '', -\ 'P_CS_PRECEDES': '', -\ 'P_SEP_BY_SPACE': '', -\ 'N_CS_PRECEDES': '', -\ 'N_SEP_BY_SPACE': '', -\ 'P_SIGN_POSN': '', -\ 'N_SIGN_POSN': '', -\ 'DECIMAL_POINT': '', -\ 'RADIXCHAR': '', -\ 'THOUSANDS_SEP': '', -\ 'THOUSEP': '', -\ 'GROUPING': '', -\ 'YESEXPR': '', -\ 'NOEXPR': '', -\ 'YESSTR': '', -\ 'NOSTR': '', -\ 'CODESET': '', -\ 'LOG_EMERG': '', -\ 'LOG_ALERT': '', -\ 'LOG_CRIT': '', -\ 'LOG_ERR': '', -\ 'LOG_WARNING': '', -\ 'LOG_NOTICE': '', -\ 'LOG_INFO': '', -\ 'LOG_DEBUG': '', -\ 'LOG_KERN': '', -\ 'LOG_USER': '', -\ 'LOG_MAIL': '', -\ 'LOG_DAEMON': '', -\ 'LOG_AUTH': '', -\ 'LOG_SYSLOG': '', -\ 'LOG_LPR': '', -\ 'LOG_NEWS': '', -\ 'LOG_UUCP': '', -\ 'LOG_CRON': '', -\ 'LOG_AUTHPRIV': '', -\ 'LOG_LOCAL0': '', -\ 'LOG_LOCAL1': '', -\ 'LOG_LOCAL2': '', -\ 'LOG_LOCAL3': '', -\ 'LOG_LOCAL4': '', -\ 'LOG_LOCAL5': '', -\ 'LOG_LOCAL6': '', -\ 'LOG_LOCAL7': '', -\ 'LOG_PID': '', -\ 'LOG_CONS': '', -\ 'LOG_ODELAY': '', -\ 'LOG_NDELAY': '', -\ 'LOG_NOWAIT': '', -\ 'LOG_PERROR': '', -\ } -" }}} -" PHP builtin functions {{{ -" To create from scratch list of functions: -" 1. Download multi html file PHP documentation -" 2. run for i in `ls | grep "^function\."`; do grep -A4 Description $i >> funcs; done -" 3. Open funcs in Vim and -" a) g/Description/normal! 5J -" b) remove all html tags (it will require few s/// and g//) -" c) :%s/^\([^[:space:]]\+\) \([^[:space:]]\+\) ( \(.*\))/\\ '\2(': '\3| \1', -" This will create Dictionary -" d) remove all /^[^\\] lines -let g:php_builtin_functions = { -\ 'abs(': 'mixed number | number', -\ 'acosh(': 'float arg | float', -\ 'acos(': 'float arg | float', -\ 'addcslashes(': 'string str, string charlist | string', -\ 'addslashes(': 'string str | string', -\ 'aggregate(': 'object object, string class_name | void', -\ 'aggregate_info(': 'object object | array', -\ 'aggregate_methods_by_list(': 'object object, string class_name, array methods_list [, bool exclude] | void', -\ 'aggregate_methods_by_regexp(': 'object object, string class_name, string regexp [, bool exclude] | void', -\ 'aggregate_methods(': 'object object, string class_name | void', -\ 'aggregate_properties_by_list(': 'object object, string class_name, array properties_list [, bool exclude] | void', -\ 'aggregate_properties_by_regexp(': 'object object, string class_name, string regexp [, bool exclude] | void', -\ 'aggregate_properties(': 'object object, string class_name | void', -\ 'apache_child_terminate(': 'void | bool', -\ 'apache_getenv(': 'string variable [, bool walk_to_top] | string', -\ 'apache_get_modules(': 'void | array', -\ 'apache_get_version(': 'void | string', -\ 'apache_lookup_uri(': 'string filename | object', -\ 'apache_note(': 'string note_name [, string note_value] | string', -\ 'apache_request_headers(': 'void | array', -\ 'apache_reset_timeout(': 'void | bool', -\ 'apache_response_headers(': 'void | array', -\ 'apache_setenv(': 'string variable, string value [, bool walk_to_top] | bool', -\ 'apc_cache_info(': '[string cache_type] | array', -\ 'apc_clear_cache(': '[string cache_type] | bool', -\ 'apc_define_constants(': 'string key, array constants [, bool case_sensitive] | bool', -\ 'apc_delete(': 'string key | bool', -\ 'apc_fetch(': 'string key | mixed', -\ 'apc_load_constants(': 'string key [, bool case_sensitive] | bool', -\ 'apc_sma_info(': 'void | array', -\ 'apc_store(': 'string key, mixed var [, int ttl] | bool', -\ 'apd_breakpoint(': 'int debug_level | bool', -\ 'apd_callstack(': 'void | array', -\ 'apd_clunk(': 'string warning [, string delimiter] | void', -\ 'apd_continue(': 'int debug_level | bool', -\ 'apd_croak(': 'string warning [, string delimiter] | void', -\ 'apd_dump_function_table(': 'void | void', -\ 'apd_dump_persistent_resources(': 'void | array', -\ 'apd_dump_regular_resources(': 'void | array', -\ 'apd_echo(': 'string output | bool', -\ 'apd_get_active_symbols(': ' | array', -\ 'apd_set_pprof_trace(': '[string dump_directory] | void', -\ 'apd_set_session(': 'int debug_level | void', -\ 'apd_set_session_trace(': 'int debug_level [, string dump_directory] | void', -\ 'apd_set_socket_session_trace(': 'string ip_address_or_unix_socket_file, int socket_type, int port, int debug_level | bool', -\ 'array_change_key_case(': 'array input [, int case] | array', -\ 'array_chunk(': 'array input, int size [, bool preserve_keys] | array', -\ 'array_combine(': 'array keys, array values | array', -\ 'array_count_values(': 'array input | array', -\ 'array_diff_assoc(': 'array array1, array array2 [, array ...] | array', -\ 'array_diff(': 'array array1, array array2 [, array ...] | array', -\ 'array_diff_key(': 'array array1, array array2 [, array ...] | array', -\ 'array_diff_uassoc(': 'array array1, array array2 [, array ..., callback key_compare_func] | array', -\ 'array_diff_ukey(': 'array array1, array array2 [, array ..., callback key_compare_func] | array', -\ 'array_fill(': 'int start_index, int num, mixed value | array', -\ 'array_filter(': 'array input [, callback callback] | array', -\ 'array_flip(': 'array trans | array', -\ 'array(': '[mixed ...] | array', -\ 'array_intersect_assoc(': 'array array1, array array2 [, array ...] | array', -\ 'array_intersect(': 'array array1, array array2 [, array ...] | array', -\ 'array_intersect_key(': 'array array1, array array2 [, array ...] | array', -\ 'array_intersect_uassoc(': 'array array1, array array2 [, array ..., callback key_compare_func] | array', -\ 'array_intersect_ukey(': 'array array1, array array2 [, array ..., callback key_compare_func] | array', -\ 'array_key_exists(': 'mixed key, array search | bool', -\ 'array_keys(': 'array input [, mixed search_value [, bool strict]] | array', -\ 'array_map(': 'callback callback, array arr1 [, array ...] | array', -\ 'array_merge(': 'array array1 [, array array2 [, array ...]] | array', -\ 'array_merge_recursive(': 'array array1 [, array ...] | array', -\ 'array_multisort(': 'array ar1 [, mixed arg [, mixed ... [, array ...]]] | bool', -\ 'array_pad(': 'array input, int pad_size, mixed pad_value | array', -\ 'array_pop(': 'array &array | mixed', -\ 'array_product(': 'array array | number', -\ 'array_push(': 'array &array, mixed var [, mixed ...] | int', -\ 'array_rand(': 'array input [, int num_req] | mixed', -\ 'array_reduce(': 'array input, callback function [, int initial] | mixed', -\ 'array_reverse(': 'array array [, bool preserve_keys] | array', -\ 'array_search(': 'mixed needle, array haystack [, bool strict] | mixed', -\ 'array_shift(': 'array &array | mixed', -\ 'array_slice(': 'array array, int offset [, int length [, bool preserve_keys]] | array', -\ 'array_splice(': 'array &input, int offset [, int length [, array replacement]] | array', -\ 'array_sum(': 'array array | number', -\ 'array_udiff_assoc(': 'array array1, array array2 [, array ..., callback data_compare_func] | array', -\ 'array_udiff(': 'array array1, array array2 [, array ..., callback data_compare_func] | array', -\ 'array_udiff_uassoc(': 'array array1, array array2 [, array ..., callback data_compare_func, callback key_compare_func] | array', -\ 'array_uintersect_assoc(': 'array array1, array array2 [, array ..., callback data_compare_func] | array', -\ 'array_uintersect(': 'array array1, array array2 [, array ..., callback data_compare_func] | array', -\ 'array_uintersect_uassoc(': 'array array1, array array2 [, array ..., callback data_compare_func, callback key_compare_func] | array', -\ 'array_unique(': 'array array | array', -\ 'array_unshift(': 'array &array, mixed var [, mixed ...] | int', -\ 'array_values(': 'array input | array', -\ 'array_walk(': 'array &array, callback funcname [, mixed userdata] | bool', -\ 'array_walk_recursive(': 'array &input, callback funcname [, mixed userdata] | bool', -\ 'arsort(': 'array &array [, int sort_flags] | bool', -\ 'ascii2ebcdic(': 'string ascii_str | int', -\ 'asinh(': 'float arg | float', -\ 'asin(': 'float arg | float', -\ 'asort(': 'array &array [, int sort_flags] | bool', -\ 'aspell_check(': 'int dictionary_link, string word | bool', -\ 'aspell_check_raw(': 'int dictionary_link, string word | bool', -\ 'aspell_new(': 'string master [, string personal] | int', -\ 'aspell_suggest(': 'int dictionary_link, string word | array', -\ 'assert(': 'mixed assertion | bool', -\ 'assert_options(': 'int what [, mixed value] | mixed', -\ 'atan2(': 'float y, float x | float', -\ 'atanh(': 'float arg | float', -\ 'atan(': 'float arg | float', -\ 'base64_decode(': 'string encoded_data | string', -\ 'base64_encode(': 'string data | string', -\ 'base_convert(': 'string number, int frombase, int tobase | string', -\ 'basename(': 'string path [, string suffix] | string', -\ 'bcadd(': 'string left_operand, string right_operand [, int scale] | string', -\ 'bccomp(': 'string left_operand, string right_operand [, int scale] | int', -\ 'bcdiv(': 'string left_operand, string right_operand [, int scale] | string', -\ 'bcmod(': 'string left_operand, string modulus | string', -\ 'bcmul(': 'string left_operand, string right_operand [, int scale] | string', -\ 'bcompiler_load_exe(': 'string filename | bool', -\ 'bcompiler_load(': 'string filename | bool', -\ 'bcompiler_parse_class(': 'string class, string callback | bool', -\ 'bcompiler_read(': 'resource filehandle | bool', -\ 'bcompiler_write_class(': 'resource filehandle, string className [, string extends] | bool', -\ 'bcompiler_write_constant(': 'resource filehandle, string constantName | bool', -\ 'bcompiler_write_exe_footer(': 'resource filehandle, int startpos | bool', -\ 'bcompiler_write_file(': 'resource filehandle, string filename | bool', -\ 'bcompiler_write_footer(': 'resource filehandle | bool', -\ 'bcompiler_write_function(': 'resource filehandle, string functionName | bool', -\ 'bcompiler_write_functions_from_file(': 'resource filehandle, string fileName | bool', -\ 'bcompiler_write_header(': 'resource filehandle [, string write_ver] | bool', -\ 'bcpow(': 'string x, string y [, int scale] | string', -\ 'bcpowmod(': 'string x, string y, string modulus [, int scale] | string', -\ 'bcscale(': 'int scale | bool', -\ 'bcsqrt(': 'string operand [, int scale] | string', -\ 'bcsub(': 'string left_operand, string right_operand [, int scale] | string', -\ 'bin2hex(': 'string str | string', -\ 'bindec(': 'string binary_string | number', -\ 'bind_textdomain_codeset(': 'string domain, string codeset | string', -\ 'bindtextdomain(': 'string domain, string directory | string', -\ 'bzclose(': 'resource bz | int', -\ 'bzcompress(': 'string source [, int blocksize [, int workfactor]] | mixed', -\ 'bzdecompress(': 'string source [, int small] | mixed', -\ 'bzerrno(': 'resource bz | int', -\ 'bzerror(': 'resource bz | array', -\ 'bzerrstr(': 'resource bz | string', -\ 'bzflush(': 'resource bz | int', -\ 'bzopen(': 'string filename, string mode | resource', -\ 'bzread(': 'resource bz [, int length] | string', -\ 'bzwrite(': 'resource bz, string data [, int length] | int', -\ 'cal_days_in_month(': 'int calendar, int month, int year | int', -\ 'cal_from_jd(': 'int jd, int calendar | array', -\ 'cal_info(': '[int calendar] | array', -\ 'call_user_func_array(': 'callback function, array param_arr | mixed', -\ 'call_user_func(': 'callback function [, mixed parameter [, mixed ...]] | mixed', -\ 'call_user_method_array(': 'string method_name, object &obj, array paramarr | mixed', -\ 'call_user_method(': 'string method_name, object &obj [, mixed parameter [, mixed ...]] | mixed', -\ 'cal_to_jd(': 'int calendar, int month, int day, int year | int', -\ 'ccvs_add(': 'string session, string invoice, string argtype, string argval | string', -\ 'ccvs_auth(': 'string session, string invoice | string', -\ 'ccvs_command(': 'string session, string type, string argval | string', -\ 'ccvs_count(': 'string session, string type | int', -\ 'ccvs_delete(': 'string session, string invoice | string', -\ 'ccvs_done(': 'string sess | string', -\ 'ccvs_init(': 'string name | string', -\ 'ccvs_lookup(': 'string session, string invoice, int inum | string', -\ 'ccvs_new(': 'string session, string invoice | string', -\ 'ccvs_report(': 'string session, string type | string', -\ 'ccvs_return(': 'string session, string invoice | string', -\ 'ccvs_reverse(': 'string session, string invoice | string', -\ 'ccvs_sale(': 'string session, string invoice | string', -\ 'ccvs_status(': 'string session, string invoice | string', -\ 'ccvs_textvalue(': 'string session | string', -\ 'ccvs_void(': 'string session, string invoice | string', -\ 'ceil(': 'float value | float', -\ 'chdir(': 'string directory | bool', -\ 'checkdate(': 'int month, int day, int year | bool', -\ 'checkdnsrr(': 'string host [, string type] | int', -\ 'chgrp(': 'string filename, mixed group | bool', -\ 'chmod(': 'string filename, int mode | bool', -\ 'chown(': 'string filename, mixed user | bool', -\ 'chr(': 'int ascii | string', -\ 'chroot(': 'string directory | bool', -\ 'chunk_split(': 'string body [, int chunklen [, string end]] | string', -\ 'class_exists(': 'string class_name [, bool autoload] | bool', -\ 'class_implements(': 'mixed class [, bool autoload] | array', -\ 'classkit_import(': 'string filename | array', -\ 'classkit_method_add(': 'string classname, string methodname, string args, string code [, int flags] | bool', -\ 'classkit_method_copy(': 'string dClass, string dMethod, string sClass [, string sMethod] | bool', -\ 'classkit_method_redefine(': 'string classname, string methodname, string args, string code [, int flags] | bool', -\ 'classkit_method_remove(': 'string classname, string methodname | bool', -\ 'classkit_method_rename(': 'string classname, string methodname, string newname | bool', -\ 'class_parents(': 'mixed class [, bool autoload] | array', -\ 'clearstatcache(': 'void | void', -\ 'closedir(': 'resource dir_handle | void', -\ 'closelog(': 'void | bool', -\ 'com_addref(': 'void | void', -\ 'com_create_guid(': 'void | string', -\ 'com_event_sink(': 'variant comobject, object sinkobject [, mixed sinkinterface] | bool', -\ 'com_get_active_object(': 'string progid [, int code_page] | variant', -\ 'com_get(': 'resource com_object, string property | mixed', -\ 'com_invoke(': 'resource com_object, string function_name [, mixed function_parameters] | mixed', -\ 'com_isenum(': 'variant com_module | bool', -\ 'com_load(': 'string module_name [, string server_name [, int codepage]] | resource', -\ 'com_load_typelib(': 'string typelib_name [, bool case_insensitive] | bool', -\ 'com_message_pump(': '[int timeoutms] | bool', -\ 'compact(': 'mixed varname [, mixed ...] | array', -\ 'com_print_typeinfo(': 'object comobject [, string dispinterface [, bool wantsink]] | bool', -\ 'com_release(': 'void | void', -\ 'com_set(': 'resource com_object, string property, mixed value | void', -\ 'connection_aborted(': 'void | int', -\ 'connection_status(': 'void | int', -\ 'connection_timeout(': 'void | bool', -\ 'constant(': 'string name | mixed', -\ 'convert_cyr_string(': 'string str, string from, string to | string', -\ 'convert_uudecode(': 'string data | string', -\ 'convert_uuencode(': 'string data | string', -\ 'copy(': 'string source, string dest | bool', -\ 'cosh(': 'float arg | float', -\ 'cos(': 'float arg | float', -\ 'count_chars(': 'string string [, int mode] | mixed', -\ 'count(': 'mixed var [, int mode] | int', -\ 'cpdf_add_annotation(': 'int pdf_document, float llx, float lly, float urx, float ury, string title, string content [, int mode] | bool', -\ 'cpdf_add_outline(': 'int pdf_document, int lastoutline, int sublevel, int open, int pagenr, string text | int', -\ 'cpdf_arc(': 'int pdf_document, float x_coor, float y_coor, float radius, float start, float end [, int mode] | bool', -\ 'cpdf_begin_text(': 'int pdf_document | bool', -\ 'cpdf_circle(': 'int pdf_document, float x_coor, float y_coor, float radius [, int mode] | bool', -\ 'cpdf_clip(': 'int pdf_document | bool', -\ 'cpdf_close(': 'int pdf_document | bool', -\ 'cpdf_closepath_fill_stroke(': 'int pdf_document | bool', -\ 'cpdf_closepath(': 'int pdf_document | bool', -\ 'cpdf_closepath_stroke(': 'int pdf_document | bool', -\ 'cpdf_continue_text(': 'int pdf_document, string text | bool', -\ 'cpdf_curveto(': 'int pdf_document, float x1, float y1, float x2, float y2, float x3, float y3 [, int mode] | bool', -\ 'cpdf_end_text(': 'int pdf_document | bool', -\ 'cpdf_fill(': 'int pdf_document | bool', -\ 'cpdf_fill_stroke(': 'int pdf_document | bool', -\ 'cpdf_finalize(': 'int pdf_document | bool', -\ 'cpdf_finalize_page(': 'int pdf_document, int page_number | bool', -\ 'cpdf_global_set_document_limits(': 'int maxpages, int maxfonts, int maximages, int maxannotations, int maxobjects | bool', -\ 'cpdf_import_jpeg(': 'int pdf_document, string file_name, float x_coor, float y_coor, float angle, float width, float height, float x_scale, float y_scale, int gsave [, int mode] | bool', -\ 'cpdf_lineto(': 'int pdf_document, float x_coor, float y_coor [, int mode] | bool', -\ 'cpdf_moveto(': 'int pdf_document, float x_coor, float y_coor [, int mode] | bool', -\ 'cpdf_newpath(': 'int pdf_document | bool', -\ 'cpdf_open(': 'int compression [, string filename [, array doc_limits]] | int', -\ 'cpdf_output_buffer(': 'int pdf_document | bool', -\ 'cpdf_page_init(': 'int pdf_document, int page_number, int orientation, float height, float width [, float unit] | bool', -\ 'cpdf_place_inline_image(': 'int pdf_document, int image, float x_coor, float y_coor, float angle, float width, float height, int gsave [, int mode] | bool', -\ 'cpdf_rect(': 'int pdf_document, float x_coor, float y_coor, float width, float height [, int mode] | bool', -\ 'cpdf_restore(': 'int pdf_document | bool', -\ 'cpdf_rlineto(': 'int pdf_document, float x_coor, float y_coor [, int mode] | bool', -\ 'cpdf_rmoveto(': 'int pdf_document, float x_coor, float y_coor [, int mode] | bool', -\ 'cpdf_rotate(': 'int pdf_document, float angle | bool', -\ 'cpdf_rotate_text(': 'int pdfdoc, float angle | bool', -\ 'cpdf_save(': 'int pdf_document | bool', -\ 'cpdf_save_to_file(': 'int pdf_document, string filename | bool', -\ 'cpdf_scale(': 'int pdf_document, float x_scale, float y_scale | bool', -\ 'cpdf_set_action_url(': 'int pdfdoc, float xll, float yll, float xur, float xur, string url [, int mode] | bool', -\ 'cpdf_set_char_spacing(': 'int pdf_document, float space | bool', -\ 'cpdf_set_creator(': 'int pdf_document, string creator | bool', -\ 'cpdf_set_current_page(': 'int pdf_document, int page_number | bool', -\ 'cpdf_setdash(': 'int pdf_document, float white, float black | bool', -\ 'cpdf_setflat(': 'int pdf_document, float value | bool', -\ 'cpdf_set_font_directories(': 'int pdfdoc, string pfmdir, string pfbdir | bool', -\ 'cpdf_set_font(': 'int pdf_document, string font_name, float size, string encoding | bool', -\ 'cpdf_set_font_map_file(': 'int pdfdoc, string filename | bool', -\ 'cpdf_setgray_fill(': 'int pdf_document, float value | bool', -\ 'cpdf_setgray(': 'int pdf_document, float gray_value | bool', -\ 'cpdf_setgray_stroke(': 'int pdf_document, float gray_value | bool', -\ 'cpdf_set_horiz_scaling(': 'int pdf_document, float scale | bool', -\ 'cpdf_set_keywords(': 'int pdf_document, string keywords | bool', -\ 'cpdf_set_leading(': 'int pdf_document, float distance | bool', -\ 'cpdf_setlinecap(': 'int pdf_document, int value | bool', -\ 'cpdf_setlinejoin(': 'int pdf_document, int value | bool', -\ 'cpdf_setlinewidth(': 'int pdf_document, float width | bool', -\ 'cpdf_setmiterlimit(': 'int pdf_document, float value | bool', -\ 'cpdf_set_page_animation(': 'int pdf_document, int transition, float duration, float direction, int orientation, int inout | bool', -\ 'cpdf_setrgbcolor_fill(': 'int pdf_document, float red_value, float green_value, float blue_value | bool', -\ 'cpdf_setrgbcolor(': 'int pdf_document, float red_value, float green_value, float blue_value | bool', -\ 'cpdf_setrgbcolor_stroke(': 'int pdf_document, float red_value, float green_value, float blue_value | bool', -\ 'cpdf_set_subject(': 'int pdf_document, string subject | bool', -\ 'cpdf_set_text_matrix(': 'int pdf_document, array matrix | bool', -\ 'cpdf_set_text_pos(': 'int pdf_document, float x_coor, float y_coor [, int mode] | bool', -\ 'cpdf_set_text_rendering(': 'int pdf_document, int rendermode | bool', -\ 'cpdf_set_text_rise(': 'int pdf_document, float value | bool', -\ 'cpdf_set_title(': 'int pdf_document, string title | bool', -\ 'cpdf_set_viewer_preferences(': 'int pdfdoc, array preferences | bool', -\ 'cpdf_set_word_spacing(': 'int pdf_document, float space | bool', -\ 'cpdf_show(': 'int pdf_document, string text | bool', -\ 'cpdf_show_xy(': 'int pdf_document, string text, float x_coor, float y_coor [, int mode] | bool', -\ 'cpdf_stringwidth(': 'int pdf_document, string text | float', -\ 'cpdf_stroke(': 'int pdf_document | bool', -\ 'cpdf_text(': 'int pdf_document, string text [, float x_coor, float y_coor [, int mode [, float orientation [, int alignmode]]]] | bool', -\ 'cpdf_translate(': 'int pdf_document, float x_coor, float y_coor | bool', -\ 'crack_check(': 'resource dictionary, string password | bool', -\ 'crack_closedict(': '[resource dictionary] | bool', -\ 'crack_getlastmessage(': 'void | string', -\ 'crack_opendict(': 'string dictionary | resource', -\ 'crc32(': 'string str | int', -\ 'create_function(': 'string args, string code | string', -\ 'crypt(': 'string str [, string salt] | string', -\ 'ctype_alnum(': 'string text | bool', -\ 'ctype_alpha(': 'string text | bool', -\ 'ctype_cntrl(': 'string text | bool', -\ 'ctype_digit(': 'string text | bool', -\ 'ctype_graph(': 'string text | bool', -\ 'ctype_lower(': 'string text | bool', -\ 'ctype_print(': 'string text | bool', -\ 'ctype_punct(': 'string text | bool', -\ 'ctype_space(': 'string text | bool', -\ 'ctype_upper(': 'string text | bool', -\ 'ctype_xdigit(': 'string text | bool', -\ 'curl_close(': 'resource ch | void', -\ 'curl_copy_handle(': 'resource ch | resource', -\ 'curl_errno(': 'resource ch | int', -\ 'curl_error(': 'resource ch | string', -\ 'curl_exec(': 'resource ch | mixed', -\ 'curl_getinfo(': 'resource ch [, int opt] | mixed', -\ 'curl_init(': '[string url] | resource', -\ 'curl_multi_add_handle(': 'resource mh, resource ch | int', -\ 'curl_multi_close(': 'resource mh | void', -\ 'curl_multi_exec(': 'resource mh, int &still_running | int', -\ 'curl_multi_getcontent(': 'resource ch | string', -\ 'curl_multi_info_read(': 'resource mh | array', -\ 'curl_multi_init(': 'void | resource', -\ 'curl_multi_remove_handle(': 'resource mh, resource ch | int', -\ 'curl_multi_select(': 'resource mh [, float timeout] | int', -\ 'curl_setopt(': 'resource ch, int option, mixed value | bool', -\ 'curl_version(': '[int version] | array', -\ 'current(': 'array &array | mixed', -\ 'cybercash_base64_decode(': 'string inbuff | string', -\ 'cybercash_base64_encode(': 'string inbuff | string', -\ 'cybercash_decr(': 'string wmk, string sk, string inbuff | array', -\ 'cybercash_encr(': 'string wmk, string sk, string inbuff | array', -\ 'cybermut_creerformulairecm(': 'string url_cm, string version, string tpe, string price, string ref_command, string text_free, string url_return, string url_return_ok, string url_return_err, string language, string code_company, string text_button | string', -\ 'cybermut_creerreponsecm(': 'string sentence | string', -\ 'cybermut_testmac(': 'string code_mac, string version, string tpe, string cdate, string price, string ref_command, string text_free, string code_return | bool', -\ 'cyrus_authenticate(': 'resource connection [, string mechlist [, string service [, string user [, int minssf [, int maxssf [, string authname [, string password]]]]]]] | void', -\ 'cyrus_bind(': 'resource connection, array callbacks | bool', -\ 'cyrus_close(': 'resource connection | bool', -\ 'cyrus_connect(': '[string host [, string port [, int flags]]] | resource', -\ 'cyrus_query(': 'resource connection, string query | array', -\ 'cyrus_unbind(': 'resource connection, string trigger_name | bool', -\ 'date_default_timezone_get(': 'void | string', -\ 'date_default_timezone_set(': 'string timezone_identifier | bool', -\ 'date(': 'string format [, int timestamp] | string', -\ 'date_sunrise(': 'int timestamp [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]] | mixed', -\ 'date_sunset(': 'int timestamp [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]] | mixed', -\ 'db2_autocommit(': 'resource connection [, bool value] | mixed', -\ 'db2_bind_param(': 'resource stmt, int parameter-number, string variable-name [, int parameter-type [, int data-type [, int precision [, int scale]]]] | bool', -\ 'db2_client_info(': 'resource connection | object', -\ 'db2_close(': 'resource connection | bool', -\ 'db2_column_privileges(': 'resource connection [, string qualifier [, string schema [, string table-name [, string column-name]]]] | resource', -\ 'db2_columns(': 'resource connection [, string qualifier [, string schema [, string table-name [, string column-name]]]] | resource', -\ 'db2_commit(': 'resource connection | bool', -\ 'db2_connect(': 'string database, string username, string password [, array options] | resource', -\ 'db2_conn_error(': '[resource connection] | string', -\ 'db2_conn_errormsg(': '[resource connection] | string', -\ 'db2_cursor_type(': 'resource stmt | int', -\ 'db2_exec(': 'resource connection, string statement [, array options] | resource', -\ 'db2_execute(': 'resource stmt [, array parameters] | bool', -\ 'db2_fetch_array(': 'resource stmt [, int row_number] | array', -\ 'db2_fetch_assoc(': 'resource stmt [, int row_number] | array', -\ 'db2_fetch_both(': 'resource stmt [, int row_number] | array', -\ 'db2_fetch_object(': 'resource stmt [, int row_number] | object', -\ 'db2_fetch_row(': 'resource stmt [, int row_number] | bool', -\ 'db2_field_display_size(': 'resource stmt, mixed column | int', -\ 'db2_field_name(': 'resource stmt, mixed column | string', -\ 'db2_field_num(': 'resource stmt, mixed column | int', -\ 'db2_field_precision(': 'resource stmt, mixed column | int', -\ 'db2_field_scale(': 'resource stmt, mixed column | int', -\ 'db2_field_type(': 'resource stmt, mixed column | string', -\ 'db2_field_width(': 'resource stmt, mixed column | int', -\ 'db2_foreign_keys(': 'resource connection, string qualifier, string schema, string table-name | resource', -\ 'db2_free_result(': 'resource stmt | bool', -\ 'db2_free_stmt(': 'resource stmt | bool', -\ 'db2_next_result(': 'resource stmt | resource', -\ 'db2_num_fields(': 'resource stmt | int', -\ 'db2_num_rows(': 'resource stmt | int', -\ 'db2_pconnect(': 'string database, string username, string password [, array options] | resource', -\ 'db2_prepare(': 'resource connection, string statement [, array options] | resource', -\ 'db2_primary_keys(': 'resource connection, string qualifier, string schema, string table-name | resource', -\ 'db2_procedure_columns(': 'resource connection, string qualifier, string schema, string procedure, string parameter | resource', -\ 'db2_procedures(': 'resource connection, string qualifier, string schema, string procedure | resource', -\ 'db2_result(': 'resource stmt, mixed column | mixed', -\ 'db2_rollback(': 'resource connection | bool', -\ 'db2_server_info(': 'resource connection | object', -\ 'db2_special_columns(': 'resource connection, string qualifier, string schema, string table_name, int scope | resource', -\ 'db2_statistics(': 'resource connection, string qualifier, string schema, string table-name, bool unique | resource', -\ 'db2_stmt_error(': '[resource stmt] | string', -\ 'db2_stmt_errormsg(': '[resource stmt] | string', -\ 'db2_table_privileges(': 'resource connection [, string qualifier [, string schema [, string table_name]]] | resource', -\ 'db2_tables(': 'resource connection [, string qualifier [, string schema [, string table-name [, string table-type]]]] | resource', -\ 'dba_close(': 'resource handle | void', -\ 'dba_delete(': 'string key, resource handle | bool', -\ 'dba_exists(': 'string key, resource handle | bool', -\ 'dba_fetch(': 'string key, resource handle | string', -\ 'dba_firstkey(': 'resource handle | string', -\ 'dba_handlers(': '[bool full_info] | array', -\ 'dba_insert(': 'string key, string value, resource handle | bool', -\ 'dba_key_split(': 'mixed key | mixed', -\ 'dba_list(': 'void | array', -\ 'dba_nextkey(': 'resource handle | string', -\ 'dba_open(': 'string path, string mode [, string handler [, mixed ...]] | resource', -\ 'dba_optimize(': 'resource handle | bool', -\ 'dba_popen(': 'string path, string mode [, string handler [, mixed ...]] | resource', -\ 'dba_replace(': 'string key, string value, resource handle | bool', -\ 'dbase_add_record(': 'int dbase_identifier, array record | bool', -\ 'dbase_close(': 'int dbase_identifier | bool', -\ 'dbase_create(': 'string filename, array fields | int', -\ 'dbase_delete_record(': 'int dbase_identifier, int record_number | bool', -\ 'dbase_get_header_info(': 'int dbase_identifier | array', -\ 'dbase_get_record(': 'int dbase_identifier, int record_number | array', -\ 'dbase_get_record_with_names(': 'int dbase_identifier, int record_number | array', -\ 'dbase_numfields(': 'int dbase_identifier | int', -\ 'dbase_numrecords(': 'int dbase_identifier | int', -\ 'dbase_open(': 'string filename, int mode | int', -\ 'dbase_pack(': 'int dbase_identifier | bool', -\ 'dbase_replace_record(': 'int dbase_identifier, array record, int record_number | bool', -\ 'dba_sync(': 'resource handle | bool', -\ 'dblist(': 'void | string', -\ 'dbmclose(': 'resource dbm_identifier | bool', -\ 'dbmdelete(': 'resource dbm_identifier, string key | bool', -\ 'dbmexists(': 'resource dbm_identifier, string key | bool', -\ 'dbmfetch(': 'resource dbm_identifier, string key | string', -\ 'dbmfirstkey(': 'resource dbm_identifier | string', -\ 'dbminsert(': 'resource dbm_identifier, string key, string value | int', -\ 'dbmnextkey(': 'resource dbm_identifier, string key | string', -\ 'dbmopen(': 'string filename, string flags | resource', -\ 'dbmreplace(': 'resource dbm_identifier, string key, string value | int', -\ 'dbplus_add(': 'resource relation, array tuple | int', -\ 'dbplus_aql(': 'string query [, string server [, string dbpath]] | resource', -\ 'dbplus_chdir(': '[string newdir] | string', -\ 'dbplus_close(': 'resource relation | mixed', -\ 'dbplus_curr(': 'resource relation, array &tuple | int', -\ 'dbplus_errcode(': '[int errno] | string', -\ 'dbplus_errno(': 'void | int', -\ 'dbplus_find(': 'resource relation, array constraints, mixed tuple | int', -\ 'dbplus_first(': 'resource relation, array &tuple | int', -\ 'dbplus_flush(': 'resource relation | int', -\ 'dbplus_freealllocks(': 'void | int', -\ 'dbplus_freelock(': 'resource relation, string tname | int', -\ 'dbplus_freerlocks(': 'resource relation | int', -\ 'dbplus_getlock(': 'resource relation, string tname | int', -\ 'dbplus_getunique(': 'resource relation, int uniqueid | int', -\ 'dbplus_info(': 'resource relation, string key, array &result | int', -\ 'dbplus_last(': 'resource relation, array &tuple | int', -\ 'dbplus_lockrel(': 'resource relation | int', -\ 'dbplus_next(': 'resource relation, array &tuple | int', -\ 'dbplus_open(': 'string name | resource', -\ 'dbplus_prev(': 'resource relation, array &tuple | int', -\ 'dbplus_rchperm(': 'resource relation, int mask, string user, string group | int', -\ 'dbplus_rcreate(': 'string name, mixed domlist [, bool overwrite] | resource', -\ 'dbplus_rcrtexact(': 'string name, resource relation [, bool overwrite] | mixed', -\ 'dbplus_rcrtlike(': 'string name, resource relation [, int overwrite] | mixed', -\ 'dbplus_resolve(': 'string relation_name | array', -\ 'dbplus_restorepos(': 'resource relation, array tuple | int', -\ 'dbplus_rkeys(': 'resource relation, mixed domlist | mixed', -\ 'dbplus_ropen(': 'string name | resource', -\ 'dbplus_rquery(': 'string query [, string dbpath] | resource', -\ 'dbplus_rrename(': 'resource relation, string name | int', -\ 'dbplus_rsecindex(': 'resource relation, mixed domlist, int type | mixed', -\ 'dbplus_runlink(': 'resource relation | int', -\ 'dbplus_rzap(': 'resource relation | int', -\ 'dbplus_savepos(': 'resource relation | int', -\ 'dbplus_setindexbynumber(': 'resource relation, int idx_number | int', -\ 'dbplus_setindex(': 'resource relation, string idx_name | int', -\ 'dbplus_sql(': 'string query [, string server [, string dbpath]] | resource', -\ 'dbplus_tcl(': 'int sid, string script | string', -\ 'dbplus_tremove(': 'resource relation, array tuple [, array &current] | int', -\ 'dbplus_undo(': 'resource relation | int', -\ 'dbplus_undoprepare(': 'resource relation | int', -\ 'dbplus_unlockrel(': 'resource relation | int', -\ 'dbplus_unselect(': 'resource relation | int', -\ 'dbplus_update(': 'resource relation, array old, array new | int', -\ 'dbplus_xlockrel(': 'resource relation | int', -\ 'dbplus_xunlockrel(': 'resource relation | int', -\ 'dbx_close(': 'object link_identifier | bool', -\ 'dbx_compare(': 'array row_a, array row_b, string column_key [, int flags] | int', -\ 'dbx_connect(': 'mixed module, string host, string database, string username, string password [, int persistent] | object', -\ 'dbx_error(': 'object link_identifier | string', -\ 'dbx_escape_string(': 'object link_identifier, string text | string', -\ 'dbx_fetch_row(': 'object result_identifier | mixed', -\ 'dbx_query(': 'object link_identifier, string sql_statement [, int flags] | mixed', -\ 'dbx_sort(': 'object result, string user_compare_function | bool', -\ 'dcgettext(': 'string domain, string message, int category | string', -\ 'dcngettext(': 'string domain, string msgid1, string msgid2, int n, int category | string', -\ 'deaggregate(': 'object object [, string class_name] | void', -\ 'debug_backtrace(': 'void | array', -\ 'debugger_off(': 'void | int', -\ 'debugger_on(': 'string address | int', -\ 'debug_print_backtrace(': 'void | void', -\ 'debug_zval_dump(': 'mixed variable | void', -\ 'decbin(': 'int number | string', -\ 'dechex(': 'int number | string', -\ 'decoct(': 'int number | string', -\ 'defined(': 'string name | bool', -\ 'define(': 'string name, mixed value [, bool case_insensitive] | bool', -\ 'define_syslog_variables(': 'void | void', -\ 'deg2rad(': 'float number | float', -\ 'delete(': 'string file | void', -\ 'dgettext(': 'string domain, string message | string', -\ 'dio_close(': 'resource fd | void', -\ 'dio_fcntl(': 'resource fd, int cmd [, mixed args] | mixed', -\ 'dio_open(': 'string filename, int flags [, int mode] | resource', -\ 'dio_read(': 'resource fd [, int len] | string', -\ 'dio_seek(': 'resource fd, int pos [, int whence] | int', -\ 'dio_stat(': 'resource fd | array', -\ 'dio_tcsetattr(': 'resource fd, array options | bool', -\ 'dio_truncate(': 'resource fd, int offset | bool', -\ 'dio_write(': 'resource fd, string data [, int len] | int', -\ 'dirname(': 'string path | string', -\ 'disk_free_space(': 'string directory | float', -\ 'disk_total_space(': 'string directory | float', -\ 'dl(': 'string library | int', -\ 'dngettext(': 'string domain, string msgid1, string msgid2, int n | string', -\ 'dns_check_record(': 'string host [, string type] | bool', -\ 'dns_get_mx(': 'string hostname, array &mxhosts [, array &weight] | bool', -\ 'dns_get_record(': 'string hostname [, int type [, array &authns, array &addtl]] | array', -\ 'DomDocument->add_root(': 'string name | domelement', -\ 'DomDocument->create_attribute(': 'string name, string value | domattribute', -\ 'DomDocument->create_cdata_section(': 'string content | domcdata', -\ 'DomDocument->create_comment(': 'string content | domcomment', -\ 'DomDocument->create_element(': 'string name | domelement', -\ 'DomDocument->create_element_ns(': 'string uri, string name [, string prefix] | domelement', -\ 'DomDocument->create_entity_reference(': 'string content | domentityreference', -\ 'DomDocument->create_processing_instruction(': 'string content | domprocessinginstruction', -\ 'DomDocument->create_text_node(': 'string content | domtext', -\ 'DomDocument->doctype(': 'void | domdocumenttype', -\ 'DomDocument->document_element(': 'void | domelement', -\ 'DomDocument->dump_file(': 'string filename [, bool compressionmode [, bool format]] | string', -\ 'DomDocument->dump_mem(': '[bool format [, string encoding]] | string', -\ 'DomDocument->get_element_by_id(': 'string id | domelement', -\ 'DomDocument->get_elements_by_tagname(': 'string name | array', -\ 'DomDocument->html_dump_mem(': 'void | string', -\ 'DomDocument->xinclude(': 'void | int', -\ 'dom_import_simplexml(': 'SimpleXMLElement node | DOMElement', -\ 'DomNode->append_sibling(': 'domelement newnode | domelement', -\ 'DomNode->attributes(': 'void | array', -\ 'DomNode->child_nodes(': 'void | array', -\ 'DomNode->clone_node(': 'void | domelement', -\ 'DomNode->dump_node(': 'void | string', -\ 'DomNode->first_child(': 'void | domelement', -\ 'DomNode->get_content(': 'void | string', -\ 'DomNode->has_attributes(': 'void | bool', -\ 'DomNode->has_child_nodes(': 'void | bool', -\ 'DomNode->insert_before(': 'domelement newnode, domelement refnode | domelement', -\ 'DomNode->is_blank_node(': 'void | bool', -\ 'DomNode->last_child(': 'void | domelement', -\ 'DomNode->next_sibling(': 'void | domelement', -\ 'DomNode->node_name(': 'void | string', -\ 'DomNode->node_type(': 'void | int', -\ 'DomNode->node_value(': 'void | string', -\ 'DomNode->owner_document(': 'void | domdocument', -\ 'DomNode->parent_node(': 'void | domnode', -\ 'DomNode->prefix(': 'void | string', -\ 'DomNode->previous_sibling(': 'void | domelement', -\ 'DomNode->remove_child(': 'domtext oldchild | domtext', -\ 'DomNode->replace_child(': 'domelement oldnode, domelement newnode | domelement', -\ 'DomNode->replace_node(': 'domelement newnode | domelement', -\ 'DomNode->set_content(': 'string content | bool', -\ 'DomNode->set_name(': 'void | bool', -\ 'DomNode->set_namespace(': 'string uri [, string prefix] | void', -\ 'DomNode->unlink_node(': 'void | void', -\ 'domxml_new_doc(': 'string version | DomDocument', -\ 'domxml_open_file(': 'string filename [, int mode [, array &error]] | DomDocument', -\ 'domxml_open_mem(': 'string str [, int mode [, array &error]] | DomDocument', -\ 'domxml_version(': 'void | string', -\ 'domxml_xmltree(': 'string str | DomDocument', -\ 'domxml_xslt_stylesheet_doc(': 'DomDocument xsl_doc | DomXsltStylesheet', -\ 'domxml_xslt_stylesheet_file(': 'string xsl_file | DomXsltStylesheet', -\ 'domxml_xslt_stylesheet(': 'string xsl_buf | DomXsltStylesheet', -\ 'domxml_xslt_version(': 'void | int', -\ 'dotnet_load(': 'string assembly_name [, string datatype_name [, int codepage]] | int', -\ 'each(': 'array &array | array', -\ 'easter_date(': '[int year] | int', -\ 'easter_days(': '[int year [, int method]] | int', -\ 'ebcdic2ascii(': 'string ebcdic_str | int', -\ 'echo(': 'string arg1 [, string ...] | void', -\ 'empty(': 'mixed var | bool', -\ 'end(': 'array &array | mixed', -\ 'ereg(': 'string pattern, string string [, array &regs] | int', -\ 'eregi(': 'string pattern, string string [, array &regs] | int', -\ 'eregi_replace(': 'string pattern, string replacement, string string | string', -\ 'ereg_replace(': 'string pattern, string replacement, string string | string', -\ 'error_log(': 'string message [, int message_type [, string destination [, string extra_headers]]] | bool', -\ 'error_reporting(': '[int level] | int', -\ 'escapeshellarg(': 'string arg | string', -\ 'escapeshellcmd(': 'string command | string', -\ 'eval(': 'string code_str | mixed', -\ 'exec(': 'string command [, array &output [, int &return_var]] | string', -\ 'exif_imagetype(': 'string filename | int', -\ 'exif_read_data(': 'string filename [, string sections [, bool arrays [, bool thumbnail]]] | array', -\ 'exif_tagname(': 'string index | string', -\ 'exif_thumbnail(': 'string filename [, int &width [, int &height [, int &imagetype]]] | string', -\ 'exit(': '[string status] | void', -\ 'expect_expectl(': 'resource expect, array cases, string &match | mixed', -\ 'expect_popen(': 'string command | resource', -\ 'exp(': 'float arg | float', -\ 'explode(': 'string separator, string string [, int limit] | array', -\ 'expm1(': 'float number | float', -\ 'extension_loaded(': 'string name | bool', -\ 'extract(': 'array var_array [, int extract_type [, string prefix]] | int', -\ 'ezmlm_hash(': 'string addr | int', -\ 'fam_cancel_monitor(': 'resource fam, resource fam_monitor | bool', -\ 'fam_close(': 'resource fam | void', -\ 'fam_monitor_collection(': 'resource fam, string dirname, int depth, string mask | resource', -\ 'fam_monitor_directory(': 'resource fam, string dirname | resource', -\ 'fam_monitor_file(': 'resource fam, string filename | resource', -\ 'fam_next_event(': 'resource fam | array', -\ 'fam_open(': '[string appname] | resource', -\ 'fam_pending(': 'resource fam | int', -\ 'fam_resume_monitor(': 'resource fam, resource fam_monitor | bool', -\ 'fam_suspend_monitor(': 'resource fam, resource fam_monitor | bool', -\ 'fbsql_affected_rows(': '[resource link_identifier] | int', -\ 'fbsql_autocommit(': 'resource link_identifier [, bool OnOff] | bool', -\ 'fbsql_blob_size(': 'string blob_handle [, resource link_identifier] | int', -\ 'fbsql_change_user(': 'string user, string password [, string database [, resource link_identifier]] | resource', -\ 'fbsql_clob_size(': 'string clob_handle [, resource link_identifier] | int', -\ 'fbsql_close(': '[resource link_identifier] | bool', -\ 'fbsql_commit(': '[resource link_identifier] | bool', -\ 'fbsql_connect(': '[string hostname [, string username [, string password]]] | resource', -\ 'fbsql_create_blob(': 'string blob_data [, resource link_identifier] | string', -\ 'fbsql_create_clob(': 'string clob_data [, resource link_identifier] | string', -\ 'fbsql_create_db(': 'string database_name [, resource link_identifier [, string database_options]] | bool', -\ 'fbsql_database(': 'resource link_identifier [, string database] | string', -\ 'fbsql_database_password(': 'resource link_identifier [, string database_password] | string', -\ 'fbsql_data_seek(': 'resource result_identifier, int row_number | bool', -\ 'fbsql_db_query(': 'string database, string query [, resource link_identifier] | resource', -\ 'fbsql_db_status(': 'string database_name [, resource link_identifier] | int', -\ 'fbsql_drop_db(': 'string database_name [, resource link_identifier] | bool', -\ 'fbsql_errno(': '[resource link_identifier] | int', -\ 'fbsql_error(': '[resource link_identifier] | string', -\ 'fbsql_fetch_array(': 'resource result [, int result_type] | array', -\ 'fbsql_fetch_assoc(': 'resource result | array', -\ 'fbsql_fetch_field(': 'resource result [, int field_offset] | object', -\ 'fbsql_fetch_lengths(': 'resource result | array', -\ 'fbsql_fetch_object(': 'resource result [, int result_type] | object', -\ 'fbsql_fetch_row(': 'resource result | array', -\ 'fbsql_field_flags(': 'resource result [, int field_offset] | string', -\ 'fbsql_field_len(': 'resource result [, int field_offset] | int', -\ 'fbsql_field_name(': 'resource result [, int field_index] | string', -\ 'fbsql_field_seek(': 'resource result [, int field_offset] | bool', -\ 'fbsql_field_table(': 'resource result [, int field_offset] | string', -\ 'fbsql_field_type(': 'resource result [, int field_offset] | string', -\ 'fbsql_free_result(': 'resource result | bool', -\ 'fbsql_get_autostart_info(': '[resource link_identifier] | array', -\ 'fbsql_hostname(': 'resource link_identifier [, string host_name] | string', -\ 'fbsql_insert_id(': '[resource link_identifier] | int', -\ 'fbsql_list_dbs(': '[resource link_identifier] | resource', -\ 'fbsql_list_fields(': 'string database_name, string table_name [, resource link_identifier] | resource', -\ 'fbsql_list_tables(': 'string database [, resource link_identifier] | resource', -\ 'fbsql_next_result(': 'resource result_id | bool', -\ 'fbsql_num_fields(': 'resource result | int', -\ 'fbsql_num_rows(': 'resource result | int', -\ 'fbsql_password(': 'resource link_identifier [, string password] | string', -\ 'fbsql_pconnect(': '[string hostname [, string username [, string password]]] | resource', -\ 'fbsql_query(': 'string query [, resource link_identifier [, int batch_size]] | resource', -\ 'fbsql_read_blob(': 'string blob_handle [, resource link_identifier] | string', -\ 'fbsql_read_clob(': 'string clob_handle [, resource link_identifier] | string', -\ 'fbsql_result(': 'resource result [, int row [, mixed field]] | mixed', -\ 'fbsql_rollback(': '[resource link_identifier] | bool', -\ 'fbsql_select_db(': '[string database_name [, resource link_identifier]] | bool', -\ 'fbsql_set_lob_mode(': 'resource result, string database_name | bool', -\ 'fbsql_set_password(': 'resource link_identifier, string user, string password, string old_password | bool', -\ 'fbsql_set_transaction(': 'resource link_identifier, int Locking, int Isolation | void', -\ 'fbsql_start_db(': 'string database_name [, resource link_identifier [, string database_options]] | bool', -\ 'fbsql_stop_db(': 'string database_name [, resource link_identifier] | bool', -\ 'fbsql_tablename(': 'resource result, int i | string', -\ 'fbsql_username(': 'resource link_identifier [, string username] | string', -\ 'fbsql_warnings(': '[bool OnOff] | bool', -\ 'fclose(': 'resource handle | bool', -\ 'fdf_add_doc_javascript(': 'resource fdfdoc, string script_name, string script_code | bool', -\ 'fdf_add_template(': 'resource fdfdoc, int newpage, string filename, string template, int rename | bool', -\ 'fdf_close(': 'resource fdf_document | void', -\ 'fdf_create(': 'void | resource', -\ 'fdf_enum_values(': 'resource fdfdoc, callback function [, mixed userdata] | bool', -\ 'fdf_errno(': 'void | int', -\ 'fdf_error(': '[int error_code] | string', -\ 'fdf_get_ap(': 'resource fdf_document, string field, int face, string filename | bool', -\ 'fdf_get_attachment(': 'resource fdf_document, string fieldname, string savepath | array', -\ 'fdf_get_encoding(': 'resource fdf_document | string', -\ 'fdf_get_file(': 'resource fdf_document | string', -\ 'fdf_get_flags(': 'resource fdfdoc, string fieldname, int whichflags | int', -\ 'fdf_get_opt(': 'resource fdfdof, string fieldname [, int element] | mixed', -\ 'fdf_get_status(': 'resource fdf_document | string', -\ 'fdf_get_value(': 'resource fdf_document, string fieldname [, int which] | mixed', -\ 'fdf_get_version(': '[resource fdf_document] | string', -\ 'fdf_header(': 'void | void', -\ 'fdf_next_field_name(': 'resource fdf_document [, string fieldname] | string', -\ 'fdf_open(': 'string filename | resource', -\ 'fdf_open_string(': 'string fdf_data | resource', -\ 'fdf_remove_item(': 'resource fdfdoc, string fieldname, int item | bool', -\ 'fdf_save(': 'resource fdf_document [, string filename] | bool', -\ 'fdf_save_string(': 'resource fdf_document | string', -\ 'fdf_set_ap(': 'resource fdf_document, string field_name, int face, string filename, int page_number | bool', -\ 'fdf_set_encoding(': 'resource fdf_document, string encoding | bool', -\ 'fdf_set_file(': 'resource fdf_document, string url [, string target_frame] | bool', -\ 'fdf_set_flags(': 'resource fdf_document, string fieldname, int whichFlags, int newFlags | bool', -\ 'fdf_set_javascript_action(': 'resource fdf_document, string fieldname, int trigger, string script | bool', -\ 'fdf_set_on_import_javascript(': 'resource fdfdoc, string script, bool before_data_import | bool', -\ 'fdf_set_opt(': 'resource fdf_document, string fieldname, int element, string str1, string str2 | bool', -\ 'fdf_set_status(': 'resource fdf_document, string status | bool', -\ 'fdf_set_submit_form_action(': 'resource fdf_document, string fieldname, int trigger, string script, int flags | bool', -\ 'fdf_set_target_frame(': 'resource fdf_document, string frame_name | bool', -\ 'fdf_set_value(': 'resource fdf_document, string fieldname, mixed value [, int isName] | bool', -\ 'fdf_set_version(': 'resource fdf_document, string version | bool', -\ 'feof(': 'resource handle | bool', -\ 'fflush(': 'resource handle | bool', -\ 'fgetc(': 'resource handle | string', -\ 'fgetcsv(': 'resource handle [, int length [, string delimiter [, string enclosure]]] | array', -\ 'fgets(': 'resource handle [, int length] | string', -\ 'fgetss(': 'resource handle [, int length [, string allowable_tags]] | string', -\ 'fileatime(': 'string filename | int', -\ 'filectime(': 'string filename | int', -\ 'file_exists(': 'string filename | bool', -\ 'file_get_contents(': 'string filename [, bool use_include_path [, resource context [, int offset [, int maxlen]]]] | string', -\ 'filegroup(': 'string filename | int', -\ 'file(': 'string filename [, int use_include_path [, resource context]] | array', -\ 'fileinode(': 'string filename | int', -\ 'filemtime(': 'string filename | int', -\ 'fileowner(': 'string filename | int', -\ 'fileperms(': 'string filename | int', -\ 'filepro_fieldcount(': 'void | int', -\ 'filepro_fieldname(': 'int field_number | string', -\ 'filepro_fieldtype(': 'int field_number | string', -\ 'filepro_fieldwidth(': 'int field_number | int', -\ 'filepro(': 'string directory | bool', -\ 'filepro_retrieve(': 'int row_number, int field_number | string', -\ 'filepro_rowcount(': 'void | int', -\ 'file_put_contents(': 'string filename, mixed data [, int flags [, resource context]] | int', -\ 'filesize(': 'string filename | int', -\ 'filetype(': 'string filename | string', -\ 'floatval(': 'mixed var | float', -\ 'flock(': 'resource handle, int operation [, int &wouldblock] | bool', -\ 'floor(': 'float value | float', -\ 'flush(': 'void | void', -\ 'fmod(': 'float x, float y | float', -\ 'fnmatch(': 'string pattern, string string [, int flags] | bool', -\ 'fopen(': 'string filename, string mode [, bool use_include_path [, resource zcontext]] | resource', -\ 'fpassthru(': 'resource handle | int', -\ 'fprintf(': 'resource handle, string format [, mixed args [, mixed ...]] | int', -\ 'fputcsv(': 'resource handle [, array fields [, string delimiter [, string enclosure]]] | int', -\ 'fread(': 'resource handle, int length | string', -\ 'frenchtojd(': 'int month, int day, int year | int', -\ 'fribidi_log2vis(': 'string str, string direction, int charset | string', -\ 'fscanf(': 'resource handle, string format [, mixed &...] | mixed', -\ 'fseek(': 'resource handle, int offset [, int whence] | int', -\ 'fsockopen(': 'string target [, int port [, int &errno [, string &errstr [, float timeout]]]] | resource', -\ 'fstat(': 'resource handle | array', -\ 'ftell(': 'resource handle | int', -\ 'ftok(': 'string pathname, string proj | int', -\ 'ftp_alloc(': 'resource ftp_stream, int filesize [, string &result] | bool', -\ 'ftp_cdup(': 'resource ftp_stream | bool', -\ 'ftp_chdir(': 'resource ftp_stream, string directory | bool', -\ 'ftp_chmod(': 'resource ftp_stream, int mode, string filename | int', -\ 'ftp_close(': 'resource ftp_stream | bool', -\ 'ftp_connect(': 'string host [, int port [, int timeout]] | resource', -\ 'ftp_delete(': 'resource ftp_stream, string path | bool', -\ 'ftp_exec(': 'resource ftp_stream, string command | bool', -\ 'ftp_fget(': 'resource ftp_stream, resource handle, string remote_file, int mode [, int resumepos] | bool', -\ 'ftp_fput(': 'resource ftp_stream, string remote_file, resource handle, int mode [, int startpos] | bool', -\ 'ftp_get(': 'resource ftp_stream, string local_file, string remote_file, int mode [, int resumepos] | bool', -\ 'ftp_get_option(': 'resource ftp_stream, int option | mixed', -\ 'ftp_login(': 'resource ftp_stream, string username, string password | bool', -\ 'ftp_mdtm(': 'resource ftp_stream, string remote_file | int', -\ 'ftp_mkdir(': 'resource ftp_stream, string directory | string', -\ 'ftp_nb_continue(': 'resource ftp_stream | int', -\ 'ftp_nb_fget(': 'resource ftp_stream, resource handle, string remote_file, int mode [, int resumepos] | int', -\ 'ftp_nb_fput(': 'resource ftp_stream, string remote_file, resource handle, int mode [, int startpos] | int', -\ 'ftp_nb_get(': 'resource ftp_stream, string local_file, string remote_file, int mode [, int resumepos] | int', -\ 'ftp_nb_put(': 'resource ftp_stream, string remote_file, string local_file, int mode [, int startpos] | int', -\ 'ftp_nlist(': 'resource ftp_stream, string directory | array', -\ 'ftp_pasv(': 'resource ftp_stream, bool pasv | bool', -\ 'ftp_put(': 'resource ftp_stream, string remote_file, string local_file, int mode [, int startpos] | bool', -\ 'ftp_pwd(': 'resource ftp_stream | string', -\ 'ftp_raw(': 'resource ftp_stream, string command | array', -\ 'ftp_rawlist(': 'resource ftp_stream, string directory [, bool recursive] | array', -\ 'ftp_rename(': 'resource ftp_stream, string oldname, string newname | bool', -\ 'ftp_rmdir(': 'resource ftp_stream, string directory | bool', -\ 'ftp_set_option(': 'resource ftp_stream, int option, mixed value | bool', -\ 'ftp_site(': 'resource ftp_stream, string command | bool', -\ 'ftp_size(': 'resource ftp_stream, string remote_file | int', -\ 'ftp_ssl_connect(': 'string host [, int port [, int timeout]] | resource', -\ 'ftp_systype(': 'resource ftp_stream | string', -\ 'ftruncate(': 'resource handle, int size | bool', -\ 'func_get_arg(': 'int arg_num | mixed', -\ 'func_get_args(': 'void | array', -\ 'func_num_args(': 'void | int', -\ 'function_exists(': 'string function_name | bool', -\ 'fwrite(': 'resource handle, string string [, int length] | int', -\ 'gd_info(': 'void | array', -\ 'getallheaders(': 'void | array', -\ 'get_browser(': '[string user_agent [, bool return_array]] | mixed', -\ 'get_cfg_var(': 'string varname | string', -\ 'get_class(': '[object obj] | string', -\ 'get_class_methods(': 'mixed class_name | array', -\ 'get_class_vars(': 'string class_name | array', -\ 'get_current_user(': 'void | string', -\ 'getcwd(': 'void | string', -\ 'getdate(': '[int timestamp] | array', -\ 'get_declared_classes(': 'void | array', -\ 'get_declared_interfaces(': 'void | array', -\ 'get_defined_constants(': '[mixed categorize] | array', -\ 'get_defined_functions(': 'void | array', -\ 'get_defined_vars(': 'void | array', -\ 'getenv(': 'string varname | string', -\ 'get_extension_funcs(': 'string module_name | array', -\ 'get_headers(': 'string url [, int format] | array', -\ 'gethostbyaddr(': 'string ip_address | string', -\ 'gethostbyname(': 'string hostname | string', -\ 'gethostbynamel(': 'string hostname | array', -\ 'get_html_translation_table(': '[int table [, int quote_style]] | array', -\ 'getimagesize(': 'string filename [, array &imageinfo] | array', -\ 'get_included_files(': 'void | array', -\ 'get_include_path(': 'void | string', -\ 'getlastmod(': 'void | int', -\ 'get_loaded_extensions(': 'void | array', -\ 'get_magic_quotes_gpc(': 'void | int', -\ 'get_magic_quotes_runtime(': 'void | int', -\ 'get_meta_tags(': 'string filename [, bool use_include_path] | array', -\ 'getmxrr(': 'string hostname, array &mxhosts [, array &weight] | bool', -\ 'getmygid(': 'void | int', -\ 'getmyinode(': 'void | int', -\ 'getmypid(': 'void | int', -\ 'getmyuid(': 'void | int', -\ 'get_object_vars(': 'object obj | array', -\ 'getopt(': 'string options | array', -\ 'get_parent_class(': '[mixed obj] | string', -\ 'getprotobyname(': 'string name | int', -\ 'getprotobynumber(': 'int number | string', -\ 'getrandmax(': 'void | int', -\ 'get_resource_type(': 'resource handle | string', -\ 'getrusage(': '[int who] | array', -\ 'getservbyname(': 'string service, string protocol | int', -\ 'getservbyport(': 'int port, string protocol | string', -\ 'gettext(': 'string message | string', -\ 'gettimeofday(': '[bool return_float] | mixed', -\ 'gettype(': 'mixed var | string', -\ 'glob(': 'string pattern [, int flags] | array', -\ 'gmdate(': 'string format [, int timestamp] | string', -\ 'gmmktime(': '[int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] | int', -\ 'gmp_abs(': 'resource a | resource', -\ 'gmp_add(': 'resource a, resource b | resource', -\ 'gmp_and(': 'resource a, resource b | resource', -\ 'gmp_clrbit(': 'resource &a, int index | void', -\ 'gmp_cmp(': 'resource a, resource b | int', -\ 'gmp_com(': 'resource a | resource', -\ 'gmp_divexact(': 'resource n, resource d | resource', -\ 'gmp_div_q(': 'resource a, resource b [, int round] | resource', -\ 'gmp_div_qr(': 'resource n, resource d [, int round] | array', -\ 'gmp_div_r(': 'resource n, resource d [, int round] | resource', -\ 'gmp_fact(': 'int a | resource', -\ 'gmp_gcdext(': 'resource a, resource b | array', -\ 'gmp_gcd(': 'resource a, resource b | resource', -\ 'gmp_hamdist(': 'resource a, resource b | int', -\ 'gmp_init(': 'mixed number [, int base] | resource', -\ 'gmp_intval(': 'resource gmpnumber | int', -\ 'gmp_invert(': 'resource a, resource b | resource', -\ 'gmp_jacobi(': 'resource a, resource p | int', -\ 'gmp_legendre(': 'resource a, resource p | int', -\ 'gmp_mod(': 'resource n, resource d | resource', -\ 'gmp_mul(': 'resource a, resource b | resource', -\ 'gmp_neg(': 'resource a | resource', -\ 'gmp_or(': 'resource a, resource b | resource', -\ 'gmp_perfect_square(': 'resource a | bool', -\ 'gmp_popcount(': 'resource a | int', -\ 'gmp_pow(': 'resource base, int exp | resource', -\ 'gmp_powm(': 'resource base, resource exp, resource mod | resource', -\ 'gmp_prob_prime(': 'resource a [, int reps] | int', -\ 'gmp_random(': 'int limiter | resource', -\ 'gmp_scan0(': 'resource a, int start | int', -\ 'gmp_scan1(': 'resource a, int start | int', -\ 'gmp_setbit(': 'resource &a, int index [, bool set_clear] | void', -\ 'gmp_sign(': 'resource a | int', -\ 'gmp_sqrt(': 'resource a | resource', -\ 'gmp_sqrtrem(': 'resource a | array', -\ 'gmp_strval(': 'resource gmpnumber [, int base] | string', -\ 'gmp_sub(': 'resource a, resource b | resource', -\ 'gmp_xor(': 'resource a, resource b | resource', -\ 'gmstrftime(': 'string format [, int timestamp] | string', -\ 'gnupg_adddecryptkey(': 'resource identifier, string fingerprint, string passphrase | bool', -\ 'gnupg_addencryptkey(': 'resource identifier, string fingerprint | bool', -\ 'gnupg_addsignkey(': 'resource identifier, string fingerprint [, string passphrase] | bool', -\ 'gnupg_cleardecryptkeys(': 'resource identifier | bool', -\ 'gnupg_clearencryptkeys(': 'resource identifier | bool', -\ 'gnupg_clearsignkeys(': 'resource identifier | bool', -\ 'gnupg_decrypt(': 'resource identifier, string text | string', -\ 'gnupg_decryptverify(': 'resource identifier, string text, string plaintext | array', -\ 'gnupg_encrypt(': 'resource identifier, string plaintext | string', -\ 'gnupg_encryptsign(': 'resource identifier, string plaintext | string', -\ 'gnupg_export(': 'resource identifier, string fingerprint | string', -\ 'gnupg_geterror(': 'resource identifier | string', -\ 'gnupg_getprotocol(': 'resource identifier | int', -\ 'gnupg_import(': 'resource identifier, string keydata | array', -\ 'gnupg_keyinfo(': 'resource identifier, string pattern | array', -\ 'gnupg_setarmor(': 'resource identifier, int armor | bool', -\ 'gnupg_seterrormode(': 'resource identifier, int errormode | void', -\ 'gnupg_setsignmode(': 'resource identifier, int signmode | bool', -\ 'gnupg_sign(': 'resource identifier, string plaintext | string', -\ 'gnupg_verify(': 'resource identifier, string signed_text, string signature [, string plaintext] | array', -\ 'gopher_parsedir(': 'string dirent | array', -\ 'gregoriantojd(': 'int month, int day, int year | int', -\ 'gzclose(': 'resource zp | bool', -\ 'gzcompress(': 'string data [, int level] | string', -\ 'gzdeflate(': 'string data [, int level] | string', -\ 'gzencode(': 'string data [, int level [, int encoding_mode]] | string', -\ 'gzeof(': 'resource zp | int', -\ 'gzfile(': 'string filename [, int use_include_path] | array', -\ 'gzgetc(': 'resource zp | string', -\ 'gzgets(': 'resource zp, int length | string', -\ 'gzgetss(': 'resource zp, int length [, string allowable_tags] | string', -\ 'gzinflate(': 'string data [, int length] | string', -\ 'gzopen(': 'string filename, string mode [, int use_include_path] | resource', -\ 'gzpassthru(': 'resource zp | int', -\ 'gzread(': 'resource zp, int length | string', -\ 'gzrewind(': 'resource zp | bool', -\ 'gzseek(': 'resource zp, int offset | int', -\ 'gztell(': 'resource zp | int', -\ 'gzuncompress(': 'string data [, int length] | string', -\ 'gzwrite(': 'resource zp, string string [, int length] | int', -\ '__halt_compiler(': 'void | void', -\ 'hash_algos(': 'void | array', -\ 'hash_file(': 'string algo, string filename [, bool raw_output] | string', -\ 'hash_final(': 'resource context [, bool raw_output] | string', -\ 'hash_hmac_file(': 'string algo, string filename, string key [, bool raw_output] | string', -\ 'hash_hmac(': 'string algo, string data, string key [, bool raw_output] | string', -\ 'hash(': 'string algo, string data [, bool raw_output] | string', -\ 'hash_init(': 'string algo [, int options, string key] | resource', -\ 'hash_update_file(': 'resource context, string filename [, resource context] | bool', -\ 'hash_update(': 'resource context, string data | bool', -\ 'hash_update_stream(': 'resource context, resource handle [, int length] | int', -\ 'header(': 'string string [, bool replace [, int http_response_code]] | void', -\ 'headers_list(': 'void | array', -\ 'headers_sent(': '[string &file [, int &line]] | bool', -\ 'hebrevc(': 'string hebrew_text [, int max_chars_per_line] | string', -\ 'hebrev(': 'string hebrew_text [, int max_chars_per_line] | string', -\ 'hexdec(': 'string hex_string | number', -\ 'highlight_file(': 'string filename [, bool return] | mixed', -\ 'highlight_string(': 'string str [, bool return] | mixed', -\ 'htmlentities(': 'string string [, int quote_style [, string charset]] | string', -\ 'html_entity_decode(': 'string string [, int quote_style [, string charset]] | string', -\ 'htmlspecialchars_decode(': 'string string [, int quote_style] | string', -\ 'htmlspecialchars(': 'string string [, int quote_style [, string charset]] | string', -\ 'http_build_query(': 'array formdata [, string numeric_prefix] | string', -\ 'hw_api_attribute(': '[string name [, string value]] | HW_API_Attribute', -\ 'hw_api_attribute->key(': 'void | string', -\ 'hw_api_attribute->langdepvalue(': 'string language | string', -\ 'hw_api_attribute->value(': 'void | string', -\ 'hw_api_attribute->values(': 'void | array', -\ 'hw_api->checkin(': 'array parameter | bool', -\ 'hw_api->checkout(': 'array parameter | bool', -\ 'hw_api->children(': 'array parameter | array', -\ 'hw_api->content(': 'array parameter | HW_API_Content', -\ 'hw_api_content->mimetype(': 'void | string', -\ 'hw_api_content->read(': 'string buffer, int len | string', -\ 'hw_api->copy(': 'array parameter | hw_api_object', -\ 'hw_api->dbstat(': 'array parameter | hw_api_object', -\ 'hw_api->dcstat(': 'array parameter | hw_api_object', -\ 'hw_api->dstanchors(': 'array parameter | array', -\ 'hw_api->dstofsrcanchor(': 'array parameter | hw_api_object', -\ 'hw_api_error->count(': 'void | int', -\ 'hw_api_error->reason(': 'void | HW_API_Reason', -\ 'hw_api->find(': 'array parameter | array', -\ 'hw_api->ftstat(': 'array parameter | hw_api_object', -\ 'hwapi_hgcsp(': 'string hostname [, int port] | HW_API', -\ 'hw_api->hwstat(': 'array parameter | hw_api_object', -\ 'hw_api->identify(': 'array parameter | bool', -\ 'hw_api->info(': 'array parameter | array', -\ 'hw_api->insertanchor(': 'array parameter | hw_api_object', -\ 'hw_api->insertcollection(': 'array parameter | hw_api_object', -\ 'hw_api->insertdocument(': 'array parameter | hw_api_object', -\ 'hw_api->insert(': 'array parameter | hw_api_object', -\ 'hw_api->link(': 'array parameter | bool', -\ 'hw_api->lock(': 'array parameter | bool', -\ 'hw_api->move(': 'array parameter | bool', -\ 'hw_api_content(': 'string content, string mimetype | HW_API_Content', -\ 'hw_api_object->assign(': 'array parameter | bool', -\ 'hw_api_object->attreditable(': 'array parameter | bool', -\ 'hw_api->objectbyanchor(': 'array parameter | hw_api_object', -\ 'hw_api_object->count(': 'array parameter | int', -\ 'hw_api->object(': 'array parameter | hw_api_object', -\ 'hw_api_object->insert(': 'HW_API_Attribute attribute | bool', -\ 'hw_api_object(': 'array parameter | hw_api_object', -\ 'hw_api_object->remove(': 'string name | bool', -\ 'hw_api_object->title(': 'array parameter | string', -\ 'hw_api_object->value(': 'string name | string', -\ 'hw_api->parents(': 'array parameter | array', -\ 'hw_api_reason->description(': 'void | string', -\ 'hw_api_reason->type(': 'void | HW_API_Reason', -\ 'hw_api->remove(': 'array parameter | bool', -\ 'hw_api->replace(': 'array parameter | hw_api_object', -\ 'hw_api->setcommittedversion(': 'array parameter | hw_api_object', -\ 'hw_api->srcanchors(': 'array parameter | array', -\ 'hw_api->srcsofdst(': 'array parameter | array', -\ 'hw_api->unlock(': 'array parameter | bool', -\ 'hw_api->user(': 'array parameter | hw_api_object', -\ 'hw_api->userlist(': 'array parameter | array', -\ 'hw_array2objrec(': 'array object_array | string', -\ 'hw_changeobject(': 'int link, int objid, array attributes | bool', -\ 'hw_children(': 'int connection, int objectID | array', -\ 'hw_childrenobj(': 'int connection, int objectID | array', -\ 'hw_close(': 'int connection | bool', -\ 'hw_connect(': 'string host, int port [, string username, string password] | int', -\ 'hw_connection_info(': 'int link | void', -\ 'hw_cp(': 'int connection, array object_id_array, int destination_id | int', -\ 'hw_deleteobject(': 'int connection, int object_to_delete | bool', -\ 'hw_docbyanchor(': 'int connection, int anchorID | int', -\ 'hw_docbyanchorobj(': 'int connection, int anchorID | string', -\ 'hw_document_attributes(': 'int hw_document | string', -\ 'hw_document_bodytag(': 'int hw_document [, string prefix] | string', -\ 'hw_document_content(': 'int hw_document | string', -\ 'hw_document_setcontent(': 'int hw_document, string content | bool', -\ 'hw_document_size(': 'int hw_document | int', -\ 'hw_dummy(': 'int link, int id, int msgid | string', -\ 'hw_edittext(': 'int connection, int hw_document | bool', -\ 'hw_error(': 'int connection | int', -\ 'hw_errormsg(': 'int connection | string', -\ 'hw_free_document(': 'int hw_document | bool', -\ 'hw_getanchors(': 'int connection, int objectID | array', -\ 'hw_getanchorsobj(': 'int connection, int objectID | array', -\ 'hw_getandlock(': 'int connection, int objectID | string', -\ 'hw_getchildcoll(': 'int connection, int objectID | array', -\ 'hw_getchildcollobj(': 'int connection, int objectID | array', -\ 'hw_getchilddoccoll(': 'int connection, int objectID | array', -\ 'hw_getchilddoccollobj(': 'int connection, int objectID | array', -\ 'hw_getobjectbyquerycoll(': 'int connection, int objectID, string query, int max_hits | array', -\ 'hw_getobjectbyquerycollobj(': 'int connection, int objectID, string query, int max_hits | array', -\ 'hw_getobjectbyquery(': 'int connection, string query, int max_hits | array', -\ 'hw_getobjectbyqueryobj(': 'int connection, string query, int max_hits | array', -\ 'hw_getobject(': 'int connection, mixed objectID [, string query] | mixed', -\ 'hw_getparents(': 'int connection, int objectID | array', -\ 'hw_getparentsobj(': 'int connection, int objectID | array', -\ 'hw_getrellink(': 'int link, int rootid, int sourceid, int destid | string', -\ 'hw_getremotechildren(': 'int connection, string object_record | mixed', -\ 'hw_getremote(': 'int connection, int objectID | int', -\ 'hw_getsrcbydestobj(': 'int connection, int objectID | array', -\ 'hw_gettext(': 'int connection, int objectID [, mixed rootID/prefix] | int', -\ 'hw_getusername(': 'int connection | string', -\ 'hw_identify(': 'int link, string username, string password | string', -\ 'hw_incollections(': 'int connection, array object_id_array, array collection_id_array, int return_collections | array', -\ 'hw_info(': 'int connection | string', -\ 'hw_inscoll(': 'int connection, int objectID, array object_array | int', -\ 'hw_insdoc(': 'resource connection, int parentID, string object_record [, string text] | int', -\ 'hw_insertanchors(': 'int hwdoc, array anchorecs, array dest [, array urlprefixes] | bool', -\ 'hw_insertdocument(': 'int connection, int parent_id, int hw_document | int', -\ 'hw_insertobject(': 'int connection, string object_rec, string parameter | int', -\ 'hw_mapid(': 'int connection, int server_id, int object_id | int', -\ 'hw_modifyobject(': 'int connection, int object_to_change, array remove, array add [, int mode] | bool', -\ 'hw_mv(': 'int connection, array object_id_array, int source_id, int destination_id | int', -\ 'hw_new_document(': 'string object_record, string document_data, int document_size | int', -\ 'hw_objrec2array(': 'string object_record [, array format] | array', -\ 'hw_output_document(': 'int hw_document | bool', -\ 'hw_pconnect(': 'string host, int port [, string username, string password] | int', -\ 'hw_pipedocument(': 'int connection, int objectID [, array url_prefixes] | int', -\ 'hw_root(': ' | int', -\ 'hw_setlinkroot(': 'int link, int rootid | int', -\ 'hw_stat(': 'int link | string', -\ 'hw_unlock(': 'int connection, int objectID | bool', -\ 'hw_who(': 'int connection | array', -\ 'hypot(': 'float x, float y | float', -\ 'i18n_loc_get_default(': 'void | string', -\ 'i18n_loc_set_default(': 'string name | bool', -\ 'ibase_add_user(': 'resource service_handle, string user_name, string password [, string first_name [, string middle_name [, string last_name]]] | bool', -\ 'ibase_affected_rows(': '[resource link_identifier] | int', -\ 'ibase_backup(': 'resource service_handle, string source_db, string dest_file [, int options [, bool verbose]] | mixed', -\ 'ibase_blob_add(': 'resource blob_handle, string data | void', -\ 'ibase_blob_cancel(': 'resource blob_handle | bool', -\ 'ibase_blob_close(': 'resource blob_handle | mixed', -\ 'ibase_blob_create(': '[resource link_identifier] | resource', -\ 'ibase_blob_echo(': 'resource link_identifier, string blob_id | bool', -\ 'ibase_blob_get(': 'resource blob_handle, int len | string', -\ 'ibase_blob_import(': 'resource link_identifier, resource file_handle | string', -\ 'ibase_blob_info(': 'resource link_identifier, string blob_id | array', -\ 'ibase_blob_open(': 'resource link_identifier, string blob_id | resource', -\ 'ibase_close(': '[resource connection_id] | bool', -\ 'ibase_commit(': '[resource link_or_trans_identifier] | bool', -\ 'ibase_commit_ret(': '[resource link_or_trans_identifier] | bool', -\ 'ibase_connect(': '[string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role [, int sync]]]]]]]] | resource', -\ 'ibase_db_info(': 'resource service_handle, string db, int action [, int argument] | string', -\ 'ibase_delete_user(': 'resource service_handle, string user_name | bool', -\ 'ibase_drop_db(': '[resource connection] | bool', -\ 'ibase_errcode(': 'void | int', -\ 'ibase_errmsg(': 'void | string', -\ 'ibase_execute(': 'resource query [, mixed bind_arg [, mixed ...]] | resource', -\ 'ibase_fetch_assoc(': 'resource result [, int fetch_flag] | array', -\ 'ibase_fetch_object(': 'resource result_id [, int fetch_flag] | object', -\ 'ibase_fetch_row(': 'resource result_identifier [, int fetch_flag] | array', -\ 'ibase_field_info(': 'resource result, int field_number | array', -\ 'ibase_free_event_handler(': 'resource event | bool', -\ 'ibase_free_query(': 'resource query | bool', -\ 'ibase_free_result(': 'resource result_identifier | bool', -\ 'ibase_gen_id(': 'string generator [, int increment [, resource link_identifier]] | mixed', -\ 'ibase_maintain_db(': 'resource service_handle, string db, int action [, int argument] | bool', -\ 'ibase_modify_user(': 'resource service_handle, string user_name, string password [, string first_name [, string middle_name [, string last_name]]] | bool', -\ 'ibase_name_result(': 'resource result, string name | bool', -\ 'ibase_num_fields(': 'resource result_id | int', -\ 'ibase_num_params(': 'resource query | int', -\ 'ibase_param_info(': 'resource query, int param_number | array', -\ 'ibase_pconnect(': '[string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role [, int sync]]]]]]]] | resource', -\ 'ibase_prepare(': 'string query | resource', -\ 'ibase_query(': '[resource link_identifier, string query [, int bind_args]] | resource', -\ 'ibase_restore(': 'resource service_handle, string source_file, string dest_db [, int options [, bool verbose]] | mixed', -\ 'ibase_rollback(': '[resource link_or_trans_identifier] | bool', -\ 'ibase_rollback_ret(': '[resource link_or_trans_identifier] | bool', -\ 'ibase_server_info(': 'resource service_handle, int action | string', -\ 'ibase_service_attach(': 'string host, string dba_username, string dba_password | resource', -\ 'ibase_service_detach(': 'resource service_handle | bool', -\ 'ibase_set_event_handler(': 'callback event_handler, string event_name1 [, string event_name2 [, string ...]] | resource', -\ 'ibase_timefmt(': 'string format [, int columntype] | int', -\ 'ibase_trans(': '[int trans_args [, resource link_identifier]] | resource', -\ 'ibase_wait_event(': 'string event_name1 [, string event_name2 [, string ...]] | string', -\ 'icap_close(': 'int icap_stream [, int flags] | int', -\ 'icap_create_calendar(': 'int stream_id, string calendar | string', -\ 'icap_delete_calendar(': 'int stream_id, string calendar | string', -\ 'icap_delete_event(': 'int stream_id, int uid | string', -\ 'icap_fetch_event(': 'int stream_id, int event_id [, int options] | int', -\ 'icap_list_alarms(': 'int stream_id, array date, array time | int', -\ 'icap_list_events(': 'int stream_id, int begin_date [, int end_date] | array', -\ 'icap_open(': 'string calendar, string username, string password, string options | resource', -\ 'icap_rename_calendar(': 'int stream_id, string old_name, string new_name | string', -\ 'icap_reopen(': 'int stream_id, string calendar [, int options] | int', -\ 'icap_snooze(': 'int stream_id, int uid | string', -\ 'icap_store_event(': 'int stream_id, object event | string', -\ 'iconv_get_encoding(': '[string type] | mixed', -\ 'iconv(': 'string in_charset, string out_charset, string str | string', -\ 'iconv_mime_decode_headers(': 'string encoded_headers [, int mode [, string charset]] | array', -\ 'iconv_mime_decode(': 'string encoded_header [, int mode [, string charset]] | string', -\ 'iconv_mime_encode(': 'string field_name, string field_value [, array preferences] | string', -\ 'iconv_set_encoding(': 'string type, string charset | bool', -\ 'iconv_strlen(': 'string str [, string charset] | int', -\ 'iconv_strpos(': 'string haystack, string needle [, int offset [, string charset]] | int', -\ 'iconv_strrpos(': 'string haystack, string needle [, string charset] | int', -\ 'iconv_substr(': 'string str, int offset [, int length [, string charset]] | string', -\ 'id3_get_frame_long_name(': 'string frameId | string', -\ 'id3_get_frame_short_name(': 'string frameId | string', -\ 'id3_get_genre_id(': 'string genre | int', -\ 'id3_get_genre_list(': 'void | array', -\ 'id3_get_genre_name(': 'int genre_id | string', -\ 'id3_get_tag(': 'string filename [, int version] | array', -\ 'id3_get_version(': 'string filename | int', -\ 'id3_remove_tag(': 'string filename [, int version] | bool', -\ 'id3_set_tag(': 'string filename, array tag [, int version] | bool', -\ 'idate(': 'string format [, int timestamp] | int', -\ 'ifx_affected_rows(': 'int result_id | int', -\ 'ifx_blobinfile_mode(': 'int mode | void', -\ 'ifx_byteasvarchar(': 'int mode | void', -\ 'ifx_close(': '[int link_identifier] | int', -\ 'ifx_connect(': '[string database [, string userid [, string password]]] | int', -\ 'ifx_copy_blob(': 'int bid | int', -\ 'ifx_create_blob(': 'int type, int mode, string param | int', -\ 'ifx_create_char(': 'string param | int', -\ 'ifx_do(': 'int result_id | int', -\ 'ifx_error(': 'void | string', -\ 'ifx_errormsg(': '[int errorcode] | string', -\ 'ifx_fetch_row(': 'int result_id [, mixed position] | array', -\ 'ifx_fieldproperties(': 'int result_id | array', -\ 'ifx_fieldtypes(': 'int result_id | array', -\ 'ifx_free_blob(': 'int bid | int', -\ 'ifx_free_char(': 'int bid | int', -\ 'ifx_free_result(': 'int result_id | int', -\ 'ifx_get_blob(': 'int bid | int', -\ 'ifx_get_char(': 'int bid | int', -\ 'ifx_getsqlca(': 'int result_id | array', -\ 'ifx_htmltbl_result(': 'int result_id [, string html_table_options] | int', -\ 'ifx_nullformat(': 'int mode | void', -\ 'ifx_num_fields(': 'int result_id | int', -\ 'ifx_num_rows(': 'int result_id | int', -\ 'ifx_pconnect(': '[string database [, string userid [, string password]]] | int', -\ 'ifx_prepare(': 'string query, int conn_id [, int cursor_def, mixed blobidarray] | int', -\ 'ifx_query(': 'string query, int link_identifier [, int cursor_type [, mixed blobidarray]] | int', -\ 'ifx_textasvarchar(': 'int mode | void', -\ 'ifx_update_blob(': 'int bid, string content | bool', -\ 'ifx_update_char(': 'int bid, string content | int', -\ 'ifxus_close_slob(': 'int bid | int', -\ 'ifxus_create_slob(': 'int mode | int', -\ 'ifxus_free_slob(': 'int bid | int', -\ 'ifxus_open_slob(': 'int bid, int mode | int', -\ 'ifxus_read_slob(': 'int bid, int nbytes | int', -\ 'ifxus_seek_slob(': 'int bid, int mode, int offset | int', -\ 'ifxus_tell_slob(': 'int bid | int', -\ 'ifxus_write_slob(': 'int bid, string content | int', -\ 'ignore_user_abort(': '[bool setting] | int', -\ 'iis_add_server(': 'string path, string comment, string server_ip, int port, string host_name, int rights, int start_server | int', -\ 'iis_get_dir_security(': 'int server_instance, string virtual_path | int', -\ 'iis_get_script_map(': 'int server_instance, string virtual_path, string script_extension | string', -\ 'iis_get_server_by_comment(': 'string comment | int', -\ 'iis_get_server_by_path(': 'string path | int', -\ 'iis_get_server_rights(': 'int server_instance, string virtual_path | int', -\ 'iis_get_service_state(': 'string service_id | int', -\ 'iis_remove_server(': 'int server_instance | int', -\ 'iis_set_app_settings(': 'int server_instance, string virtual_path, string application_scope | int', -\ 'iis_set_dir_security(': 'int server_instance, string virtual_path, int directory_flags | int', -\ 'iis_set_script_map(': 'int server_instance, string virtual_path, string script_extension, string engine_path, int allow_scripting | int', -\ 'iis_set_server_rights(': 'int server_instance, string virtual_path, int directory_flags | int', -\ 'iis_start_server(': 'int server_instance | int', -\ 'iis_start_service(': 'string service_id | int', -\ 'iis_stop_server(': 'int server_instance | int', -\ 'iis_stop_service(': 'string service_id | int', -\ 'image2wbmp(': 'resource image [, string filename [, int threshold]] | int', -\ 'imagealphablending(': 'resource image, bool blendmode | bool', -\ 'imageantialias(': 'resource im, bool on | bool', -\ 'imagearc(': 'resource image, int cx, int cy, int w, int h, int s, int e, int color | bool', -\ 'imagechar(': 'resource image, int font, int x, int y, string c, int color | bool', -\ 'imagecharup(': 'resource image, int font, int x, int y, string c, int color | bool', -\ 'imagecolorallocatealpha(': 'resource image, int red, int green, int blue, int alpha | int', -\ 'imagecolorallocate(': 'resource image, int red, int green, int blue | int', -\ 'imagecolorat(': 'resource image, int x, int y | int', -\ 'imagecolorclosestalpha(': 'resource image, int red, int green, int blue, int alpha | int', -\ 'imagecolorclosest(': 'resource image, int red, int green, int blue | int', -\ 'imagecolorclosesthwb(': 'resource image, int red, int green, int blue | int', -\ 'imagecolordeallocate(': 'resource image, int color | bool', -\ 'imagecolorexactalpha(': 'resource image, int red, int green, int blue, int alpha | int', -\ 'imagecolorexact(': 'resource image, int red, int green, int blue | int', -\ 'imagecolormatch(': 'resource image1, resource image2 | bool', -\ 'imagecolorresolvealpha(': 'resource image, int red, int green, int blue, int alpha | int', -\ 'imagecolorresolve(': 'resource image, int red, int green, int blue | int', -\ 'imagecolorset(': 'resource image, int index, int red, int green, int blue | void', -\ 'imagecolorsforindex(': 'resource image, int index | array', -\ 'imagecolorstotal(': 'resource image | int', -\ 'imagecolortransparent(': 'resource image [, int color] | int', -\ 'imageconvolution(': 'resource image, array matrix3x3, float div, float offset | bool', -\ 'imagecopy(': 'resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h | bool', -\ 'imagecopymergegray(': 'resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct | bool', -\ 'imagecopymerge(': 'resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct | bool', -\ 'imagecopyresampled(': 'resource dst_image, resource src_image, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h | bool', -\ 'imagecopyresized(': 'resource dst_image, resource src_image, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h | bool', -\ 'imagecreatefromgd2(': 'string filename | resource', -\ 'imagecreatefromgd2part(': 'string filename, int srcX, int srcY, int width, int height | resource', -\ 'imagecreatefromgd(': 'string filename | resource', -\ 'imagecreatefromgif(': 'string filename | resource', -\ 'imagecreatefromjpeg(': 'string filename | resource', -\ 'imagecreatefrompng(': 'string filename | resource', -\ 'imagecreatefromstring(': 'string image | resource', -\ 'imagecreatefromwbmp(': 'string filename | resource', -\ 'imagecreatefromxbm(': 'string filename | resource', -\ 'imagecreatefromxpm(': 'string filename | resource', -\ 'imagecreate(': 'int x_size, int y_size | resource', -\ 'imagecreatetruecolor(': 'int x_size, int y_size | resource', -\ 'imagedashedline(': 'resource image, int x1, int y1, int x2, int y2, int color | bool', -\ 'imagedestroy(': 'resource image | bool', -\ 'imageellipse(': 'resource image, int cx, int cy, int w, int h, int color | bool', -\ 'imagefilledarc(': 'resource image, int cx, int cy, int w, int h, int s, int e, int color, int style | bool', -\ 'imagefilledellipse(': 'resource image, int cx, int cy, int w, int h, int color | bool', -\ 'imagefilledpolygon(': 'resource image, array points, int num_points, int color | bool', -\ 'imagefilledrectangle(': 'resource image, int x1, int y1, int x2, int y2, int color | bool', -\ 'imagefill(': 'resource image, int x, int y, int color | bool', -\ 'imagefilltoborder(': 'resource image, int x, int y, int border, int color | bool', -\ 'imagefilter(': 'resource src_im, int filtertype [, int arg1 [, int arg2 [, int arg3]]] | bool', -\ 'imagefontheight(': 'int font | int', -\ 'imagefontwidth(': 'int font | int', -\ 'imageftbbox(': 'float size, float angle, string font_file, string text [, array extrainfo] | array', -\ 'imagefttext(': 'resource image, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo] | array', -\ 'imagegammacorrect(': 'resource image, float inputgamma, float outputgamma | bool', -\ 'imagegd2(': 'resource image [, string filename [, int chunk_size [, int type]]] | bool', -\ 'imagegd(': 'resource image [, string filename] | bool', -\ 'imagegif(': 'resource image [, string filename] | bool', -\ 'imageinterlace(': 'resource image [, int interlace] | int', -\ 'imageistruecolor(': 'resource image | bool', -\ 'imagejpeg(': 'resource image [, string filename [, int quality]] | bool', -\ 'imagelayereffect(': 'resource image, int effect | bool', -\ 'imageline(': 'resource image, int x1, int y1, int x2, int y2, int color | bool', -\ 'imageloadfont(': 'string file | int', -\ 'imagepalettecopy(': 'resource destination, resource source | void', -\ 'imagepng(': 'resource image [, string filename] | bool', -\ 'imagepolygon(': 'resource image, array points, int num_points, int color | bool', -\ 'imagepsbbox(': 'string text, int font, int size [, int space, int tightness, float angle] | array', -\ 'imagepscopyfont(': 'resource fontindex | int', -\ 'imagepsencodefont(': 'resource font_index, string encodingfile | bool', -\ 'imagepsextendfont(': 'int font_index, float extend | bool', -\ 'imagepsfreefont(': 'resource fontindex | bool', -\ 'imagepsloadfont(': 'string filename | resource', -\ 'imagepsslantfont(': 'resource font_index, float slant | bool', -\ 'imagepstext(': 'resource image, string text, resource font, int size, int foreground, int background, int x, int y [, int space, int tightness, float angle, int antialias_steps] | array', -\ 'imagerectangle(': 'resource image, int x1, int y1, int x2, int y2, int col | bool', -\ 'imagerotate(': 'resource src_im, float angle, int bgd_color [, int ignore_transparent] | resource', -\ 'imagesavealpha(': 'resource image, bool saveflag | bool', -\ 'imagesetbrush(': 'resource image, resource brush | bool', -\ 'imagesetpixel(': 'resource image, int x, int y, int color | bool', -\ 'imagesetstyle(': 'resource image, array style | bool', -\ 'imagesetthickness(': 'resource image, int thickness | bool', -\ 'imagesettile(': 'resource image, resource tile | bool', -\ 'imagestring(': 'resource image, int font, int x, int y, string s, int col | bool', -\ 'imagestringup(': 'resource image, int font, int x, int y, string s, int col | bool', -\ 'imagesx(': 'resource image | int', -\ 'imagesy(': 'resource image | int', -\ 'imagetruecolortopalette(': 'resource image, bool dither, int ncolors | bool', -\ 'imagettfbbox(': 'float size, float angle, string fontfile, string text | array', -\ 'imagettftext(': 'resource image, float size, float angle, int x, int y, int color, string fontfile, string text | array', -\ 'imagetypes(': 'void | int', -\ 'image_type_to_extension(': 'int imagetype [, bool include_dot] | string', -\ 'image_type_to_mime_type(': 'int imagetype | string', -\ 'imagewbmp(': 'resource image [, string filename [, int foreground]] | bool', -\ 'imagexbm(': 'resource image, string filename [, int foreground] | bool', -\ 'imap_8bit(': 'string string | string', -\ 'imap_alerts(': 'void | array', -\ 'imap_append(': 'resource imap_stream, string mbox, string message [, string options] | bool', -\ 'imap_base64(': 'string text | string', -\ 'imap_binary(': 'string string | string', -\ 'imap_body(': 'resource imap_stream, int msg_number [, int options] | string', -\ 'imap_bodystruct(': 'resource stream_id, int msg_no, string section | object', -\ 'imap_check(': 'resource imap_stream | object', -\ 'imap_clearflag_full(': 'resource stream, string sequence, string flag [, string options] | bool', -\ 'imap_close(': 'resource imap_stream [, int flag] | bool', -\ 'imap_createmailbox(': 'resource imap_stream, string mbox | bool', -\ 'imap_delete(': 'int imap_stream, int msg_number [, int options] | bool', -\ 'imap_deletemailbox(': 'resource imap_stream, string mbox | bool', -\ 'imap_errors(': 'void | array', -\ 'imap_expunge(': 'resource imap_stream | bool', -\ 'imap_fetchbody(': 'resource imap_stream, int msg_number, string part_number [, int options] | string', -\ 'imap_fetchheader(': 'resource imap_stream, int msgno [, int options] | string', -\ 'imap_fetch_overview(': 'resource imap_stream, string sequence [, int options] | array', -\ 'imap_fetchstructure(': 'resource imap_stream, int msg_number [, int options] | object', -\ 'imap_getacl(': 'resource stream_id, string mailbox | array', -\ 'imap_getmailboxes(': 'resource imap_stream, string ref, string pattern | array', -\ 'imap_get_quota(': 'resource imap_stream, string quota_root | array', -\ 'imap_get_quotaroot(': 'resource imap_stream, string quota_root | array', -\ 'imap_getsubscribed(': 'resource imap_stream, string ref, string pattern | array', -\ 'imap_headerinfo(': 'resource imap_stream, int msg_number [, int fromlength [, int subjectlength [, string defaulthost]]] | object', -\ 'imap_headers(': 'resource imap_stream | array', -\ 'imap_last_error(': 'void | string', -\ 'imap_list(': 'resource imap_stream, string ref, string pattern | array', -\ 'imap_listscan(': 'resource imap_stream, string ref, string pattern, string content | array', -\ 'imap_lsub(': 'resource imap_stream, string ref, string pattern | array', -\ 'imap_mailboxmsginfo(': 'resource imap_stream | object', -\ 'imap_mail_compose(': 'array envelope, array body | string', -\ 'imap_mail_copy(': 'resource imap_stream, string msglist, string mbox [, int options] | bool', -\ 'imap_mail(': 'string to, string subject, string message [, string additional_headers [, string cc [, string bcc [, string rpath]]]] | bool', -\ 'imap_mail_move(': 'resource imap_stream, string msglist, string mbox [, int options] | bool', -\ 'imap_mime_header_decode(': 'string text | array', -\ 'imap_msgno(': 'resource imap_stream, int uid | int', -\ 'imap_num_msg(': 'resource imap_stream | int', -\ 'imap_num_recent(': 'resource imap_stream | int', -\ 'imap_open(': 'string mailbox, string username, string password [, int options] | resource', -\ 'imap_ping(': 'resource imap_stream | bool', -\ 'imap_qprint(': 'string string | string', -\ 'imap_renamemailbox(': 'resource imap_stream, string old_mbox, string new_mbox | bool', -\ 'imap_reopen(': 'resource imap_stream, string mailbox [, int options] | bool', -\ 'imap_rfc822_parse_adrlist(': 'string address, string default_host | array', -\ 'imap_rfc822_parse_headers(': 'string headers [, string defaulthost] | object', -\ 'imap_rfc822_write_address(': 'string mailbox, string host, string personal | string', -\ 'imap_search(': 'resource imap_stream, string criteria [, int options [, string charset]] | array', -\ 'imap_setacl(': 'resource stream_id, string mailbox, string id, string rights | bool', -\ 'imap_setflag_full(': 'resource stream, string sequence, string flag [, string options] | bool', -\ 'imap_set_quota(': 'resource imap_stream, string quota_root, int quota_limit | bool', -\ 'imap_sort(': 'resource stream, int criteria, int reverse [, int options [, string search_criteria [, string charset]]] | array', -\ 'imap_status(': 'resource imap_stream, string mailbox, int options | object', -\ 'imap_subscribe(': 'resource imap_stream, string mbox | bool', -\ 'imap_thread(': 'resource stream_id [, int options] | array', -\ 'imap_timeout(': 'int timeout_type [, int timeout] | mixed', -\ 'imap_uid(': 'resource imap_stream, int msgno | int', -\ 'imap_undelete(': 'resource imap_stream, int msg_number [, int flags] | bool', -\ 'imap_unsubscribe(': 'string imap_stream, string mbox | bool', -\ 'imap_utf7_decode(': 'string text | string', -\ 'imap_utf7_encode(': 'string data | string', -\ 'imap_utf8(': 'string mime_encoded_text | string', -\ 'implode(': 'string glue, array pieces | string', -\ 'import_request_variables(': 'string types [, string prefix] | bool', -\ 'in_array(': 'mixed needle, array haystack [, bool strict] | bool', -\ 'inet_ntop(': 'string in_addr | string', -\ 'inet_pton(': 'string address | string', -\ 'ingres_autocommit(': '[resource link] | bool', -\ 'ingres_close(': '[resource link] | bool', -\ 'ingres_commit(': '[resource link] | bool', -\ 'ingres_connect(': '[string database [, string username [, string password]]] | resource', -\ 'ingres_cursor(': '[resource link] | string', -\ 'ingres_errno(': '[resource link] | int', -\ 'ingres_error(': '[resource link] | string', -\ 'ingres_errsqlstate(': '[resource link] | string', -\ 'ingres_fetch_array(': '[int result_type [, resource link]] | array', -\ 'ingres_fetch_object(': '[int result_type [, resource link]] | object', -\ 'ingres_fetch_row(': '[resource link] | array', -\ 'ingres_field_length(': 'int index [, resource link] | int', -\ 'ingres_field_name(': 'int index [, resource link] | string', -\ 'ingres_field_nullable(': 'int index [, resource link] | bool', -\ 'ingres_field_precision(': 'int index [, resource link] | int', -\ 'ingres_field_scale(': 'int index [, resource link] | int', -\ 'ingres_field_type(': 'int index [, resource link] | string', -\ 'ingres_num_fields(': '[resource link] | int', -\ 'ingres_num_rows(': '[resource link] | int', -\ 'ingres_pconnect(': '[string database [, string username [, string password]]] | resource', -\ 'ingres_query(': 'string query [, resource link] | bool', -\ 'ingres_rollback(': '[resource link] | bool', -\ 'ini_get_all(': '[string extension] | array', -\ 'ini_get(': 'string varname | string', -\ 'ini_restore(': 'string varname | void', -\ 'ini_set(': 'string varname, string newvalue | string', -\ 'interface_exists(': 'string interface_name [, bool autoload] | bool', -\ 'intval(': 'mixed var [, int base] | int', -\ 'ip2long(': 'string ip_address | int', -\ 'iptcembed(': 'string iptcdata, string jpeg_file_name [, int spool] | mixed', -\ 'iptcparse(': 'string iptcblock | array', -\ 'ircg_channel_mode(': 'resource connection, string channel, string mode_spec, string nick | bool', -\ 'ircg_disconnect(': 'resource connection, string reason | bool', -\ 'ircg_eval_ecmascript_params(': 'string params | array', -\ 'ircg_fetch_error_msg(': 'resource connection | array', -\ 'ircg_get_username(': 'resource connection | string', -\ 'ircg_html_encode(': 'string html_string [, bool auto_links [, bool conv_br]] | string', -\ 'ircg_ignore_add(': 'resource connection, string nick | void', -\ 'ircg_ignore_del(': 'resource connection, string nick | bool', -\ 'ircg_invite(': 'resource connection, string channel, string nickname | bool', -\ 'ircg_is_conn_alive(': 'resource connection | bool', -\ 'ircg_join(': 'resource connection, string channel [, string key] | bool', -\ 'ircg_kick(': 'resource connection, string channel, string nick, string reason | bool', -\ 'ircg_list(': 'resource connection, string channel | bool', -\ 'ircg_lookup_format_messages(': 'string name | bool', -\ 'ircg_lusers(': 'resource connection | bool', -\ 'ircg_msg(': 'resource connection, string recipient, string message [, bool suppress] | bool', -\ 'ircg_names(': 'int connection, string channel [, string target] | bool', -\ 'ircg_nick(': 'resource connection, string nick | bool', -\ 'ircg_nickname_escape(': 'string nick | string', -\ 'ircg_nickname_unescape(': 'string nick | string', -\ 'ircg_notice(': 'resource connection, string recipient, string message | bool', -\ 'ircg_oper(': 'resource connection, string name, string password | bool', -\ 'ircg_part(': 'resource connection, string channel | bool', -\ 'ircg_pconnect(': 'string username [, string server_ip [, int server_port [, string msg_format [, array ctcp_messages [, array user_settings [, bool bailout_on_trivial]]]]]] | resource', -\ 'ircg_register_format_messages(': 'string name, array messages | bool', -\ 'ircg_set_current(': 'resource connection | bool', -\ 'ircg_set_file(': 'resource connection, string path | bool', -\ 'ircg_set_on_die(': 'resource connection, string host, int port, string data | bool', -\ 'ircg_topic(': 'resource connection, string channel, string new_topic | bool', -\ 'ircg_who(': 'resource connection, string mask [, bool ops_only] | bool', -\ 'ircg_whois(': 'resource connection, string nick | bool', -\ 'is_a(': 'object object, string class_name | bool', -\ 'is_array(': 'mixed var | bool', -\ 'is_bool(': 'mixed var | bool', -\ 'is_callable(': 'mixed var [, bool syntax_only [, string &callable_name]] | bool', -\ 'is_dir(': 'string filename | bool', -\ 'is_executable(': 'string filename | bool', -\ 'is_file(': 'string filename | bool', -\ 'is_finite(': 'float val | bool', -\ 'is_float(': 'mixed var | bool', -\ 'is_infinite(': 'float val | bool', -\ 'is_int(': 'mixed var | bool', -\ 'is_link(': 'string filename | bool', -\ 'is_nan(': 'float val | bool', -\ 'is_null(': 'mixed var | bool', -\ 'is_numeric(': 'mixed var | bool', -\ 'is_object(': 'mixed var | bool', -\ 'is_readable(': 'string filename | bool', -\ 'is_resource(': 'mixed var | bool', -\ 'is_scalar(': 'mixed var | bool', -\ 'isset(': 'mixed var [, mixed var [, ...]] | bool', -\ 'is_soap_fault(': 'mixed obj | bool', -\ 'is_string(': 'mixed var | bool', -\ 'is_subclass_of(': 'mixed object, string class_name | bool', -\ 'is_uploaded_file(': 'string filename | bool', -\ 'is_writable(': 'string filename | bool', -\ 'iterator_count(': 'IteratorAggregate iterator | int', -\ 'iterator_to_array(': 'IteratorAggregate iterator | array', -\ 'java_last_exception_clear(': 'void | void', -\ 'java_last_exception_get(': 'void | object', -\ 'jddayofweek(': 'int julianday [, int mode] | mixed', -\ 'jdmonthname(': 'int julianday, int mode | string', -\ 'jdtofrench(': 'int juliandaycount | string', -\ 'jdtogregorian(': 'int julianday | string', -\ 'jdtojewish(': 'int juliandaycount [, bool hebrew [, int fl]] | string', -\ 'jdtojulian(': 'int julianday | string', -\ 'jdtounix(': 'int jday | int', -\ 'jewishtojd(': 'int month, int day, int year | int', -\ 'jpeg2wbmp(': 'string jpegname, string wbmpname, int d_height, int d_width, int threshold | int', -\ 'juliantojd(': 'int month, int day, int year | int', -\ 'kadm5_chpass_principal(': 'resource handle, string principal, string password | bool', -\ 'kadm5_create_principal(': 'resource handle, string principal [, string password [, array options]] | bool', -\ 'kadm5_delete_principal(': 'resource handle, string principal | bool', -\ 'kadm5_destroy(': 'resource handle | bool', -\ 'kadm5_flush(': 'resource handle | bool', -\ 'kadm5_get_policies(': 'resource handle | array', -\ 'kadm5_get_principal(': 'resource handle, string principal | array', -\ 'kadm5_get_principals(': 'resource handle | array', -\ 'kadm5_init_with_password(': 'string admin_server, string realm, string principal, string password | resource', -\ 'kadm5_modify_principal(': 'resource handle, string principal, array options | bool', -\ 'key(': 'array &array | mixed', -\ 'krsort(': 'array &array [, int sort_flags] | bool', -\ 'ksort(': 'array &array [, int sort_flags] | bool', -\ 'lcg_value(': 'void | float', -\ 'ldap_8859_to_t61(': 'string value | string', -\ 'ldap_add(': 'resource link_identifier, string dn, array entry | bool', -\ 'ldap_bind(': 'resource link_identifier [, string bind_rdn [, string bind_password]] | bool', -\ 'ldap_compare(': 'resource link_identifier, string dn, string attribute, string value | mixed', -\ 'ldap_connect(': '[string hostname [, int port]] | resource', -\ 'ldap_count_entries(': 'resource link_identifier, resource result_identifier | int', -\ 'ldap_delete(': 'resource link_identifier, string dn | bool', -\ 'ldap_dn2ufn(': 'string dn | string', -\ 'ldap_err2str(': 'int errno | string', -\ 'ldap_errno(': 'resource link_identifier | int', -\ 'ldap_error(': 'resource link_identifier | string', -\ 'ldap_explode_dn(': 'string dn, int with_attrib | array', -\ 'ldap_first_attribute(': 'resource link_identifier, resource result_entry_identifier, int &ber_identifier | string', -\ 'ldap_first_entry(': 'resource link_identifier, resource result_identifier | resource', -\ 'ldap_first_reference(': 'resource link, resource result | resource', -\ 'ldap_free_result(': 'resource result_identifier | bool', -\ 'ldap_get_attributes(': 'resource link_identifier, resource result_entry_identifier | array', -\ 'ldap_get_dn(': 'resource link_identifier, resource result_entry_identifier | string', -\ 'ldap_get_entries(': 'resource link_identifier, resource result_identifier | array', -\ 'ldap_get_option(': 'resource link_identifier, int option, mixed &retval | bool', -\ 'ldap_get_values(': 'resource link_identifier, resource result_entry_identifier, string attribute | array', -\ 'ldap_get_values_len(': 'resource link_identifier, resource result_entry_identifier, string attribute | array', -\ 'ldap_list(': 'resource link_identifier, string base_dn, string filter [, array attributes [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] | resource', -\ 'ldap_mod_add(': 'resource link_identifier, string dn, array entry | bool', -\ 'ldap_mod_del(': 'resource link_identifier, string dn, array entry | bool', -\ 'ldap_modify(': 'resource link_identifier, string dn, array entry | bool', -\ 'ldap_mod_replace(': 'resource link_identifier, string dn, array entry | bool', -\ 'ldap_next_attribute(': 'resource link_identifier, resource result_entry_identifier, resource &ber_identifier | string', -\ 'ldap_next_entry(': 'resource link_identifier, resource result_entry_identifier | resource', -\ 'ldap_next_reference(': 'resource link, resource entry | resource', -\ 'ldap_parse_reference(': 'resource link, resource entry, array &referrals | bool', -\ 'ldap_parse_result(': 'resource link, resource result, int &errcode [, string &matcheddn [, string &errmsg [, array &referrals]]] | bool', -\ 'ldap_read(': 'resource link_identifier, string base_dn, string filter [, array attributes [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] | resource', -\ 'ldap_rename(': 'resource link_identifier, string dn, string newrdn, string newparent, bool deleteoldrdn | bool', -\ 'ldap_sasl_bind(': 'resource link [, string binddn [, string password [, string sasl_mech [, string sasl_realm [, string sasl_authz_id [, string props]]]]]] | bool', -\ 'ldap_search(': 'resource link_identifier, string base_dn, string filter [, array attributes [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] | resource', -\ 'ldap_set_option(': 'resource link_identifier, int option, mixed newval | bool', -\ 'ldap_set_rebind_proc(': 'resource link, callback callback | bool', -\ 'ldap_sort(': 'resource link, resource result, string sortfilter | bool', -\ 'ldap_start_tls(': 'resource link | bool', -\ 'ldap_t61_to_8859(': 'string value | string', -\ 'ldap_unbind(': 'resource link_identifier | bool', -\ 'levenshtein(': 'string str1, string str2 [, int cost_ins [, int cost_rep, int cost_del]] | int', -\ 'libxml_clear_errors(': 'void | void', -\ 'libxml_get_errors(': 'void | array', -\ 'libxml_get_last_error(': 'void | LibXMLError', -\ 'libxml_set_streams_context(': 'resource streams_context | void', -\ 'libxml_use_internal_errors(': '[bool use_errors] | bool', -\ 'link(': 'string target, string link | bool', -\ 'linkinfo(': 'string path | int', -\ 'list(': 'mixed varname, mixed ... | void', -\ 'localeconv(': 'void | array', -\ 'localtime(': '[int timestamp [, bool is_associative]] | array', -\ 'log10(': 'float arg | float', -\ 'log1p(': 'float number | float', -\ 'log(': 'float arg [, float base] | float', -\ 'long2ip(': 'int proper_address | string', -\ 'lstat(': 'string filename | array', -\ 'ltrim(': 'string str [, string charlist] | string', -\ 'lzf_compress(': 'string data | string', -\ 'lzf_decompress(': 'string data | string', -\ 'lzf_optimized_for(': 'void | int', -\ 'mail(': 'string to, string subject, string message [, string additional_headers [, string additional_parameters]] | bool', -\ 'mailparse_determine_best_xfer_encoding(': 'resource fp | string', -\ 'mailparse_msg_create(': 'void | resource', -\ 'mailparse_msg_extract_part_file(': 'resource rfc2045, string filename [, callback callbackfunc] | string', -\ 'mailparse_msg_extract_part(': 'resource rfc2045, string msgbody [, callback callbackfunc] | void', -\ 'mailparse_msg_free(': 'resource rfc2045buf | bool', -\ 'mailparse_msg_get_part_data(': 'resource rfc2045 | array', -\ 'mailparse_msg_get_part(': 'resource rfc2045, string mimesection | resource', -\ 'mailparse_msg_get_structure(': 'resource rfc2045 | array', -\ 'mailparse_msg_parse_file(': 'string filename | resource', -\ 'mailparse_msg_parse(': 'resource rfc2045buf, string data | bool', -\ 'mailparse_rfc822_parse_addresses(': 'string addresses | array', -\ 'mailparse_stream_encode(': 'resource sourcefp, resource destfp, string encoding | bool', -\ 'mailparse_uudecode_all(': 'resource fp | array', -\ 'maxdb_connect_errno(': 'void | int', -\ 'maxdb_connect_error(': 'void | string', -\ 'maxdb_debug(': 'string debug | void', -\ 'maxdb_disable_rpl_parse(': 'resource link | bool', -\ 'maxdb_dump_debug_info(': 'resource link | bool', -\ 'maxdb_embedded_connect(': '[string dbname] | resource', -\ 'maxdb_enable_reads_from_master(': 'resource link | bool', -\ 'maxdb_enable_rpl_parse(': 'resource link | bool', -\ 'maxdb_get_client_info(': 'void | string', -\ 'maxdb_get_client_version(': 'void | int', -\ 'maxdb_init(': 'void | resource', -\ 'maxdb_master_query(': 'resource link, string query | bool', -\ 'maxdb_more_results(': 'resource link | bool', -\ 'maxdb_next_result(': 'resource link | bool', -\ 'maxdb_report(': 'int flags | bool', -\ 'maxdb_rollback(': 'resource link | bool', -\ 'maxdb_rpl_parse_enabled(': 'resource link | int', -\ 'maxdb_rpl_probe(': 'resource link | bool', -\ 'maxdb_rpl_query_type(': 'resource link | int', -\ 'maxdb_select_db(': 'resource link, string dbname | bool', -\ 'maxdb_send_query(': 'resource link, string query | bool', -\ 'maxdb_server_end(': 'void | void', -\ 'maxdb_server_init(': '[array server [, array groups]] | bool', -\ 'maxdb_stmt_sqlstate(': 'resource stmt | string', -\ 'max(': 'number arg1, number arg2 [, number ...] | mixed', -\ 'mb_convert_case(': 'string str, int mode [, string encoding] | string', -\ 'mb_convert_encoding(': 'string str, string to_encoding [, mixed from_encoding] | string', -\ 'mb_convert_kana(': 'string str [, string option [, string encoding]] | string', -\ 'mb_convert_variables(': 'string to_encoding, mixed from_encoding, mixed &vars [, mixed &...] | string', -\ 'mb_decode_mimeheader(': 'string str | string', -\ 'mb_decode_numericentity(': 'string str, array convmap [, string encoding] | string', -\ 'mb_detect_encoding(': 'string str [, mixed encoding_list [, bool strict]] | string', -\ 'mb_detect_order(': '[mixed encoding_list] | mixed', -\ 'mb_encode_mimeheader(': 'string str [, string charset [, string transfer_encoding [, string linefeed]]] | string', -\ 'mb_encode_numericentity(': 'string str, array convmap [, string encoding] | string', -\ 'mb_ereg(': 'string pattern, string string [, array regs] | int', -\ 'mb_eregi(': 'string pattern, string string [, array regs] | int', -\ 'mb_eregi_replace(': 'string pattern, string replace, string string [, string option] | string', -\ 'mb_ereg_match(': 'string pattern, string string [, string option] | bool', -\ 'mb_ereg_replace(': 'string pattern, string replacement, string string [, string option] | string', -\ 'mb_ereg_search_getpos(': 'void | int', -\ 'mb_ereg_search_getregs(': 'void | array', -\ 'mb_ereg_search(': '[string pattern [, string option]] | bool', -\ 'mb_ereg_search_init(': 'string string [, string pattern [, string option]] | bool', -\ 'mb_ereg_search_pos(': '[string pattern [, string option]] | array', -\ 'mb_ereg_search_regs(': '[string pattern [, string option]] | array', -\ 'mb_ereg_search_setpos(': 'int position | bool', -\ 'mb_get_info(': '[string type] | mixed', -\ 'mb_http_input(': '[string type] | mixed', -\ 'mb_http_output(': '[string encoding] | mixed', -\ 'mb_internal_encoding(': '[string encoding] | mixed', -\ 'mb_language(': '[string language] | mixed', -\ 'mb_list_encodings(': 'void | array', -\ 'mb_output_handler(': 'string contents, int status | string', -\ 'mb_parse_str(': 'string encoded_string [, array &result] | bool', -\ 'mb_preferred_mime_name(': 'string encoding | string', -\ 'mb_regex_encoding(': '[string encoding] | mixed', -\ 'mb_regex_set_options(': '[string options] | string', -\ 'mb_send_mail(': 'string to, string subject, string message [, string additional_headers [, string additional_parameter]] | bool', -\ 'mb_split(': 'string pattern, string string [, int limit] | array', -\ 'mb_strcut(': 'string str, int start [, int length [, string encoding]] | string', -\ 'mb_strimwidth(': 'string str, int start, int width [, string trimmarker [, string encoding]] | string', -\ 'mb_strlen(': 'string str [, string encoding] | int', -\ 'mb_strpos(': 'string haystack, string needle [, int offset [, string encoding]] | int', -\ 'mb_strrpos(': 'string haystack, string needle [, string encoding] | int', -\ 'mb_strtolower(': 'string str [, string encoding] | string', -\ 'mb_strtoupper(': 'string str [, string encoding] | string', -\ 'mb_strwidth(': 'string str [, string encoding] | int', -\ 'mb_substitute_character(': '[mixed substrchar] | mixed', -\ 'mb_substr_count(': 'string haystack, string needle [, string encoding] | int', -\ 'mb_substr(': 'string str, int start [, int length [, string encoding]] | string', -\ 'mcal_append_event(': 'int mcal_stream | int', -\ 'mcal_close(': 'int mcal_stream [, int flags] | bool', -\ 'mcal_create_calendar(': 'int stream, string calendar | bool', -\ 'mcal_date_compare(': 'int a_year, int a_month, int a_day, int b_year, int b_month, int b_day | int', -\ 'mcal_date_valid(': 'int year, int month, int day | bool', -\ 'mcal_day_of_week(': 'int year, int month, int day | int', -\ 'mcal_day_of_year(': 'int year, int month, int day | int', -\ 'mcal_days_in_month(': 'int month, int leap_year | int', -\ 'mcal_delete_calendar(': 'int stream, string calendar | bool', -\ 'mcal_delete_event(': 'int mcal_stream, int event_id | bool', -\ 'mcal_event_add_attribute(': 'int stream, string attribute, string value | bool', -\ 'mcal_event_init(': 'int stream | void', -\ 'mcal_event_set_alarm(': 'int stream, int alarm | void', -\ 'mcal_event_set_category(': 'int stream, string category | void', -\ 'mcal_event_set_class(': 'int stream, int class | void', -\ 'mcal_event_set_description(': 'int stream, string description | void', -\ 'mcal_event_set_end(': 'int stream, int year, int month, int day [, int hour [, int min [, int sec]]] | void', -\ 'mcal_event_set_recur_daily(': 'int stream, int year, int month, int day, int interval | void', -\ 'mcal_event_set_recur_monthly_mday(': 'int stream, int year, int month, int day, int interval | void', -\ 'mcal_event_set_recur_monthly_wday(': 'int stream, int year, int month, int day, int interval | void', -\ 'mcal_event_set_recur_none(': 'int stream | void', -\ 'mcal_event_set_recur_weekly(': 'int stream, int year, int month, int day, int interval, int weekdays | void', -\ 'mcal_event_set_recur_yearly(': 'int stream, int year, int month, int day, int interval | void', -\ 'mcal_event_set_start(': 'int stream, int year, int month, int day [, int hour [, int min [, int sec]]] | void', -\ 'mcal_event_set_title(': 'int stream, string title | void', -\ 'mcal_expunge(': 'int stream | bool', -\ 'mcal_fetch_current_stream_event(': 'int stream | object', -\ 'mcal_fetch_event(': 'int mcal_stream, int event_id [, int options] | object', -\ 'mcal_is_leap_year(': 'int year | bool', -\ 'mcal_list_alarms(': 'int mcal_stream [, int begin_year, int begin_month, int begin_day, int end_year, int end_month, int end_day] | array', -\ 'mcal_list_events(': 'int mcal_stream [, int begin_year, int begin_month, int begin_day, int end_year, int end_month, int end_day] | array', -\ 'mcal_next_recurrence(': 'int stream, int weekstart, array next | object', -\ 'mcal_open(': 'string calendar, string username, string password [, int options] | int', -\ 'mcal_popen(': 'string calendar, string username, string password [, int options] | int', -\ 'mcal_rename_calendar(': 'int stream, string old_name, string new_name | bool', -\ 'mcal_reopen(': 'int mcal_stream, string calendar [, int options] | bool', -\ 'mcal_snooze(': 'int stream_id, int event_id | bool', -\ 'mcal_store_event(': 'int mcal_stream | int', -\ 'mcal_time_valid(': 'int hour, int minutes, int seconds | bool', -\ 'mcal_week_of_year(': 'int day, int month, int year | int', -\ 'm_checkstatus(': 'resource conn, int identifier | int', -\ 'm_completeauthorizations(': 'resource conn, int &array | int', -\ 'm_connect(': 'resource conn | int', -\ 'm_connectionerror(': 'resource conn | string', -\ 'mcrypt_cbc(': 'int cipher, string key, string data, int mode [, string iv] | string', -\ 'mcrypt_cfb(': 'int cipher, string key, string data, int mode, string iv | string', -\ 'mcrypt_create_iv(': 'int size [, int source] | string', -\ 'mcrypt_decrypt(': 'string cipher, string key, string data, string mode [, string iv] | string', -\ 'mcrypt_ecb(': 'int cipher, string key, string data, int mode | string', -\ 'mcrypt_enc_get_algorithms_name(': 'resource td | string', -\ 'mcrypt_enc_get_block_size(': 'resource td | int', -\ 'mcrypt_enc_get_iv_size(': 'resource td | int', -\ 'mcrypt_enc_get_key_size(': 'resource td | int', -\ 'mcrypt_enc_get_modes_name(': 'resource td | string', -\ 'mcrypt_enc_get_supported_key_sizes(': 'resource td | array', -\ 'mcrypt_enc_is_block_algorithm(': 'resource td | bool', -\ 'mcrypt_enc_is_block_algorithm_mode(': 'resource td | bool', -\ 'mcrypt_enc_is_block_mode(': 'resource td | bool', -\ 'mcrypt_encrypt(': 'string cipher, string key, string data, string mode [, string iv] | string', -\ 'mcrypt_enc_self_test(': 'resource td | int', -\ 'mcrypt_generic_deinit(': 'resource td | bool', -\ 'mcrypt_generic_end(': 'resource td | bool', -\ 'mcrypt_generic(': 'resource td, string data | string', -\ 'mcrypt_generic_init(': 'resource td, string key, string iv | int', -\ 'mcrypt_get_block_size(': 'int cipher | int', -\ 'mcrypt_get_cipher_name(': 'int cipher | string', -\ 'mcrypt_get_iv_size(': 'string cipher, string mode | int', -\ 'mcrypt_get_key_size(': 'int cipher | int', -\ 'mcrypt_list_algorithms(': '[string lib_dir] | array', -\ 'mcrypt_list_modes(': '[string lib_dir] | array', -\ 'mcrypt_module_close(': 'resource td | bool', -\ 'mcrypt_module_get_algo_block_size(': 'string algorithm [, string lib_dir] | int', -\ 'mcrypt_module_get_algo_key_size(': 'string algorithm [, string lib_dir] | int', -\ 'mcrypt_module_get_supported_key_sizes(': 'string algorithm [, string lib_dir] | array', -\ 'mcrypt_module_is_block_algorithm(': 'string algorithm [, string lib_dir] | bool', -\ 'mcrypt_module_is_block_algorithm_mode(': 'string mode [, string lib_dir] | bool', -\ 'mcrypt_module_is_block_mode(': 'string mode [, string lib_dir] | bool', -\ 'mcrypt_module_open(': 'string algorithm, string algorithm_directory, string mode, string mode_directory | resource', -\ 'mcrypt_module_self_test(': 'string algorithm [, string lib_dir] | bool', -\ 'mcrypt_ofb(': 'int cipher, string key, string data, int mode, string iv | string', -\ 'md5_file(': 'string filename [, bool raw_output] | string', -\ 'md5(': 'string str [, bool raw_output] | string', -\ 'mdecrypt_generic(': 'resource td, string data | string', -\ 'm_deletetrans(': 'resource conn, int identifier | bool', -\ 'm_destroyconn(': 'resource conn | bool', -\ 'm_destroyengine(': 'void | void', -\ 'memcache_debug(': 'bool on_off | bool', -\ 'memory_get_usage(': 'void | int', -\ 'metaphone(': 'string str [, int phones] | string', -\ 'method_exists(': 'object object, string method_name | bool', -\ 'm_getcellbynum(': 'resource conn, int identifier, int column, int row | string', -\ 'm_getcell(': 'resource conn, int identifier, string column, int row | string', -\ 'm_getcommadelimited(': 'resource conn, int identifier | string', -\ 'm_getheader(': 'resource conn, int identifier, int column_num | string', -\ 'mhash_count(': 'void | int', -\ 'mhash_get_block_size(': 'int hash | int', -\ 'mhash_get_hash_name(': 'int hash | string', -\ 'mhash(': 'int hash, string data [, string key] | string', -\ 'mhash_keygen_s2k(': 'int hash, string password, string salt, int bytes | string', -\ 'microtime(': '[bool get_as_float] | mixed', -\ 'mime_content_type(': 'string filename | string', -\ 'ming_keypress(': 'string str | int', -\ 'ming_setcubicthreshold(': 'int threshold | void', -\ 'ming_setscale(': 'int scale | void', -\ 'ming_useConstants(': 'int use | void', -\ 'ming_useswfversion(': 'int version | void', -\ 'min(': 'number arg1, number arg2 [, number ...] | mixed', -\ 'm_initconn(': 'void | resource', -\ 'm_initengine(': 'string location | int', -\ 'm_iscommadelimited(': 'resource conn, int identifier | int', -\ 'mkdir(': 'string pathname [, int mode [, bool recursive [, resource context]]] | bool', -\ 'mktime(': '[int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] | int', -\ 'm_maxconntimeout(': 'resource conn, int secs | bool', -\ 'm_monitor(': 'resource conn | int', -\ 'm_numcolumns(': 'resource conn, int identifier | int', -\ 'm_numrows(': 'resource conn, int identifier | int', -\ 'money_format(': 'string format, float number | string', -\ 'move_uploaded_file(': 'string filename, string destination | bool', -\ 'm_parsecommadelimited(': 'resource conn, int identifier | int', -\ 'm_responsekeys(': 'resource conn, int identifier | array', -\ 'm_responseparam(': 'resource conn, int identifier, string key | string', -\ 'm_returnstatus(': 'resource conn, int identifier | int', -\ 'msession_connect(': 'string host, string port | bool', -\ 'msession_count(': 'void | int', -\ 'msession_create(': 'string session | bool', -\ 'msession_destroy(': 'string name | bool', -\ 'msession_disconnect(': 'void | void', -\ 'msession_find(': 'string name, string value | array', -\ 'msession_get_array(': 'string session | array', -\ 'msession_get_data(': 'string session | string', -\ 'msession_get(': 'string session, string name, string value | string', -\ 'msession_inc(': 'string session, string name | string', -\ 'msession_list(': 'void | array', -\ 'msession_listvar(': 'string name | array', -\ 'msession_lock(': 'string name | int', -\ 'msession_plugin(': 'string session, string val [, string param] | string', -\ 'msession_randstr(': 'int param | string', -\ 'msession_set_array(': 'string session, array tuples | void', -\ 'msession_set_data(': 'string session, string value | bool', -\ 'msession_set(': 'string session, string name, string value | bool', -\ 'msession_timeout(': 'string session [, int param] | int', -\ 'msession_uniq(': 'int param | string', -\ 'msession_unlock(': 'string session, int key | int', -\ 'm_setblocking(': 'resource conn, int tf | int', -\ 'm_setdropfile(': 'resource conn, string directory | int', -\ 'm_setip(': 'resource conn, string host, int port | int', -\ 'm_setssl_cafile(': 'resource conn, string cafile | int', -\ 'm_setssl_files(': 'resource conn, string sslkeyfile, string sslcertfile | int', -\ 'm_setssl(': 'resource conn, string host, int port | int', -\ 'm_settimeout(': 'resource conn, int seconds | int', -\ 'msg_get_queue(': 'int key [, int perms] | resource', -\ 'msg_receive(': 'resource queue, int desiredmsgtype, int &msgtype, int maxsize, mixed &message [, bool unserialize [, int flags [, int &errorcode]]] | bool', -\ 'msg_remove_queue(': 'resource queue | bool', -\ 'msg_send(': 'resource queue, int msgtype, mixed message [, bool serialize [, bool blocking [, int &errorcode]]] | bool', -\ 'msg_set_queue(': 'resource queue, array data | bool', -\ 'msg_stat_queue(': 'resource queue | array', -\ 'msql_affected_rows(': 'resource result | int', -\ 'msql_close(': '[resource link_identifier] | bool', -\ 'msql_connect(': '[string hostname] | resource', -\ 'msql_create_db(': 'string database_name [, resource link_identifier] | bool', -\ 'msql_data_seek(': 'resource result, int row_number | bool', -\ 'msql_db_query(': 'string database, string query [, resource link_identifier] | resource', -\ 'msql_drop_db(': 'string database_name [, resource link_identifier] | bool', -\ 'msql_error(': 'void | string', -\ 'msql_fetch_array(': 'resource result [, int result_type] | array', -\ 'msql_fetch_field(': 'resource result [, int field_offset] | object', -\ 'msql_fetch_object(': 'resource result | object', -\ 'msql_fetch_row(': 'resource result | array', -\ 'msql_field_flags(': 'resource result, int field_offset | string', -\ 'msql_field_len(': 'resource result, int field_offset | int', -\ 'msql_field_name(': 'resource result, int field_offset | string', -\ 'msql_field_seek(': 'resource result, int field_offset | bool', -\ 'msql_field_table(': 'resource result, int field_offset | int', -\ 'msql_field_type(': 'resource result, int field_offset | string', -\ 'msql_free_result(': 'resource result | bool', -\ 'msql_list_dbs(': '[resource link_identifier] | resource', -\ 'msql_list_fields(': 'string database, string tablename [, resource link_identifier] | resource', -\ 'msql_list_tables(': 'string database [, resource link_identifier] | resource', -\ 'msql_num_fields(': 'resource result | int', -\ 'msql_num_rows(': 'resource query_identifier | int', -\ 'msql_pconnect(': '[string hostname] | resource', -\ 'msql_query(': 'string query [, resource link_identifier] | resource', -\ 'msql_result(': 'resource result, int row [, mixed field] | string', -\ 'msql_select_db(': 'string database_name [, resource link_identifier] | bool', -\ 'm_sslcert_gen_hash(': 'string filename | string', -\ 'mssql_bind(': 'resource stmt, string param_name, mixed &var, int type [, int is_output [, int is_null [, int maxlen]]] | bool', -\ 'mssql_close(': '[resource link_identifier] | bool', -\ 'mssql_connect(': '[string servername [, string username [, string password]]] | resource', -\ 'mssql_data_seek(': 'resource result_identifier, int row_number | bool', -\ 'mssql_execute(': 'resource stmt [, bool skip_results] | mixed', -\ 'mssql_fetch_array(': 'resource result [, int result_type] | array', -\ 'mssql_fetch_assoc(': 'resource result_id | array', -\ 'mssql_fetch_batch(': 'resource result_index | int', -\ 'mssql_fetch_field(': 'resource result [, int field_offset] | object', -\ 'mssql_fetch_object(': 'resource result | object', -\ 'mssql_fetch_row(': 'resource result | array', -\ 'mssql_field_length(': 'resource result [, int offset] | int', -\ 'mssql_field_name(': 'resource result [, int offset] | string', -\ 'mssql_field_seek(': 'resource result, int field_offset | bool', -\ 'mssql_field_type(': 'resource result [, int offset] | string', -\ 'mssql_free_result(': 'resource result | bool', -\ 'mssql_free_statement(': 'resource statement | bool', -\ 'mssql_get_last_message(': 'void | string', -\ 'mssql_guid_string(': 'string binary [, int short_format] | string', -\ 'mssql_init(': 'string sp_name [, resource conn_id] | resource', -\ 'mssql_min_error_severity(': 'int severity | void', -\ 'mssql_min_message_severity(': 'int severity | void', -\ 'mssql_next_result(': 'resource result_id | bool', -\ 'mssql_num_fields(': 'resource result | int', -\ 'mssql_num_rows(': 'resource result | int', -\ 'mssql_pconnect(': '[string servername [, string username [, string password]]] | resource', -\ 'mssql_query(': 'string query [, resource link_identifier [, int batch_size]] | mixed', -\ 'mssql_result(': 'resource result, int row, mixed field | string', -\ 'mssql_rows_affected(': 'resource conn_id | int', -\ 'mssql_select_db(': 'string database_name [, resource link_identifier] | bool', -\ 'mt_getrandmax(': 'void | int', -\ 'mt_rand(': '[int min, int max] | int', -\ 'm_transactionssent(': 'resource conn | int', -\ 'm_transinqueue(': 'resource conn | int', -\ 'm_transkeyval(': 'resource conn, int identifier, string key, string value | int', -\ 'm_transnew(': 'resource conn | int', -\ 'm_transsend(': 'resource conn, int identifier | int', -\ 'mt_srand(': '[int seed] | void', -\ 'muscat_close(': 'resource muscat_handle | void', -\ 'muscat_get(': 'resource muscat_handle | string', -\ 'muscat_give(': 'resource muscat_handle, string string | void', -\ 'muscat_setup(': 'int size [, string muscat_dir] | resource', -\ 'muscat_setup_net(': 'string muscat_host | resource', -\ 'm_uwait(': 'int microsecs | int', -\ 'm_validateidentifier(': 'resource conn, int tf | int', -\ 'm_verifyconnection(': 'resource conn, int tf | bool', -\ 'm_verifysslcert(': 'resource conn, int tf | bool', -\ 'mysql_affected_rows(': '[resource link_identifier] | int', -\ 'mysql_change_user(': 'string user, string password [, string database [, resource link_identifier]] | int', -\ 'mysql_client_encoding(': '[resource link_identifier] | string', -\ 'mysql_close(': '[resource link_identifier] | bool', -\ 'mysql_connect(': '[string server [, string username [, string password [, bool new_link [, int client_flags]]]]] | resource', -\ 'mysql_create_db(': 'string database_name [, resource link_identifier] | bool', -\ 'mysql_data_seek(': 'resource result, int row_number | bool', -\ 'mysql_db_name(': 'resource result, int row [, mixed field] | string', -\ 'mysql_db_query(': 'string database, string query [, resource link_identifier] | resource', -\ 'mysql_drop_db(': 'string database_name [, resource link_identifier] | bool', -\ 'mysql_errno(': '[resource link_identifier] | int', -\ 'mysql_error(': '[resource link_identifier] | string', -\ 'mysql_escape_string(': 'string unescaped_string | string', -\ 'mysql_fetch_array(': 'resource result [, int result_type] | array', -\ 'mysql_fetch_assoc(': 'resource result | array', -\ 'mysql_fetch_field(': 'resource result [, int field_offset] | object', -\ 'mysql_fetch_lengths(': 'resource result | array', -\ 'mysql_fetch_object(': 'resource result | object', -\ 'mysql_fetch_row(': 'resource result | array', -\ 'mysql_field_flags(': 'resource result, int field_offset | string', -\ 'mysql_field_len(': 'resource result, int field_offset | int', -\ 'mysql_field_name(': 'resource result, int field_offset | string', -\ 'mysql_field_seek(': 'resource result, int field_offset | bool', -\ 'mysql_field_table(': 'resource result, int field_offset | string', -\ 'mysql_field_type(': 'resource result, int field_offset | string', -\ 'mysql_free_result(': 'resource result | bool', -\ 'mysql_get_client_info(': 'void | string', -\ 'mysql_get_host_info(': '[resource link_identifier] | string', -\ 'mysql_get_proto_info(': '[resource link_identifier] | int', -\ 'mysql_get_server_info(': '[resource link_identifier] | string', -\ 'mysqli_connect_errno(': 'void | int', -\ 'mysqli_connect_error(': 'void | string', -\ 'mysqli_debug(': 'string debug | bool', -\ 'mysqli_disable_rpl_parse(': 'mysqli link | bool', -\ 'mysqli_dump_debug_info(': 'mysqli link | bool', -\ 'mysqli_embedded_connect(': '[string dbname] | mysqli', -\ 'mysqli_enable_reads_from_master(': 'mysqli link | bool', -\ 'mysqli_enable_rpl_parse(': 'mysqli link | bool', -\ 'mysqli_get_client_info(': 'void | string', -\ 'mysqli_get_client_version(': 'void | int', -\ 'mysqli_init(': 'void | mysqli', -\ 'mysqli_master_query(': 'mysqli link, string query | bool', -\ 'mysqli_more_results(': 'mysqli link | bool', -\ 'mysqli_next_result(': 'mysqli link | bool', -\ 'mysql_info(': '[resource link_identifier] | string', -\ 'mysql_insert_id(': '[resource link_identifier] | int', -\ 'mysqli_report(': 'int flags | bool', -\ 'mysqli_rollback(': 'mysqli link | bool', -\ 'mysqli_rpl_parse_enabled(': 'mysqli link | int', -\ 'mysqli_rpl_probe(': 'mysqli link | bool', -\ 'mysqli_select_db(': 'mysqli link, string dbname | bool', -\ 'mysqli_server_end(': 'void | void', -\ 'mysqli_server_init(': '[array server [, array groups]] | bool', -\ 'mysqli_set_charset(': 'mysqli link, string charset | bool', -\ 'mysqli_stmt_sqlstate(': 'mysqli_stmt stmt | string', -\ 'mysql_list_dbs(': '[resource link_identifier] | resource', -\ 'mysql_list_fields(': 'string database_name, string table_name [, resource link_identifier] | resource', -\ 'mysql_list_processes(': '[resource link_identifier] | resource', -\ 'mysql_list_tables(': 'string database [, resource link_identifier] | resource', -\ 'mysql_num_fields(': 'resource result | int', -\ 'mysql_num_rows(': 'resource result | int', -\ 'mysql_pconnect(': '[string server [, string username [, string password [, int client_flags]]]] | resource', -\ 'mysql_ping(': '[resource link_identifier] | bool', -\ 'mysql_query(': 'string query [, resource link_identifier] | resource', -\ 'mysql_real_escape_string(': 'string unescaped_string [, resource link_identifier] | string', -\ 'mysql_result(': 'resource result, int row [, mixed field] | string', -\ 'mysql_select_db(': 'string database_name [, resource link_identifier] | bool', -\ 'mysql_stat(': '[resource link_identifier] | string', -\ 'mysql_tablename(': 'resource result, int i | string', -\ 'mysql_thread_id(': '[resource link_identifier] | int', -\ 'mysql_unbuffered_query(': 'string query [, resource link_identifier] | resource', -\ 'natcasesort(': 'array &array | bool', -\ 'natsort(': 'array &array | bool', -\ 'ncurses_addch(': 'int ch | int', -\ 'ncurses_addchnstr(': 'string s, int n | int', -\ 'ncurses_addchstr(': 'string s | int', -\ 'ncurses_addnstr(': 'string s, int n | int', -\ 'ncurses_addstr(': 'string text | int', -\ 'ncurses_assume_default_colors(': 'int fg, int bg | int', -\ 'ncurses_attroff(': 'int attributes | int', -\ 'ncurses_attron(': 'int attributes | int', -\ 'ncurses_attrset(': 'int attributes | int', -\ 'ncurses_baudrate(': 'void | int', -\ 'ncurses_beep(': 'void | int', -\ 'ncurses_bkgd(': 'int attrchar | int', -\ 'ncurses_bkgdset(': 'int attrchar | void', -\ 'ncurses_border(': 'int left, int right, int top, int bottom, int tl_corner, int tr_corner, int bl_corner, int br_corner | int', -\ 'ncurses_bottom_panel(': 'resource panel | int', -\ 'ncurses_can_change_color(': 'void | bool', -\ 'ncurses_cbreak(': 'void | bool', -\ 'ncurses_clear(': 'void | bool', -\ 'ncurses_clrtobot(': 'void | bool', -\ 'ncurses_clrtoeol(': 'void | bool', -\ 'ncurses_color_content(': 'int color, int &r, int &g, int &b | int', -\ 'ncurses_color_set(': 'int pair | int', -\ 'ncurses_curs_set(': 'int visibility | int', -\ 'ncurses_define_key(': 'string definition, int keycode | int', -\ 'ncurses_def_prog_mode(': 'void | bool', -\ 'ncurses_def_shell_mode(': 'void | bool', -\ 'ncurses_delay_output(': 'int milliseconds | int', -\ 'ncurses_delch(': 'void | bool', -\ 'ncurses_deleteln(': 'void | bool', -\ 'ncurses_del_panel(': 'resource panel | bool', -\ 'ncurses_delwin(': 'resource window | bool', -\ 'ncurses_doupdate(': 'void | bool', -\ 'ncurses_echochar(': 'int character | int', -\ 'ncurses_echo(': 'void | bool', -\ 'ncurses_end(': 'void | int', -\ 'ncurses_erasechar(': 'void | string', -\ 'ncurses_erase(': 'void | bool', -\ 'ncurses_filter(': 'void | void', -\ 'ncurses_flash(': 'void | bool', -\ 'ncurses_flushinp(': 'void | bool', -\ 'ncurses_getch(': 'void | int', -\ 'ncurses_getmaxyx(': 'resource window, int &y, int &x | void', -\ 'ncurses_getmouse(': 'array &mevent | bool', -\ 'ncurses_getyx(': 'resource window, int &y, int &x | void', -\ 'ncurses_halfdelay(': 'int tenth | int', -\ 'ncurses_has_colors(': 'void | bool', -\ 'ncurses_has_ic(': 'void | bool', -\ 'ncurses_has_il(': 'void | bool', -\ 'ncurses_has_key(': 'int keycode | int', -\ 'ncurses_hide_panel(': 'resource panel | int', -\ 'ncurses_hline(': 'int charattr, int n | int', -\ 'ncurses_inch(': 'void | string', -\ 'ncurses_init_color(': 'int color, int r, int g, int b | int', -\ 'ncurses_init(': 'void | void', -\ 'ncurses_init_pair(': 'int pair, int fg, int bg | int', -\ 'ncurses_insch(': 'int character | int', -\ 'ncurses_insdelln(': 'int count | int', -\ 'ncurses_insertln(': 'void | bool', -\ 'ncurses_insstr(': 'string text | int', -\ 'ncurses_instr(': 'string &buffer | int', -\ 'ncurses_isendwin(': 'void | bool', -\ 'ncurses_keyok(': 'int keycode, bool enable | int', -\ 'ncurses_keypad(': 'resource window, bool bf | int', -\ 'ncurses_killchar(': 'void | string', -\ 'ncurses_longname(': 'void | string', -\ 'ncurses_meta(': 'resource window, bool 8bit | int', -\ 'ncurses_mouseinterval(': 'int milliseconds | int', -\ 'ncurses_mousemask(': 'int newmask, int &oldmask | int', -\ 'ncurses_mouse_trafo(': 'int &y, int &x, bool toscreen | bool', -\ 'ncurses_move(': 'int y, int x | int', -\ 'ncurses_move_panel(': 'resource panel, int startx, int starty | int', -\ 'ncurses_mvaddch(': 'int y, int x, int c | int', -\ 'ncurses_mvaddchnstr(': 'int y, int x, string s, int n | int', -\ 'ncurses_mvaddchstr(': 'int y, int x, string s | int', -\ 'ncurses_mvaddnstr(': 'int y, int x, string s, int n | int', -\ 'ncurses_mvaddstr(': 'int y, int x, string s | int', -\ 'ncurses_mvcur(': 'int old_y, int old_x, int new_y, int new_x | int', -\ 'ncurses_mvdelch(': 'int y, int x | int', -\ 'ncurses_mvgetch(': 'int y, int x | int', -\ 'ncurses_mvhline(': 'int y, int x, int attrchar, int n | int', -\ 'ncurses_mvinch(': 'int y, int x | int', -\ 'ncurses_mvvline(': 'int y, int x, int attrchar, int n | int', -\ 'ncurses_mvwaddstr(': 'resource window, int y, int x, string text | int', -\ 'ncurses_napms(': 'int milliseconds | int', -\ 'ncurses_newpad(': 'int rows, int cols | resource', -\ 'ncurses_new_panel(': 'resource window | resource', -\ 'ncurses_newwin(': 'int rows, int cols, int y, int x | resource', -\ 'ncurses_nl(': 'void | bool', -\ 'ncurses_nocbreak(': 'void | bool', -\ 'ncurses_noecho(': 'void | bool', -\ 'ncurses_nonl(': 'void | bool', -\ 'ncurses_noqiflush(': 'void | void', -\ 'ncurses_noraw(': 'void | bool', -\ 'ncurses_pair_content(': 'int pair, int &f, int &b | int', -\ 'ncurses_panel_above(': 'resource panel | resource', -\ 'ncurses_panel_below(': 'resource panel | resource', -\ 'ncurses_panel_window(': 'resource panel | resource', -\ 'ncurses_pnoutrefresh(': 'resource pad, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol | int', -\ 'ncurses_prefresh(': 'resource pad, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol | int', -\ 'ncurses_putp(': 'string text | int', -\ 'ncurses_qiflush(': 'void | void', -\ 'ncurses_raw(': 'void | bool', -\ 'ncurses_refresh(': 'int ch | int', -\ 'ncurses_replace_panel(': 'resource panel, resource window | int', -\ 'ncurses_reset_prog_mode(': 'void | int', -\ 'ncurses_reset_shell_mode(': 'void | int', -\ 'ncurses_resetty(': 'void | bool', -\ 'ncurses_savetty(': 'void | bool', -\ 'ncurses_scr_dump(': 'string filename | int', -\ 'ncurses_scr_init(': 'string filename | int', -\ 'ncurses_scrl(': 'int count | int', -\ 'ncurses_scr_restore(': 'string filename | int', -\ 'ncurses_scr_set(': 'string filename | int', -\ 'ncurses_show_panel(': 'resource panel | int', -\ 'ncurses_slk_attr(': 'void | bool', -\ 'ncurses_slk_attroff(': 'int intarg | int', -\ 'ncurses_slk_attron(': 'int intarg | int', -\ 'ncurses_slk_attrset(': 'int intarg | int', -\ 'ncurses_slk_clear(': 'void | bool', -\ 'ncurses_slk_color(': 'int intarg | int', -\ 'ncurses_slk_init(': 'int format | bool', -\ 'ncurses_slk_noutrefresh(': 'void | bool', -\ 'ncurses_slk_refresh(': 'void | bool', -\ 'ncurses_slk_restore(': 'void | bool', -\ 'ncurses_slk_set(': 'int labelnr, string label, int format | bool', -\ 'ncurses_slk_touch(': 'void | bool', -\ 'ncurses_standend(': 'void | int', -\ 'ncurses_standout(': 'void | int', -\ 'ncurses_start_color(': 'void | int', -\ 'ncurses_termattrs(': 'void | bool', -\ 'ncurses_termname(': 'void | string', -\ 'ncurses_timeout(': 'int millisec | void', -\ 'ncurses_top_panel(': 'resource panel | int', -\ 'ncurses_typeahead(': 'int fd | int', -\ 'ncurses_ungetch(': 'int keycode | int', -\ 'ncurses_ungetmouse(': 'array mevent | bool', -\ 'ncurses_update_panels(': 'void | void', -\ 'ncurses_use_default_colors(': 'void | bool', -\ 'ncurses_use_env(': 'bool flag | void', -\ 'ncurses_use_extended_names(': 'bool flag | int', -\ 'ncurses_vidattr(': 'int intarg | int', -\ 'ncurses_vline(': 'int charattr, int n | int', -\ 'ncurses_waddch(': 'resource window, int ch | int', -\ 'ncurses_waddstr(': 'resource window, string str [, int n] | int', -\ 'ncurses_wattroff(': 'resource window, int attrs | int', -\ 'ncurses_wattron(': 'resource window, int attrs | int', -\ 'ncurses_wattrset(': 'resource window, int attrs | int', -\ 'ncurses_wborder(': 'resource window, int left, int right, int top, int bottom, int tl_corner, int tr_corner, int bl_corner, int br_corner | int', -\ 'ncurses_wclear(': 'resource window | int', -\ 'ncurses_wcolor_set(': 'resource window, int color_pair | int', -\ 'ncurses_werase(': 'resource window | int', -\ 'ncurses_wgetch(': 'resource window | int', -\ 'ncurses_whline(': 'resource window, int charattr, int n | int', -\ 'ncurses_wmouse_trafo(': 'resource window, int &y, int &x, bool toscreen | bool', -\ 'ncurses_wmove(': 'resource window, int y, int x | int', -\ 'ncurses_wnoutrefresh(': 'resource window | int', -\ 'ncurses_wrefresh(': 'resource window | int', -\ 'ncurses_wstandend(': 'resource window | int', -\ 'ncurses_wstandout(': 'resource window | int', -\ 'ncurses_wvline(': 'resource window, int charattr, int n | int', -\ 'newt_bell(': 'void | void', -\ 'newt_button_bar(': 'array &buttons | resource', -\ 'newt_button(': 'int left, int top, string text | resource', -\ 'newt_centered_window(': 'int width, int height [, string title] | int', -\ 'newt_checkbox_get_value(': 'resource checkbox | string', -\ 'newt_checkbox(': 'int left, int top, string text, string def_value [, string seq] | resource', -\ 'newt_checkbox_set_flags(': 'resource checkbox, int flags, int sense | void', -\ 'newt_checkbox_set_value(': 'resource checkbox, string value | void', -\ 'newt_checkbox_tree_add_item(': 'resource checkboxtree, string text, mixed data, int flags, int index [, int ...] | void', -\ 'newt_checkbox_tree_find_item(': 'resource checkboxtree, mixed data | array', -\ 'newt_checkbox_tree_get_current(': 'resource checkboxtree | mixed', -\ 'newt_checkbox_tree_get_entry_value(': 'resource checkboxtree, mixed data | string', -\ 'newt_checkbox_tree_get_multi_selection(': 'resource checkboxtree, string seqnum | array', -\ 'newt_checkbox_tree_get_selection(': 'resource checkboxtree | array', -\ 'newt_checkbox_tree(': 'int left, int top, int height [, int flags] | resource', -\ 'newt_checkbox_tree_multi(': 'int left, int top, int height, string seq [, int flags] | resource', -\ 'newt_checkbox_tree_set_current(': 'resource checkboxtree, mixed data | void', -\ 'newt_checkbox_tree_set_entry(': 'resource checkboxtree, mixed data, string text | void', -\ 'newt_checkbox_tree_set_entry_value(': 'resource checkboxtree, mixed data, string value | void', -\ 'newt_checkbox_tree_set_width(': 'resource checkbox_tree, int width | void', -\ 'newt_clear_key_buffer(': 'void | void', -\ 'newt_cls(': 'void | void', -\ 'newt_compact_button(': 'int left, int top, string text | resource', -\ 'newt_component_add_callback(': 'resource component, mixed func_name, mixed data | void', -\ 'newt_component_takes_focus(': 'resource component, bool takes_focus | void', -\ 'newt_create_grid(': 'int cols, int rows | resource', -\ 'newt_cursor_off(': 'void | void', -\ 'newt_cursor_on(': 'void | void', -\ 'newt_delay(': 'int microseconds | void', -\ 'newt_draw_form(': 'resource form | void', -\ 'newt_draw_root_text(': 'int left, int top, string text | void', -\ 'newt_entry_get_value(': 'resource entry | string', -\ 'newt_entry(': 'int left, int top, int width [, string init_value [, int flags]] | resource', -\ 'newt_entry_set_filter(': 'resource entry, callback filter, mixed data | void', -\ 'newt_entry_set_flags(': 'resource entry, int flags, int sense | void', -\ 'newt_entry_set(': 'resource entry, string value [, bool cursor_at_end] | void', -\ 'newt_finished(': 'void | int', -\ 'newt_form_add_component(': 'resource form, resource component | void', -\ 'newt_form_add_components(': 'resource form, array components | void', -\ 'newt_form_add_host_key(': 'resource form, int key | void', -\ 'newt_form_destroy(': 'resource form | void', -\ 'newt_form_get_current(': 'resource form | resource', -\ 'newt_form(': '[resource vert_bar [, string help [, int flags]]] | resource', -\ 'newt_form_run(': 'resource form, array &exit_struct | void', -\ 'newt_form_set_background(': 'resource from, int background | void', -\ 'newt_form_set_height(': 'resource form, int height | void', -\ 'newt_form_set_size(': 'resource form | void', -\ 'newt_form_set_timer(': 'resource form, int milliseconds | void', -\ 'newt_form_set_width(': 'resource form, int width | void', -\ 'newt_form_watch_fd(': 'resource form, resource stream [, int flags] | void', -\ 'newt_get_screen_size(': 'int &cols, int &rows | void', -\ 'newt_grid_add_components_to_form(': 'resource grid, resource form, bool recurse | void', -\ 'newt_grid_basic_window(': 'resource text, resource middle, resource buttons | resource', -\ 'newt_grid_free(': 'resource grid, bool recurse | void', -\ 'newt_grid_get_size(': 'resouce grid, int &width, int &height | void', -\ 'newt_grid_h_close_stacked(': 'int element1_type, resource element1 [, int ... [, resource ...]] | resource', -\ 'newt_grid_h_stacked(': 'int element1_type, resource element1 [, int ... [, resource ...]] | resource', -\ 'newt_grid_place(': 'resource grid, int left, int top | void', -\ 'newt_grid_set_field(': 'resource grid, int col, int row, int type, resource val, int pad_left, int pad_top, int pad_right, int pad_bottom, int anchor [, int flags] | void', -\ 'newt_grid_simple_window(': 'resource text, resource middle, resource buttons | resource', -\ 'newt_grid_v_close_stacked(': 'int element1_type, resource element1 [, int ... [, resource ...]] | resource', -\ 'newt_grid_v_stacked(': 'int element1_type, resource element1 [, int ... [, resource ...]] | resource', -\ 'newt_grid_wrapped_window_at(': 'resource grid, string title, int left, int top | void', -\ 'newt_grid_wrapped_window(': 'resource grid, string title | void', -\ 'newt_init(': 'void | int', -\ 'newt_label(': 'int left, int top, string text | resource', -\ 'newt_label_set_text(': 'resource label, string text | void', -\ 'newt_listbox_append_entry(': 'resource listbox, string text, mixed data | void', -\ 'newt_listbox_clear(': 'resource listobx | void', -\ 'newt_listbox_clear_selection(': 'resource listbox | void', -\ 'newt_listbox_delete_entry(': 'resource listbox, mixed key | void', -\ 'newt_listbox_get_current(': 'resource listbox | string', -\ 'newt_listbox_get_selection(': 'resource listbox | array', -\ 'newt_listbox(': 'int left, int top, int height [, int flags] | resource', -\ 'newt_listbox_insert_entry(': 'resource listbox, string text, mixed data, mixed key | void', -\ 'newt_listbox_item_count(': 'resource listbox | int', -\ 'newt_listbox_select_item(': 'resource listbox, mixed key, int sense | void', -\ 'newt_listbox_set_current_by_key(': 'resource listbox, mixed key | void', -\ 'newt_listbox_set_current(': 'resource listbox, int num | void', -\ 'newt_listbox_set_data(': 'resource listbox, int num, mixed data | void', -\ 'newt_listbox_set_entry(': 'resource listbox, int num, string text | void', -\ 'newt_listbox_set_width(': 'resource listbox, int width | void', -\ 'newt_listitem_get_data(': 'resource item | mixed', -\ 'newt_listitem(': 'int left, int top, string text, bool is_default, resouce prev_item, mixed data [, int flags] | resource', -\ 'newt_listitem_set(': 'resource item, string text | void', -\ 'newt_open_window(': 'int left, int top, int width, int height [, string title] | int', -\ 'newt_pop_help_line(': 'void | void', -\ 'newt_pop_window(': 'void | void', -\ 'newt_push_help_line(': '[string text] | void', -\ 'newt_radiobutton(': 'int left, int top, string text, bool is_default [, resource prev_button] | resource', -\ 'newt_radio_get_current(': 'resource set_member | resource', -\ 'newt_redraw_help_line(': 'void | void', -\ 'newt_reflow_text(': 'string text, int width, int flex_down, int flex_up, int &actual_width, int &actual_height | string', -\ 'newt_refresh(': 'void | void', -\ 'newt_resize_screen(': '[bool redraw] | void', -\ 'newt_resume(': 'void | void', -\ 'newt_run_form(': 'resource form | resource', -\ 'newt_scale(': 'int left, int top, int width, int full_value | resource', -\ 'newt_scale_set(': 'resource scale, int amount | void', -\ 'newt_scrollbar_set(': 'resource scrollbar, int where, int total | void', -\ 'newt_set_help_callback(': 'mixed function | void', -\ 'newt_set_suspend_callback(': 'callback function, mixed data | void', -\ 'newt_suspend(': 'void | void', -\ 'newt_texbox_set_text(': 'resource textbox, string text | void', -\ 'newt_textbox_get_num_lines(': 'resource textbox | int', -\ 'newt_textbox(': 'int left, int top, int width, int height [, int flags] | resource', -\ 'newt_textbox_reflowed(': 'int left, int top, char *text, int width, int flex_down, int flex_up [, int flags] | resource', -\ 'newt_textbox_set_height(': 'resource textbox, int height | void', -\ 'newt_vertical_scrollbar(': 'int left, int top, int height [, int normal_colorset [, int thumb_colorset]] | resource', -\ 'newt_wait_for_key(': 'void | void', -\ 'newt_win_choice(': 'string title, string button1_text, string button2_text, string format [, mixed args [, mixed ...]] | int', -\ 'newt_win_entries(': 'string title, string text, int suggested_width, int flex_down, int flex_up, int data_width, array &items, string button1 [, string ...] | int', -\ 'newt_win_menu(': 'string title, string text, int suggestedWidth, int flexDown, int flexUp, int maxListHeight, array items, int &listItem [, string button1 [, string ...]] | int', -\ 'newt_win_message(': 'string title, string button_text, string format [, mixed args [, mixed ...]] | void', -\ 'newt_win_messagev(': 'string title, string button_text, string format, array args | void', -\ 'newt_win_ternary(': 'string title, string button1_text, string button2_text, string button3_text, string format [, mixed args [, mixed ...]] | int', -\ 'next(': 'array &array | mixed', -\ 'ngettext(': 'string msgid1, string msgid2, int n | string', -\ 'nl2br(': 'string string | string', -\ 'nl_langinfo(': 'int item | string', -\ 'notes_body(': 'string server, string mailbox, int msg_number | array', -\ 'notes_copy_db(': 'string from_database_name, string to_database_name | bool', -\ 'notes_create_db(': 'string database_name | bool', -\ 'notes_create_note(': 'string database_name, string form_name | bool', -\ 'notes_drop_db(': 'string database_name | bool', -\ 'notes_find_note(': 'string database_name, string name [, string type] | int', -\ 'notes_header_info(': 'string server, string mailbox, int msg_number | object', -\ 'notes_list_msgs(': 'string db | bool', -\ 'notes_mark_read(': 'string database_name, string user_name, string note_id | bool', -\ 'notes_mark_unread(': 'string database_name, string user_name, string note_id | bool', -\ 'notes_nav_create(': 'string database_name, string name | bool', -\ 'notes_search(': 'string database_name, string keywords | array', -\ 'notes_unread(': 'string database_name, string user_name | array', -\ 'notes_version(': 'string database_name | float', -\ 'nsapi_request_headers(': 'void | array', -\ 'nsapi_response_headers(': 'void | array', -\ 'nsapi_virtual(': 'string uri | bool', -\ 'number_format(': 'float number [, int decimals [, string dec_point, string thousands_sep]] | string', -\ 'ob_clean(': 'void | void', -\ 'ob_end_clean(': 'void | bool', -\ 'ob_end_flush(': 'void | bool', -\ 'ob_flush(': 'void | void', -\ 'ob_get_clean(': 'void | string', -\ 'ob_get_contents(': 'void | string', -\ 'ob_get_flush(': 'void | string', -\ 'ob_get_length(': 'void | int', -\ 'ob_get_level(': 'void | int', -\ 'ob_gzhandler(': 'string buffer, int mode | string', -\ 'ob_iconv_handler(': 'string contents, int status | string', -\ 'ob_implicit_flush(': '[int flag] | void', -\ 'ob_list_handlers(': 'void | array', -\ 'ob_start(': '[callback output_callback [, int chunk_size [, bool erase]]] | bool', -\ 'ob_tidyhandler(': 'string input [, int mode] | string', -\ 'oci_bind_by_name(': 'resource stmt, string ph_name, mixed &variable [, int maxlength [, int type]] | bool', -\ 'oci_cancel(': 'resource stmt | bool', -\ 'oci_close(': 'resource connection | bool', -\ 'oci_commit(': 'resource connection | bool', -\ 'oci_connect(': 'string username, string password [, string db [, string charset [, int session_mode]]] | resource', -\ 'oci_define_by_name(': 'resource statement, string column_name, mixed &variable [, int type] | bool', -\ 'oci_error(': '[resource source] | array', -\ 'oci_execute(': 'resource stmt [, int mode] | bool', -\ 'oci_fetch_all(': 'resource statement, array &output [, int skip [, int maxrows [, int flags]]] | int', -\ 'oci_fetch_array(': 'resource statement [, int mode] | array', -\ 'oci_fetch_assoc(': 'resource statement | array', -\ 'oci_fetch(': 'resource statement | bool', -\ 'ocifetchinto(': 'resource statement, array &result [, int mode] | int', -\ 'oci_fetch_object(': 'resource statement | object', -\ 'oci_fetch_row(': 'resource statement | array', -\ 'oci_field_is_null(': 'resource stmt, mixed field | bool', -\ 'oci_field_name(': 'resource statement, int field | string', -\ 'oci_field_precision(': 'resource statement, int field | int', -\ 'oci_field_scale(': 'resource statement, int field | int', -\ 'oci_field_size(': 'resource stmt, mixed field | int', -\ 'oci_field_type(': 'resource stmt, int field | mixed', -\ 'oci_field_type_raw(': 'resource statement, int field | int', -\ 'oci_free_statement(': 'resource statement | bool', -\ 'oci_internal_debug(': 'int onoff | void', -\ 'oci_lob_copy(': 'OCI-Lob lob_to, OCI-Lob lob_from [, int length] | bool', -\ 'oci_lob_is_equal(': 'OCI-Lob lob1, OCI-Lob lob2 | bool', -\ 'oci_new_collection(': 'resource connection, string tdo [, string schema] | OCI-Collection', -\ 'oci_new_connect(': 'string username, string password [, string db [, string charset [, int session_mode]]] | resource', -\ 'oci_new_cursor(': 'resource connection | resource', -\ 'oci_new_descriptor(': 'resource connection [, int type] | OCI-Lob', -\ 'oci_num_fields(': 'resource statement | int', -\ 'oci_num_rows(': 'resource stmt | int', -\ 'oci_parse(': 'resource connection, string query | resource', -\ 'oci_password_change(': 'resource connection, string username, string old_password, string new_password | bool', -\ 'oci_pconnect(': 'string username, string password [, string db [, string charset [, int session_mode]]] | resource', -\ 'oci_result(': 'resource statement, mixed field | mixed', -\ 'oci_rollback(': 'resource connection | bool', -\ 'oci_server_version(': 'resource connection | string', -\ 'oci_set_prefetch(': 'resource statement [, int rows] | bool', -\ 'oci_statement_type(': 'resource statement | string', -\ 'octdec(': 'string octal_string | number', -\ 'odbc_autocommit(': 'resource connection_id [, bool OnOff] | mixed', -\ 'odbc_binmode(': 'resource result_id, int mode | bool', -\ 'odbc_close_all(': 'void | void', -\ 'odbc_close(': 'resource connection_id | void', -\ 'odbc_columnprivileges(': 'resource connection_id, string qualifier, string owner, string table_name, string column_name | resource', -\ 'odbc_columns(': 'resource connection_id [, string qualifier [, string schema [, string table_name [, string column_name]]]] | resource', -\ 'odbc_commit(': 'resource connection_id | bool', -\ 'odbc_connect(': 'string dsn, string user, string password [, int cursor_type] | resource', -\ 'odbc_cursor(': 'resource result_id | string', -\ 'odbc_data_source(': 'resource connection_id, int fetch_type | array', -\ 'odbc_do(': 'resource conn_id, string query | resource', -\ 'odbc_error(': '[resource connection_id] | string', -\ 'odbc_errormsg(': '[resource connection_id] | string', -\ 'odbc_exec(': 'resource connection_id, string query_string [, int flags] | resource', -\ 'odbc_execute(': 'resource result_id [, array parameters_array] | bool', -\ 'odbc_fetch_array(': 'resource result [, int rownumber] | array', -\ 'odbc_fetch_into(': 'resource result_id, array &result_array [, int rownumber] | int', -\ 'odbc_fetch_object(': 'resource result [, int rownumber] | object', -\ 'odbc_fetch_row(': 'resource result_id [, int row_number] | bool', -\ 'odbc_field_len(': 'resource result_id, int field_number | int', -\ 'odbc_field_name(': 'resource result_id, int field_number | string', -\ 'odbc_field_num(': 'resource result_id, string field_name | int', -\ 'odbc_field_precision(': 'resource result_id, int field_number | int', -\ 'odbc_field_scale(': 'resource result_id, int field_number | int', -\ 'odbc_field_type(': 'resource result_id, int field_number | string', -\ 'odbc_foreignkeys(': 'resource connection_id, string pk_qualifier, string pk_owner, string pk_table, string fk_qualifier, string fk_owner, string fk_table | resource', -\ 'odbc_free_result(': 'resource result_id | bool', -\ 'odbc_gettypeinfo(': 'resource connection_id [, int data_type] | resource', -\ 'odbc_longreadlen(': 'resource result_id, int length | bool', -\ 'odbc_next_result(': 'resource result_id | bool', -\ 'odbc_num_fields(': 'resource result_id | int', -\ 'odbc_num_rows(': 'resource result_id | int', -\ 'odbc_pconnect(': 'string dsn, string user, string password [, int cursor_type] | resource', -\ 'odbc_prepare(': 'resource connection_id, string query_string | resource', -\ 'odbc_primarykeys(': 'resource connection_id, string qualifier, string owner, string table | resource', -\ 'odbc_procedurecolumns(': 'resource connection_id [, string qualifier, string owner, string proc, string column] | resource', -\ 'odbc_procedures(': 'resource connection_id [, string qualifier, string owner, string name] | resource', -\ 'odbc_result_all(': 'resource result_id [, string format] | int', -\ 'odbc_result(': 'resource result_id, mixed field | mixed', -\ 'odbc_rollback(': 'resource connection_id | bool', -\ 'odbc_setoption(': 'resource id, int function, int option, int param | bool', -\ 'odbc_specialcolumns(': 'resource connection_id, int type, string qualifier, string owner, string table, int scope, int nullable | resource', -\ 'odbc_statistics(': 'resource connection_id, string qualifier, string owner, string table_name, int unique, int accuracy | resource', -\ 'odbc_tableprivileges(': 'resource connection_id, string qualifier, string owner, string name | resource', -\ 'odbc_tables(': 'resource connection_id [, string qualifier [, string owner [, string name [, string types]]]] | resource', -\ 'openal_buffer_create(': 'void | resource', -\ 'openal_buffer_data(': 'resource buffer, int format, string data, int freq | bool', -\ 'openal_buffer_destroy(': 'resource buffer | bool', -\ 'openal_buffer_get(': 'resource buffer, int property | int', -\ 'openal_buffer_loadwav(': 'resource buffer, string wavfile | bool', -\ 'openal_context_create(': 'resource device | resource', -\ 'openal_context_current(': 'resource context | bool', -\ 'openal_context_destroy(': 'resource context | bool', -\ 'openal_context_process(': 'resource context | bool', -\ 'openal_context_suspend(': 'resource context | bool', -\ 'openal_device_close(': 'resource device | bool', -\ 'openal_device_open(': '[string device_desc] | resource', -\ 'openal_listener_get(': 'int property | mixed', -\ 'openal_listener_set(': 'int property, mixed setting | bool', -\ 'openal_source_create(': 'void | resource', -\ 'openal_source_destroy(': 'resource source | bool', -\ 'openal_source_get(': 'resource source, int property | mixed', -\ 'openal_source_pause(': 'resource source | bool', -\ 'openal_source_play(': 'resource source | bool', -\ 'openal_source_rewind(': 'resource source | bool', -\ 'openal_source_set(': 'resource source, int property, mixed setting | bool', -\ 'openal_source_stop(': 'resource source | bool', -\ 'openal_stream(': 'resource source, int format, int rate | resource', -\ 'opendir(': 'string path [, resource context] | resource', -\ 'openlog(': 'string ident, int option, int facility | bool', -\ 'openssl_csr_export(': 'resource csr, string &out [, bool notext] | bool', -\ 'openssl_csr_export_to_file(': 'resource csr, string outfilename [, bool notext] | bool', -\ 'openssl_csr_new(': 'array dn, resource &privkey [, array configargs [, array extraattribs]] | mixed', -\ 'openssl_csr_sign(': 'mixed csr, mixed cacert, mixed priv_key, int days [, array configargs [, int serial]] | resource', -\ 'openssl_error_string(': 'void | string', -\ 'openssl_free_key(': 'resource key_identifier | void', -\ 'openssl_open(': 'string sealed_data, string &open_data, string env_key, mixed priv_key_id | bool', -\ 'openssl_pkcs7_decrypt(': 'string infilename, string outfilename, mixed recipcert [, mixed recipkey] | bool', -\ 'openssl_pkcs7_encrypt(': 'string infile, string outfile, mixed recipcerts, array headers [, int flags [, int cipherid]] | bool', -\ 'openssl_pkcs7_sign(': 'string infilename, string outfilename, mixed signcert, mixed privkey, array headers [, int flags [, string extracerts]] | bool', -\ 'openssl_pkcs7_verify(': 'string filename, int flags [, string outfilename [, array cainfo [, string extracerts]]] | mixed', -\ 'openssl_pkey_export(': 'mixed key, string &out [, string passphrase [, array configargs]] | bool', -\ 'openssl_pkey_export_to_file(': 'mixed key, string outfilename [, string passphrase [, array configargs]] | bool', -\ 'openssl_pkey_free(': 'resource key | void', -\ 'openssl_pkey_get_private(': 'mixed key [, string passphrase] | resource', -\ 'openssl_pkey_get_public(': 'mixed certificate | resource', -\ 'openssl_pkey_new(': '[array configargs] | resource', -\ 'openssl_private_decrypt(': 'string data, string &decrypted, mixed key [, int padding] | bool', -\ 'openssl_private_encrypt(': 'string data, string &crypted, mixed key [, int padding] | bool', -\ 'openssl_public_decrypt(': 'string data, string &decrypted, mixed key [, int padding] | bool', -\ 'openssl_public_encrypt(': 'string data, string &crypted, mixed key [, int padding] | bool', -\ 'openssl_seal(': 'string data, string &sealed_data, array &env_keys, array pub_key_ids | int', -\ 'openssl_sign(': 'string data, string &signature, mixed priv_key_id [, int signature_alg] | bool', -\ 'openssl_verify(': 'string data, string signature, mixed pub_key_id | int', -\ 'openssl_x509_check_private_key(': 'mixed cert, mixed key | bool', -\ 'openssl_x509_checkpurpose(': 'mixed x509cert, int purpose [, array cainfo [, string untrustedfile]] | int', -\ 'openssl_x509_export(': 'mixed x509, string &output [, bool notext] | bool', -\ 'openssl_x509_export_to_file(': 'mixed x509, string outfilename [, bool notext] | bool', -\ 'openssl_x509_free(': 'resource x509cert | void', -\ 'openssl_x509_parse(': 'mixed x509cert [, bool shortnames] | array', -\ 'openssl_x509_read(': 'mixed x509certdata | resource', -\ 'ora_bind(': 'resource cursor, string PHP_variable_name, string SQL_parameter_name, int length [, int type] | bool', -\ 'ora_close(': 'resource cursor | bool', -\ 'ora_columnname(': 'resource cursor, int column | string', -\ 'ora_columnsize(': 'resource cursor, int column | int', -\ 'ora_columntype(': 'resource cursor, int column | string', -\ 'ora_commit(': 'resource conn | bool', -\ 'ora_commitoff(': 'resource conn | bool', -\ 'ora_commiton(': 'resource conn | bool', -\ 'ora_do(': 'resource conn, string query | resource', -\ 'ora_errorcode(': '[resource cursor_or_connection] | int', -\ 'ora_error(': '[resource cursor_or_connection] | string', -\ 'ora_exec(': 'resource cursor | bool', -\ 'ora_fetch(': 'resource cursor | bool', -\ 'ora_fetch_into(': 'resource cursor, array &result [, int flags] | int', -\ 'ora_getcolumn(': 'resource cursor, int column | string', -\ 'ora_logoff(': 'resource connection | bool', -\ 'ora_logon(': 'string user, string password | resource', -\ 'ora_numcols(': 'resource cursor | int', -\ 'ora_numrows(': 'resource cursor | int', -\ 'ora_open(': 'resource connection | resource', -\ 'ora_parse(': 'resource cursor, string sql_statement [, int defer] | bool', -\ 'ora_plogon(': 'string user, string password | resource', -\ 'ora_rollback(': 'resource connection | bool', -\ 'OrbitEnum(': 'string id | new', -\ 'OrbitObject(': 'string ior | new', -\ 'OrbitStruct(': 'string id | new', -\ 'ord(': 'string string | int', -\ 'output_add_rewrite_var(': 'string name, string value | bool', -\ 'output_reset_rewrite_vars(': 'void | bool', -\ 'overload(': '[string class_name] | void', -\ 'override_function(': 'string function_name, string function_args, string function_code | bool', -\ 'ovrimos_close(': 'int connection | void', -\ 'ovrimos_commit(': 'int connection_id | bool', -\ 'ovrimos_connect(': 'string host, string db, string user, string password | int', -\ 'ovrimos_cursor(': 'int result_id | string', -\ 'ovrimos_exec(': 'int connection_id, string query | int', -\ 'ovrimos_execute(': 'int result_id [, array parameters_array] | bool', -\ 'ovrimos_fetch_into(': 'int result_id, array &result_array [, string how [, int rownumber]] | bool', -\ 'ovrimos_fetch_row(': 'int result_id [, int how [, int row_number]] | bool', -\ 'ovrimos_field_len(': 'int result_id, int field_number | int', -\ 'ovrimos_field_name(': 'int result_id, int field_number | string', -\ 'ovrimos_field_num(': 'int result_id, string field_name | int', -\ 'ovrimos_field_type(': 'int result_id, int field_number | int', -\ 'ovrimos_free_result(': 'int result_id | bool', -\ 'ovrimos_longreadlen(': 'int result_id, int length | bool', -\ 'ovrimos_num_fields(': 'int result_id | int', -\ 'ovrimos_num_rows(': 'int result_id | int', -\ 'ovrimos_prepare(': 'int connection_id, string query | int', -\ 'ovrimos_result_all(': 'int result_id [, string format] | int', -\ 'ovrimos_result(': 'int result_id, mixed field | string', -\ 'ovrimos_rollback(': 'int connection_id | bool', -\ 'pack(': 'string format [, mixed args [, mixed ...]] | string', -\ 'parse_ini_file(': 'string filename [, bool process_sections] | array', -\ 'parsekit_compile_file(': 'string filename [, array &errors [, int options]] | array', -\ 'parsekit_compile_string(': 'string phpcode [, array &errors [, int options]] | array', -\ 'parsekit_func_arginfo(': 'mixed function | array', -\ 'parse_str(': 'string str [, array &arr] | void', -\ 'parse_url(': 'string url | array', -\ 'passthru(': 'string command [, int &return_var] | void', -\ 'pathinfo(': 'string path [, int options] | mixed', -\ 'pclose(': 'resource handle | int', -\ 'pcntl_alarm(': 'int seconds | int', -\ 'pcntl_exec(': 'string path [, array args [, array envs]] | void', -\ 'pcntl_fork(': 'void | int', -\ 'pcntl_getpriority(': '[int pid [, int process_identifier]] | int', -\ 'pcntl_setpriority(': 'int priority [, int pid [, int process_identifier]] | bool', -\ 'pcntl_signal(': 'int signo, callback handle [, bool restart_syscalls] | bool', -\ 'pcntl_wait(': 'int &status [, int options] | int', -\ 'pcntl_waitpid(': 'int pid, int &status [, int options] | int', -\ 'pcntl_wexitstatus(': 'int status | int', -\ 'pcntl_wifexited(': 'int status | bool', -\ 'pcntl_wifsignaled(': 'int status | bool', -\ 'pcntl_wifstopped(': 'int status | bool', -\ 'pcntl_wstopsig(': 'int status | int', -\ 'pcntl_wtermsig(': 'int status | int', -\ 'pdf_activate_item(': 'resource pdfdoc, int id | bool', -\ 'pdf_add_launchlink(': 'resource pdfdoc, float llx, float lly, float urx, float ury, string filename | bool', -\ 'pdf_add_locallink(': 'resource pdfdoc, float lowerleftx, float lowerlefty, float upperrightx, float upperrighty, int page, string dest | bool', -\ 'pdf_add_nameddest(': 'resource pdfdoc, string name, string optlist | bool', -\ 'pdf_add_note(': 'resource pdfdoc, float llx, float lly, float urx, float ury, string contents, string title, string icon, int open | bool', -\ 'pdf_add_pdflink(': 'resource pdfdoc, float bottom_left_x, float bottom_left_y, float up_right_x, float up_right_y, string filename, int page, string dest | bool', -\ 'pdf_add_thumbnail(': 'resource pdfdoc, int image | bool', -\ 'pdf_add_weblink(': 'resource pdfdoc, float lowerleftx, float lowerlefty, float upperrightx, float upperrighty, string url | bool', -\ 'pdf_arc(': 'resource p, float x, float y, float r, float alpha, float beta | bool', -\ 'pdf_arcn(': 'resource p, float x, float y, float r, float alpha, float beta | bool', -\ 'pdf_attach_file(': 'resource pdfdoc, float llx, float lly, float urx, float ury, string filename, string description, string author, string mimetype, string icon | bool', -\ 'pdf_begin_document(': 'resource pdfdoc, string filename, string optlist | int', -\ 'pdf_begin_font(': 'resource pdfdoc, string filename, float a, float b, float c, float d, float e, float f, string optlist | bool', -\ 'pdf_begin_glyph(': 'resource pdfdoc, string glyphname, float wx, float llx, float lly, float urx, float ury | bool', -\ 'pdf_begin_item(': 'resource pdfdoc, string tag, string optlist | int', -\ 'pdf_begin_layer(': 'resource pdfdoc, int layer | bool', -\ 'pdf_begin_page_ext(': 'resource pdfdoc, float width, float height, string optlist | bool', -\ 'pdf_begin_page(': 'resource pdfdoc, float width, float height | bool', -\ 'pdf_begin_pattern(': 'resource pdfdoc, float width, float height, float xstep, float ystep, int painttype | int', -\ 'pdf_begin_template(': 'resource pdfdoc, float width, float height | int', -\ 'pdf_circle(': 'resource pdfdoc, float x, float y, float r | bool', -\ 'pdf_clip(': 'resource p | bool', -\ 'pdf_close(': 'resource p | bool', -\ 'pdf_close_image(': 'resource p, int image | void', -\ 'pdf_closepath_fill_stroke(': 'resource p | bool', -\ 'pdf_closepath(': 'resource p | bool', -\ 'pdf_closepath_stroke(': 'resource p | bool', -\ 'pdf_close_pdi(': 'resource p, int doc | bool', -\ 'pdf_close_pdi_page(': 'resource p, int page | bool', -\ 'pdf_concat(': 'resource p, float a, float b, float c, float d, float e, float f | bool', -\ 'pdf_continue_text(': 'resource p, string text | bool', -\ 'pdf_create_action(': 'resource pdfdoc, string type, string optlist | int', -\ 'pdf_create_annotation(': 'resource pdfdoc, float llx, float lly, float urx, float ury, string type, string optlist | bool', -\ 'pdf_create_bookmark(': 'resource pdfdoc, string text, string optlist | int', -\ 'pdf_create_fieldgroup(': 'resource pdfdoc, string name, string optlist | bool', -\ 'pdf_create_field(': 'resource pdfdoc, float llx, float lly, float urx, float ury, string name, string type, string optlist | bool', -\ 'pdf_create_gstate(': 'resource pdfdoc, string optlist | int', -\ 'pdf_create_pvf(': 'resource pdfdoc, string filename, string data, string optlist | bool', -\ 'pdf_create_textflow(': 'resource pdfdoc, string text, string optlist | int', -\ 'pdf_curveto(': 'resource p, float x1, float y1, float x2, float y2, float x3, float y3 | bool', -\ 'pdf_define_layer(': 'resource pdfdoc, string name, string optlist | int', -\ 'pdf_delete(': 'resource pdfdoc | bool', -\ 'pdf_delete_pvf(': 'resource pdfdoc, string filename | int', -\ 'pdf_delete_textflow(': 'resource pdfdoc, int textflow | bool', -\ 'pdf_encoding_set_char(': 'resource pdfdoc, string encoding, int slot, string glyphname, int uv | bool', -\ 'pdf_end_document(': 'resource pdfdoc, string optlist | bool', -\ 'pdf_end_font(': 'resource pdfdoc | bool', -\ 'pdf_end_glyph(': 'resource pdfdoc | bool', -\ 'pdf_end_item(': 'resource pdfdoc, int id | bool', -\ 'pdf_end_layer(': 'resource pdfdoc | bool', -\ 'pdf_end_page_ext(': 'resource pdfdoc, string optlist | bool', -\ 'pdf_end_page(': 'resource p | bool', -\ 'pdf_end_pattern(': 'resource p | bool', -\ 'pdf_end_template(': 'resource p | bool', -\ 'pdf_fill(': 'resource p | bool', -\ 'pdf_fill_imageblock(': 'resource pdfdoc, int page, string blockname, int image, string optlist | int', -\ 'pdf_fill_pdfblock(': 'resource pdfdoc, int page, string blockname, int contents, string optlist | int', -\ 'pdf_fill_stroke(': 'resource p | bool', -\ 'pdf_fill_textblock(': 'resource pdfdoc, int page, string blockname, string text, string optlist | int', -\ 'pdf_findfont(': 'resource p, string fontname, string encoding, int embed | int', -\ 'pdf_fit_image(': 'resource pdfdoc, int image, float x, float y, string optlist | bool', -\ 'pdf_fit_pdi_page(': 'resource pdfdoc, int page, float x, float y, string optlist | bool', -\ 'pdf_fit_textflow(': 'resource pdfdoc, int textflow, float llx, float lly, float urx, float ury, string optlist | string', -\ 'pdf_fit_textline(': 'resource pdfdoc, string text, float x, float y, string optlist | bool', -\ 'pdf_get_apiname(': 'resource pdfdoc | string', -\ 'pdf_get_buffer(': 'resource p | string', -\ 'pdf_get_errmsg(': 'resource pdfdoc | string', -\ 'pdf_get_errnum(': 'resource pdfdoc | int', -\ 'pdf_get_majorversion(': 'void | int', -\ 'pdf_get_minorversion(': 'void | int', -\ 'pdf_get_parameter(': 'resource p, string key, float modifier | string', -\ 'pdf_get_pdi_parameter(': 'resource p, string key, int doc, int page, int reserved | string', -\ 'pdf_get_pdi_value(': 'resource p, string key, int doc, int page, int reserved | float', -\ 'pdf_get_value(': 'resource p, string key, float modifier | float', -\ 'pdf_info_textflow(': 'resource pdfdoc, int textflow, string keyword | float', -\ 'pdf_initgraphics(': 'resource p | bool', -\ 'pdf_lineto(': 'resource p, float x, float y | bool', -\ 'pdf_load_font(': 'resource pdfdoc, string fontname, string encoding, string optlist | int', -\ 'pdf_load_iccprofile(': 'resource pdfdoc, string profilename, string optlist | int', -\ 'pdf_load_image(': 'resource pdfdoc, string imagetype, string filename, string optlist | int', -\ 'pdf_makespotcolor(': 'resource p, string spotname | int', -\ 'pdf_moveto(': 'resource p, float x, float y | bool', -\ 'pdf_new(': ' | resource', -\ 'pdf_open_ccitt(': 'resource pdfdoc, string filename, int width, int height, int BitReverse, int k, int Blackls1 | int', -\ 'pdf_open_file(': 'resource p, string filename | bool', -\ 'pdf_open_image_file(': 'resource p, string imagetype, string filename, string stringparam, int intparam | int', -\ 'pdf_open_image(': 'resource p, string imagetype, string source, string data, int length, int width, int height, int components, int bpc, string params | int', -\ 'pdf_open_memory_image(': 'resource p, resource image | int', -\ 'pdf_open_pdi(': 'resource pdfdoc, string filename, string optlist, int len | int', -\ 'pdf_open_pdi_page(': 'resource p, int doc, int pagenumber, string optlist | int', -\ 'pdf_place_image(': 'resource pdfdoc, int image, float x, float y, float scale | bool', -\ 'pdf_place_pdi_page(': 'resource pdfdoc, int page, float x, float y, float sx, float sy | bool', -\ 'pdf_process_pdi(': 'resource pdfdoc, int doc, int page, string optlist | int', -\ 'pdf_rect(': 'resource p, float x, float y, float width, float height | bool', -\ 'pdf_restore(': 'resource p | bool', -\ 'pdf_resume_page(': 'resource pdfdoc, string optlist | bool', -\ 'pdf_rotate(': 'resource p, float phi | bool', -\ 'pdf_save(': 'resource p | bool', -\ 'pdf_scale(': 'resource p, float sx, float sy | bool', -\ 'pdf_set_border_color(': 'resource p, float red, float green, float blue | bool', -\ 'pdf_set_border_dash(': 'resource pdfdoc, float black, float white | bool', -\ 'pdf_set_border_style(': 'resource pdfdoc, string style, float width | bool', -\ 'pdf_setcolor(': 'resource p, string fstype, string colorspace, float c1, float c2, float c3, float c4 | bool', -\ 'pdf_setdash(': 'resource pdfdoc, float b, float w | bool', -\ 'pdf_setdashpattern(': 'resource pdfdoc, string optlist | bool', -\ 'pdf_setflat(': 'resource pdfdoc, float flatness | bool', -\ 'pdf_setfont(': 'resource pdfdoc, int font, float fontsize | bool', -\ 'pdf_setgray_fill(': 'resource p, float g | bool', -\ 'pdf_setgray(': 'resource p, float g | bool', -\ 'pdf_setgray_stroke(': 'resource p, float g | bool', -\ 'pdf_set_gstate(': 'resource pdfdoc, int gstate | bool', -\ 'pdf_set_info(': 'resource p, string key, string value | bool', -\ 'pdf_set_layer_dependency(': 'resource pdfdoc, string type, string optlist | bool', -\ 'pdf_setlinecap(': 'resource p, int linecap | bool', -\ 'pdf_setlinejoin(': 'resource p, int value | bool', -\ 'pdf_setlinewidth(': 'resource p, float width | bool', -\ 'pdf_setmatrix(': 'resource p, float a, float b, float c, float d, float e, float f | bool', -\ 'pdf_setmiterlimit(': 'resource pdfdoc, float miter | bool', -\ 'pdf_set_parameter(': 'resource p, string key, string value | bool', -\ 'pdf_setrgbcolor_fill(': 'resource p, float red, float green, float blue | bool', -\ 'pdf_setrgbcolor(': 'resource p, float red, float green, float blue | bool', -\ 'pdf_setrgbcolor_stroke(': 'resource p, float red, float green, float blue | bool', -\ 'pdf_set_text_pos(': 'resource p, float x, float y | bool', -\ 'pdf_set_value(': 'resource p, string key, float value | bool', -\ 'pdf_shading(': 'resource pdfdoc, string shtype, float x0, float y0, float x1, float y1, float c1, float c2, float c3, float c4, string optlist | int', -\ 'pdf_shading_pattern(': 'resource pdfdoc, int shading, string optlist | int', -\ 'pdf_shfill(': 'resource pdfdoc, int shading | bool', -\ 'pdf_show_boxed(': 'resource p, string text, float left, float top, float width, float height, string mode, string feature | int', -\ 'pdf_show(': 'resource pdfdoc, string text | bool', -\ 'pdf_show_xy(': 'resource p, string text, float x, float y | bool', -\ 'pdf_skew(': 'resource p, float alpha, float beta | bool', -\ 'pdf_stringwidth(': 'resource p, string text, int font, float fontsize | float', -\ 'pdf_stroke(': 'resource p | bool', -\ 'pdf_suspend_page(': 'resource pdfdoc, string optlist | bool', -\ 'pdf_translate(': 'resource p, float tx, float ty | bool', -\ 'pdf_utf16_to_utf8(': 'resource pdfdoc, string utf16string | string', -\ 'pdf_utf8_to_utf16(': 'resource pdfdoc, string utf8string, string ordering | string', -\ 'pdf_xshow(': 'resource pdfdoc, string text | bool', -\ 'pfpro_cleanup(': 'void | bool', -\ 'pfpro_init(': 'void | bool', -\ 'pfpro_process(': 'array parameters [, string address [, int port [, int timeout [, string proxy_address [, int proxy_port [, string proxy_logon [, string proxy_password]]]]]]] | array', -\ 'pfpro_process_raw(': 'string parameters [, string address [, int port [, int timeout [, string proxy_address [, int proxy_port [, string proxy_logon [, string proxy_password]]]]]]] | string', -\ 'pfpro_version(': 'void | string', -\ 'pfsockopen(': 'string hostname [, int port [, int &errno [, string &errstr [, float timeout]]]] | resource', -\ 'pg_affected_rows(': 'resource result | int', -\ 'pg_cancel_query(': 'resource connection | bool', -\ 'pg_client_encoding(': '[resource connection] | string', -\ 'pg_close(': '[resource connection] | bool', -\ 'pg_connect(': 'string connection_string [, int connect_type] | resource', -\ 'pg_connection_busy(': 'resource connection | bool', -\ 'pg_connection_reset(': 'resource connection | bool', -\ 'pg_connection_status(': 'resource connection | int', -\ 'pg_convert(': 'resource connection, string table_name, array assoc_array [, int options] | array', -\ 'pg_copy_from(': 'resource connection, string table_name, array rows [, string delimiter [, string null_as]] | bool', -\ 'pg_copy_to(': 'resource connection, string table_name [, string delimiter [, string null_as]] | array', -\ 'pg_dbname(': '[resource connection] | string', -\ 'pg_delete(': 'resource connection, string table_name, array assoc_array [, int options] | mixed', -\ 'pg_end_copy(': '[resource connection] | bool', -\ 'pg_escape_bytea(': 'string data | string', -\ 'pg_escape_string(': 'string data | string', -\ 'pg_execute(': 'resource connection, string stmtname, array params | resource', -\ 'pg_fetch_all_columns(': 'resource result [, int column] | array', -\ 'pg_fetch_all(': 'resource result | array', -\ 'pg_fetch_array(': 'resource result [, int row [, int result_type]] | array', -\ 'pg_fetch_assoc(': 'resource result [, int row] | array', -\ 'pg_fetch_object(': 'resource result [, int row [, int result_type]] | object', -\ 'pg_fetch_result(': 'resource result, int row, mixed field | string', -\ 'pg_fetch_row(': 'resource result [, int row] | array', -\ 'pg_field_is_null(': 'resource result, int row, mixed field | int', -\ 'pg_field_name(': 'resource result, int field_number | string', -\ 'pg_field_num(': 'resource result, string field_name | int', -\ 'pg_field_prtlen(': 'resource result, int row_number, mixed field_name_or_number | int', -\ 'pg_field_size(': 'resource result, int field_number | int', -\ 'pg_field_type(': 'resource result, int field_number | string', -\ 'pg_field_type_oid(': 'resource result, int field_number | int', -\ 'pg_free_result(': 'resource result | bool', -\ 'pg_get_notify(': 'resource connection [, int result_type] | array', -\ 'pg_get_pid(': 'resource connection | int', -\ 'pg_get_result(': '[resource connection] | resource', -\ 'pg_host(': '[resource connection] | string', -\ 'pg_insert(': 'resource connection, string table_name, array assoc_array [, int options] | mixed', -\ 'pg_last_error(': '[resource connection] | string', -\ 'pg_last_notice(': 'resource connection | string', -\ 'pg_last_oid(': 'resource result | string', -\ 'pg_lo_close(': 'resource large_object | bool', -\ 'pg_lo_create(': '[resource connection] | int', -\ 'pg_lo_export(': 'resource connection, int oid, string pathname | bool', -\ 'pg_lo_import(': 'resource connection, string pathname | int', -\ 'pg_lo_open(': 'resource connection, int oid, string mode | resource', -\ 'pg_lo_read_all(': 'resource large_object | int', -\ 'pg_lo_read(': 'resource large_object [, int len] | string', -\ 'pg_lo_seek(': 'resource large_object, int offset [, int whence] | bool', -\ 'pg_lo_tell(': 'resource large_object | int', -\ 'pg_lo_unlink(': 'resource connection, int oid | bool', -\ 'pg_lo_write(': 'resource large_object, string data [, int len] | int', -\ 'pg_meta_data(': 'resource connection, string table_name | array', -\ 'pg_num_fields(': 'resource result | int', -\ 'pg_num_rows(': 'resource result | int', -\ 'pg_options(': '[resource connection] | string', -\ 'pg_parameter_status(': 'resource connection, string param_name | string', -\ 'pg_pconnect(': 'string connection_string [, int connect_type] | resource', -\ 'pg_ping(': '[resource connection] | bool', -\ 'pg_port(': '[resource connection] | int', -\ 'pg_prepare(': 'resource connection, string stmtname, string query | resource', -\ 'pg_put_line(': 'string data | bool', -\ 'pg_query(': 'string query | resource', -\ 'pg_query_params(': 'resource connection, string query, array params | resource', -\ 'pg_result_error_field(': 'resource result, int fieldcode | string', -\ 'pg_result_error(': 'resource result | string', -\ 'pg_result_seek(': 'resource result, int offset | bool', -\ 'pg_result_status(': 'resource result [, int type] | mixed', -\ 'pg_select(': 'resource connection, string table_name, array assoc_array [, int options] | mixed', -\ 'pg_send_execute(': 'resource connection, string stmtname, array params | bool', -\ 'pg_send_prepare(': 'resource connection, string stmtname, string query | bool', -\ 'pg_send_query(': 'resource connection, string query | bool', -\ 'pg_send_query_params(': 'resource connection, string query, array params | bool', -\ 'pg_set_client_encoding(': 'string encoding | int', -\ 'pg_set_error_verbosity(': 'resource connection, int verbosity | int', -\ 'pg_trace(': 'string pathname [, string mode [, resource connection]] | bool', -\ 'pg_transaction_status(': 'resource connection | int', -\ 'pg_tty(': '[resource connection] | string', -\ 'pg_unescape_bytea(': 'string data | string', -\ 'pg_untrace(': '[resource connection] | bool', -\ 'pg_update(': 'resource connection, string table_name, array data, array condition [, int options] | mixed', -\ 'pg_version(': '[resource connection] | array', -\ 'php_check_syntax(': 'string file_name [, string &error_message] | bool', -\ 'phpcredits(': '[int flag] | bool', -\ 'phpinfo(': '[int what] | bool', -\ 'php_ini_scanned_files(': 'void | string', -\ 'php_logo_guid(': 'void | string', -\ 'php_sapi_name(': 'void | string', -\ 'php_strip_whitespace(': 'string filename | string', -\ 'php_uname(': '[string mode] | string', -\ 'phpversion(': '[string extension] | string', -\ 'pi(': 'void | float', -\ 'png2wbmp(': 'string pngname, string wbmpname, int d_height, int d_width, int threshold | int', -\ 'popen(': 'string command, string mode | resource', -\ 'posix_access(': 'string file [, int mode] | bool', -\ 'posix_ctermid(': 'void | string', -\ 'posix_getcwd(': 'void | string', -\ 'posix_getegid(': 'void | int', -\ 'posix_geteuid(': 'void | int', -\ 'posix_getgid(': 'void | int', -\ 'posix_getgrgid(': 'int gid | array', -\ 'posix_getgrnam(': 'string name | array', -\ 'posix_getgroups(': 'void | array', -\ 'posix_get_last_error(': 'void | int', -\ 'posix_getlogin(': 'void | string', -\ 'posix_getpgid(': 'int pid | int', -\ 'posix_getpgrp(': 'void | int', -\ 'posix_getpid(': 'void | int', -\ 'posix_getppid(': 'void | int', -\ 'posix_getpwnam(': 'string username | array', -\ 'posix_getpwuid(': 'int uid | array', -\ 'posix_getrlimit(': 'void | array', -\ 'posix_getsid(': 'int pid | int', -\ 'posix_getuid(': 'void | int', -\ 'posix_isatty(': 'int fd | bool', -\ 'posix_kill(': 'int pid, int sig | bool', -\ 'posix_mkfifo(': 'string pathname, int mode | bool', -\ 'posix_mknod(': 'string pathname, int mode [, int major [, int minor]] | bool', -\ 'posix_setegid(': 'int gid | bool', -\ 'posix_seteuid(': 'int uid | bool', -\ 'posix_setgid(': 'int gid | bool', -\ 'posix_setpgid(': 'int pid, int pgid | bool', -\ 'posix_setsid(': 'void | int', -\ 'posix_setuid(': 'int uid | bool', -\ 'posix_strerror(': 'int errno | string', -\ 'posix_times(': 'void | array', -\ 'posix_ttyname(': 'int fd | string', -\ 'posix_uname(': 'void | array', -\ 'pow(': 'number base, number exp | number', -\ 'preg_grep(': 'string pattern, array input [, int flags] | array', -\ 'preg_match_all(': 'string pattern, string subject, array &matches [, int flags [, int offset]] | int', -\ 'preg_match(': 'string pattern, string subject [, array &matches [, int flags [, int offset]]] | int', -\ 'preg_quote(': 'string str [, string delimiter] | string', -\ 'preg_replace_callback(': 'mixed pattern, callback callback, mixed subject [, int limit [, int &count]] | mixed', -\ 'preg_replace(': 'mixed pattern, mixed replacement, mixed subject [, int limit [, int &count]] | mixed', -\ 'preg_split(': 'string pattern, string subject [, int limit [, int flags]] | array', -\ 'prev(': 'array &array | mixed', -\ 'printer_abort(': 'resource handle | void', -\ 'printer_close(': 'resource handle | void', -\ 'printer_create_brush(': 'int style, string color | resource', -\ 'printer_create_dc(': 'resource handle | void', -\ 'printer_create_font(': 'string face, int height, int width, int font_weight, bool italic, bool underline, bool strikeout, int orientation | resource', -\ 'printer_create_pen(': 'int style, int width, string color | resource', -\ 'printer_delete_brush(': 'resource handle | void', -\ 'printer_delete_dc(': 'resource handle | bool', -\ 'printer_delete_font(': 'resource handle | void', -\ 'printer_delete_pen(': 'resource handle | void', -\ 'printer_draw_bmp(': 'resource handle, string filename, int x, int y [, int width, int height] | bool', -\ 'printer_draw_chord(': 'resource handle, int rec_x, int rec_y, int rec_x1, int rec_y1, int rad_x, int rad_y, int rad_x1, int rad_y1 | void', -\ 'printer_draw_elipse(': 'resource handle, int ul_x, int ul_y, int lr_x, int lr_y | void', -\ 'printer_draw_line(': 'resource printer_handle, int from_x, int from_y, int to_x, int to_y | void', -\ 'printer_draw_pie(': 'resource handle, int rec_x, int rec_y, int rec_x1, int rec_y1, int rad1_x, int rad1_y, int rad2_x, int rad2_y | void', -\ 'printer_draw_rectangle(': 'resource handle, int ul_x, int ul_y, int lr_x, int lr_y | void', -\ 'printer_draw_roundrect(': 'resource handle, int ul_x, int ul_y, int lr_x, int lr_y, int width, int height | void', -\ 'printer_draw_text(': 'resource printer_handle, string text, int x, int y | void', -\ 'printer_end_doc(': 'resource handle | bool', -\ 'printer_end_page(': 'resource handle | bool', -\ 'printer_get_option(': 'resource handle, string option | mixed', -\ 'printer_list(': 'int enumtype [, string name [, int level]] | array', -\ 'printer_logical_fontheight(': 'resource handle, int height | int', -\ 'printer_open(': '[string devicename] | resource', -\ 'printer_select_brush(': 'resource printer_handle, resource brush_handle | void', -\ 'printer_select_font(': 'resource printer_handle, resource font_handle | void', -\ 'printer_select_pen(': 'resource printer_handle, resource pen_handle | void', -\ 'printer_set_option(': 'resource handle, int option, mixed value | bool', -\ 'printer_start_doc(': 'resource handle [, string document] | bool', -\ 'printer_start_page(': 'resource handle | bool', -\ 'printer_write(': 'resource handle, string content | bool', -\ 'printf(': 'string format [, mixed args [, mixed ...]] | int', -\ 'print(': 'string arg | int', -\ 'print_r(': 'mixed expression [, bool return] | bool', -\ 'proc_close(': 'resource process | int', -\ 'proc_get_status(': 'resource process | array', -\ 'proc_nice(': 'int increment | bool', -\ 'proc_open(': 'string cmd, array descriptorspec, array &pipes [, string cwd [, array env [, array other_options]]] | resource', -\ 'proc_terminate(': 'resource process [, int signal] | int', -\ 'property_exists(': 'mixed class, string property | bool', -\ 'ps_add_bookmark(': 'resource psdoc, string text [, int parent [, int open]] | int', -\ 'ps_add_launchlink(': 'resource psdoc, float llx, float lly, float urx, float ury, string filename | bool', -\ 'ps_add_locallink(': 'resource psdoc, float llx, float lly, float urx, float ury, int page, string dest | bool', -\ 'ps_add_note(': 'resource psdoc, float llx, float lly, float urx, float ury, string contents, string title, string icon, int open | bool', -\ 'ps_add_pdflink(': 'resource psdoc, float llx, float lly, float urx, float ury, string filename, int page, string dest | bool', -\ 'ps_add_weblink(': 'resource psdoc, float llx, float lly, float urx, float ury, string url | bool', -\ 'ps_arc(': 'resource psdoc, float x, float y, float radius, float alpha, float beta | bool', -\ 'ps_arcn(': 'resource psdoc, float x, float y, float radius, float alpha, float beta | bool', -\ 'ps_begin_page(': 'resource psdoc, float width, float height | bool', -\ 'ps_begin_pattern(': 'resource psdoc, float width, float height, float xstep, float ystep, int painttype | bool', -\ 'ps_begin_template(': 'resource psdoc, float width, float height | bool', -\ 'ps_circle(': 'resource psdoc, float x, float y, float radius | bool', -\ 'ps_clip(': 'resource psdoc | bool', -\ 'ps_close(': 'resource psdoc | bool', -\ 'ps_close_image(': 'resource psdoc, int imageid | void', -\ 'ps_closepath(': 'resource psdoc | bool', -\ 'ps_closepath_stroke(': 'resource psdoc | bool', -\ 'ps_continue_text(': 'resource psdoc, string text | bool', -\ 'ps_curveto(': 'resource psdoc, float x1, float y1, float x2, float y2, float x3, float y3 | bool', -\ 'ps_delete(': 'resource psdoc | bool', -\ 'ps_end_page(': 'resource psdoc | bool', -\ 'ps_end_pattern(': 'resource psdoc | bool', -\ 'ps_end_template(': 'resource psdoc | bool', -\ 'ps_fill(': 'resource psdoc | bool', -\ 'ps_fill_stroke(': 'resource psdoc | bool', -\ 'ps_findfont(': 'resource psdoc, string fontname, string encoding [, bool embed] | int', -\ 'ps_get_buffer(': 'resource psdoc | string', -\ 'ps_get_parameter(': 'resource psdoc, string name [, float modifier] | string', -\ 'ps_get_value(': 'resource psdoc, string name [, float modifier] | float', -\ 'ps_hyphenate(': 'resource psdoc, string text | array', -\ 'ps_lineto(': 'resource psdoc, float x, float y | bool', -\ 'ps_makespotcolor(': 'resource psdoc, string name [, float reserved] | int', -\ 'ps_moveto(': 'resource psdoc, float x, float y | bool', -\ 'ps_new(': 'void | resource', -\ 'ps_open_file(': 'resource psdoc [, string filename] | bool', -\ 'ps_open_image_file(': 'resource psdoc, string type, string filename [, string stringparam [, int intparam]] | int', -\ 'ps_open_image(': 'resource psdoc, string type, string source, string data, int lenght, int width, int height, int components, int bpc, string params | int', -\ 'pspell_add_to_personal(': 'int dictionary_link, string word | bool', -\ 'pspell_add_to_session(': 'int dictionary_link, string word | bool', -\ 'pspell_check(': 'int dictionary_link, string word | bool', -\ 'pspell_clear_session(': 'int dictionary_link | bool', -\ 'pspell_config_create(': 'string language [, string spelling [, string jargon [, string encoding]]] | int', -\ 'pspell_config_data_dir(': 'int conf, string directory | bool', -\ 'pspell_config_dict_dir(': 'int conf, string directory | bool', -\ 'pspell_config_ignore(': 'int dictionary_link, int n | bool', -\ 'pspell_config_mode(': 'int dictionary_link, int mode | bool', -\ 'pspell_config_personal(': 'int dictionary_link, string file | bool', -\ 'pspell_config_repl(': 'int dictionary_link, string file | bool', -\ 'pspell_config_runtogether(': 'int dictionary_link, bool flag | bool', -\ 'pspell_config_save_repl(': 'int dictionary_link, bool flag | bool', -\ 'pspell_new_config(': 'int config | int', -\ 'pspell_new(': 'string language [, string spelling [, string jargon [, string encoding [, int mode]]]] | int', -\ 'pspell_new_personal(': 'string personal, string language [, string spelling [, string jargon [, string encoding [, int mode]]]] | int', -\ 'pspell_save_wordlist(': 'int dictionary_link | bool', -\ 'pspell_store_replacement(': 'int dictionary_link, string misspelled, string correct | bool', -\ 'pspell_suggest(': 'int dictionary_link, string word | array', -\ 'ps_place_image(': 'resource psdoc, int imageid, float x, float y, float scale | bool', -\ 'ps_rect(': 'resource psdoc, float x, float y, float width, float height | bool', -\ 'ps_restore(': 'resource psdoc | bool', -\ 'ps_rotate(': 'resource psdoc, float rot | bool', -\ 'ps_save(': 'resource psdoc | bool', -\ 'ps_scale(': 'resource psdoc, float x, float y | bool', -\ 'ps_set_border_color(': 'resource psdoc, float red, float green, float blue | bool', -\ 'ps_set_border_dash(': 'resource psdoc, float black, float white | bool', -\ 'ps_set_border_style(': 'resource psdoc, string style, float width | bool', -\ 'ps_setcolor(': 'resource psdoc, string type, string colorspace, float c1, float c2, float c3, float c4 | bool', -\ 'ps_setdash(': 'resource psdoc, float on, float off | bool', -\ 'ps_setflat(': 'resource psdoc, float value | bool', -\ 'ps_setfont(': 'resource psdoc, int fontid, float size | bool', -\ 'ps_setgray(': 'resource psdoc, float gray | bool', -\ 'ps_set_info(': 'resource p, string key, string val | bool', -\ 'ps_setlinecap(': 'resource psdoc, int type | bool', -\ 'ps_setlinejoin(': 'resource psdoc, int type | bool', -\ 'ps_setlinewidth(': 'resource psdoc, float width | bool', -\ 'ps_setmiterlimit(': 'resource psdoc, float value | bool', -\ 'ps_set_parameter(': 'resource psdoc, string name, string value | bool', -\ 'ps_setpolydash(': 'resource psdoc, float arr | bool', -\ 'ps_set_text_pos(': 'resource psdoc, float x, float y | bool', -\ 'ps_set_value(': 'resource psdoc, string name, float value | bool', -\ 'ps_shading(': 'resource psdoc, string type, float x0, float y0, float x1, float y1, float c1, float c2, float c3, float c4, string optlist | int', -\ 'ps_shading_pattern(': 'resource psdoc, int shadingid, string optlist | int', -\ 'ps_shfill(': 'resource psdoc, int shadingid | bool', -\ 'ps_show_boxed(': 'resource psdoc, string text, float left, float bottom, float width, float height, string hmode [, string feature] | int', -\ 'ps_show(': 'resource psdoc, string text | bool', -\ 'ps_show_xy(': 'resource psdoc, string text, float x, float y | bool', -\ 'ps_string_geometry(': 'resource psdoc, string text [, int fontid [, float size]] | array', -\ 'ps_stringwidth(': 'resource psdoc, string text [, int fontid [, float size]] | float', -\ 'ps_stroke(': 'resource psdoc | bool', -\ 'ps_symbol(': 'resource psdoc, int ord | bool', -\ 'ps_symbol_name(': 'resource psdoc, int ord [, int fontid] | string', -\ 'ps_symbol_width(': 'resource psdoc, int ord [, int fontid [, float size]] | float', -\ 'ps_translate(': 'resource psdoc, float x, float y | bool', -\ 'putenv(': 'string setting | bool', -\ 'px_close(': 'resource pxdoc | bool', -\ 'px_create_fp(': 'resource pxdoc, resource file, array fielddesc | bool', -\ 'px_date2string(': 'resource pxdoc, int value, string format | string', -\ 'px_delete(': 'resource pxdoc | bool', -\ 'px_delete_record(': 'resource pxdoc, int num | bool', -\ 'px_get_field(': 'resource pxdoc, int fieldno | array', -\ 'px_get_info(': 'resource pxdoc | array', -\ 'px_get_parameter(': 'resource pxdoc, string name | string', -\ 'px_get_record(': 'resource pxdoc, int num [, int mode] | array', -\ 'px_get_schema(': 'resource pxdoc [, int mode] | array', -\ 'px_get_value(': 'resource pxdoc, string name | float', -\ 'px_insert_record(': 'resource pxdoc, array data | int', -\ 'px_new(': 'void | resource', -\ 'px_numfields(': 'resource pxdoc | int', -\ 'px_numrecords(': 'resource pxdoc | int', -\ 'px_open_fp(': 'resource pxdoc, resource file | bool', -\ 'px_put_record(': 'resource pxdoc, array record [, int recpos] | bool', -\ 'px_retrieve_record(': 'resource pxdoc, int num [, int mode] | array', -\ 'px_set_blob_file(': 'resource pxdoc, string filename | bool', -\ 'px_set_parameter(': 'resource pxdoc, string name, string value | bool', -\ 'px_set_tablename(': 'resource pxdoc, string name | void', -\ 'px_set_targetencoding(': 'resource pxdoc, string encoding | bool', -\ 'px_set_value(': 'resource pxdoc, string name, float value | bool', -\ 'px_timestamp2string(': 'resource pxdoc, float value, string format | string', -\ 'px_update_record(': 'resource pxdoc, array data, int num | bool', -\ 'qdom_error(': 'void | string', -\ 'qdom_tree(': 'string doc | QDomDocument', -\ 'quoted_printable_decode(': 'string str | string', -\ 'quotemeta(': 'string str | string', -\ 'rad2deg(': 'float number | float', -\ 'radius_acct_open(': 'void | resource', -\ 'radius_add_server(': 'resource radius_handle, string hostname, int port, string secret, int timeout, int max_tries | bool', -\ 'radius_auth_open(': 'void | resource', -\ 'radius_close(': 'resource radius_handle | bool', -\ 'radius_config(': 'resource radius_handle, string file | bool', -\ 'radius_create_request(': 'resource radius_handle, int type | bool', -\ 'radius_cvt_addr(': 'string data | string', -\ 'radius_cvt_int(': 'string data | int', -\ 'radius_cvt_string(': 'string data | string', -\ 'radius_demangle(': 'resource radius_handle, string mangled | string', -\ 'radius_demangle_mppe_key(': 'resource radius_handle, string mangled | string', -\ 'radius_get_attr(': 'resource radius_handle | mixed', -\ 'radius_get_vendor_attr(': 'string data | array', -\ 'radius_put_addr(': 'resource radius_handle, int type, string addr | bool', -\ 'radius_put_attr(': 'resource radius_handle, int type, string value | bool', -\ 'radius_put_int(': 'resource radius_handle, int type, int value | bool', -\ 'radius_put_string(': 'resource radius_handle, int type, string value | bool', -\ 'radius_put_vendor_addr(': 'resource radius_handle, int vendor, int type, string addr | bool', -\ 'radius_put_vendor_attr(': 'resource radius_handle, int vendor, int type, string value | bool', -\ 'radius_put_vendor_int(': 'resource radius_handle, int vendor, int type, int value | bool', -\ 'radius_put_vendor_string(': 'resource radius_handle, int vendor, int type, string value | bool', -\ 'radius_request_authenticator(': 'resource radius_handle | string', -\ 'radius_send_request(': 'resource radius_handle | int', -\ 'radius_server_secret(': 'resource radius_handle | string', -\ 'radius_strerror(': 'resource radius_handle | string', -\ 'rand(': '[int min, int max] | int', -\ 'range(': 'mixed low, mixed high [, number step] | array', -\ 'rar_close(': 'resource rar_file | bool', -\ 'rar_entry_get(': 'resource rar_file, string entry_name | RarEntry', -\ 'rar_list(': 'resource rar_file | array', -\ 'rar_open(': 'string filename [, string password] | resource', -\ 'rawurldecode(': 'string str | string', -\ 'rawurlencode(': 'string str | string', -\ 'readdir(': 'resource dir_handle | string', -\ 'readfile(': 'string filename [, bool use_include_path [, resource context]] | int', -\ 'readgzfile(': 'string filename [, int use_include_path] | int', -\ 'readline_add_history(': 'string line | bool', -\ 'readline_callback_handler_install(': 'string prompt, callback callback | bool', -\ 'readline_callback_handler_remove(': 'void | bool', -\ 'readline_callback_read_char(': 'void | void', -\ 'readline_clear_history(': 'void | bool', -\ 'readline_completion_function(': 'callback function | bool', -\ 'readline(': 'string prompt | string', -\ 'readline_info(': '[string varname [, string newvalue]] | mixed', -\ 'readline_list_history(': 'void | array', -\ 'readline_on_new_line(': 'void | void', -\ 'readline_read_history(': '[string filename] | bool', -\ 'readline_redisplay(': 'void | void', -\ 'readline_write_history(': '[string filename] | bool', -\ 'readlink(': 'string path | string', -\ 'realpath(': 'string path | string', -\ 'recode_file(': 'string request, resource input, resource output | bool', -\ 'recode_string(': 'string request, string string | string', -\ 'register_shutdown_function(': 'callback function [, mixed parameter [, mixed ...]] | void', -\ 'register_tick_function(': 'callback function [, mixed arg [, mixed ...]] | bool', -\ 'rename_function(': 'string original_name, string new_name | bool', -\ 'rename(': 'string oldname, string newname [, resource context] | bool', -\ 'reset(': 'array &array | mixed', -\ 'restore_error_handler(': 'void | bool', -\ 'restore_exception_handler(': 'void | bool', -\ 'restore_include_path(': 'void | void', -\ 'rewinddir(': 'resource dir_handle | void', -\ 'rewind(': 'resource handle | bool', -\ 'rmdir(': 'string dirname [, resource context] | bool', -\ 'round(': 'float val [, int precision] | float', -\ 'rpm_close(': 'resource rpmr | boolean', -\ 'rpm_get_tag(': 'resource rpmr, int tagnum | mixed', -\ 'rpm_is_valid(': 'string filename | boolean', -\ 'rpm_open(': 'string filename | resource', -\ 'rpm_version(': 'void | string', -\ 'rsort(': 'array &array [, int sort_flags] | bool', -\ 'rtrim(': 'string str [, string charlist] | string', -\ 'runkit_class_adopt(': 'string classname, string parentname | bool', -\ 'runkit_class_emancipate(': 'string classname | bool', -\ 'runkit_constant_add(': 'string constname, mixed value | bool', -\ 'runkit_constant_redefine(': 'string constname, mixed newvalue | bool', -\ 'runkit_constant_remove(': 'string constname | bool', -\ 'runkit_function_add(': 'string funcname, string arglist, string code | bool', -\ 'runkit_function_copy(': 'string funcname, string targetname | bool', -\ 'runkit_function_redefine(': 'string funcname, string arglist, string code | bool', -\ 'runkit_function_remove(': 'string funcname | bool', -\ 'runkit_function_rename(': 'string funcname, string newname | bool', -\ 'runkit_import(': 'string filename [, int flags] | bool', -\ 'runkit_lint_file(': 'string filename | bool', -\ 'runkit_lint(': 'string code | bool', -\ 'runkit_method_add(': 'string classname, string methodname, string args, string code [, int flags] | bool', -\ 'runkit_method_copy(': 'string dClass, string dMethod, string sClass [, string sMethod] | bool', -\ 'runkit_method_redefine(': 'string classname, string methodname, string args, string code [, int flags] | bool', -\ 'runkit_method_remove(': 'string classname, string methodname | bool', -\ 'runkit_method_rename(': 'string classname, string methodname, string newname | bool', -\ 'runkit_return_value_used(': 'void | bool', -\ 'runkit_sandbox_output_handler(': 'object sandbox [, mixed callback] | mixed', -\ 'runkit_superglobals(': 'void | array', -\ 'satellite_caught_exception(': 'void | bool', -\ 'satellite_exception_id(': 'void | string', -\ 'satellite_exception_value(': 'void | OrbitStruct', -\ 'satellite_get_repository_id(': 'object obj | int', -\ 'satellite_load_idl(': 'string file | bool', -\ 'satellite_object_to_string(': 'object obj | string', -\ 'scandir(': 'string directory [, int sorting_order [, resource context]] | array', -\ 'sem_acquire(': 'resource sem_identifier | bool', -\ 'sem_get(': 'int key [, int max_acquire [, int perm [, int auto_release]]] | resource', -\ 'sem_release(': 'resource sem_identifier | bool', -\ 'sem_remove(': 'resource sem_identifier | bool', -\ 'serialize(': 'mixed value | string', -\ 'sesam_affected_rows(': 'string result_id | int', -\ 'sesam_commit(': 'void | bool', -\ 'sesam_connect(': 'string catalog, string schema, string user | bool', -\ 'sesam_diagnostic(': 'void | array', -\ 'sesam_disconnect(': 'void | bool', -\ 'sesam_errormsg(': 'void | string', -\ 'sesam_execimm(': 'string query | string', -\ 'sesam_fetch_array(': 'string result_id [, int whence [, int offset]] | array', -\ 'sesam_fetch_result(': 'string result_id [, int max_rows] | mixed', -\ 'sesam_fetch_row(': 'string result_id [, int whence [, int offset]] | array', -\ 'sesam_field_array(': 'string result_id | array', -\ 'sesam_field_name(': 'string result_id, int index | int', -\ 'sesam_free_result(': 'string result_id | int', -\ 'sesam_num_fields(': 'string result_id | int', -\ 'sesam_query(': 'string query [, bool scrollable] | string', -\ 'sesam_rollback(': 'void | bool', -\ 'sesam_seek_row(': 'string result_id, int whence [, int offset] | bool', -\ 'sesam_settransaction(': 'int isolation_level, int read_only | bool', -\ 'session_cache_expire(': '[int new_cache_expire] | int', -\ 'session_cache_limiter(': '[string cache_limiter] | string', -\ 'session_decode(': 'string data | bool', -\ 'session_destroy(': 'void | bool', -\ 'session_encode(': 'void | string', -\ 'session_get_cookie_params(': 'void | array', -\ 'session_id(': '[string id] | string', -\ 'session_is_registered(': 'string name | bool', -\ 'session_module_name(': '[string module] | string', -\ 'session_name(': '[string name] | string', -\ 'session_pgsql_add_error(': 'int error_level [, string error_message] | bool', -\ 'session_pgsql_get_error(': '[bool with_error_message] | array', -\ 'session_pgsql_get_field(': 'void | string', -\ 'session_pgsql_reset(': 'void | bool', -\ 'session_pgsql_set_field(': 'string value | bool', -\ 'session_pgsql_status(': 'void | array', -\ 'session_regenerate_id(': '[bool delete_old_session] | bool', -\ 'session_register(': 'mixed name [, mixed ...] | bool', -\ 'session_save_path(': '[string path] | string', -\ 'session_set_cookie_params(': 'int lifetime [, string path [, string domain [, bool secure]]] | void', -\ 'session_set_save_handler(': 'callback open, callback close, callback read, callback write, callback destroy, callback gc | bool', -\ 'session_start(': 'void | bool', -\ 'session_unregister(': 'string name | bool', -\ 'session_unset(': 'void | void', -\ 'session_write_close(': 'void | void', -\ 'setcookie(': 'string name [, string value [, int expire [, string path [, string domain [, bool secure]]]]] | bool', -\ 'set_error_handler(': 'callback error_handler [, int error_types] | mixed', -\ 'set_exception_handler(': 'callback exception_handler | string', -\ 'set_include_path(': 'string new_include_path | string', -\ 'setlocale(': 'int category, string locale [, string ...] | string', -\ 'set_magic_quotes_runtime(': 'int new_setting | bool', -\ 'setrawcookie(': 'string name [, string value [, int expire [, string path [, string domain [, bool secure]]]]] | bool', -\ 'set_time_limit(': 'int seconds | void', -\ 'settype(': 'mixed &var, string type | bool', -\ 'sha1_file(': 'string filename [, bool raw_output] | string', -\ 'sha1(': 'string str [, bool raw_output] | string', -\ 'shell_exec(': 'string cmd | string', -\ 'shm_attach(': 'int key [, int memsize [, int perm]] | int', -\ 'shm_detach(': 'int shm_identifier | bool', -\ 'shm_get_var(': 'int shm_identifier, int variable_key | mixed', -\ 'shmop_close(': 'int shmid | void', -\ 'shmop_delete(': 'int shmid | bool', -\ 'shmop_open(': 'int key, string flags, int mode, int size | int', -\ 'shmop_read(': 'int shmid, int start, int count | string', -\ 'shmop_size(': 'int shmid | int', -\ 'shmop_write(': 'int shmid, string data, int offset | int', -\ 'shm_put_var(': 'int shm_identifier, int variable_key, mixed variable | bool', -\ 'shm_remove(': 'int shm_identifier | bool', -\ 'shm_remove_var(': 'int shm_identifier, int variable_key | bool', -\ 'shuffle(': 'array &array | bool', -\ 'similar_text(': 'string first, string second [, float &percent] | int', -\ 'SimpleXMLElement->asXML(': '[string filename] | mixed', -\ 'simplexml_element->attributes(': '[string data] | SimpleXMLElement', -\ 'simplexml_element->children(': '[string nsprefix] | SimpleXMLElement', -\ 'SimpleXMLElement->xpath(': 'string path | array', -\ 'simplexml_import_dom(': 'DOMNode node [, string class_name] | SimpleXMLElement', -\ 'simplexml_load_file(': 'string filename [, string class_name [, int options]] | object', -\ 'simplexml_load_string(': 'string data [, string class_name [, int options]] | object', -\ 'sinh(': 'float arg | float', -\ 'sin(': 'float arg | float', -\ 'sleep(': 'int seconds | int', -\ 'snmpget(': 'string hostname, string community, string object_id [, int timeout [, int retries]] | string', -\ 'snmpgetnext(': 'string host, string community, string object_id [, int timeout [, int retries]] | string', -\ 'snmp_get_quick_print(': 'void | bool', -\ 'snmp_get_valueretrieval(': 'void | int', -\ 'snmp_read_mib(': 'string filename | bool', -\ 'snmprealwalk(': 'string host, string community, string object_id [, int timeout [, int retries]] | array', -\ 'snmp_set_enum_print(': 'int enum_print | void', -\ 'snmpset(': 'string hostname, string community, string object_id, string type, mixed value [, int timeout [, int retries]] | bool', -\ 'snmp_set_oid_numeric_print(': 'int oid_numeric_print | void', -\ 'snmp_set_quick_print(': 'bool quick_print | void', -\ 'snmp_set_valueretrieval(': 'int method | void', -\ 'snmpwalk(': 'string hostname, string community, string object_id [, int timeout [, int retries]] | array', -\ 'snmpwalkoid(': 'string hostname, string community, string object_id [, int timeout [, int retries]] | array', -\ 'socket_accept(': 'resource socket | resource', -\ 'socket_bind(': 'resource socket, string address [, int port] | bool', -\ 'socket_clear_error(': '[resource socket] | void', -\ 'socket_close(': 'resource socket | void', -\ 'socket_connect(': 'resource socket, string address [, int port] | bool', -\ 'socket_create(': 'int domain, int type, int protocol | resource', -\ 'socket_create_listen(': 'int port [, int backlog] | resource', -\ 'socket_create_pair(': 'int domain, int type, int protocol, array &fd | bool', -\ 'socket_get_option(': 'resource socket, int level, int optname | mixed', -\ 'socket_getpeername(': 'resource socket, string &addr [, int &port] | bool', -\ 'socket_getsockname(': 'resource socket, string &addr [, int &port] | bool', -\ 'socket_last_error(': '[resource socket] | int', -\ 'socket_listen(': 'resource socket [, int backlog] | bool', -\ 'socket_read(': 'resource socket, int length [, int type] | string', -\ 'socket_recvfrom(': 'resource socket, string &buf, int len, int flags, string &name [, int &port] | int', -\ 'socket_recv(': 'resource socket, string &buf, int len, int flags | int', -\ 'socket_select(': 'array &read, array &write, array &except, int tv_sec [, int tv_usec] | int', -\ 'socket_send(': 'resource socket, string buf, int len, int flags | int', -\ 'socket_sendto(': 'resource socket, string buf, int len, int flags, string addr [, int port] | int', -\ 'socket_set_block(': 'resource socket | bool', -\ 'socket_set_nonblock(': 'resource socket | bool', -\ 'socket_set_option(': 'resource socket, int level, int optname, mixed optval | bool', -\ 'socket_shutdown(': 'resource socket [, int how] | bool', -\ 'socket_strerror(': 'int errno | string', -\ 'socket_write(': 'resource socket, string buffer [, int length] | int', -\ 'sort(': 'array &array [, int sort_flags] | bool', -\ 'soundex(': 'string str | string', -\ 'spl_classes(': 'void | array', -\ 'split(': 'string pattern, string string [, int limit] | array', -\ 'spliti(': 'string pattern, string string [, int limit] | array', -\ 'sprintf(': 'string format [, mixed args [, mixed ...]] | string', -\ 'sqlite_array_query(': 'resource dbhandle, string query [, int result_type [, bool decode_binary]] | array', -\ 'sqlite_busy_timeout(': 'resource dbhandle, int milliseconds | void', -\ 'sqlite_changes(': 'resource dbhandle | int', -\ 'sqlite_close(': 'resource dbhandle | void', -\ 'sqlite_column(': 'resource result, mixed index_or_name [, bool decode_binary] | mixed', -\ 'sqlite_create_aggregate(': 'resource dbhandle, string function_name, callback step_func, callback finalize_func [, int num_args] | void', -\ 'sqlite_create_function(': 'resource dbhandle, string function_name, callback callback [, int num_args] | void', -\ 'sqlite_current(': 'resource result [, int result_type [, bool decode_binary]] | array', -\ 'sqlite_error_string(': 'int error_code | string', -\ 'sqlite_escape_string(': 'string item | string', -\ 'sqlite_exec(': 'resource dbhandle, string query [, string &error_msg] | bool', -\ 'sqlite_factory(': 'string filename [, int mode [, string &error_message]] | SQLiteDatabase', -\ 'sqlite_fetch_all(': 'resource result [, int result_type [, bool decode_binary]] | array', -\ 'sqlite_fetch_array(': 'resource result [, int result_type [, bool decode_binary]] | array', -\ 'sqlite_fetch_column_types(': 'string table_name, resource dbhandle [, int result_type] | array', -\ 'sqlite_fetch_object(': 'resource result [, string class_name [, array ctor_params [, bool decode_binary]]] | object', -\ 'sqlite_fetch_single(': 'resource result [, bool decode_binary] | string', -\ 'sqlite_field_name(': 'resource result, int field_index | string', -\ 'sqlite_has_more(': 'resource result | bool', -\ 'sqlite_has_prev(': 'resource result | bool', -\ 'sqlite_key(': 'resource result | int', -\ 'sqlite_last_error(': 'resource dbhandle | int', -\ 'sqlite_last_insert_rowid(': 'resource dbhandle | int', -\ 'sqlite_libencoding(': 'void | string', -\ 'sqlite_libversion(': 'void | string', -\ 'sqlite_next(': 'resource result | bool', -\ 'sqlite_num_fields(': 'resource result | int', -\ 'sqlite_num_rows(': 'resource result | int', -\ 'sqlite_open(': 'string filename [, int mode [, string &error_message]] | resource', -\ 'sqlite_popen(': 'string filename [, int mode [, string &error_message]] | resource', -\ 'sqlite_prev(': 'resource result | bool', -\ 'sqlite_query(': 'resource dbhandle, string query [, int result_type [, string &error_msg]] | resource', -\ 'sqlite_rewind(': 'resource result | bool', -\ 'sqlite_seek(': 'resource result, int rownum | bool', -\ 'sqlite_single_query(': 'resource db, string query [, bool first_row_only [, bool decode_binary]] | array', -\ 'sqlite_udf_decode_binary(': 'string data | string', -\ 'sqlite_udf_encode_binary(': 'string data | string', -\ 'sqlite_unbuffered_query(': 'resource dbhandle, string query [, int result_type [, string &error_msg]] | resource', -\ 'sqlite_valid(': 'resource result | bool', -\ 'sql_regcase(': 'string string | string', -\ 'sqrt(': 'float arg | float', -\ 'srand(': '[int seed] | void', -\ 'sscanf(': 'string str, string format [, mixed &...] | mixed', -\ 'ssh2_auth_hostbased_file(': 'resource session, string username, string hostname, string pubkeyfile, string privkeyfile [, string passphrase [, string local_username]] | bool', -\ 'ssh2_auth_none(': 'resource session, string username | mixed', -\ 'ssh2_auth_password(': 'resource session, string username, string password | bool', -\ 'ssh2_auth_pubkey_file(': 'resource session, string username, string pubkeyfile, string privkeyfile [, string passphrase] | bool', -\ 'ssh2_connect(': 'string host [, int port [, array methods [, array callbacks]]] | resource', -\ 'ssh2_exec(': 'resource session, string command [, string pty [, array env [, int width [, int height [, int width_height_type]]]]] | resource', -\ 'ssh2_fetch_stream(': 'resource channel, int streamid | resource', -\ 'ssh2_fingerprint(': 'resource session [, int flags] | string', -\ 'ssh2_methods_negotiated(': 'resource session | array', -\ 'ssh2_publickey_add(': 'resource pkey, string algoname, string blob [, bool overwrite [, array attributes]] | bool', -\ 'ssh2_publickey_init(': 'resource session | resource', -\ 'ssh2_publickey_list(': 'resource pkey | array', -\ 'ssh2_publickey_remove(': 'resource pkey, string algoname, string blob | bool', -\ 'ssh2_scp_recv(': 'resource session, string remote_file, string local_file | bool', -\ 'ssh2_scp_send(': 'resource session, string local_file, string remote_file [, int create_mode] | bool', -\ 'ssh2_sftp(': 'resource session | resource', -\ 'ssh2_sftp_lstat(': 'resource sftp, string path | array', -\ 'ssh2_sftp_mkdir(': 'resource sftp, string dirname [, int mode [, bool recursive]] | bool', -\ 'ssh2_sftp_readlink(': 'resource sftp, string link | string', -\ 'ssh2_sftp_realpath(': 'resource sftp, string filename | string', -\ 'ssh2_sftp_rename(': 'resource sftp, string from, string to | bool', -\ 'ssh2_sftp_rmdir(': 'resource sftp, string dirname | bool', -\ 'ssh2_sftp_stat(': 'resource sftp, string path | array', -\ 'ssh2_sftp_symlink(': 'resource sftp, string target, string link | bool', -\ 'ssh2_sftp_unlink(': 'resource sftp, string filename | bool', -\ 'ssh2_shell(': 'resource session [, string term_type [, array env [, int width [, int height [, int width_height_type]]]]] | resource', -\ 'ssh2_tunnel(': 'resource session, string host, int port | resource', -\ 'stat(': 'string filename | array', -\ 'stats_absolute_deviation(': 'array a | float', -\ 'stats_cdf_beta(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_binomial(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_cauchy(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_chisquare(': 'float par1, float par2, int which | float', -\ 'stats_cdf_exponential(': 'float par1, float par2, int which | float', -\ 'stats_cdf_f(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_gamma(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_laplace(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_logistic(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_negative_binomial(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_noncentral_chisquare(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_noncentral_f(': 'float par1, float par2, float par3, float par4, int which | float', -\ 'stats_cdf_poisson(': 'float par1, float par2, int which | float', -\ 'stats_cdf_t(': 'float par1, float par2, int which | float', -\ 'stats_cdf_uniform(': 'float par1, float par2, float par3, int which | float', -\ 'stats_cdf_weibull(': 'float par1, float par2, float par3, int which | float', -\ 'stats_covariance(': 'array a, array b | float', -\ 'stats_dens_beta(': 'float x, float a, float b | float', -\ 'stats_dens_cauchy(': 'float x, float ave, float stdev | float', -\ 'stats_dens_chisquare(': 'float x, float dfr | float', -\ 'stats_dens_exponential(': 'float x, float scale | float', -\ 'stats_dens_f(': 'float x, float dfr1, float dfr2 | float', -\ 'stats_dens_gamma(': 'float x, float shape, float scale | float', -\ 'stats_dens_laplace(': 'float x, float ave, float stdev | float', -\ 'stats_dens_logistic(': 'float x, float ave, float stdev | float', -\ 'stats_dens_negative_binomial(': 'float x, float n, float pi | float', -\ 'stats_dens_normal(': 'float x, float ave, float stdev | float', -\ 'stats_dens_pmf_binomial(': 'float x, float n, float pi | float', -\ 'stats_dens_pmf_hypergeometric(': 'float n1, float n2, float N1, float N2 | float', -\ 'stats_dens_pmf_poisson(': 'float x, float lb | float', -\ 'stats_dens_t(': 'float x, float dfr | float', -\ 'stats_dens_weibull(': 'float x, float a, float b | float', -\ 'stats_den_uniform(': 'float x, float a, float b | float', -\ 'stats_harmonic_mean(': 'array a | number', -\ 'stats_kurtosis(': 'array a | float', -\ 'stats_rand_gen_beta(': 'float a, float b | float', -\ 'stats_rand_gen_chisquare(': 'float df | float', -\ 'stats_rand_gen_exponential(': 'float av | float', -\ 'stats_rand_gen_f(': 'float dfn, float dfd | float', -\ 'stats_rand_gen_funiform(': 'float low, float high | float', -\ 'stats_rand_gen_gamma(': 'float a, float r | float', -\ 'stats_rand_gen_ibinomial(': 'int n, float pp | int', -\ 'stats_rand_gen_ibinomial_negative(': 'int n, float p | int', -\ 'stats_rand_gen_int(': 'void | int', -\ 'stats_rand_gen_ipoisson(': 'float mu | int', -\ 'stats_rand_gen_iuniform(': 'int low, int high | int', -\ 'stats_rand_gen_noncenral_chisquare(': 'float df, float xnonc | float', -\ 'stats_rand_gen_noncentral_f(': 'float dfn, float dfd, float xnonc | float', -\ 'stats_rand_gen_noncentral_t(': 'float df, float xnonc | float', -\ 'stats_rand_gen_normal(': 'float av, float sd | float', -\ 'stats_rand_gen_t(': 'float df | float', -\ 'stats_rand_get_seeds(': 'void | array', -\ 'stats_rand_phrase_to_seeds(': 'string phrase | array', -\ 'stats_rand_ranf(': 'void | float', -\ 'stats_rand_setall(': 'int iseed1, int iseed2 | void', -\ 'stats_skew(': 'array a | float', -\ 'stats_standard_deviation(': 'array a [, bool sample] | float', -\ 'stats_stat_binomial_coef(': 'int x, int n | float', -\ 'stats_stat_correlation(': 'array arr1, array arr2 | float', -\ 'stats_stat_gennch(': 'int n | float', -\ 'stats_stat_independent_t(': 'array arr1, array arr2 | float', -\ 'stats_stat_innerproduct(': 'array arr1, array arr2 | float', -\ 'stats_stat_noncentral_t(': 'float par1, float par2, float par3, int which | float', -\ 'stats_stat_paired_t(': 'array arr1, array arr2 | float', -\ 'stats_stat_percentile(': 'float df, float xnonc | float', -\ 'stats_stat_powersum(': 'array arr, float power | float', -\ 'stats_variance(': 'array a [, bool sample] | float', -\ 'strcasecmp(': 'string str1, string str2 | int', -\ 'strcmp(': 'string str1, string str2 | int', -\ 'strcoll(': 'string str1, string str2 | int', -\ 'strcspn(': 'string str1, string str2 [, int start [, int length]] | int', -\ 'stream_bucket_append(': 'resource brigade, resource bucket | void', -\ 'stream_bucket_make_writeable(': 'resource brigade | object', -\ 'stream_bucket_new(': 'resource stream, string buffer | object', -\ 'stream_bucket_prepend(': 'resource brigade, resource bucket | void', -\ 'stream_context_create(': '[array options] | resource', -\ 'stream_context_get_default(': '[array options] | resource', -\ 'stream_context_get_options(': 'resource stream_or_context | array', -\ 'stream_context_set_option(': 'resource stream_or_context, string wrapper, string option, mixed value | bool', -\ 'stream_context_set_params(': 'resource stream_or_context, array params | bool', -\ 'stream_copy_to_stream(': 'resource source, resource dest [, int maxlength [, int offset]] | int', -\ 'stream_filter_append(': 'resource stream, string filtername [, int read_write [, mixed params]] | resource', -\ 'stream_filter_prepend(': 'resource stream, string filtername [, int read_write [, mixed params]] | resource', -\ 'stream_filter_register(': 'string filtername, string classname | bool', -\ 'stream_filter_remove(': 'resource stream_filter | bool', -\ 'stream_get_contents(': 'resource handle [, int maxlength [, int offset]] | string', -\ 'stream_get_filters(': 'void | array', -\ 'stream_get_line(': 'resource handle, int length [, string ending] | string', -\ 'stream_get_meta_data(': 'resource stream | array', -\ 'stream_get_transports(': 'void | array', -\ 'stream_get_wrappers(': 'void | array', -\ 'stream_select(': 'array &read, array &write, array &except, int tv_sec [, int tv_usec] | int', -\ 'stream_set_blocking(': 'resource stream, int mode | bool', -\ 'stream_set_timeout(': 'resource stream, int seconds [, int microseconds] | bool', -\ 'stream_set_write_buffer(': 'resource stream, int buffer | int', -\ 'stream_socket_accept(': 'resource server_socket [, float timeout [, string &peername]] | resource', -\ 'stream_socket_client(': 'string remote_socket [, int &errno [, string &errstr [, float timeout [, int flags [, resource context]]]]] | resource', -\ 'stream_socket_enable_crypto(': 'resource stream, bool enable [, int crypto_type [, resource session_stream]] | mixed', -\ 'stream_socket_get_name(': 'resource handle, bool want_peer | string', -\ 'stream_socket_pair(': 'int domain, int type, int protocol | array', -\ 'stream_socket_recvfrom(': 'resource socket, int length [, int flags [, string &address]] | string', -\ 'stream_socket_sendto(': 'resource socket, string data [, int flags [, string address]] | int', -\ 'stream_socket_server(': 'string local_socket [, int &errno [, string &errstr [, int flags [, resource context]]]] | resource', -\ 'stream_wrapper_register(': 'string protocol, string classname | bool', -\ 'stream_wrapper_restore(': 'string protocol | bool', -\ 'stream_wrapper_unregister(': 'string protocol | bool', -\ 'strftime(': 'string format [, int timestamp] | string', -\ 'stripcslashes(': 'string str | string', -\ 'stripos(': 'string haystack, string needle [, int offset] | int', -\ 'stripslashes(': 'string str | string', -\ 'strip_tags(': 'string str [, string allowable_tags] | string', -\ 'str_ireplace(': 'mixed search, mixed replace, mixed subject [, int &count] | mixed', -\ 'stristr(': 'string haystack, string needle | string', -\ 'strlen(': 'string string | int', -\ 'strnatcasecmp(': 'string str1, string str2 | int', -\ 'strnatcmp(': 'string str1, string str2 | int', -\ 'strncasecmp(': 'string str1, string str2, int len | int', -\ 'strncmp(': 'string str1, string str2, int len | int', -\ 'str_pad(': 'string input, int pad_length [, string pad_string [, int pad_type]] | string', -\ 'strpbrk(': 'string haystack, string char_list | string', -\ 'strpos(': 'string haystack, mixed needle [, int offset] | int', -\ 'strptime(': 'string date, string format | array', -\ 'strrchr(': 'string haystack, string needle | string', -\ 'str_repeat(': 'string input, int multiplier | string', -\ 'str_replace(': 'mixed search, mixed replace, mixed subject [, int &count] | mixed', -\ 'strrev(': 'string string | string', -\ 'strripos(': 'string haystack, string needle [, int offset] | int', -\ 'str_rot13(': 'string str | string', -\ 'strrpos(': 'string haystack, string needle [, int offset] | int', -\ 'str_shuffle(': 'string str | string', -\ 'str_split(': 'string string [, int split_length] | array', -\ 'strspn(': 'string str1, string str2 [, int start [, int length]] | int', -\ 'strstr(': 'string haystack, string needle | string', -\ 'strtok(': 'string str, string token | string', -\ 'strtolower(': 'string str | string', -\ 'strtotime(': 'string time [, int now] | int', -\ 'strtoupper(': 'string string | string', -\ 'strtr(': 'string str, string from, string to | string', -\ 'strval(': 'mixed var | string', -\ 'str_word_count(': 'string string [, int format [, string charlist]] | mixed', -\ 'substr_compare(': 'string main_str, string str, int offset [, int length [, bool case_insensitivity]] | int', -\ 'substr_count(': 'string haystack, string needle [, int offset [, int length]] | int', -\ 'substr(': 'string string, int start [, int length] | string', -\ 'substr_replace(': 'mixed string, string replacement, int start [, int length] | mixed', -\ 'swf_actiongeturl(': 'string url, string target | void', -\ 'swf_actiongotoframe(': 'int framenumber | void', -\ 'swf_actiongotolabel(': 'string label | void', -\ 'swfaction(': 'string script | SWFAction', -\ 'swf_actionnextframe(': 'void | void', -\ 'swf_actionplay(': 'void | void', -\ 'swf_actionprevframe(': 'void | void', -\ 'swf_actionsettarget(': 'string target | void', -\ 'swf_actionstop(': 'void | void', -\ 'swf_actiontogglequality(': 'void | void', -\ 'swf_actionwaitforframe(': 'int framenumber, int skipcount | void', -\ 'swf_addbuttonrecord(': 'int states, int shapeid, int depth | void', -\ 'swf_addcolor(': 'float r, float g, float b, float a | void', -\ 'swfbitmap->getheight(': 'void | float', -\ 'swfbitmap->getwidth(': 'void | float', -\ 'swfbitmap(': 'mixed file [, mixed alphafile] | SWFBitmap', -\ 'swfbutton->addaction(': 'resource action, int flags | void', -\ 'swfbutton->addshape(': 'resource shape, int flags | void', -\ 'swfbutton(': 'void | SWFButton', -\ 'swfbutton->setaction(': 'resource action | void', -\ 'swfbutton->setdown(': 'resource shape | void', -\ 'swfbutton->sethit(': 'resource shape | void', -\ 'swfbutton->setover(': 'resource shape | void', -\ 'swfbutton->setup(': 'resource shape | void', -\ 'swf_closefile(': '[int return_file] | void', -\ 'swf_definebitmap(': 'int objid, string image_name | void', -\ 'swf_definefont(': 'int fontid, string fontname | void', -\ 'swf_defineline(': 'int objid, float x1, float y1, float x2, float y2, float width | void', -\ 'swf_definepoly(': 'int objid, array coords, int npoints, float width | void', -\ 'swf_definerect(': 'int objid, float x1, float y1, float x2, float y2, float width | void', -\ 'swf_definetext(': 'int objid, string str, int docenter | void', -\ 'swfdisplayitem->addcolor(': 'int red, int green, int blue [, int a] | void', -\ 'swfdisplayitem->move(': 'int dx, int dy | void', -\ 'swfdisplayitem->moveto(': 'int x, int y | void', -\ 'swfdisplayitem->multcolor(': 'int red, int green, int blue [, int a] | void', -\ 'swfdisplayitem->remove(': 'void | void', -\ 'swfdisplayitem->rotate(': 'float ddegrees | void', -\ 'swfdisplayitem->rotateto(': 'float degrees | void', -\ 'swfdisplayitem->scale(': 'int dx, int dy | void', -\ 'swfdisplayitem->scaleto(': 'int x [, int y] | void', -\ 'swfdisplayitem->setdepth(': 'float depth | void', -\ 'swfdisplayitem->setname(': 'string name | void', -\ 'swfdisplayitem->setratio(': 'float ratio | void', -\ 'swfdisplayitem->skewx(': 'float ddegrees | void', -\ 'swfdisplayitem->skewxto(': 'float degrees | void', -\ 'swfdisplayitem->skewy(': 'float ddegrees | void', -\ 'swfdisplayitem->skewyto(': 'float degrees | void', -\ 'swf_endbutton(': 'void | void', -\ 'swf_enddoaction(': 'void | void', -\ 'swf_endshape(': 'void | void', -\ 'swf_endsymbol(': 'void | void', -\ 'swffill(': 'void | SWFFill', -\ 'swffill->moveto(': 'int x, int y | void', -\ 'swffill->rotateto(': 'float degrees | void', -\ 'swffill->scaleto(': 'int x [, int y] | void', -\ 'swffill->skewxto(': 'float x | void', -\ 'swffill->skewyto(': 'float y | void', -\ 'swffont->getwidth(': 'string string | float', -\ 'swffont(': 'string filename | SWFFont', -\ 'swf_fontsize(': 'float size | void', -\ 'swf_fontslant(': 'float slant | void', -\ 'swf_fonttracking(': 'float tracking | void', -\ 'swf_getbitmapinfo(': 'int bitmapid | array', -\ 'swf_getfontinfo(': 'void | array', -\ 'swf_getframe(': 'void | int', -\ 'swfgradient->addentry(': 'float ratio, int red, int green, int blue [, int a] | void', -\ 'swfgradient(': 'void | SWFGradient', -\ 'swf_labelframe(': 'string name | void', -\ 'swf_lookat(': 'float view_x, float view_y, float view_z, float reference_x, float reference_y, float reference_z, float twist | void', -\ 'swf_modifyobject(': 'int depth, int how | void', -\ 'swfmorph->getshape1(': 'void | mixed', -\ 'swfmorph->getshape2(': 'void | mixed', -\ 'swfmorph(': 'void | SWFMorph', -\ 'swfmovie->add(': 'resource instance | void', -\ 'swfmovie(': 'void | SWFMovie', -\ 'swfmovie->nextframe(': 'void | void', -\ 'swfmovie->output(': '[int compression] | int', -\ 'swfmovie->remove(': 'resource instance | void', -\ 'swfmovie->save(': 'string filename [, int compression] | int', -\ 'swfmovie->setbackground(': 'int red, int green, int blue | void', -\ 'swfmovie->setdimension(': 'int width, int height | void', -\ 'swfmovie->setframes(': 'string numberofframes | void', -\ 'swfmovie->setrate(': 'int rate | void', -\ 'swfmovie->streammp3(': 'mixed mp3File | void', -\ 'swf_mulcolor(': 'float r, float g, float b, float a | void', -\ 'swf_nextid(': 'void | int', -\ 'swf_oncondition(': 'int transition | void', -\ 'swf_openfile(': 'string filename, float width, float height, float framerate, float r, float g, float b | void', -\ 'swf_ortho2(': 'float xmin, float xmax, float ymin, float ymax | void', -\ 'swf_ortho(': 'float xmin, float xmax, float ymin, float ymax, float zmin, float zmax | void', -\ 'swf_perspective(': 'float fovy, float aspect, float near, float far | void', -\ 'swf_placeobject(': 'int objid, int depth | void', -\ 'swf_polarview(': 'float dist, float azimuth, float incidence, float twist | void', -\ 'swf_popmatrix(': 'void | void', -\ 'swf_posround(': 'int round | void', -\ 'SWFPrebuiltClip(': '[string file] | SWFPrebuiltClip', -\ 'swf_pushmatrix(': 'void | void', -\ 'swf_removeobject(': 'int depth | void', -\ 'swf_rotate(': 'float angle, string axis | void', -\ 'swf_scale(': 'float x, float y, float z | void', -\ 'swf_setfont(': 'int fontid | void', -\ 'swf_setframe(': 'int framenumber | void', -\ 'SWFShape->addFill(': 'int red, int green, int blue [, int a] | SWFFill', -\ 'swf_shapearc(': 'float x, float y, float r, float ang1, float ang2 | void', -\ 'swf_shapecurveto3(': 'float x1, float y1, float x2, float y2, float x3, float y3 | void', -\ 'swf_shapecurveto(': 'float x1, float y1, float x2, float y2 | void', -\ 'swfshape->drawcurve(': 'int controldx, int controldy, int anchordx, int anchordy [, int targetdx, int targetdy] | int', -\ 'swfshape->drawcurveto(': 'int controlx, int controly, int anchorx, int anchory [, int targetx, int targety] | int', -\ 'swfshape->drawline(': 'int dx, int dy | void', -\ 'swfshape->drawlineto(': 'int x, int y | void', -\ 'swf_shapefillbitmapclip(': 'int bitmapid | void', -\ 'swf_shapefillbitmaptile(': 'int bitmapid | void', -\ 'swf_shapefilloff(': 'void | void', -\ 'swf_shapefillsolid(': 'float r, float g, float b, float a | void', -\ 'swfshape(': 'void | SWFShape', -\ 'swf_shapelinesolid(': 'float r, float g, float b, float a, float width | void', -\ 'swf_shapelineto(': 'float x, float y | void', -\ 'swfshape->movepen(': 'int dx, int dy | void', -\ 'swfshape->movepento(': 'int x, int y | void', -\ 'swf_shapemoveto(': 'float x, float y | void', -\ 'swfshape->setleftfill(': 'swfgradient fill | void', -\ 'swfshape->setline(': 'swfshape shape | void', -\ 'swfshape->setrightfill(': 'swfgradient fill | void', -\ 'swf_showframe(': 'void | void', -\ 'SWFSound(': 'string filename, int flags | SWFSound', -\ 'swfsprite->add(': 'resource object | void', -\ 'swfsprite(': 'void | SWFSprite', -\ 'swfsprite->nextframe(': 'void | void', -\ 'swfsprite->remove(': 'resource object | void', -\ 'swfsprite->setframes(': 'int numberofframes | void', -\ 'swf_startbutton(': 'int objid, int type | void', -\ 'swf_startdoaction(': 'void | void', -\ 'swf_startshape(': 'int objid | void', -\ 'swf_startsymbol(': 'int objid | void', -\ 'swftext->addstring(': 'string string | void', -\ 'swftextfield->addstring(': 'string string | void', -\ 'swftextfield->align(': 'int alignement | void', -\ 'swftextfield(': '[int flags] | SWFTextField', -\ 'swftextfield->setbounds(': 'int width, int height | void', -\ 'swftextfield->setcolor(': 'int red, int green, int blue [, int a] | void', -\ 'swftextfield->setfont(': 'string font | void', -\ 'swftextfield->setheight(': 'int height | void', -\ 'swftextfield->setindentation(': 'int width | void', -\ 'swftextfield->setleftmargin(': 'int width | void', -\ 'swftextfield->setlinespacing(': 'int height | void', -\ 'swftextfield->setmargins(': 'int left, int right | void', -\ 'swftextfield->setname(': 'string name | void', -\ 'swftextfield->setrightmargin(': 'int width | void', -\ 'swftext->getwidth(': 'string string | float', -\ 'swftext(': 'void | SWFText', -\ 'swftext->moveto(': 'int x, int y | void', -\ 'swftext->setcolor(': 'int red, int green, int blue [, int a] | void', -\ 'swftext->setfont(': 'string font | void', -\ 'swftext->setheight(': 'int height | void', -\ 'swftext->setspacing(': 'float spacing | void', -\ 'swf_textwidth(': 'string str | float', -\ 'swf_translate(': 'float x, float y, float z | void', -\ 'SWFVideoStream(': '[string file] | SWFVideoStream', -\ 'swf_viewport(': 'float xmin, float xmax, float ymin, float ymax | void', -\ 'sybase_affected_rows(': '[resource link_identifier] | int', -\ 'sybase_close(': '[resource link_identifier] | bool', -\ 'sybase_connect(': '[string servername [, string username [, string password [, string charset [, string appname]]]]] | resource', -\ 'sybase_data_seek(': 'resource result_identifier, int row_number | bool', -\ 'sybase_deadlock_retry_count(': 'int retry_count | void', -\ 'sybase_fetch_array(': 'resource result | array', -\ 'sybase_fetch_assoc(': 'resource result | array', -\ 'sybase_fetch_field(': 'resource result [, int field_offset] | object', -\ 'sybase_fetch_object(': 'resource result [, mixed object] | object', -\ 'sybase_fetch_row(': 'resource result | array', -\ 'sybase_field_seek(': 'resource result, int field_offset | bool', -\ 'sybase_free_result(': 'resource result | bool', -\ 'sybase_get_last_message(': 'void | string', -\ 'sybase_min_client_severity(': 'int severity | void', -\ 'sybase_min_error_severity(': 'int severity | void', -\ 'sybase_min_message_severity(': 'int severity | void', -\ 'sybase_min_server_severity(': 'int severity | void', -\ 'sybase_num_fields(': 'resource result | int', -\ 'sybase_num_rows(': 'resource result | int', -\ 'sybase_pconnect(': '[string servername [, string username [, string password [, string charset [, string appname]]]]] | resource', -\ 'sybase_query(': 'string query [, resource link_identifier] | mixed', -\ 'sybase_result(': 'resource result, int row, mixed field | string', -\ 'sybase_select_db(': 'string database_name [, resource link_identifier] | bool', -\ 'sybase_set_message_handler(': 'callback handler [, resource connection] | bool', -\ 'sybase_unbuffered_query(': 'string query, resource link_identifier [, bool store_result] | resource', -\ 'symlink(': 'string target, string link | bool', -\ 'sys_getloadavg(': 'void | array', -\ 'syslog(': 'int priority, string message | bool', -\ 'system(': 'string command [, int &return_var] | string', -\ 'tanh(': 'float arg | float', -\ 'tan(': 'float arg | float', -\ 'tcpwrap_check(': 'string daemon, string address [, string user [, bool nodns]] | bool', -\ 'tempnam(': 'string dir, string prefix | string', -\ 'textdomain(': 'string text_domain | string', -\ 'tidy_access_count(': 'tidy object | int', -\ 'tidy_config_count(': 'tidy object | int', -\ 'tidy_error_count(': 'tidy object | int', -\ 'tidy_get_output(': 'tidy object | string', -\ 'tidy_load_config(': 'string filename, string encoding | void', -\ 'tidy_node->get_attr(': 'int attrib_id | tidy_attr', -\ 'tidy_node->get_nodes(': 'int node_id | array', -\ 'tidyNode->hasChildren(': 'void | bool', -\ 'tidyNode->hasSiblings(': 'void | bool', -\ 'tidyNode->isAsp(': 'void | bool', -\ 'tidyNode->isComment(': 'void | bool', -\ 'tidyNode->isHtml(': 'void | bool', -\ 'tidyNode->isJste(': 'void | bool', -\ 'tidyNode->isPhp(': 'void | bool', -\ 'tidyNode->isText(': 'void | bool', -\ 'tidy_node->next(': 'void | tidy_node', -\ 'tidy_node->prev(': 'void | tidy_node', -\ 'tidy_repair_file(': 'string filename [, mixed config [, string encoding [, bool use_include_path]]] | string', -\ 'tidy_repair_string(': 'string data [, mixed config [, string encoding]] | string', -\ 'tidy_reset_config(': 'void | bool', -\ 'tidy_save_config(': 'string filename | bool', -\ 'tidy_set_encoding(': 'string encoding | bool', -\ 'tidy_setopt(': 'string option, mixed value | bool', -\ 'tidy_warning_count(': 'tidy object | int', -\ 'time(': 'void | int', -\ 'time_nanosleep(': 'int seconds, int nanoseconds | mixed', -\ 'time_sleep_until(': 'float timestamp | bool', -\ 'tmpfile(': 'void | resource', -\ 'token_get_all(': 'string source | array', -\ 'token_name(': 'int token | string', -\ 'touch(': 'string filename [, int time [, int atime]] | bool', -\ 'trigger_error(': 'string error_msg [, int error_type] | bool', -\ 'trim(': 'string str [, string charlist] | string', -\ 'uasort(': 'array &array, callback cmp_function | bool', -\ 'ucfirst(': 'string str | string', -\ 'ucwords(': 'string str | string', -\ 'udm_add_search_limit(': 'resource agent, int var, string val | bool', -\ 'udm_alloc_agent_array(': 'array databases | resource', -\ 'udm_alloc_agent(': 'string dbaddr [, string dbmode] | resource', -\ 'udm_api_version(': 'void | int', -\ 'udm_cat_list(': 'resource agent, string category | array', -\ 'udm_cat_path(': 'resource agent, string category | array', -\ 'udm_check_charset(': 'resource agent, string charset | bool', -\ 'udm_check_stored(': 'resource agent, int link, string doc_id | int', -\ 'udm_clear_search_limits(': 'resource agent | bool', -\ 'udm_close_stored(': 'resource agent, int link | int', -\ 'udm_crc32(': 'resource agent, string str | int', -\ 'udm_errno(': 'resource agent | int', -\ 'udm_error(': 'resource agent | string', -\ 'udm_find(': 'resource agent, string query | resource', -\ 'udm_free_agent(': 'resource agent | int', -\ 'udm_free_ispell_data(': 'int agent | bool', -\ 'udm_free_res(': 'resource res | bool', -\ 'udm_get_doc_count(': 'resource agent | int', -\ 'udm_get_res_field(': 'resource res, int row, int field | string', -\ 'udm_get_res_param(': 'resource res, int param | string', -\ 'udm_hash32(': 'resource agent, string str | int', -\ 'udm_load_ispell_data(': 'resource agent, int var, string val1, string val2, int flag | bool', -\ 'udm_open_stored(': 'resource agent, string storedaddr | int', -\ 'udm_set_agent_param(': 'resource agent, int var, string val | bool', -\ 'uksort(': 'array &array, callback cmp_function | bool', -\ 'umask(': '[int mask] | int', -\ 'unicode_encode(': 'unicode input, string encoding | string', -\ 'unicode_semantics(': 'void | bool', -\ 'uniqid(': '[string prefix [, bool more_entropy]] | string', -\ 'unixtojd(': '[int timestamp] | int', -\ 'unlink(': 'string filename [, resource context] | bool', -\ 'unpack(': 'string format, string data | array', -\ 'unregister_tick_function(': 'string function_name | void', -\ 'unserialize(': 'string str | mixed', -\ 'unset(': 'mixed var [, mixed var [, mixed ...]] | void', -\ 'urldecode(': 'string str | string', -\ 'urlencode(': 'string str | string', -\ 'use_soap_error_handler(': '[bool handler] | bool', -\ 'usleep(': 'int micro_seconds | void', -\ 'usort(': 'array &array, callback cmp_function | bool', -\ 'utf8_decode(': 'string data | string', -\ 'utf8_encode(': 'string data | string', -\ 'var_dump(': 'mixed expression [, mixed expression [, ...]] | void', -\ 'var_export(': 'mixed expression [, bool return] | mixed', -\ 'variant_abs(': 'mixed val | mixed', -\ 'variant_add(': 'mixed left, mixed right | mixed', -\ 'variant_and(': 'mixed left, mixed right | mixed', -\ 'variant_cast(': 'variant variant, int type | variant', -\ 'variant_cat(': 'mixed left, mixed right | mixed', -\ 'variant_cmp(': 'mixed left, mixed right [, int lcid [, int flags]] | int', -\ 'variant_date_from_timestamp(': 'int timestamp | variant', -\ 'variant_date_to_timestamp(': 'variant variant | int', -\ 'variant_div(': 'mixed left, mixed right | mixed', -\ 'variant_eqv(': 'mixed left, mixed right | mixed', -\ 'variant_fix(': 'mixed variant | mixed', -\ 'variant_get_type(': 'variant variant | int', -\ 'variant_idiv(': 'mixed left, mixed right | mixed', -\ 'variant_imp(': 'mixed left, mixed right | mixed', -\ 'variant_int(': 'mixed variant | mixed', -\ 'variant_mod(': 'mixed left, mixed right | mixed', -\ 'variant_mul(': 'mixed left, mixed right | mixed', -\ 'variant_neg(': 'mixed variant | mixed', -\ 'variant_not(': 'mixed variant | mixed', -\ 'variant_or(': 'mixed left, mixed right | mixed', -\ 'variant_pow(': 'mixed left, mixed right | mixed', -\ 'variant_round(': 'mixed variant, int decimals | mixed', -\ 'variant_set(': 'variant variant, mixed value | void', -\ 'variant_set_type(': 'variant variant, int type | void', -\ 'variant_sub(': 'mixed left, mixed right | mixed', -\ 'variant_xor(': 'mixed left, mixed right | mixed', -\ 'version_compare(': 'string version1, string version2 [, string operator] | mixed', -\ 'vfprintf(': 'resource handle, string format, array args | int', -\ 'virtual(': 'string filename | bool', -\ 'vpopmail_add_alias_domain_ex(': 'string olddomain, string newdomain | bool', -\ 'vpopmail_add_alias_domain(': 'string domain, string aliasdomain | bool', -\ 'vpopmail_add_domain_ex(': 'string domain, string passwd [, string quota [, string bounce [, bool apop]]] | bool', -\ 'vpopmail_add_domain(': 'string domain, string dir, int uid, int gid | bool', -\ 'vpopmail_add_user(': 'string user, string domain, string password [, string gecos [, bool apop]] | bool', -\ 'vpopmail_alias_add(': 'string user, string domain, string alias | bool', -\ 'vpopmail_alias_del_domain(': 'string domain | bool', -\ 'vpopmail_alias_del(': 'string user, string domain | bool', -\ 'vpopmail_alias_get_all(': 'string domain | array', -\ 'vpopmail_alias_get(': 'string alias, string domain | array', -\ 'vpopmail_auth_user(': 'string user, string domain, string password [, string apop] | bool', -\ 'vpopmail_del_domain_ex(': 'string domain | bool', -\ 'vpopmail_del_domain(': 'string domain | bool', -\ 'vpopmail_del_user(': 'string user, string domain | bool', -\ 'vpopmail_error(': 'void | string', -\ 'vpopmail_passwd(': 'string user, string domain, string password [, bool apop] | bool', -\ 'vpopmail_set_user_quota(': 'string user, string domain, string quota | bool', -\ 'vprintf(': 'string format, array args | int', -\ 'vsprintf(': 'string format, array args | string', -\ 'w32api_deftype(': 'string typename, string member1_type, string member1_name [, string ... [, string ...]] | bool', -\ 'w32api_init_dtype(': 'string typename, mixed value [, mixed ...] | resource', -\ 'w32api_invoke_function(': 'string funcname, mixed argument [, mixed ...] | mixed', -\ 'w32api_register_function(': 'string library, string function_name, string return_type | bool', -\ 'w32api_set_call_method(': 'int method | void', -\ 'wddx_add_vars(': 'int packet_id, mixed name_var [, mixed ...] | bool', -\ 'wddx_packet_end(': 'resource packet_id | string', -\ 'wddx_packet_start(': '[string comment] | resource', -\ 'wddx_serialize_value(': 'mixed var [, string comment] | string', -\ 'wddx_serialize_vars(': 'mixed var_name [, mixed ...] | string', -\ 'wddx_unserialize(': 'string packet | mixed', -\ 'win32_create_service(': 'array details [, string machine] | int', -\ 'win32_delete_service(': 'string servicename [, string machine] | int', -\ 'win32_get_last_control_message(': 'void | int', -\ 'win32_ps_list_procs(': 'void | array', -\ 'win32_ps_stat_mem(': 'void | array', -\ 'win32_ps_stat_proc(': '[int pid] | array', -\ 'win32_query_service_status(': 'string servicename [, string machine] | mixed', -\ 'win32_set_service_status(': 'int status | bool', -\ 'win32_start_service_ctrl_dispatcher(': 'string name | bool', -\ 'win32_start_service(': 'string servicename [, string machine] | int', -\ 'win32_stop_service(': 'string servicename [, string machine] | int', -\ 'wordwrap(': 'string str [, int width [, string break [, bool cut]]] | string', -\ 'xattr_get(': 'string filename, string name [, int flags] | string', -\ 'xattr_list(': 'string filename [, int flags] | array', -\ 'xattr_remove(': 'string filename, string name [, int flags] | bool', -\ 'xattr_set(': 'string filename, string name, string value [, int flags] | bool', -\ 'xattr_supported(': 'string filename [, int flags] | bool', -\ 'xdiff_file_diff_binary(': 'string file1, string file2, string dest | bool', -\ 'xdiff_file_diff(': 'string file1, string file2, string dest [, int context [, bool minimal]] | bool', -\ 'xdiff_file_merge3(': 'string file1, string file2, string file3, string dest | mixed', -\ 'xdiff_file_patch_binary(': 'string file, string patch, string dest | bool', -\ 'xdiff_file_patch(': 'string file, string patch, string dest [, int flags] | mixed', -\ 'xdiff_string_diff_binary(': 'string str1, string str2 | string', -\ 'xdiff_string_diff(': 'string str1, string str2 [, int context [, bool minimal]] | string', -\ 'xdiff_string_merge3(': 'string str1, string str2, string str3 [, string &error] | mixed', -\ 'xdiff_string_patch_binary(': 'string str, string patch | string', -\ 'xdiff_string_patch(': 'string str, string patch [, int flags [, string &error]] | string', -\ 'xml_error_string(': 'int code | string', -\ 'xml_get_current_byte_index(': 'resource parser | int', -\ 'xml_get_current_column_number(': 'resource parser | int', -\ 'xml_get_current_line_number(': 'resource parser | int', -\ 'xml_get_error_code(': 'resource parser | int', -\ 'xml_parse(': 'resource parser, string data [, bool is_final] | int', -\ 'xml_parse_into_struct(': 'resource parser, string data, array &values [, array &index] | int', -\ 'xml_parser_create(': '[string encoding] | resource', -\ 'xml_parser_create_ns(': '[string encoding [, string separator]] | resource', -\ 'xml_parser_free(': 'resource parser | bool', -\ 'xml_parser_get_option(': 'resource parser, int option | mixed', -\ 'xml_parser_set_option(': 'resource parser, int option, mixed value | bool', -\ 'xmlrpc_decode(': 'string xml [, string encoding] | array', -\ 'xmlrpc_decode_request(': 'string xml, string &method [, string encoding] | array', -\ 'xmlrpc_encode(': 'mixed value | string', -\ 'xmlrpc_encode_request(': 'string method, mixed params [, array output_options] | string', -\ 'xmlrpc_get_type(': 'mixed value | string', -\ 'xmlrpc_is_fault(': 'array arg | bool', -\ 'xmlrpc_parse_method_descriptions(': 'string xml | array', -\ 'xmlrpc_server_add_introspection_data(': 'resource server, array desc | int', -\ 'xmlrpc_server_call_method(': 'resource server, string xml, mixed user_data [, array output_options] | string', -\ 'xmlrpc_server_create(': 'void | resource', -\ 'xmlrpc_server_destroy(': 'resource server | int', -\ 'xmlrpc_server_register_introspection_callback(': 'resource server, string function | bool', -\ 'xmlrpc_server_register_method(': 'resource server, string method_name, string function | bool', -\ 'xmlrpc_set_type(': 'string &value, string type | bool', -\ 'xml_set_character_data_handler(': 'resource parser, callback handler | bool', -\ 'xml_set_default_handler(': 'resource parser, callback handler | bool', -\ 'xml_set_element_handler(': 'resource parser, callback start_element_handler, callback end_element_handler | bool', -\ 'xml_set_end_namespace_decl_handler(': 'resource parser, callback handler | bool', -\ 'xml_set_external_entity_ref_handler(': 'resource parser, callback handler | bool', -\ 'xml_set_notation_decl_handler(': 'resource parser, callback handler | bool', -\ 'xml_set_object(': 'resource parser, object &object | bool', -\ 'xml_set_processing_instruction_handler(': 'resource parser, callback handler | bool', -\ 'xml_set_start_namespace_decl_handler(': 'resource parser, callback handler | bool', -\ 'xml_set_unparsed_entity_decl_handler(': 'resource parser, callback handler | bool', -\ 'xmlwriter_end_attribute(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_cdata(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_comment(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_document(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_dtd_attlist(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_dtd_element(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_dtd_entity(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_dtd(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_element(': 'resource xmlwriter | bool', -\ 'xmlwriter_end_pi(': 'resource xmlwriter | bool', -\ 'xmlwriter_flush(': 'resource xmlwriter [, bool empty] | mixed', -\ 'xmlwriter_full_end_element(': 'resource xmlwriter | bool', -\ 'xmlwriter_open_memory(': 'void | resource', -\ 'xmlwriter_open_uri(': 'string source | resource', -\ 'xmlwriter_output_memory(': 'resource xmlwriter [, bool flush] | string', -\ 'xmlwriter_set_indent(': 'resource xmlwriter, bool indent | bool', -\ 'xmlwriter_set_indent_string(': 'resource xmlwriter, string indentString | bool', -\ 'xmlwriter_start_attribute(': 'resource xmlwriter, string name | bool', -\ 'xmlwriter_start_attribute_ns(': 'resource xmlwriter, string prefix, string name, string uri | bool', -\ 'xmlwriter_start_cdata(': 'resource xmlwriter | bool', -\ 'xmlwriter_start_comment(': 'resource xmlwriter | bool', -\ 'xmlwriter_start_document(': 'resource xmlwriter [, string version [, string encoding [, string standalone]]] | bool', -\ 'xmlwriter_start_dtd_attlist(': 'resource xmlwriter, string name | bool', -\ 'xmlwriter_start_dtd_element(': 'resource xmlwriter, string name | bool', -\ 'xmlwriter_start_dtd_entity(': 'resource xmlwriter, string name, bool isparam | bool', -\ 'xmlwriter_start_dtd(': 'resource xmlwriter, string name [, string pubid [, string sysid]] | bool', -\ 'xmlwriter_start_element(': 'resource xmlwriter, string name | bool', -\ 'xmlwriter_start_element_ns(': 'resource xmlwriter, string prefix, string name, string uri | bool', -\ 'xmlwriter_start_pi(': 'resource xmlwriter, string target | bool', -\ 'xmlwriter_text(': 'resource xmlwriter, string content | bool', -\ 'xmlwriter_write_attribute(': 'resource xmlwriter, string name, string content | bool', -\ 'xmlwriter_write_attribute_ns(': 'resource xmlwriter, string prefix, string name, string uri, string content | bool', -\ 'xmlwriter_write_cdata(': 'resource xmlwriter, string content | bool', -\ 'xmlwriter_write_comment(': 'resource xmlwriter, string content | bool', -\ 'xmlwriter_write_dtd_attlist(': 'resource xmlwriter, string name, string content | bool', -\ 'xmlwriter_write_dtd_element(': 'resource xmlwriter, string name, string content | bool', -\ 'xmlwriter_write_dtd_entity(': 'resource xmlwriter, string name, string content | bool', -\ 'xmlwriter_write_dtd(': 'resource xmlwriter, string name [, string pubid [, string sysid [, string subset]]] | bool', -\ 'xmlwriter_write_element(': 'resource xmlwriter, string name, string content | bool', -\ 'xmlwriter_write_element_ns(': 'resource xmlwriter, string prefix, string name, string uri, string content | bool', -\ 'xmlwriter_write_pi(': 'resource xmlwriter, string target, string content | bool', -\ 'xmlwriter_write_raw(': 'resource xmlwriter, string content | bool', -\ 'xpath_new_context(': 'domdocument dom_document | XPathContext', -\ 'xpath_register_ns_auto(': 'XPathContext xpath_context [, object context_node] | bool', -\ 'xpath_register_ns(': 'XPathContext xpath_context, string prefix, string uri | bool', -\ 'xptr_new_context(': 'void | XPathContext', -\ 'xslt_backend_info(': 'void | string', -\ 'xslt_backend_name(': 'void | string', -\ 'xslt_backend_version(': 'void | string', -\ 'xslt_create(': 'void | resource', -\ 'xslt_errno(': 'resource xh | int', -\ 'xslt_error(': 'resource xh | string', -\ 'xslt_free(': 'resource xh | void', -\ 'xslt_getopt(': 'resource processor | int', -\ 'xslt_process(': 'resource xh, string xmlcontainer, string xslcontainer [, string resultcontainer [, array arguments [, array parameters]]] | mixed', -\ 'xslt_set_base(': 'resource xh, string uri | void', -\ 'xslt_set_encoding(': 'resource xh, string encoding | void', -\ 'xslt_set_error_handler(': 'resource xh, mixed handler | void', -\ 'xslt_set_log(': 'resource xh [, mixed log] | void', -\ 'xslt_set_object(': 'resource processor, object &obj | bool', -\ 'xslt_setopt(': 'resource processor, int newmask | mixed', -\ 'xslt_set_sax_handler(': 'resource xh, array handlers | void', -\ 'xslt_set_sax_handlers(': 'resource processor, array handlers | void', -\ 'xslt_set_scheme_handler(': 'resource xh, array handlers | void', -\ 'xslt_set_scheme_handlers(': 'resource processor, array handlers | void', -\ 'yaz_addinfo(': 'resource id | string', -\ 'yaz_ccl_conf(': 'resource id, array config | void', -\ 'yaz_ccl_parse(': 'resource id, string query, array &result | bool', -\ 'yaz_close(': 'resource id | bool', -\ 'yaz_connect(': 'string zurl [, mixed options] | mixed', -\ 'yaz_database(': 'resource id, string databases | bool', -\ 'yaz_element(': 'resource id, string elementset | bool', -\ 'yaz_errno(': 'resource id | int', -\ 'yaz_error(': 'resource id | string', -\ 'yaz_es_result(': 'resource id | array', -\ 'yaz_get_option(': 'resource id, string name | string', -\ 'yaz_hits(': 'resource id [, array searchresult] | int', -\ 'yaz_itemorder(': 'resource id, array args | void', -\ 'yaz_present(': 'resource id | bool', -\ 'yaz_range(': 'resource id, int start, int number | void', -\ 'yaz_record(': 'resource id, int pos, string type | string', -\ 'yaz_scan(': 'resource id, string type, string startterm [, array flags] | void', -\ 'yaz_scan_result(': 'resource id [, array &result] | array', -\ 'yaz_schema(': 'resource id, string schema | void', -\ 'yaz_search(': 'resource id, string type, string query | bool', -\ 'yaz_set_option(': 'resource id, string name, string value | void', -\ 'yaz_sort(': 'resource id, string criteria | void', -\ 'yaz_syntax(': 'resource id, string syntax | void', -\ 'yaz_wait(': '[array &options] | mixed', -\ 'yp_all(': 'string domain, string map, string callback | void', -\ 'yp_cat(': 'string domain, string map | array', -\ 'yp_errno(': 'void | int', -\ 'yp_err_string(': 'int errorcode | string', -\ 'yp_first(': 'string domain, string map | array', -\ 'yp_get_default_domain(': 'void | string', -\ 'yp_master(': 'string domain, string map | string', -\ 'yp_match(': 'string domain, string map, string key | string', -\ 'yp_next(': 'string domain, string map, string key | array', -\ 'yp_order(': 'string domain, string map | int', -\ 'zend_logo_guid(': 'void | string', -\ 'zend_version(': 'void | string', -\ 'zip_close(': 'resource zip | void', -\ 'zip_entry_close(': 'resource zip_entry | void', -\ 'zip_entry_compressedsize(': 'resource zip_entry | int', -\ 'zip_entry_compressionmethod(': 'resource zip_entry | string', -\ 'zip_entry_filesize(': 'resource zip_entry | int', -\ 'zip_entry_name(': 'resource zip_entry | string', -\ 'zip_entry_open(': 'resource zip, resource zip_entry [, string mode] | bool', -\ 'zip_entry_read(': 'resource zip_entry [, int length] | string', -\ 'zip_open(': 'string filename | resource', -\ 'zip_read(': 'resource zip | resource', -\ 'zlib_get_coding_type(': 'void | string' -\ } -" }}} -" built-in object functions {{{ -let g:php_builtin_object_functions = { -\ 'ArrayIterator::current(': 'void | mixed', -\ 'ArrayIterator::key(': 'void | mixed', -\ 'ArrayIterator::next(': 'void | void', -\ 'ArrayIterator::rewind(': 'void | void', -\ 'ArrayIterator::seek(': 'int position | void', -\ 'ArrayIterator::valid(': 'void | bool', -\ 'ArrayObject::append(': 'mixed newval | void', -\ 'ArrayObject::__construct(': 'mixed input | ArrayObject', -\ 'ArrayObject::count(': 'void | int', -\ 'ArrayObject::getIterator(': 'void | ArrayIterator', -\ 'ArrayObject::offsetExists(': 'mixed index | bool', -\ 'ArrayObject::offsetGet(': 'mixed index | bool', -\ 'ArrayObject::offsetSet(': 'mixed index, mixed newval | void', -\ 'ArrayObject::offsetUnset(': 'mixed index | void', -\ 'CachingIterator::hasNext(': 'void | bool', -\ 'CachingIterator::next(': 'void | void', -\ 'CachingIterator::rewind(': 'void | void', -\ 'CachingIterator::__toString(': 'void | string', -\ 'CachingIterator::valid(': 'void | bool', -\ 'CachingRecursiveIterator::getChildren(': 'void | CachingRecursiveIterator', -\ 'CachingRecursiveIterator::hasChildren(': 'void | bolean', -\ 'DirectoryIterator::__construct(': 'string path | DirectoryIterator', -\ 'DirectoryIterator::current(': 'void | DirectoryIterator', -\ 'DirectoryIterator::getATime(': 'void | int', -\ 'DirectoryIterator::getChildren(': 'void | RecursiveDirectoryIterator', -\ 'DirectoryIterator::getCTime(': 'void | int', -\ 'DirectoryIterator::getFilename(': 'void | string', -\ 'DirectoryIterator::getGroup(': 'void | int', -\ 'DirectoryIterator::getInode(': 'void | int', -\ 'DirectoryIterator::getMTime(': 'void | int', -\ 'DirectoryIterator::getOwner(': 'void | int', -\ 'DirectoryIterator::getPath(': 'void | string', -\ 'DirectoryIterator::getPathname(': 'void | string', -\ 'DirectoryIterator::getPerms(': 'void | int', -\ 'DirectoryIterator::getSize(': 'void | int', -\ 'DirectoryIterator::getType(': 'void | string', -\ 'DirectoryIterator::isDir(': 'void | bool', -\ 'DirectoryIterator::isDot(': 'void | bool', -\ 'DirectoryIterator::isExecutable(': 'void | bool', -\ 'DirectoryIterator::isFile(': 'void | bool', -\ 'DirectoryIterator::isLink(': 'void | bool', -\ 'DirectoryIterator::isReadable(': 'void | bool', -\ 'DirectoryIterator::isWritable(': 'void | bool', -\ 'DirectoryIterator::key(': 'void | string', -\ 'DirectoryIterator::next(': 'void | void', -\ 'DirectoryIterator::rewind(': 'void | void', -\ 'DirectoryIterator::valid(': 'void | string', -\ 'FilterIterator::current(': 'void | mixed', -\ 'FilterIterator::getInnerIterator(': 'void | Iterator', -\ 'FilterIterator::key(': 'void | mixed', -\ 'FilterIterator::next(': 'void | void', -\ 'FilterIterator::rewind(': 'void | void', -\ 'FilterIterator::valid(': 'void | bool', -\ 'LimitIterator::getPosition(': 'void | int', -\ 'LimitIterator::next(': 'void | void', -\ 'LimitIterator::rewind(': 'void | void', -\ 'LimitIterator::seek(': 'int position | void', -\ 'LimitIterator::valid(': 'void | bool', -\ 'Memcache::add(': 'string key, mixed var [, int flag [, int expire]] | bool', -\ 'Memcache::addServer(': 'string host [, int port [, bool persistent [, int weight [, int timeout [, int retry_interval]]]]] | bool', -\ 'Memcache::close(': 'void | bool', -\ 'Memcache::connect(': 'string host [, int port [, int timeout]] | bool', -\ 'Memcache::decrement(': 'string key [, int value] | int', -\ 'Memcache::delete(': 'string key [, int timeout] | bool', -\ 'Memcache::flush(': 'void | bool', -\ 'Memcache::getExtendedStats(': 'void | array', -\ 'Memcache::get(': 'string key | string', -\ 'Memcache::getStats(': 'void | array', -\ 'Memcache::getVersion(': 'void | string', -\ 'Memcache::increment(': 'string key [, int value] | int', -\ 'Memcache::pconnect(': 'string host [, int port [, int timeout]] | bool', -\ 'Memcache::replace(': 'string key, mixed var [, int flag [, int expire]] | bool', -\ 'Memcache::setCompressThreshold(': 'int threshold [, float min_savings] | bool', -\ 'Memcache::set(': 'string key, mixed var [, int flag [, int expire]] | bool', -\ 'ParentIterator::getChildren(': 'void | ParentIterator', -\ 'ParentIterator::hasChildren(': 'void | bool', -\ 'ParentIterator::next(': 'void | void', -\ 'ParentIterator::rewind(': 'void | void', -\ 'PDO::beginTransaction(': 'void | bool', -\ 'PDO::commit(': 'void | bool', -\ 'PDO::__construct(': 'string dsn [, string username [, string password [, array driver_options]]] | PDO', -\ 'PDO::errorCode(': 'void | string', -\ 'PDO::errorInfo(': 'void | array', -\ 'PDO::exec(': 'string statement | int', -\ 'PDO::getAttribute(': 'int attribute | mixed', -\ 'PDO::getAvailableDrivers(': 'void | array', -\ 'PDO::lastInsertId(': '[string name] | string', -\ 'PDO::prepare(': 'string statement [, array driver_options] | PDOStatement', -\ 'PDO::query(': 'string statement | PDOStatement', -\ 'PDO::quote(': 'string string [, int parameter_type] | string', -\ 'PDO::rollBack(': 'void | bool', -\ 'PDO::setAttribute(': 'int attribute, mixed value | bool', -\ 'PDO::sqliteCreateAggregate(': 'string function_name, callback step_func, callback finalize_func [, int num_args] | bool', -\ 'PDO::sqliteCreateFunction(': 'string function_name, callback callback [, int num_args] | bool', -\ 'PDOStatement::bindColumn(': 'mixed column, mixed &param [, int type] | bool', -\ 'PDOStatement::bindParam(': 'mixed parameter, mixed &variable [, int data_type [, int length [, mixed driver_options]]] | bool', -\ 'PDOStatement::bindValue(': 'mixed parameter, mixed value [, int data_type] | bool', -\ 'PDOStatement::closeCursor(': 'void | bool', -\ 'PDOStatement::columnCount(': 'void | int', -\ 'PDOStatement::errorCode(': 'void | string', -\ 'PDOStatement::errorInfo(': 'void | array', -\ 'PDOStatement::execute(': '[array input_parameters] | bool', -\ 'PDOStatement::fetchAll(': '[int fetch_style [, int column_index]] | array', -\ 'PDOStatement::fetchColumn(': '[int column_number] | string', -\ 'PDOStatement::fetch(': '[int fetch_style [, int cursor_orientation [, int cursor_offset]]] | mixed', -\ 'PDOStatement::fetchObject(': '[string class_name [, array ctor_args]] | mixed', -\ 'PDOStatement::getAttribute(': 'int attribute | mixed', -\ 'PDOStatement::getColumnMeta(': 'int column | mixed', -\ 'PDOStatement::nextRowset(': 'void | bool', -\ 'PDOStatement::rowCount(': 'void | int', -\ 'PDOStatement::setAttribute(': 'int attribute, mixed value | bool', -\ 'PDOStatement::setFetchMode(': 'int mode | bool', -\ 'Rar::extract(': 'string dir [, string filepath] | bool', -\ 'Rar::getAttr(': 'void | int', -\ 'Rar::getCrc(': 'void | int', -\ 'Rar::getFileTime(': 'void | string', -\ 'Rar::getHostOs(': 'void | int', -\ 'Rar::getMethod(': 'void | int', -\ 'Rar::getName(': 'void | string', -\ 'Rar::getPackedSize(': 'void | int', -\ 'Rar::getUnpackedSize(': 'void | int', -\ 'Rar::getVersion(': 'void | int', -\ 'RecursiveDirectoryIterator::getChildren(': 'void | object', -\ 'RecursiveDirectoryIterator::hasChildren(': '[bool allow_links] | bool', -\ 'RecursiveDirectoryIterator::key(': 'void | string', -\ 'RecursiveDirectoryIterator::next(': 'void | void', -\ 'RecursiveDirectoryIterator::rewind(': 'void | void', -\ 'RecursiveIteratorIterator::current(': 'void | mixed', -\ 'RecursiveIteratorIterator::getDepth(': 'void | int', -\ 'RecursiveIteratorIterator::getSubIterator(': 'void | RecursiveIterator', -\ 'RecursiveIteratorIterator::key(': 'void | mixed', -\ 'RecursiveIteratorIterator::next(': 'void | void', -\ 'RecursiveIteratorIterator::rewind(': 'void | void', -\ 'RecursiveIteratorIterator::valid(': 'void | bolean', -\ 'SDO_DAS_ChangeSummary::beginLogging(': 'void | void', -\ 'SDO_DAS_ChangeSummary::endLogging(': 'void | void', -\ 'SDO_DAS_ChangeSummary::getChangedDataObjects(': 'void | SDO_List', -\ 'SDO_DAS_ChangeSummary::getChangeType(': 'SDO_DataObject dataObject | int', -\ 'SDO_DAS_ChangeSummary::getOldContainer(': 'SDO_DataObject data_object | SDO_DataObject', -\ 'SDO_DAS_ChangeSummary::getOldValues(': 'SDO_DataObject data_object | SDO_List', -\ 'SDO_DAS_ChangeSummary::isLogging(': 'void | bool', -\ 'SDO_DAS_DataFactory::addPropertyToType(': 'string parent_type_namespace_uri, string parent_type_name, string property_name, string type_namespace_uri, string type_name [, array options] | void', -\ 'SDO_DAS_DataFactory::addType(': 'string type_namespace_uri, string type_name [, array options] | void', -\ 'SDO_DAS_DataFactory::getDataFactory(': 'void | SDO_DAS_DataFactory', -\ 'SDO_DAS_DataObject::getChangeSummary(': 'void | SDO_DAS_ChangeSummary', -\ 'SDO_DAS_Relational::applyChanges(': 'PDO database_handle, SDODataObject root_data_object | void', -\ 'SDO_DAS_Relational::__construct(': 'array database_metadata [, string application_root_type [, array SDO_containment_references_metadata]] | SDO_DAS_Relational', -\ 'SDO_DAS_Relational::createRootDataObject(': 'void | SDODataObject', -\ 'SDO_DAS_Relational::executePreparedQuery(': 'PDO database_handle, PDOStatement prepared_statement, array value_list [, array column_specifier] | SDODataObject', -\ 'SDO_DAS_Relational::executeQuery(': 'PDO database_handle, string SQL_statement [, array column_specifier] | SDODataObject', -\ 'SDO_DAS_Setting::getListIndex(': 'void | int', -\ 'SDO_DAS_Setting::getPropertyIndex(': 'void | int', -\ 'SDO_DAS_Setting::getPropertyName(': 'void | string', -\ 'SDO_DAS_Setting::getValue(': 'void | mixed', -\ 'SDO_DAS_Setting::isSet(': 'void | bool', -\ 'SDO_DAS_XML::addTypes(': 'string xsd_file | void', -\ 'SDO_DAS_XML::createDataObject(': 'string namespace_uri, string type_name | SDO_DataObject', -\ 'SDO_DAS_XML::createDocument(': '[string document_element_name] | SDO_DAS_XML_Document', -\ 'SDO_DAS_XML::create(': '[string xsd_file] | SDO_DAS_XML', -\ 'SDO_DAS_XML_Document::getRootDataObject(': 'void | SDO_DataObject', -\ 'SDO_DAS_XML_Document::getRootElementName(': 'void | string', -\ 'SDO_DAS_XML_Document::getRootElementURI(': 'void | string', -\ 'SDO_DAS_XML_Document::setEncoding(': 'string encoding | void', -\ 'SDO_DAS_XML_Document::setXMLDeclaration(': 'bool xmlDeclatation | void', -\ 'SDO_DAS_XML_Document::setXMLVersion(': 'string xmlVersion | void', -\ 'SDO_DAS_XML::loadFile(': 'string xml_file | SDO_XMLDocument', -\ 'SDO_DAS_XML::loadString(': 'string xml_string | SDO_DAS_XML_Document', -\ 'SDO_DAS_XML::saveFile(': 'SDO_XMLDocument xdoc, string xml_file [, int indent] | void', -\ 'SDO_DAS_XML::saveString(': 'SDO_XMLDocument xdoc [, int indent] | string', -\ 'SDO_DataFactory::create(': 'string type_namespace_uri, string type_name | void', -\ 'SDO_DataObject::clear(': 'void | void', -\ 'SDO_DataObject::createDataObject(': 'mixed identifier | SDO_DataObject', -\ 'SDO_DataObject::getContainer(': 'void | SDO_DataObject', -\ 'SDO_DataObject::getSequence(': 'void | SDO_Sequence', -\ 'SDO_DataObject::getTypeName(': 'void | string', -\ 'SDO_DataObject::getTypeNamespaceURI(': 'void | string', -\ 'SDO_Exception::getCause(': 'void | mixed', -\ 'SDO_List::insert(': 'mixed value [, int index] | void', -\ 'SDO_Model_Property::getContainingType(': 'void | SDO_Model_Type', -\ 'SDO_Model_Property::getDefault(': 'void | mixed', -\ 'SDO_Model_Property::getName(': 'void | string', -\ 'SDO_Model_Property::getType(': 'void | SDO_Model_Type', -\ 'SDO_Model_Property::isContainment(': 'void | bool', -\ 'SDO_Model_Property::isMany(': 'void | bool', -\ 'SDO_Model_ReflectionDataObject::__construct(': 'SDO_DataObject data_object | SDO_Model_ReflectionDataObject', -\ 'SDO_Model_ReflectionDataObject::export(': 'SDO_Model_ReflectionDataObject rdo [, bool return] | mixed', -\ 'SDO_Model_ReflectionDataObject::getContainmentProperty(': 'void | SDO_Model_Property', -\ 'SDO_Model_ReflectionDataObject::getInstanceProperties(': 'void | array', -\ 'SDO_Model_ReflectionDataObject::getType(': 'void | SDO_Model_Type', -\ 'SDO_Model_Type::getBaseType(': 'void | SDO_Model_Type', -\ 'SDO_Model_Type::getName(': 'void | string', -\ 'SDO_Model_Type::getNamespaceURI(': 'void | string', -\ 'SDO_Model_Type::getProperties(': 'void | array', -\ 'SDO_Model_Type::getProperty(': 'mixed identifier | SDO_Model_Property', -\ 'SDO_Model_Type::isAbstractType(': 'void | bool', -\ 'SDO_Model_Type::isDataType(': 'void | bool', -\ 'SDO_Model_Type::isInstance(': 'SDO_DataObject data_object | bool', -\ 'SDO_Model_Type::isOpenType(': 'void | bool', -\ 'SDO_Model_Type::isSequencedType(': 'void | bool', -\ 'SDO_Sequence::getProperty(': 'int sequence_index | SDO_Model_Property', -\ 'SDO_Sequence::insert(': 'mixed value [, int sequenceIndex [, mixed propertyIdentifier]] | void', -\ 'SDO_Sequence::move(': 'int toIndex, int fromIndex | void', -\ 'SimpleXMLIterator::current(': 'void | mixed', -\ 'SimpleXMLIterator::getChildren(': 'void | object', -\ 'SimpleXMLIterator::hasChildren(': 'void | bool', -\ 'SimpleXMLIterator::key(': 'void | mixed', -\ 'SimpleXMLIterator::next(': 'void | void', -\ 'SimpleXMLIterator::rewind(': 'void | void', -\ 'SimpleXMLIterator::valid(': 'void | bool', -\ 'SWFButton::addASound(': 'SWFSound sound, int flags | SWFSoundInstance', -\ 'SWFButton::setMenu(': 'int flag | void', -\ 'SWFDisplayItem::addAction(': 'SWFAction action, int flags | void', -\ 'SWFDisplayItem::endMask(': 'void | void', -\ 'SWFDisplayItem::getRot(': 'void | float', -\ 'SWFDisplayItem::getX(': 'void | float', -\ 'SWFDisplayItem::getXScale(': 'void | float', -\ 'SWFDisplayItem::getXSkew(': 'void | float', -\ 'SWFDisplayItem::getY(': 'void | float', -\ 'SWFDisplayItem::getYScale(': 'void | float', -\ 'SWFDisplayItem::getYSkew(': 'void | float', -\ 'SWFDisplayItem::setMaskLevel(': 'int level | void', -\ 'SWFDisplayItem::setMatrix(': 'float a, float b, float c, float d, float x, float y | void', -\ 'SWFFontChar::addChars(': 'string char | void', -\ 'SWFFontChar::addUTF8Chars(': 'string char | void', -\ 'SWFFont::getAscent(': 'void | float', -\ 'SWFFont::getDescent(': 'void | float', -\ 'SWFFont::getLeading(': 'void | float', -\ 'SWFFont::getShape(': 'int code | string', -\ 'SWFFont::getUTF8Width(': 'string string | float', -\ 'SWFMovie::addExport(': 'SWFCharacter char, string name | void', -\ 'SWFMovie::addFont(': 'SWFFont font | SWFFontChar', -\ 'SWFMovie::importChar(': 'string libswf, string name | SWFSprite', -\ 'SWFMovie::importFont(': 'string libswf, string name | SWFFontChar', -\ 'SWFMovie::labelFrame(': 'string label | void', -\ 'SWFMovie::saveToFile(': 'stream x [, int compression] | int', -\ 'SWFMovie::startSound(': 'SWFSound sound | SWFSoundInstance', -\ 'SWFMovie::stopSound(': 'SWFSound sound | void', -\ 'SWFMovie::writeExports(': 'void | void', -\ 'SWFShape::drawArc(': 'float r, float startAngle, float endAngle | void', -\ 'SWFShape::drawCircle(': 'float r | void', -\ 'SWFShape::drawCubic(': 'float bx, float by, float cx, float cy, float dx, float dy | int', -\ 'SWFShape::drawCubicTo(': 'float bx, float by, float cx, float cy, float dx, float dy | int', -\ 'SWFShape::drawGlyph(': 'SWFFont font, string character [, int size] | void', -\ 'SWFSoundInstance::loopCount(': 'int point | void', -\ 'SWFSoundInstance::loopInPoint(': 'int point | void', -\ 'SWFSoundInstance::loopOutPoint(': 'int point | void', -\ 'SWFSoundInstance::noMultiple(': 'void | void', -\ 'SWFSprite::labelFrame(': 'string label | void', -\ 'SWFSprite::startSound(': 'SWFSound sound | SWFSoundInstance', -\ 'SWFSprite::stopSound(': 'SWFSound sound | void', -\ 'SWFText::addUTF8String(': 'string text | void', -\ 'SWFTextField::addChars(': 'string chars | void', -\ 'SWFTextField::setPadding(': 'float padding | void', -\ 'SWFText::getAscent(': 'void | float', -\ 'SWFText::getDescent(': 'void | float', -\ 'SWFText::getLeading(': 'void | float', -\ 'SWFText::getUTF8Width(': 'string string | float', -\ 'SWFVideoStream::getNumFrames(': 'void | int', -\ 'SWFVideoStream::setDimension(': 'int x, int y | void', -\ 'tidy::__construct(': '[string filename [, mixed config [, string encoding [, bool use_include_path]]]] | tidy' -\ } - " }}} -" Add control structures (they are outside regular pattern of PHP functions) -let php_control = { - \ 'include(': 'string filename | resource', - \ 'include_once(': 'string filename | resource', - \ 'require(': 'string filename | resource', - \ 'require_once(': 'string filename | resource', - \ } -call extend(g:php_builtin_functions, php_control) -endfunction -" }}} " vim:set foldmethod=marker: diff --git a/tests/examplefiles/test.html b/tests/examplefiles/test.html index ea723232..39365c0e 100644 --- a/tests/examplefiles/test.html +++ b/tests/examplefiles/test.html @@ -348,774 +348,4 @@ pre.syntax { padding: 5px; margin-top: 0px; } <span class="bn bn-pseudo">self</span>.<span class="name">subject</span>.<span class="name">subject_id</span> ) -<span class="cm"># -*- coding: utf-8 -*-</span> -<span class="st st-db">"""</span><span class="st"> - pocoo.pkg.core.auth - ~~~~~~~~~~~~~~~~~~~ - - Default authentication module. - - :copyright: 2006-2007 by Armin Ronacher. - :license: GNU GPL, see LICENSE for more details. -</span><span class="st st-db">"""</span> - -<span class="kw">from </span><span class="cls">datetime</span><span class="kw"> import</span> <span class="name">datetime</span> -<span class="kw">from </span><span class="cls">pocoo.context</span><span class="kw"> import</span> <span class="name">Component</span> - -<span class="kw">from </span><span class="cls">pocoo.utils.net</span><span class="kw"> import</span> <span class="name">IP</span> -<span class="kw">from </span><span class="cls">pocoo.application</span><span class="kw"> import</span> <span class="name">RequestWrapper</span> -<span class="kw">from </span><span class="cls">pocoo.settings</span><span class="kw"> import</span> <span class="name">cfg</span> - -<span class="kw">from </span><span class="cls">pocoo.pkg.core.user</span><span class="kw"> import</span> <span class="name">User</span>, <span class="name">check_login_data</span> - - -<span class="kw">class </span><span class="cls">AuthProvider</span>(<span class="name">Component</span>): - - <span class="deco">@property</span> - - <span class="kw">def </span><span class="fun">auth_name</span>(<span class="bn bn-pseudo">self</span>): - <span class="st st-db">"""</span><span class="st"> - has to return the name of the auth module for the configuration - file. This name defaults to the classname. - </span><span class="st st-db">"""</span> - <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">__class__</span>.<span class="name">__name__</span> - - <span class="kw">def </span><span class="fun">get_user</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="st st-db">"""</span><span class="st"> - This method should either return a valid `User object`_ or ``None``. - - .. _User object: pocoo.pkg.core.user - </span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">get_user_id</span>(<span class="bn bn-pseudo">self</span>, <span class="name">session_dict</span>): - <span class="st st-db">"""</span><span class="st"> - - This method should either return the user_id of the user or ``None``. - </span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">do_login</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">username</span>, <span class="name">password</span>): - <span class="st st-db">"""</span><span class="st"> - - This method should update the user session so that the auth provider - can recognize the user in the ``get_user`` method. - It has to return a valid ``HttpResponse``, for redirecting to external - login scripts or ``False``, to display an error message (login failed). - If it returns ``True`` pocoo will redirect to the last visited page. - </span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">do_logout</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="st st-db">"""</span><span class="st"> - This method should return a valid ``Response`` for redirecting - to external scripts or ``None``. - </span><span class="st st-db">"""</span> - -<span class="kw">class </span><span class="cls">SessionAuth</span>(<span class="name">AuthProvider</span>): - - <span class="kw">def </span><span class="fun">get_user</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="kw">try</span>: - <span class="name">user_id</span> <span class="op">=</span> <span class="name">req</span>.<span class="name">session</span>[<span class="st st-sg">'</span><span class="st">user_id</span><span class="st st-sg">'</span>] - <span class="kw">return</span> <span class="name">User</span>(<span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>, <span class="name">user_id</span>) - <span class="kw">except</span> (<span class="exc">KeyError</span>, <span class="name">User</span>.<span class="name">NotFound</span>): - <span class="kw">return</span> <span class="bn bn-pseudo">None</span> - - <span class="kw">def </span><span class="fun">do_login</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">username</span>, <span class="name">password</span>): - <span class="name">user_id</span> <span class="op">=</span> <span class="name">check_login_data</span>(<span class="name">req</span>.<span class="name">ctx</span>, <span class="name">username</span>, <span class="name">password</span>) - <span class="kw">if</span> <span class="name">user_id</span> <span class="op op-word">is</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">None</span>: - <span class="name">req</span>.<span class="name">session</span>[<span class="st st-sg">'</span><span class="st">user_id</span><span class="st st-sg">'</span>] <span class="op">=</span> <span class="name">user_id</span> - - <span class="kw">return</span> <span class="bn bn-pseudo">True</span> - <span class="kw">return</span> <span class="bn bn-pseudo">False</span> - - <span class="kw">def </span><span class="fun">do_logout</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="kw">if</span> <span class="st st-sg">'</span><span class="st">user_id</span><span class="st st-sg">'</span> <span class="op op-word">in</span> <span class="name">req</span>.<span class="name">session</span>: - <span class="name">req</span>.<span class="name">session</span>.<span class="name">pop</span>(<span class="st st-sg">'</span><span class="st">user_id</span><span class="st st-sg">'</span>) - - <span class="kw">def </span><span class="fun">get_user_id</span>(<span class="bn bn-pseudo">self</span>, <span class="name">session_dict</span>): - <span class="kw">return</span> <span class="name">session_dict</span>.<span class="name">get</span>(<span class="st st-sg">'</span><span class="st">user_id</span><span class="st st-sg">'</span>) - - - -<span class="kw">class </span><span class="cls">AuthWrapper</span>(<span class="name">RequestWrapper</span>): - - <span class="kw">def </span><span class="fun">get_priority</span>(<span class="bn bn-pseudo">self</span>): - <span class="cm"># after SessionWrapper</span> - <span class="kw">return</span> <span class="nb nb-int">3</span> - - <span class="kw">def </span><span class="fun">process_request</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="cm"># XXX: what to do with uid?</span> - <span class="name">uid</span> <span class="op">=</span> <span class="name">req</span>.<span class="name">session</span>.<span class="name">get</span>(<span class="st st-sg">'</span><span class="st">user_id</span><span class="st st-sg">'</span>, <span class="op">-</span><span class="nb nb-int">1</span>) - <span class="name">req</span>.<span class="name">auth</span> <span class="op">=</span> <span class="name">AuthController</span>(<span class="name">req</span>) - <span class="name">req</span>.<span class="name">user</span> <span class="op">=</span> <span class="name">req</span>.<span class="name">auth</span>.<span class="name">get_user</span>() - - <span class="kw">def </span><span class="fun">process_response</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">resp</span>): - <span class="kw">return</span> <span class="name">resp</span> - - -<span class="kw">def </span><span class="fun">get_auth_provider_mapping</span>(<span class="name">ctx</span>): - <span class="st st-db">"""</span><span class="st">Returns a list of auth providers.</span><span class="st st-db">"""</span> - <span class="name">providers</span> <span class="op">=</span> {} - <span class="kw">for</span> <span class="name">comp</span> <span class="op op-word">in</span> <span class="name">ctx</span>.<span class="name">get_components</span>(<span class="name">AuthProvider</span>): - <span class="name">providers</span>[<span class="name">comp</span>.<span class="name">auth_name</span>] <span class="op">=</span> <span class="name">comp</span> - - <span class="kw">return</span> <span class="name">providers</span> - - -<span class="kw">def </span><span class="fun">get_auth_provider</span>(<span class="name">ctx</span>): - <span class="st st-db">"""</span><span class="st">Returns the enabled auth provider.</span><span class="st st-db">"""</span> - <span class="kw">if</span> <span class="st st-sg">'</span><span class="st">auth/provider</span><span class="st st-sg">'</span> <span class="op op-word">not</span> <span class="op op-word">in</span> <span class="name">ctx</span>.<span class="name">_cache</span>: - <span class="name">providers</span> <span class="op">=</span> <span class="name">get_auth_provider_mapping</span>(<span class="name">ctx</span>) - <span class="name">provider</span> <span class="op">=</span> <span class="name">providers</span>[<span class="name">ctx</span>.<span class="name">cfg</span>.<span class="name">get</span>(<span class="st st-sg">'</span><span class="st">general</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">auth_module</span><span class="st st-sg">'</span>)] - <span class="name">ctx</span>.<span class="name">_cache</span>[<span class="st st-sg">'</span><span class="st">auth/provider</span><span class="st st-sg">'</span>] <span class="op">=</span> <span class="name">provider</span> - - <span class="kw">return</span> <span class="name">ctx</span>.<span class="name">_cache</span>[<span class="st st-sg">'</span><span class="st">auth/provider</span><span class="st st-sg">'</span>] - - -<span class="kw">class </span><span class="cls">AuthController</span>(<span class="bn">object</span>): - <span class="name">auth_provider</span> <span class="op">=</span> <span class="name">cfg</span>.<span class="name">str</span>(<span class="st st-sg">'</span><span class="st">general</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">auth_module</span><span class="st st-sg">'</span>) - - <span class="kw">def </span><span class="fun">__init__</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span> <span class="op">=</span> <span class="name">req</span>.<span class="name">ctx</span> - - <span class="bn bn-pseudo">self</span>.<span class="name">req</span> <span class="op">=</span> <span class="name">req</span> - <span class="bn bn-pseudo">self</span>.<span class="name">provider</span> <span class="op">=</span> <span class="name">get_auth_provider</span>(<span class="name">req</span>.<span class="name">ctx</span>) - - <span class="kw">def </span><span class="fun">get_user</span>(<span class="bn bn-pseudo">self</span>): - <span class="st st-db">"""</span><span class="st"> - - Returns the user for this request - </span><span class="st st-db">"""</span> - <span class="name">user</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">provider</span>.<span class="name">get_user</span>(<span class="bn bn-pseudo">self</span>.<span class="name">req</span>) - <span class="kw">if</span> <span class="name">user</span> <span class="op op-word">is</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">None</span>: - <span class="name">user</span>.<span class="name">ip</span> <span class="op">=</span> <span class="name">IP</span>(<span class="bn bn-pseudo">self</span>.<span class="name">req</span>.<span class="name">environ</span>[<span class="st st-sg">'</span><span class="st">REMOTE_ADDR</span><span class="st st-sg">'</span>]) - <span class="kw">return</span> <span class="name">user</span> - - <span class="cm"># return anonymous user</span> - <span class="kw">return</span> <span class="name">User</span>(<span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>, <span class="op">-</span><span class="nb nb-int">1</span>) - - <span class="kw">def </span><span class="fun">do_login</span>(<span class="bn bn-pseudo">self</span>, <span class="name">username</span>, <span class="name">password</span>): - <span class="st st-db">"""</span><span class="st"> - - Returns a valid ``Response``, for redirecting to external - login scripts or ``False``, to display an error message (login failed). - If it returns ``True`` pocoo should redirect to the last visited page. - </span><span class="st st-db">"""</span> - <span class="name">rv</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">provider</span>.<span class="name">do_login</span>(<span class="bn bn-pseudo">self</span>.<span class="name">req</span>, <span class="name">username</span>, <span class="name">password</span>) - <span class="kw">if</span> <span class="name">rv</span> <span class="op op-word">is</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">False</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">req</span>.<span class="name">user</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">get_user</span>() - <span class="kw">return</span> <span class="name">rv</span> - - <span class="kw">return</span> <span class="bn bn-pseudo">False</span> - - <span class="kw">def </span><span class="fun">do_logout</span>(<span class="bn bn-pseudo">self</span>): - <span class="st st-db">"""</span><span class="st"> - Loggs the user out. Can eiter return None or a Response for - external redirects. - </span><span class="st st-db">"""</span> - <span class="cm"># update last login time</span> - - <span class="bn bn-pseudo">self</span>.<span class="name">req</span>.<span class="name">user</span>.<span class="name">last_login</span> <span class="op">=</span> <span class="name">datetime</span>.<span class="name">now</span>() - <span class="bn bn-pseudo">self</span>.<span class="name">req</span>.<span class="name">user</span>.<span class="name">save</span>() - <span class="bn bn-pseudo">self</span>.<span class="name">provider</span>.<span class="name">do_logout</span>(<span class="bn bn-pseudo">self</span>.<span class="name">req</span>) - <span class="cm">#XXX: maybe a bit slow</span> - - <span class="bn bn-pseudo">self</span>.<span class="name">req</span>.<span class="name">user</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">get_user</span>() -<span class="cm"># -*- coding: utf-8 -*-</span> -<span class="st st-db">"""</span><span class="st"> - pocoo.pkg.core.bbcode - ~~~~~~~~~~~~~~~~~~~~~ - - Pocoo BBCode parser. - - :copyright: 2006-2007 by Georg Brandl, Armin Ronacher. - :license: GNU GPL, see LICENSE for more details. - -</span><span class="st st-db">"""</span> -<span class="kw">import </span><span class="cls">re</span> - -<span class="kw">from </span><span class="cls">pocoo</span><span class="kw"> import</span> <span class="name">Component</span> -<span class="kw">from </span><span class="cls">pocoo.pkg.core.textfmt</span><span class="kw"> import</span> <span class="name">MarkupFormat</span> - -<span class="kw">from </span><span class="cls">pocoo.pkg.core.smilies</span><span class="kw"> import</span> <span class="name">get_smiley_buttons</span>, <span class="name">replace_smilies</span> -<span class="kw">from </span><span class="cls">pocoo.utils.html</span><span class="kw"> import</span> <span class="name">escape_html</span>, <span class="name">translate_color</span> - -<span class="kw">from </span><span class="cls">pocoo.utils.activecache</span><span class="kw"> import</span> <span class="name">Node</span>, <span class="name">CallbackNode</span>, <span class="name">NodeList</span> - -<span class="name">tag_re</span> <span class="op">=</span> <span class="name">re</span>.<span class="name">compile</span>(<span class="st st-sg">r'</span><span class="st">(\[(/?[a-zA-Z0-9]+)(?:=(&quot;.+?&quot;|.+?))?\])</span><span class="st st-sg">'</span>) - - - -<span class="kw">class </span><span class="cls">EndOfText</span>(<span class="exc">Exception</span>): - <span class="st st-db">"""</span><span class="st">Raise when the end of the text is reached.</span><span class="st st-db">"""</span> - - -<span class="kw">class </span><span class="cls">TokenList</span>(<span class="bn">list</span>): - <span class="st st-db">"""</span><span class="st">A subclass of a list for tokens which allows to flatten - the tokens so that the original bbcode is the return value.</span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">flatten</span>(<span class="bn bn-pseudo">self</span>): - <span class="kw">return</span> <span class="name">u</span><span class="st st-sg">''</span>.<span class="name">join</span>(<span class="name">token</span>.<span class="name">raw</span> <span class="kw">for</span> <span class="name">token</span> <span class="op op-word">in</span> <span class="bn bn-pseudo">self</span>) - - <span class="kw">def </span><span class="fun">__repr__</span>(<span class="bn bn-pseudo">self</span>): - <span class="kw">return</span> <span class="st st-sg">'</span><span class="st"><</span><span class="st st-int">%s</span><span class="st"> </span><span class="st st-int">%s</span><span class="st">></span><span class="st st-sg">'</span> <span class="op">%</span> ( - <span class="bn bn-pseudo">self</span>.<span class="name">__class__</span>.<span class="name">__name__</span>, - <span class="bn">list</span>.<span class="name">__repr__</span>(<span class="bn bn-pseudo">self</span>) - ) - - - -<span class="kw">class </span><span class="cls">Token</span>(<span class="bn">object</span>): - <span class="st st-db">"""</span><span class="st">Token Baseclass</span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">__repr__</span>(<span class="bn bn-pseudo">self</span>): - <span class="kw">return</span> <span class="st st-sg">'</span><span class="st"><</span><span class="st st-int">%s</span><span class="st"> </span><span class="st st-int">%s</span><span class="st">></span><span class="st st-sg">'</span> <span class="op">%</span> ( - <span class="bn bn-pseudo">self</span>.<span class="name">__class__</span>.<span class="name">__name__</span>, - <span class="bn bn-pseudo">self</span>.<span class="name">raw</span> - - ) - - -<span class="kw">class </span><span class="cls">TextToken</span>(<span class="name">Token</span>): - <span class="st st-db">"""</span><span class="st">A token for plain text.</span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">__init__</span>(<span class="bn bn-pseudo">self</span>, <span class="name">data</span>): - <span class="bn bn-pseudo">self</span>.<span class="name">data</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">raw</span> <span class="op">=</span> <span class="name">data</span> - - -<span class="kw">class </span><span class="cls">TagToken</span>(<span class="name">Token</span>): - <span class="st st-db">"""</span><span class="st">A token for tags.</span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">__init__</span>(<span class="bn bn-pseudo">self</span>, <span class="name">raw</span>, <span class="name">tagname</span>, <span class="name">attr</span>): - <span class="bn bn-pseudo">self</span>.<span class="name">raw</span> <span class="op">=</span> <span class="name">raw</span> - - <span class="bn bn-pseudo">self</span>.<span class="name">name</span> <span class="op">=</span> <span class="name">tagname</span> - <span class="bn bn-pseudo">self</span>.<span class="name">attr</span> <span class="op">=</span> <span class="name">attr</span> - - -<span class="kw">class </span><span class="cls">Parser</span>(<span class="bn">object</span>): - <span class="st st-db">"""</span><span class="st"> - BBCode Parser Class - </span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">__init__</span>(<span class="bn bn-pseudo">self</span>, <span class="name">ctx</span>, <span class="name">text</span>, <span class="name">handlers</span>, <span class="name">allowed_tags</span>): - <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span> <span class="op">=</span> <span class="name">ctx</span> - - <span class="bn bn-pseudo">self</span>.<span class="name">_tokens</span> <span class="op">=</span> <span class="name">tag_re</span>.<span class="name">split</span>(<span class="name">text</span>) - <span class="bn bn-pseudo">self</span>.<span class="name">_tokens</span>.<span class="name">reverse</span>() - <span class="bn bn-pseudo">self</span>.<span class="name">_is_text</span> <span class="op">=</span> <span class="bn bn-pseudo">True</span> - - <span class="bn bn-pseudo">self</span>.<span class="name">_cache</span> <span class="op">=</span> [] - <span class="bn bn-pseudo">self</span>.<span class="name">_handlers</span> <span class="op">=</span> <span class="name">handlers</span> - <span class="bn bn-pseudo">self</span>.<span class="name">_allowed_tags</span> <span class="op">=</span> <span class="name">allowed_tags</span> - - <span class="kw">def </span><span class="fun">tag_allowed</span>(<span class="bn bn-pseudo">self</span>, <span class="name">tagname</span>): - <span class="st st-db">"""</span><span class="st"> - Check if a tagname is allowed for this parser. - </span><span class="st st-db">"""</span> - <span class="kw">if</span> <span class="bn bn-pseudo">self</span>.<span class="name">_allowed_tags</span> <span class="op op-word">is</span> <span class="bn bn-pseudo">None</span>: - <span class="kw">return</span> <span class="bn bn-pseudo">True</span> - - <span class="kw">return</span> <span class="name">tagname</span> <span class="op op-word">in</span> <span class="bn bn-pseudo">self</span>.<span class="name">_allowed_tags</span> - - <span class="kw">def </span><span class="fun">get_next_token</span>(<span class="bn bn-pseudo">self</span>): - <span class="st st-db">"""</span><span class="st"> - - Fetch the next raw token from the text - Raise ``EndOfText`` if not further token exists. - </span><span class="st st-db">"""</span> - <span class="kw">if</span> <span class="bn bn-pseudo">self</span>.<span class="name">_cache</span>: - <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">_cache</span>.<span class="name">pop</span>() - <span class="name">get_token</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">_tokens</span>.<span class="name">pop</span> - - <span class="kw">if</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">self</span>.<span class="name">_tokens</span>: - <span class="kw">raise</span> <span class="name">EndOfText</span>() - <span class="kw">if</span> <span class="bn bn-pseudo">self</span>.<span class="name">_is_text</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">_is_text</span> <span class="op">=</span> <span class="bn bn-pseudo">False</span> - - <span class="kw">return</span> <span class="name">TextToken</span>(<span class="name">get_token</span>()) - <span class="kw">else</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">_is_text</span> <span class="op">=</span> <span class="bn bn-pseudo">True</span> - - <span class="name">raw</span> <span class="op">=</span> <span class="name">get_token</span>() - <span class="name">tagname</span> <span class="op">=</span> <span class="name">get_token</span>().<span class="name">lower</span>() - <span class="name">attr</span> <span class="op">=</span> <span class="name">get_token</span>() - <span class="kw">if</span> <span class="name">attr</span> <span class="op op-word">and</span> <span class="name">attr</span>[:<span class="nb nb-int">6</span>] <span class="op">==</span> <span class="name">attr</span>[<span class="op">-</span><span class="nb nb-int">6</span>:] <span class="op">==</span> <span class="st st-sg">'</span><span class="st">&quot;</span><span class="st st-sg">'</span>: - <span class="name">attr</span> <span class="op">=</span> <span class="name">attr</span>[<span class="nb nb-int">6</span>:<span class="op">-</span><span class="nb nb-int">6</span>] - <span class="kw">return</span> <span class="name">TagToken</span>(<span class="name">raw</span>, <span class="name">tagname</span>, <span class="name">attr</span>) - - <span class="kw">def </span><span class="fun">push_token</span>(<span class="bn bn-pseudo">self</span>, <span class="name">token</span>): - <span class="st st-db">"""</span><span class="st"> - - Pushes the last fetched token in a cache so that the next time - you call ``get_next_token`` returns the pushed token. - </span><span class="st st-db">"""</span> - <span class="bn bn-pseudo">self</span>.<span class="name">_cache</span>.<span class="name">append</span>(<span class="name">token</span>) - - <span class="kw">def </span><span class="fun">parse</span>(<span class="bn bn-pseudo">self</span>, <span class="name">needle</span><span class="op">=</span><span class="bn bn-pseudo">None</span>, <span class="name">preserve_needle</span><span class="op">=</span><span class="bn bn-pseudo">False</span>): - <span class="st st-db">"""</span><span class="st"> - - Parses the text until ``needle`` or the end of text if not defined. - If it finds the needle it will delete the needle token. If you want - the needle token too set ``preserve_needle`` to ``True``. - - In comparison with the ``get_tokens`` method this method will call - the node handlers for each node. - </span><span class="st st-db">"""</span> - <span class="name">result</span> <span class="op">=</span> <span class="name">NodeList</span>() - <span class="kw">try</span>: - <span class="kw">while</span> <span class="bn bn-pseudo">True</span>: - <span class="name">token</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">get_next_token</span>() - <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">token</span>, <span class="name">TagToken</span>) <span class="op op-word">and</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="name">needle</span>: - <span class="kw">if</span> <span class="name">preserve_needle</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">push_token</span>(<span class="name">token</span>) - <span class="kw">break</span> - - <span class="name">result</span>.<span class="name">append</span>(<span class="bn bn-pseudo">self</span>.<span class="name">get_node</span>(<span class="name">token</span>)) - <span class="kw">except</span> <span class="name">EndOfText</span>: - <span class="kw">pass</span> - - <span class="kw">return</span> <span class="name">result</span> - - <span class="kw">def </span><span class="fun">get_tokens</span>(<span class="bn bn-pseudo">self</span>, <span class="name">needle</span><span class="op">=</span><span class="bn bn-pseudo">None</span>, <span class="name">preserve_needle</span><span class="op">=</span><span class="bn bn-pseudo">False</span>): - <span class="st st-db">"""</span><span class="st"> - - Like ``parse`` but returns an unparsed TokenList. Basically you - would never need this method except for preserved areas like - Code blocks etc. - </span><span class="st st-db">"""</span> - <span class="name">result</span> <span class="op">=</span> <span class="name">TokenList</span>() - <span class="kw">try</span>: - <span class="kw">while</span> <span class="bn bn-pseudo">True</span>: - <span class="name">token</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">get_next_token</span>() - <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">token</span>, <span class="name">TagToken</span>) <span class="op op-word">and</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="name">needle</span>: - <span class="kw">if</span> <span class="name">preserve_needle</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">push_token</span>(<span class="name">token</span>) - <span class="kw">break</span> - - <span class="name">result</span>.<span class="name">append</span>(<span class="name">token</span>) - <span class="kw">except</span> <span class="name">EndOfText</span>: - <span class="kw">pass</span> - <span class="kw">return</span> <span class="name">result</span> - - <span class="kw">def </span><span class="fun">get_node</span>(<span class="bn bn-pseudo">self</span>, <span class="name">token</span>): - <span class="st st-db">"""</span><span class="st"> - Return the node for a token. If the token was a ``TextToken`` - the resulting node will call ``get_text_node`` which returns a - </span><span class="st st-esc">\n</span><span class="st"> to <br/> replaced version of the token value wrapped in a - plain ``Node``. In all other cases it will try to lookup the node - in the list of registered token handlers. - - If this fails it wraps the raw token value in a ``Node``. - </span><span class="st st-db">"""</span> - - <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">token</span>, <span class="name">TextToken</span>): - <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">get_text_node</span>(<span class="name">token</span>.<span class="name">data</span>) - <span class="kw">if</span> <span class="bn bn-pseudo">self</span>.<span class="name">tag_allowed</span>(<span class="name">token</span>.<span class="name">name</span>): - <span class="kw">for</span> <span class="name">handler</span> <span class="op op-word">in</span> <span class="bn bn-pseudo">self</span>.<span class="name">_handlers</span>: - <span class="name">rv</span> <span class="op">=</span> <span class="name">handler</span>.<span class="name">get_node</span>(<span class="name">token</span>, <span class="bn bn-pseudo">self</span>) - <span class="kw">if</span> <span class="name">rv</span> <span class="op op-word">is</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">None</span>: - <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">rv</span>, <span class="name">Node</span>): - <span class="kw">return</span> <span class="name">rv</span> - - <span class="kw">return</span> <span class="name">Node</span>(<span class="name">rv</span>) - <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">get_text_node</span>(<span class="name">token</span>.<span class="name">raw</span>) - - <span class="kw">def </span><span class="fun">get_text_node</span>(<span class="bn bn-pseudo">self</span>, <span class="name">data</span>): - <span class="st st-db">"""</span><span class="st"> - - Newline replaces the text and wraps it in an ``Node``. - </span><span class="st st-db">"""</span> - <span class="name">text</span> <span class="op">=</span> <span class="name">replace_smilies</span>(<span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>, <span class="name">data</span>) - <span class="kw">return</span> <span class="name">Node</span>(<span class="name">re</span>.<span class="name">sub</span>(<span class="st st-sg">r'</span><span class="st">\r?\n</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st"><br /></span><span class="st st-esc">\n</span><span class="st st-sg">'</span>, <span class="name">text</span>)) - - <span class="kw">def </span><span class="fun">wrap_render</span>(<span class="bn bn-pseudo">self</span>, <span class="name">tag</span>, <span class="name">parse_until</span>): - <span class="st st-db">"""</span><span class="st"> - - Renders untile ``parse_until`` and wraps it in the html tag ``tag``. - </span><span class="st st-db">"""</span> - <span class="kw">return</span> <span class="name">NodeList</span>(<span class="name">Node</span>(<span class="st st-sg">'</span><span class="st"><</span><span class="st st-int">%s</span><span class="st">></span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">tag</span>), <span class="bn bn-pseudo">self</span>.<span class="name">parse</span>(<span class="name">parse_until</span>), - <span class="name">Node</span>(<span class="st st-sg">'</span><span class="st"></</span><span class="st st-int">%s</span><span class="st">></span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">tag</span>)) - - <span class="kw">def </span><span class="fun">joined_render</span>(<span class="bn bn-pseudo">self</span>, <span class="op">*</span><span class="name">args</span>): - <span class="st st-db">"""</span><span class="st"> - - Takes a number of arguments which are either strings, unicode objects - or nodes. It creates a new newlist, iterates over all arguments and - converts all to nodes if not happened by now. - </span><span class="st st-db">"""</span> - <span class="name">result</span> <span class="op">=</span> <span class="name">NodeList</span>() - <span class="kw">for</span> <span class="name">arg</span> <span class="op op-word">in</span> <span class="name">args</span>: - <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">arg</span>, <span class="name">Node</span>): - <span class="name">result</span>.<span class="name">append</span>(<span class="name">arg</span>) - <span class="kw">else</span>: - <span class="name">result</span>.<span class="name">append</span>(<span class="name">Node</span>(<span class="name">arg</span>)) - <span class="kw">return</span> <span class="name">result</span> - - <span class="kw">def </span><span class="fun">callback</span>(<span class="bn bn-pseudo">self</span>, <span class="name">callback</span>, <span class="name">data</span>): - <span class="st st-db">"""</span><span class="st"> - Returns a new ``CallbackNode``. Don't create callback nodes on your - own, this method might do some further magic in the future. - </span><span class="st st-db">"""</span> - <span class="kw">return</span> <span class="name">CallbackNode</span>(<span class="name">callback</span>, <span class="op">*</span><span class="name">data</span>) - - - -<span class="kw">class </span><span class="cls">BBCodeTagProvider</span>(<span class="name">Component</span>): - <span class="cm">#: list of handled tags</span> - <span class="name">tags</span> <span class="op">=</span> [] - - <span class="cm">#: list of callbacks</span> - <span class="name">callbacks</span> <span class="op">=</span> [] - - <span class="kw">def </span><span class="fun">get_node</span>(<span class="bn bn-pseudo">self</span>, <span class="name">token</span>, <span class="name">parser</span>): - <span class="st st-db">"""</span><span class="st"> - - Is called when a tag is found. It must return a valid ``Node`` - or a string which is automatically wrapped into a plain ``Node``. - </span><span class="st st-db">"""</span> - - <span class="kw">def </span><span class="fun">render_callback</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">callback</span>, <span class="name">data</span>): - <span class="st st-db">"""</span><span class="st"> - - Has to handle a callback for ``callback`` with ``data`` and return a - string - </span><span class="st st-db">"""</span> - <span class="kw">return</span> <span class="name">u</span><span class="st st-sg">''</span> - - <span class="kw">def </span><span class="fun">get_buttons</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="st st-db">"""</span><span class="st"> - - Return a valid button definition for "tagname" or - None if no button is required. - - A valid button definition is a dict in the following - form:: - - {'name': _('Bold'), - 'description': _('Insert bold text'), - 'icon': self.ctx.make_url('!cobalt/...'), - 'insert': '[b]{text}[/b]'} - </span><span class="st st-db">"""</span> - - <span class="kw">return</span> () - - -<span class="kw">class </span><span class="cls">BBCode</span>(<span class="name">MarkupFormat</span>): - <span class="st st-db">"""</span><span class="st"> - BBCode markup format. - </span><span class="st st-db">"""</span> - <span class="name">name</span> <span class="op">=</span> <span class="st st-sg">'</span><span class="st">bbcode</span><span class="st st-sg">'</span> - - <span class="name">editor_javascript</span> <span class="op">=</span> <span class="st st-sg">'</span><span class="st">!cobalt/core/pocoo/app/BBCodeEditor.js</span><span class="st st-sg">'</span> - - <span class="kw">def </span><span class="fun">__init__</span>(<span class="bn bn-pseudo">self</span>, <span class="name">ctx</span>): - <span class="bn">super</span>(<span class="name">BBCode</span>, <span class="bn bn-pseudo">self</span>).<span class="name">__init__</span>(<span class="name">ctx</span>) - <span class="bn bn-pseudo">self</span>.<span class="name">handlers</span> <span class="op">=</span> {} - <span class="bn bn-pseudo">self</span>.<span class="name">callbacks</span> <span class="op">=</span> {} - <span class="kw">for</span> <span class="name">comp</span> <span class="op op-word">in</span> <span class="name">ctx</span>.<span class="name">get_components</span>(<span class="name">BBCodeTagProvider</span>): - <span class="kw">for</span> <span class="name">tag</span> <span class="op op-word">in</span> <span class="name">comp</span>.<span class="name">tags</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">handlers</span>.<span class="name">setdefault</span>(<span class="name">tag</span>, []).<span class="name">append</span>(<span class="name">comp</span>) - <span class="kw">for</span> <span class="name">callback</span> <span class="op op-word">in</span> <span class="name">comp</span>.<span class="name">callbacks</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">callbacks</span>[<span class="name">callback</span>] <span class="op">=</span> <span class="name">comp</span> - - <span class="kw">def </span><span class="fun">get_signature_tags</span>(<span class="bn bn-pseudo">self</span>): - <span class="st st-db">"""</span><span class="st">Returns the allowed signature tags or None if all</span><span class="st st-db">"""</span> - <span class="kw">if</span> <span class="op op-word">not</span> <span class="bn">hasattr</span>(<span class="bn bn-pseudo">self</span>, <span class="st st-sg">'</span><span class="st">_signature_tags</span><span class="st st-sg">'</span>): - <span class="name">r</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">cfg</span>.<span class="name">get</span>(<span class="st st-sg">'</span><span class="st">board</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">bbcode_signature_tags</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">ALL</span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">r</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">ALL</span><span class="st st-sg">'</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">_signature_tags</span> <span class="op">=</span> <span class="bn bn-pseudo">None</span> - - <span class="kw">else</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">_signature_tags</span> <span class="op">=</span> [<span class="name">s</span>.<span class="name">strip</span>().<span class="name">lower</span>() <span class="kw">for</span> <span class="name">s</span> <span class="op op-word">in</span> <span class="name">r</span>.<span class="name">split</span>(<span class="st st-sg">'</span><span class="st">,</span><span class="st st-sg">'</span>)] - <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">_signature_tags</span> - - <span class="kw">def </span><span class="fun">parse</span>(<span class="bn bn-pseudo">self</span>, <span class="name">text</span>, <span class="name">signature</span>): - <span class="name">handlers</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">get_components</span>(<span class="name">BBCodeTagProvider</span>) - <span class="name">allowed_tags</span> <span class="op">=</span> <span class="bn bn-pseudo">None</span> - - <span class="kw">if</span> <span class="name">signature</span>: - <span class="name">allowed_tags</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">get_signature_tags</span>() - <span class="name">p</span> <span class="op">=</span> <span class="name">Parser</span>(<span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>, <span class="name">escape_html</span>(<span class="name">text</span>), <span class="name">handlers</span>, <span class="name">allowed_tags</span>) - <span class="kw">return</span> <span class="name">p</span>.<span class="name">parse</span>() - - <span class="kw">def </span><span class="fun">render_callback</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">callback</span>, <span class="name">data</span>): - <span class="st st-db">"""</span><span class="st">Redirect the callback to the BBCode Provider.</span><span class="st st-db">"""</span> - - <span class="kw">for</span> <span class="name">comp</span> <span class="op op-word">in</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">get_components</span>(<span class="name">BBCodeTagProvider</span>): - <span class="name">rv</span> <span class="op">=</span> <span class="name">comp</span>.<span class="name">render_callback</span>(<span class="name">req</span>, <span class="name">callback</span>, <span class="name">data</span>) - <span class="kw">if</span> <span class="name">rv</span> <span class="op op-word">is</span> <span class="op op-word">not</span> <span class="bn bn-pseudo">None</span>: - <span class="kw">return</span> <span class="name">rv</span> - - <span class="kw">raise</span> <span class="exc">Exception</span>(<span class="st st-sg">'</span><span class="st">unhandled callback </span><span class="st st-int">%r</span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">callback</span>) - - <span class="kw">def </span><span class="fun">quote_text</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">text</span>, <span class="name">username</span><span class="op">=</span><span class="bn bn-pseudo">None</span>): - <span class="kw">if</span> <span class="name">username</span> <span class="op op-word">is</span> <span class="bn bn-pseudo">None</span>: - <span class="kw">return</span> <span class="st st-sg">'</span><span class="st">[quote]</span><span class="st st-int">%s</span><span class="st">[/quote]</span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">text</span> - - <span class="kw">return</span> <span class="st st-sg">'</span><span class="st">[quote="</span><span class="st st-int">%s</span><span class="st">"]</span><span class="st st-int">%s</span><span class="st">[/quote]</span><span class="st st-sg">'</span> <span class="op">%</span> (<span class="name">username</span>, <span class="name">text</span>) - - <span class="kw">def </span><span class="fun">get_editor_options</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">signature</span>): - <span class="name">buttons</span> <span class="op">=</span> [] - <span class="kw">if</span> <span class="name">signature</span>: - <span class="name">signature_tags</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">get_signature_tags</span>() - <span class="kw">for</span> <span class="name">comp</span> <span class="op op-word">in</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">get_components</span>(<span class="name">BBCodeTagProvider</span>): - <span class="kw">for</span> <span class="name">button</span> <span class="op op-word">in</span> <span class="name">comp</span>.<span class="name">get_buttons</span>(<span class="name">req</span>): - <span class="kw">if</span> <span class="name">signature</span> <span class="op op-word">and</span> <span class="name">button</span>[<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>] <span class="op op-word">not</span> <span class="op op-word">in</span> <span class="name">signature_tags</span>: - <span class="kw">continue</span> - - <span class="name">buttons</span>.<span class="name">append</span>(<span class="name">button</span>) - <span class="kw">return</span> { - <span class="st st-sg">'</span><span class="st">buttons</span><span class="st st-sg">'</span>: <span class="name">buttons</span>, - <span class="st st-sg">'</span><span class="st">smilies</span><span class="st st-sg">'</span>: <span class="name">get_smiley_buttons</span>(<span class="name">req</span>.<span class="name">ctx</span>) - } - - - -<span class="kw">class </span><span class="cls">BasicBBCodeTagProvider</span>(<span class="name">BBCodeTagProvider</span>): - <span class="name">tags</span> <span class="op">=</span> [<span class="st st-sg">'</span><span class="st">b</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">i</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">u</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">s</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">url</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">email</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">color</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">size</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">code</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">quote</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">list</span><span class="st st-sg">'</span>] - <span class="name">callbacks</span> <span class="op">=</span> [<span class="st st-sg">'</span><span class="st">quote</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">list</span><span class="st st-sg">'</span>] - - <span class="kw">def </span><span class="fun">get_node</span>(<span class="bn bn-pseudo">self</span>, <span class="name">token</span>, <span class="name">parser</span>): - <span class="name">ctx</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span> - - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">b</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="name">token</span>.<span class="name">attr</span>: - <span class="kw">return</span> - - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">wrap_render</span>(<span class="st st-sg">'</span><span class="st">strong</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">/b</span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">i</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="name">token</span>.<span class="name">attr</span>: - <span class="kw">return</span> - - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">wrap_render</span>(<span class="st st-sg">'</span><span class="st">em</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">/i</span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">u</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="name">token</span>.<span class="name">attr</span>: - <span class="kw">return</span> - - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">wrap_render</span>(<span class="st st-sg">'</span><span class="st">ins</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">/u</span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">s</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="name">token</span>.<span class="name">attr</span>: - <span class="kw">return</span> - - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">wrap_render</span>(<span class="st st-sg">'</span><span class="st">del</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">/s</span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">url</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="name">token</span>.<span class="name">attr</span>: - <span class="name">content</span> <span class="op">=</span> <span class="name">parser</span>.<span class="name">parse</span>(<span class="st st-sg">'</span><span class="st">/url</span><span class="st st-sg">'</span>) - <span class="name">url</span> <span class="op">=</span> <span class="name">token</span>.<span class="name">attr</span> - - <span class="kw">else</span>: - <span class="name">tokenlist</span> <span class="op">=</span> <span class="name">parser</span>.<span class="name">get_tokens</span>(<span class="st st-sg">'</span><span class="st">/url</span><span class="st st-sg">'</span>) - <span class="name">content</span> <span class="op">=</span> <span class="name">url</span> <span class="op">=</span> <span class="name">tokenlist</span>.<span class="name">flatten</span>() - <span class="kw">if</span> <span class="name">url</span>.<span class="name">startswith</span>(<span class="st st-sg">'</span><span class="st">javascript:</span><span class="st st-sg">'</span>): - <span class="name">url</span> <span class="op">=</span> <span class="name">url</span>[<span class="nb nb-int">11</span>:] - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">joined_render</span>(<span class="st st-sg">'</span><span class="st"><a href="</span><span class="st st-sg">'</span>, <span class="name">url</span>, <span class="st st-sg">'</span><span class="st">"></span><span class="st st-sg">'</span>, <span class="name">content</span>, <span class="st st-sg">'</span><span class="st"></a></span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">email</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="name">token</span>.<span class="name">attr</span>: - <span class="name">content</span> <span class="op">=</span> <span class="name">parser</span>.<span class="name">parse</span>(<span class="st st-sg">'</span><span class="st">/email</span><span class="st st-sg">'</span>) - <span class="name">mail</span> <span class="op">=</span> <span class="name">token</span>.<span class="name">attr</span> - - <span class="kw">else</span>: - <span class="name">tokenlist</span> <span class="op">=</span> <span class="name">parser</span>.<span class="name">get_tokens</span>(<span class="st st-sg">'</span><span class="st">/email</span><span class="st st-sg">'</span>) - <span class="name">mail</span> <span class="op">=</span> <span class="name">content</span> <span class="op">=</span> <span class="name">tokenlist</span>.<span class="name">flatten</span>() - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">joined_render</span>(<span class="st st-sg">'</span><span class="st"><a href="mailto:"</span><span class="st st-sg">'</span>, <span class="name">mail</span>, <span class="st st-sg">'</span><span class="st">"></span><span class="st st-sg">'</span>, - <span class="name">content</span>, <span class="st st-sg">'</span><span class="st"></a></span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">color</span><span class="st st-sg">'</span>: - <span class="name">content</span> <span class="op">=</span> <span class="name">parser</span>.<span class="name">parse</span>(<span class="st st-sg">'</span><span class="st">/color</span><span class="st st-sg">'</span>) - <span class="kw">try</span>: - <span class="name">color</span> <span class="op">=</span> <span class="name">translate_color</span>(<span class="name">token</span>.<span class="name">attr</span>) - <span class="kw">except</span> <span class="exc">ValueError</span>: - <span class="kw">return</span> <span class="name">token</span>.<span class="name">raw</span> - - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">joined_render</span>(<span class="st st-sg">'</span><span class="st"><span style="color: </span><span class="st st-sg">'</span>, <span class="name">color</span>, <span class="st st-sg">'</span><span class="st">"></span><span class="st st-sg">'</span>, - <span class="name">content</span>, <span class="st st-sg">'</span><span class="st"></span></span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">size</span><span class="st st-sg">'</span>: - <span class="name">content</span> <span class="op">=</span> <span class="name">parser</span>.<span class="name">parse</span>(<span class="st st-sg">'</span><span class="st">/size</span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="op op-word">not</span> <span class="name">token</span>.<span class="name">attr</span> <span class="op op-word">or</span> <span class="op op-word">not</span> <span class="name">token</span>.<span class="name">attr</span>.<span class="name">isdigit</span>() <span class="op op-word">or</span> <span class="bn">len</span>(<span class="name">token</span>.<span class="name">attr</span>) <span class="op">></span> <span class="nb nb-int">2</span>: - <span class="kw">return</span> <span class="name">token</span>.<span class="name">raw</span> - - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">joined_render</span>(<span class="st st-sg">'</span><span class="st"><span style="font-size: </span><span class="st st-sg">'</span>, <span class="name">token</span>.<span class="name">attr</span>, - <span class="st st-sg">'</span><span class="st">px"></span><span class="st st-sg">'</span>, <span class="name">content</span>, <span class="st st-sg">'</span><span class="st"></span></span><span class="st st-sg">'</span>) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">img</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="name">token</span>.<span class="name">attr</span>: - <span class="kw">return</span> - - <span class="name">tokenlist</span> <span class="op">=</span> <span class="name">parser</span>.<span class="name">get_tokens</span>(<span class="st st-sg">'</span><span class="st">/img</span><span class="st st-sg">'</span>) - <span class="name">url</span> <span class="op">=</span> <span class="name">tokenlist</span>.<span class="name">flatten</span>() - <span class="kw">if</span> <span class="name">url</span>.<span class="name">startswith</span>(<span class="st st-sg">'</span><span class="st">javascript:</span><span class="st st-sg">'</span>): - <span class="name">url</span> <span class="op">=</span> <span class="name">url</span>[<span class="nb nb-int">11</span>:] - <span class="kw">return</span> <span class="name">u</span><span class="st st-sg">'</span><span class="st"><img src="</span><span class="st st-int">%s</span><span class="st">" /></span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">url</span> - - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">code</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="name">token</span>.<span class="name">attr</span>: - <span class="kw">return</span> - - <span class="kw">return</span> <span class="name">u</span><span class="st st-sg">'</span><span class="st"><pre></span><span class="st st-int">%s</span><span class="st"></pre></span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">parser</span>.<span class="name">get_tokens</span>(<span class="st st-sg">'</span><span class="st">/code</span><span class="st st-sg">'</span>).<span class="name">flatten</span>() - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">quote</span><span class="st st-sg">'</span>: - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">callback</span>(<span class="st st-sg">'</span><span class="st">quote</span><span class="st st-sg">'</span>, (<span class="name">token</span>.<span class="name">attr</span> <span class="op op-word">or</span> <span class="name">u</span><span class="st st-sg">''</span>, - <span class="name">parser</span>.<span class="name">parse</span>(<span class="st st-sg">'</span><span class="st">/quote</span><span class="st st-sg">'</span>))) - <span class="kw">if</span> <span class="name">token</span>.<span class="name">name</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">list</span><span class="st st-sg">'</span>: - <span class="kw">return</span> <span class="name">parser</span>.<span class="name">callback</span>(<span class="st st-sg">'</span><span class="st">list</span><span class="st st-sg">'</span>, (<span class="name">token</span>.<span class="name">attr</span> <span class="op op-word">or</span> <span class="name">u</span><span class="st st-sg">'</span><span class="st">*</span><span class="st st-sg">'</span>, - <span class="name">parser</span>.<span class="name">parse</span>(<span class="st st-sg">'</span><span class="st">/list</span><span class="st st-sg">'</span>))) - - <span class="kw">def </span><span class="fun">render_callback</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">callback</span>, <span class="name">data</span>): - <span class="kw">if</span> <span class="name">callback</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">quote</span><span class="st st-sg">'</span>: - <span class="name">_</span> <span class="op">=</span> <span class="name">req</span>.<span class="name">gettext</span> - - <span class="name">written</span>, <span class="name">body</span> <span class="op">=</span> <span class="name">data</span> - <span class="kw">if</span> <span class="name">written</span>: - <span class="kw">if</span> <span class="op op-word">not</span> <span class="name">written</span>.<span class="name">endswith</span>(<span class="st st-sg">'</span><span class="st">:</span><span class="st st-sg">'</span>): - <span class="name">written</span> <span class="op">=</span> (<span class="name">_</span>(<span class="st st-sg">'</span><span class="st st-int">%s</span><span class="st"> wrote</span><span class="st st-sg">'</span>) <span class="op">%</span> <span class="name">written</span>) <span class="op">+</span> <span class="name">u</span><span class="st st-sg">'</span><span class="st">:</span><span class="st st-sg">'</span> - - <span class="name">written</span> <span class="op">=</span> <span class="name">u</span><span class="st st-sg">'</span><span class="st"><div class="written_by"></span><span class="st st-int">%s</span><span class="st"></div></span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">written</span> - <span class="kw">return</span> <span class="name">u</span><span class="st st-sg">'</span><span class="st"><blockquote></span><span class="st st-int">%s%s</span><span class="st"></blockquote></span><span class="st st-sg">'</span> <span class="op">%</span> ( - <span class="name">written</span>, <span class="name">body</span>.<span class="name">render</span>(<span class="name">req</span>, <span class="bn bn-pseudo">self</span>) - ) - <span class="kw">if</span> <span class="name">callback</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">list</span><span class="st st-sg">'</span>: - <span class="bn">type</span>, <span class="name">body</span> <span class="op">=</span> <span class="name">data</span> - - <span class="name">lines</span> <span class="op">=</span> [] - <span class="kw">for</span> <span class="name">line</span> <span class="op op-word">in</span> <span class="name">re</span>.<span class="name">split</span>(<span class="st st-sg">r'</span><span class="st">^\s*\[\*\](?m)</span><span class="st st-sg">'</span>, <span class="name">body</span>.<span class="name">render</span>(<span class="name">req</span>, <span class="bn bn-pseudo">self</span>)): - <span class="name">line</span> <span class="op">=</span> <span class="name">line</span>.<span class="name">strip</span>() - <span class="kw">if</span> <span class="name">line</span>: - <span class="name">lines</span>.<span class="name">append</span>(<span class="name">u</span><span class="st st-sg">'</span><span class="st"><li></span><span class="st st-int">%s</span><span class="st"></li></span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">line</span>) - <span class="kw">return</span> <span class="name">u</span><span class="st st-sg">'</span><span class="st"><ul></span><span class="st st-int">%s</span><span class="st"></ul></span><span class="st st-sg">'</span> <span class="op">%</span> <span class="name">u</span><span class="st st-sg">'</span><span class="st st-esc">\n</span><span class="st st-sg">'</span>.<span class="name">join</span>(<span class="name">lines</span>) - - <span class="kw">def </span><span class="fun">get_buttons</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="name">_</span> <span class="op">=</span> <span class="name">req</span>.<span class="name">gettext</span> - - <span class="name">make_url</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">ctx</span>.<span class="name">make_url</span> - <span class="cm">#XXX: themeable</span> - <span class="name">icon_url</span> <span class="op">=</span> <span class="kw">lambda</span> <span class="name">x</span>: <span class="name">make_url</span>(<span class="st st-sg">'</span><span class="st">!cobalt/core/default/img/bbcode/</span><span class="st st-sg">'</span> <span class="op">+</span> <span class="name">x</span>) - - <span class="kw">return</span> [ - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">b</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Bold</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Insert bold text</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[b]{text}[/b]</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">icon</span><span class="st st-sg">'</span>: <span class="name">icon_url</span>(<span class="st st-sg">'</span><span class="st">bold.png</span><span class="st st-sg">'</span>)}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">i</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Italic</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Insert italic text</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[i]{text}[/i]</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">icon</span><span class="st st-sg">'</span>: <span class="name">icon_url</span>(<span class="st st-sg">'</span><span class="st">italic.png</span><span class="st st-sg">'</span>)}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">u</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Underline</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Insert underlined text</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[u]{text}[/u]</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">icon</span><span class="st st-sg">'</span>: <span class="name">icon_url</span>(<span class="st st-sg">'</span><span class="st">underline.png</span><span class="st st-sg">'</span>)}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">s</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Strikethrough</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Insert striked text</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[i]{text}[/i]</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">icon</span><span class="st st-sg">'</span>: <span class="name">icon_url</span>(<span class="st st-sg">'</span><span class="st">strikethrough.png</span><span class="st st-sg">'</span>)}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">size</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Font Size</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Change the font size</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[size={attr}]{text}[/size]</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">values</span><span class="st st-sg">'</span>: [ - (<span class="nb nb-int">8</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Tiny</span><span class="st st-sg">'</span>)), - (<span class="nb nb-int">11</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Small</span><span class="st st-sg">'</span>)), - (<span class="nb nb-int">13</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Normal</span><span class="st st-sg">'</span>)), - (<span class="nb nb-int">18</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Big</span><span class="st st-sg">'</span>)), - (<span class="nb nb-int">24</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Huge</span><span class="st st-sg">'</span>)) - ]}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">color</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Font Color</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Change Font Color</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[color={attr}]{text}[/size]</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">values</span><span class="st st-sg">'</span>: [ - (<span class="st st-sg">'</span><span class="st">black</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Black</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">blue</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Blue</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">brown</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Brown</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">cyan</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Cyan</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">gray</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Gray</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">green</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Green</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">magenta</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Magenta</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">purple</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Purple</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">red</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Red</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">white</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">White</span><span class="st st-sg">'</span>)), - (<span class="st st-sg">'</span><span class="st">yellow</span><span class="st st-sg">'</span>, <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Yellow</span><span class="st st-sg">'</span>)) - ]}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">url</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Link</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Create a Link</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">icon</span><span class="st st-sg">'</span>: <span class="name">icon_url</span>(<span class="st st-sg">'</span><span class="st">link.png</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[url]{text}[/url]</span><span class="st st-sg">'</span>}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">img</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Image</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Insert an image</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">icon</span><span class="st st-sg">'</span>: <span class="name">icon_url</span>(<span class="st st-sg">'</span><span class="st">img.png</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[img]{text}[/img]</span><span class="st st-sg">'</span>}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">code</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Code</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Insert a codeblock</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">icon</span><span class="st st-sg">'</span>: <span class="name">icon_url</span>(<span class="st st-sg">'</span><span class="st">code.png</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[code]{text}[/code]</span><span class="st st-sg">'</span>}, - {<span class="st st-sg">'</span><span class="st">tagname</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">quote</span><span class="st st-sg">'</span>, - <span class="st st-sg">'</span><span class="st">name</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Quote</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">description</span><span class="st st-sg">'</span>: <span class="name">_</span>(<span class="st st-sg">'</span><span class="st">Insert a blockquote</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">icon</span><span class="st st-sg">'</span>: <span class="name">icon_url</span>(<span class="st st-sg">'</span><span class="st">quote.png</span><span class="st st-sg">'</span>), - <span class="st st-sg">'</span><span class="st">insert</span><span class="st st-sg">'</span>: <span class="st st-sg">'</span><span class="st">[quote]{text}[/quote]</span><span class="st st-sg">'</span>} - ] - -<span class="cm"># -*- coding: utf-8 -*-</span> -<span class="st st-db">"""</span><span class="st"> - pocoo.pkg.core.cache - ~~~~~~~~~~~~~~~~~~~~ - - Provides a very simple caching system for persistent processes. - - :copyright: 2006-2007 by Armin Ronacher. - :license: GNU GPL, see LICENSE for more details. -</span><span class="st st-db">"""</span> -<span class="kw">from </span><span class="cls">pocoo.application</span><span class="kw"> import</span> <span class="name">RequestWrapper</span> -<span class="kw">from </span><span class="cls">pocoo.exceptions</span><span class="kw"> import</span> <span class="name">PocooRuntimeError</span> - -<span class="kw">from </span><span class="cls">pocoo.utils.cache</span><span class="kw"> import</span> <span class="name">Cache</span> - -<span class="cm"># This is currently unused.</span> - -<span class="kw">class </span><span class="cls">CacheSystem</span>(<span class="name">RequestWrapper</span>): - - <span class="kw">def </span><span class="fun">__init__</span>(<span class="bn bn-pseudo">self</span>, <span class="name">ctx</span>): - <span class="bn bn-pseudo">self</span>.<span class="name">cache</span> <span class="op">=</span> <span class="name">Cache</span>(<span class="name">autoprune</span><span class="op">=</span><span class="name">ctx</span>.<span class="name">cfg</span>.<span class="name">get</span>(<span class="st st-sg">'</span><span class="st">cache</span><span class="st st-sg">'</span>, <span class="st st-sg">'</span><span class="st">autoprune</span><span class="st st-sg">'</span>, <span class="bn bn-pseudo">False</span>)) - <span class="bn bn-pseudo">self</span>.<span class="name">uri2key</span> <span class="op">=</span> {} - <span class="name">RequestWrapper</span>.<span class="name">__init__</span>(<span class="bn bn-pseudo">self</span>, <span class="name">ctx</span>) - - <span class="kw">def </span><span class="fun">get_priority</span>(<span class="bn bn-pseudo">self</span>): - <span class="cm"># caching has highest priority</span> - - <span class="kw">return</span> <span class="nb nb-int">1</span> - - <span class="kw">def </span><span class="fun">process_request</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>): - <span class="name">req</span>.<span class="name">cache_control</span> <span class="op">=</span> <span class="bn bn-pseudo">None</span> - - <span class="name">req</span>.<span class="name">cache</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">cache</span> - - <span class="kw">if</span> <span class="name">req</span>.<span class="name">environ</span>[<span class="st st-sg">'</span><span class="st">REQUEST_METHOD</span><span class="st st-sg">'</span>] <span class="op">!=</span> <span class="st st-sg">'</span><span class="st">GET</span><span class="st st-sg">'</span>: - <span class="kw">return</span> - - <span class="kw">if</span> <span class="name">req</span>.<span class="name">environ</span>[<span class="st st-sg">'</span><span class="st">REQUEST_URI</span><span class="st st-sg">'</span>] <span class="op op-word">not</span> <span class="op op-word">in</span> <span class="bn bn-pseudo">self</span>.<span class="name">uri2key</span>: - <span class="kw">return</span> - - <span class="name">key</span> <span class="op">=</span> <span class="bn bn-pseudo">self</span>.<span class="name">uri2key</span>[<span class="name">req</span>.<span class="name">environ</span>[<span class="st st-sg">'</span><span class="st">REQUEST_URI</span><span class="st st-sg">'</span>]] - <span class="kw">return</span> <span class="bn bn-pseudo">self</span>.<span class="name">cache</span>.<span class="name">fetch</span>(<span class="name">key</span>, <span class="bn bn-pseudo">None</span>) - - <span class="kw">def </span><span class="fun">process_response</span>(<span class="bn bn-pseudo">self</span>, <span class="name">req</span>, <span class="name">resp</span>): - <span class="kw">if</span> <span class="op op-word">not</span> <span class="name">req</span>.<span class="name">cache_control</span>: - <span class="kw">return</span> <span class="name">resp</span> - - <span class="name">action</span>, <span class="name">key</span> <span class="op">=</span> <span class="name">req</span>.<span class="name">cache_control</span> - <span class="kw">if</span> <span class="name">action</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">set</span><span class="st st-sg">'</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">cache</span>.<span class="name">dump</span>(<span class="name">key</span>, <span class="name">resp</span>) - <span class="bn bn-pseudo">self</span>.<span class="name">uri2key</span>[<span class="name">req</span>.<span class="name">environ</span>[<span class="st st-sg">'</span><span class="st">REQUEST_URI</span><span class="st st-sg">'</span>]] <span class="op">=</span> <span class="name">key</span> - - <span class="kw">elif</span> <span class="name">action</span> <span class="op">==</span> <span class="st st-sg">'</span><span class="st">update</span><span class="st st-sg">'</span>: - <span class="kw">if</span> <span class="bn">isinstance</span>(<span class="name">key</span>, <span class="bn">basestring</span>): - <span class="bn bn-pseudo">self</span>.<span class="name">cache</span>.<span class="name">remove</span>(<span class="name">key</span>) - <span class="kw">else</span>: - <span class="kw">for</span> <span class="name">k</span> <span class="op op-word">in</span> <span class="name">key</span>: - <span class="bn bn-pseudo">self</span>.<span class="name">cache</span>.<span class="name">remove</span>(<span class="name">k</span>) - <span class="kw">else</span>: - <span class="kw">raise</span> <span class="name">PocooRuntimeError</span>(<span class="st st-sg">'</span><span class="st">req.cache_control invalid</span><span class="st st-sg">'</span>) |