~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/dist/gen_inc.awk

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This awk script parses C input files looking for lines marked "PUBLIC:"
2
 
# and "EXTERN:".  (PUBLIC lines are DB internal function prototypes and
3
 
# #defines, EXTERN are DB external function prototypes and #defines.)
4
 
#
5
 
# PUBLIC lines are put into two versions of per-directory include files:
6
 
# one file that contains the prototypes, and one file that contains a
7
 
# #define for the name to be processed during configuration when creating
8
 
# unique names for every global symbol in the DB library.
9
 
#
10
 
# The EXTERN lines are put into two files: one of which contains prototypes
11
 
# which are always appended to the db.h file, and one of which contains a
12
 
# #define list for use when creating unique symbol names.
13
 
#
14
 
# Four arguments:
15
 
#       e_dfile         list of EXTERN #defines
16
 
#       e_pfile         include file that contains EXTERN prototypes
17
 
#       i_dfile         list of internal (PUBLIC) #defines
18
 
#       i_pfile         include file that contains internal (PUBLIC) prototypes
19
 
/PUBLIC:/ {
20
 
        sub("^.*PUBLIC:[         ][      ]*", "")
21
 
        if ($0 ~ "^#if|^#ifdef|^#ifndef|^#else|^#endif") {
22
 
                print $0 >> i_pfile
23
 
                print $0 >> i_dfile
24
 
                next
25
 
        }
26
 
        pline = sprintf("%s %s", pline, $0)
27
 
        if (pline ~ "));") {
28
 
                sub("^[  ]*", "", pline)
29
 
                print pline >> i_pfile
30
 
                if (pline !~ db_version_unique_name) {
31
 
                        def = gensub("[  ][      ]*__P.*", "", 1, pline)
32
 
                        sub("^.*[        ][*]*", "", def)
33
 
                        printf("#define %s %s@DB_VERSION_UNIQUE_NAME@\n",
34
 
                            def, def) >> i_dfile
35
 
                }
36
 
                pline = ""
37
 
        }
38
 
}
39
 
 
40
 
# When we switched to methods in 4.0, we guessed txn_{abort,begin,commit}
41
 
# were the interfaces applications would likely use and not be willing to
42
 
# change, due to the sheer volume of the calls.  Provide wrappers -- we
43
 
# could do txn_abort and txn_commit using macros, but not txn_begin, as
44
 
# the name of the field is txn_begin, we didn't want to modify it.
45
 
#
46
 
# The issue with txn_begin hits us in another way.  If configured with the
47
 
# --with-uniquename option, we use #defines to re-define DB's interfaces
48
 
# to unique names.  We can't do that for these functions because txn_begin
49
 
# is also a field name in the DB_ENV structure, and the #defines we use go
50
 
# at the end of the db.h file -- we get control too late to #define a field
51
 
# name.  So, modify the script that generates the unique names #defines to
52
 
# not generate them for these three functions, and don't include the three
53
 
# functions in libraries built with that configuration option.
54
 
/EXTERN:/ {
55
 
        sub("^.*EXTERN:[         ][      ]*", "")
56
 
        if ($0 ~ "^#if|^#ifdef|^#ifndef|^#else|^#endif") {
57
 
                print $0 >> e_pfile
58
 
                print $0 >> e_dfile
59
 
                next
60
 
        }
61
 
        eline = sprintf("%s %s", eline, $0)
62
 
        if (eline ~ "));") {
63
 
                sub("^[  ]*", "", eline)
64
 
                print eline >> e_pfile
65
 
                if (eline !~ db_version_unique_name && eline !~ "^int txn_") {
66
 
                        def = gensub("[  ][      ]*__P.*", "", 1, eline)
67
 
                        sub("^.*[        ][*]*", "", def)
68
 
                        printf("#define %s %s@DB_VERSION_UNIQUE_NAME@\n",
69
 
                            def, def) >> e_dfile
70
 
                }
71
 
                eline = ""
72
 
        }
73
 
}