~ubuntu-branches/ubuntu/wily/afnix/wily

« back to all changes in this revision

Viewing changes to src/mod/itu/shl/Libitu.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2011-03-16 21:31:18 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110316213118-gk4k3ez3e5d2huna
Tags: 2.0.0-1
* QA upload.
* New upstream release
* Debian source format is 3.0 (quilt)
* Fix debhelper-but-no-misc-depends
* Fix ancient-standards-version
* Fix package-contains-linda-override
* debhelper compatibility is 7
* Fix dh-clean-k-is-deprecated

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// ---------------------------------------------------------------------------
 
2
// - Libitu.cpp                                                              -
 
3
// - afnix:itu module - declaration & implementation                         -
 
4
// ---------------------------------------------------------------------------
 
5
// - This program is free software;  you can redistribute it  and/or  modify -
 
6
// - it provided that this copyright notice is kept intact.                  -
 
7
// -                                                                         -
 
8
// - This program  is  distributed in  the hope  that it will be useful, but -
 
9
// - without  any  warranty;  without  even   the   implied    warranty   of -
 
10
// - merchantability or fitness for a particular purpose.  In no event shall -
 
11
// - the copyright holder be liable for any  direct, indirect, incidental or -
 
12
// - special damages arising in any way out of the use of this software.     -
 
13
// ---------------------------------------------------------------------------
 
14
// - copyright (c) 1999-2011 amaury darsch                                   -
 
15
// ---------------------------------------------------------------------------
 
16
 
 
17
#include "Meta.hpp"
 
18
#include "Libitu.hpp"
 
19
#include "AsnEoc.hpp"
 
20
#include "AsnGtm.hpp"
 
21
#include "AsnUtc.hpp"
 
22
#include "AsnIas.hpp"
 
23
#include "AsnOid.hpp"
 
24
#include "AsnSet.hpp"
 
25
#include "AsnNull.hpp"
 
26
#include "AsnRoid.hpp"
 
27
#include "AsnBits.hpp"
 
28
#include "AsnNums.hpp"
 
29
#include "AsnPrts.hpp"
 
30
#include "AsnBmps.hpp"
 
31
#include "AsnUnvs.hpp"
 
32
#include "AsnUtfs.hpp"
 
33
#include "Preditu.hpp"
 
34
#include "Function.hpp"
 
35
#include "AsnBuffer.hpp"
 
36
#include "AsnRandom.hpp"
 
37
#include "AsnOctets.hpp"
 
38
#include "AsnBoolean.hpp"
 
39
#include "AsnInteger.hpp"
 
40
#include "AsnSequence.hpp"
 
41
 
 
42
namespace afnix {
 
43
 
 
44
  // initialize the afnix:itu module
 
45
 
 
46
  Object* init_afnix_itu (Interp* interp, Vector* argv) {
 
47
    // make sure we are not called from something crazy
 
48
    if (interp == nilp) return nilp;
 
49
 
 
50
    // create the afnix:itu nameset
 
51
    Nameset* aset = interp->mknset ("afnix");
 
52
    Nameset* gset = aset->mknset   ("itu");
 
53
 
 
54
    // bind all symbols in the afnix:itu nameset
 
55
    gset->symcst ("Oid",               new Meta (Oid::mknew));
 
56
 
 
57
    gset->symcst ("AsnEoc",            new Meta (AsnEoc::mknew));
 
58
    gset->symcst ("AsnGtm",            new Meta (AsnGtm::mknew));
 
59
    gset->symcst ("AsnUtc",            new Meta (AsnUtc::mknew));
 
60
    gset->symcst ("AsnIas",            new Meta (AsnIas::mknew));
 
61
    gset->symcst ("AsnOid",            new Meta (AsnOid::mknew));
 
62
    gset->symcst ("AsnSet",            new Meta (AsnSet::mknew));
 
63
    gset->symcst ("AsnNode",           new Meta (AsnNode::meval));
 
64
    gset->symcst ("AsnNull",           new Meta (AsnNull::mknew));
 
65
    gset->symcst ("AsnNums",           new Meta (AsnNums::mknew));
 
66
    gset->symcst ("AsnPrts",           new Meta (AsnPrts::mknew));
 
67
    gset->symcst ("AsnBmps",           new Meta (AsnBmps::mknew));
 
68
    gset->symcst ("AsnUnvs",           new Meta (AsnUnvs::mknew));
 
69
    gset->symcst ("AsnUtfs",           new Meta (AsnUtfs::mknew));
 
70
    gset->symcst ("AsnRoid",           new Meta (AsnRoid::mknew));
 
71
    gset->symcst ("AsnBits",           new Meta (AsnBits::mknew));
 
72
    gset->symcst ("AsnBuffer",         new Meta (AsnBuffer::mknew));
 
73
    gset->symcst ("AsnOctets",         new Meta (AsnOctets::mknew));
 
74
    gset->symcst ("AsnBoolean",        new Meta (AsnBoolean::mknew));
 
75
    gset->symcst ("AsnInteger",        new Meta (AsnInteger::mknew));
 
76
    gset->symcst ("AsnInteger",        new Meta (AsnInteger::mknew));
 
77
    gset->symcst ("AsnSequence",       new Meta (AsnSequence::mknew));
 
78
 
 
79
    // bind the predicates
 
80
    gset->symcst ("oid-p",             new Function (itu_oidp));
 
81
 
 
82
    gset->symcst ("asn-eoc-p",         new Function (itu_asneocp));
 
83
    gset->symcst ("asn-gtm-p",         new Function (itu_asngtmp));
 
84
    gset->symcst ("asn-utc-p",         new Function (itu_asnutcp));
 
85
    gset->symcst ("asn-ias-p",         new Function (itu_asniasp));
 
86
    gset->symcst ("asn-oid-p",         new Function (itu_asnoidp));
 
87
    gset->symcst ("asn-set-p",         new Function (itu_asnsetp));
 
88
    gset->symcst ("asn-node-p",        new Function (itu_asnnodep));
 
89
    gset->symcst ("asn-null-p",        new Function (itu_asnnullp));
 
90
    gset->symcst ("asn-nums-p",        new Function (itu_asnnumsp));
 
91
    gset->symcst ("asn-prts-p",        new Function (itu_asnprtsp));
 
92
    gset->symcst ("asn-bmps-p",        new Function (itu_asnbmpsp));
 
93
    gset->symcst ("asn-unvs-p",        new Function (itu_asnunvsp));
 
94
    gset->symcst ("asn-utfs-p",        new Function (itu_asnutfsp));
 
95
    gset->symcst ("asn-roid-p",        new Function (itu_asnroidp));
 
96
    gset->symcst ("asn-bits-p",        new Function (itu_asnbitsp));
 
97
    gset->symcst ("asn-buffer-p",      new Function (itu_asnbufp));
 
98
    gset->symcst ("asn-octets-p",      new Function (itu_asnoctsp));
 
99
    gset->symcst ("asn-boolean-p",     new Function (itu_asnboolp));
 
100
    gset->symcst ("asn-integer-p",     new Function (itu_asnintgp));
 
101
    gset->symcst ("asn-sequence-p",    new Function (itu_asnseqp));
 
102
    
 
103
    // bind the special functions
 
104
    gset->symcst ("asn-random-bits",   new Function (itu_asnbrnd));
 
105
    gset->symcst ("asn-random-octets", new Function (itu_asnornd));
 
106
 
 
107
    // not used but needed
 
108
    return nilp;
 
109
  }
 
110
}
 
111
 
 
112
extern "C" {
 
113
  afnix::Object* dli_afnix_itu (afnix::Interp* interp, afnix::Vector* argv) {
 
114
    return init_afnix_itu (interp, argv);
 
115
  }
 
116
}