summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Lepsch <lepsch@expertisesolutions.com.br>2015-03-16 17:28:17 -0300
committerGuilherme Lepsch <lepsch@expertisesolutions.com.br>2015-03-16 17:28:17 -0300
commitd82d61c2d70d99818be4c3c33f9c039b9ce1c7e9 (patch)
treed2b4d19fbcedc6b2644d8f488ec987af8992a926
soap_model: Initial commit.
-rw-r--r--.gitignore25
-rw-r--r--AUTHORS0
-rw-r--r--COPYING674
-rw-r--r--ChangeLog0
-rw-r--r--INSTALL370
-rw-r--r--Makefile.am80
-rw-r--r--NEWS0
-rw-r--r--README0
-rwxr-xr-xautogen.sh39
-rw-r--r--configure.ac109
-rw-r--r--m4/efl.m4449
-rw-r--r--m4/efl_binary.m442
-rw-r--r--m4/efl_compiler.m490
-rw-r--r--m4/efl_doxygen.m498
-rw-r--r--soap_model-cxx.pc.in11
-rw-r--r--soap_model.pc.in11
-rw-r--r--src/lib/Makefile.am84
-rw-r--r--src/lib/Soap_Model.h30
-rw-r--r--src/lib/soap_model.c451
-rw-r--r--src/lib/soap_model.eo31
-rw-r--r--src/lib/soap_model_private.h36
-rw-r--r--src/tests/Makefile.am11
-rw-r--r--src/tests/soap_model_suite.c121
-rw-r--r--src/tests/soap_model_suite.h16
-rw-r--r--src/tests/soap_model_test_soap_model.c218
-rw-r--r--src/tests/soap_model_test_soap_model.h6
26 files changed, 3002 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e4fb944
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,25 @@
1*.eo.c
2*.eo.h
3*.eo.hh
4*.eo.legacy.h
5*.eo.lua
6aclocal.m4
7ar-lib
8autom4te.cache/
9check-results.xml
10compile
11config.*
12configure
13configure.scan
14autoscan.log
15depcomp
16eflat_xml_model_suite
17install-sh
18libtool
19ltmain.sh
20m4/l*
21Makefile
22Makefile.in
23missing
24test-driver
25~
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/AUTHORS
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The GNU General Public License is a free, copyleft license for
11software and other kinds of works.
12
13 The licenses for most software and other practical works are designed
14to take away your freedom to share and change the works. By contrast,
15the GNU General Public License is intended to guarantee your freedom to
16share and change all versions of a program--to make sure it remains free
17software for all its users. We, the Free Software Foundation, use the
18GNU General Public License for most of our software; it applies also to
19any other work released this way by its authors. You can apply it to
20your programs, too.
21
22 When we speak of free software, we are referring to freedom, not
23price. Our General Public Licenses are designed to make sure that you
24have the freedom to distribute copies of free software (and charge for
25them if you wish), that you receive source code or can get it if you
26want it, that you can change the software or use pieces of it in new
27free programs, and that you know you can do these things.
28
29 To protect your rights, we need to prevent others from denying you
30these rights or asking you to surrender the rights. Therefore, you have
31certain responsibilities if you distribute copies of the software, or if
32you modify it: responsibilities to respect the freedom of others.
33
34 For example, if you distribute copies of such a program, whether
35gratis or for a fee, you must pass on to the recipients the same
36freedoms that you received. You must make sure that they, too, receive
37or can get the source code. And you must show them these terms so they
38know their rights.
39
40 Developers that use the GNU GPL protect your rights with two steps:
41(1) assert copyright on the software, and (2) offer you this License
42giving you legal permission to copy, distribute and/or modify it.
43
44 For the developers' and authors' protection, the GPL clearly explains
45that there is no warranty for this free software. For both users' and
46authors' sake, the GPL requires that modified versions be marked as
47changed, so that their problems will not be attributed erroneously to
48authors of previous versions.
49
50 Some devices are designed to deny users access to install or run
51modified versions of the software inside them, although the manufacturer
52can do so. This is fundamentally incompatible with the aim of
53protecting users' freedom to change the software. The systematic
54pattern of such abuse occurs in the area of products for individuals to
55use, which is precisely where it is most unacceptable. Therefore, we
56have designed this version of the GPL to prohibit the practice for those
57products. If such problems arise substantially in other domains, we
58stand ready to extend this provision to those domains in future versions
59of the GPL, as needed to protect the freedom of users.
60
61 Finally, every program is threatened constantly by software patents.
62States should not allow patents to restrict development and use of
63software on general-purpose computers, but in those that do, we wish to
64avoid the special danger that patents applied to a free program could
65make it effectively proprietary. To prevent this, the GPL assures that
66patents cannot be used to render the program non-free.
67
68 The precise terms and conditions for copying, distribution and
69modification follow.
70
71 TERMS AND CONDITIONS
72
73 0. Definitions.
74
75 "This License" refers to version 3 of the GNU General Public License.
76
77 "Copyright" also means copyright-like laws that apply to other kinds of
78works, such as semiconductor masks.
79
80 "The Program" refers to any copyrightable work licensed under this
81License. Each licensee is addressed as "you". "Licensees" and
82"recipients" may be individuals or organizations.
83
84 To "modify" a work means to copy from or adapt all or part of the work
85in a fashion requiring copyright permission, other than the making of an
86exact copy. The resulting work is called a "modified version" of the
87earlier work or a work "based on" the earlier work.
88
89 A "covered work" means either the unmodified Program or a work based
90on the Program.
91
92 To "propagate" a work means to do anything with it that, without
93permission, would make you directly or secondarily liable for
94infringement under applicable copyright law, except executing it on a
95computer or modifying a private copy. Propagation includes copying,
96distribution (with or without modification), making available to the
97public, and in some countries other activities as well.
98
99 To "convey" a work means any kind of propagation that enables other
100parties to make or receive copies. Mere interaction with a user through
101a computer network, with no transfer of a copy, is not conveying.
102
103 An interactive user interface displays "Appropriate Legal Notices"
104to the extent that it includes a convenient and prominently visible
105feature that (1) displays an appropriate copyright notice, and (2)
106tells the user that there is no warranty for the work (except to the
107extent that warranties are provided), that licensees may convey the
108work under this License, and how to view a copy of this License. If
109the interface presents a list of user commands or options, such as a
110menu, a prominent item in the list meets this criterion.
111
112 1. Source Code.
113
114 The "source code" for a work means the preferred form of the work
115for making modifications to it. "Object code" means any non-source
116form of a work.
117
118 A "Standard Interface" means an interface that either is an official
119standard defined by a recognized standards body, or, in the case of
120interfaces specified for a particular programming language, one that
121is widely used among developers working in that language.
122
123 The "System Libraries" of an executable work include anything, other
124than the work as a whole, that (a) is included in the normal form of
125packaging a Major Component, but which is not part of that Major
126Component, and (b) serves only to enable use of the work with that
127Major Component, or to implement a Standard Interface for which an
128implementation is available to the public in source code form. A
129"Major Component", in this context, means a major essential component
130(kernel, window system, and so on) of the specific operating system
131(if any) on which the executable work runs, or a compiler used to
132produce the work, or an object code interpreter used to run it.
133
134 The "Corresponding Source" for a work in object code form means all
135the source code needed to generate, install, and (for an executable
136work) run the object code and to modify the work, including scripts to
137control those activities. However, it does not include the work's
138System Libraries, or general-purpose tools or generally available free
139programs which are used unmodified in performing those activities but
140which are not part of the work. For example, Corresponding Source
141includes interface definition files associated with source files for
142the work, and the source code for shared libraries and dynamically
143linked subprograms that the work is specifically designed to require,
144such as by intimate data communication or control flow between those
145subprograms and other parts of the work.
146
147 The Corresponding Source need not include anything that users
148can regenerate automatically from other parts of the Corresponding
149Source.
150
151 The Corresponding Source for a work in source code form is that
152same work.
153
154 2. Basic Permissions.
155
156 All rights granted under this License are granted for the term of
157copyright on the Program, and are irrevocable provided the stated
158conditions are met. This License explicitly affirms your unlimited
159permission to run the unmodified Program. The output from running a
160covered work is covered by this License only if the output, given its
161content, constitutes a covered work. This License acknowledges your
162rights of fair use or other equivalent, as provided by copyright law.
163
164 You may make, run and propagate covered works that you do not
165convey, without conditions so long as your license otherwise remains
166in force. You may convey covered works to others for the sole purpose
167of having them make modifications exclusively for you, or provide you
168with facilities for running those works, provided that you comply with
169the terms of this License in conveying all material for which you do
170not control copyright. Those thus making or running the covered works
171for you must do so exclusively on your behalf, under your direction
172and control, on terms that prohibit them from making any copies of
173your copyrighted material outside their relationship with you.
174
175 Conveying under any other circumstances is permitted solely under
176the conditions stated below. Sublicensing is not allowed; section 10
177makes it unnecessary.
178
179 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
181 No covered work shall be deemed part of an effective technological
182measure under any applicable law fulfilling obligations under article
18311 of the WIPO copyright treaty adopted on 20 December 1996, or
184similar laws prohibiting or restricting circumvention of such
185measures.
186
187 When you convey a covered work, you waive any legal power to forbid
188circumvention of technological measures to the extent such circumvention
189is effected by exercising rights under this License with respect to
190the covered work, and you disclaim any intention to limit operation or
191modification of the work as a means of enforcing, against the work's
192users, your or third parties' legal rights to forbid circumvention of
193technological measures.
194
195 4. Conveying Verbatim Copies.
196
197 You may convey verbatim copies of the Program's source code as you
198receive it, in any medium, provided that you conspicuously and
199appropriately publish on each copy an appropriate copyright notice;
200keep intact all notices stating that this License and any
201non-permissive terms added in accord with section 7 apply to the code;
202keep intact all notices of the absence of any warranty; and give all
203recipients a copy of this License along with the Program.
204
205 You may charge any price or no price for each copy that you convey,
206and you may offer support or warranty protection for a fee.
207
208 5. Conveying Modified Source Versions.
209
210 You may convey a work based on the Program, or the modifications to
211produce it from the Program, in the form of source code under the
212terms of section 4, provided that you also meet all of these conditions:
213
214 a) The work must carry prominent notices stating that you modified
215 it, and giving a relevant date.
216
217 b) The work must carry prominent notices stating that it is
218 released under this License and any conditions added under section
219 7. This requirement modifies the requirement in section 4 to
220 "keep intact all notices".
221
222 c) You must license the entire work, as a whole, under this
223 License to anyone who comes into possession of a copy. This
224 License will therefore apply, along with any applicable section 7
225 additional terms, to the whole of the work, and all its parts,
226 regardless of how they are packaged. This License gives no
227 permission to license the work in any other way, but it does not
228 invalidate such permission if you have separately received it.
229
230 d) If the work has interactive user interfaces, each must display
231 Appropriate Legal Notices; however, if the Program has interactive
232 interfaces that do not display Appropriate Legal Notices, your
233 work need not make them do so.
234
235 A compilation of a covered work with other separate and independent
236works, which are not by their nature extensions of the covered work,
237and which are not combined with it such as to form a larger program,
238in or on a volume of a storage or distribution medium, is called an
239"aggregate" if the compilation and its resulting copyright are not
240used to limit the access or legal rights of the compilation's users
241beyond what the individual works permit. Inclusion of a covered work
242in an aggregate does not cause this License to apply to the other
243parts of the aggregate.
244
245 6. Conveying Non-Source Forms.
246
247 You may convey a covered work in object code form under the terms
248of sections 4 and 5, provided that you also convey the
249machine-readable Corresponding Source under the terms of this License,
250in one of these ways:
251
252 a) Convey the object code in, or embodied in, a physical product
253 (including a physical distribution medium), accompanied by the
254 Corresponding Source fixed on a durable physical medium
255 customarily used for software interchange.
256
257 b) Convey the object code in, or embodied in, a physical product
258 (including a physical distribution medium), accompanied by a
259 written offer, valid for at least three years and valid for as
260 long as you offer spare parts or customer support for that product
261 model, to give anyone who possesses the object code either (1) a
262 copy of the Corresponding Source for all the software in the
263 product that is covered by this License, on a durable physical
264 medium customarily used for software interchange, for a price no
265 more than your reasonable cost of physically performing this
266 conveying of source, or (2) access to copy the
267 Corresponding Source from a network server at no charge.
268
269 c) Convey individual copies of the object code with a copy of the
270 written offer to provide the Corresponding Source. This
271 alternative is allowed only occasionally and noncommercially, and
272 only if you received the object code with such an offer, in accord
273 with subsection 6b.
274
275 d) Convey the object code by offering access from a designated
276 place (gratis or for a charge), and offer equivalent access to the
277 Corresponding Source in the same way through the same place at no
278 further charge. You need not require recipients to copy the
279 Corresponding Source along with the object code. If the place to
280 copy the object code is a network server, the Corresponding Source
281 may be on a different server (operated by you or a third party)
282 that supports equivalent copying facilities, provided you maintain
283 clear directions next to the object code saying where to find the
284 Corresponding Source. Regardless of what server hosts the
285 Corresponding Source, you remain obligated to ensure that it is
286 available for as long as needed to satisfy these requirements.
287
288 e) Convey the object code using peer-to-peer transmission, provided
289 you inform other peers where the object code and Corresponding
290 Source of the work are being offered to the general public at no
291 charge under subsection 6d.
292
293 A separable portion of the object code, whose source code is excluded
294from the Corresponding Source as a System Library, need not be
295included in conveying the object code work.
296
297 A "User Product" is either (1) a "consumer product", which means any
298tangible personal property which is normally used for personal, family,
299or household purposes, or (2) anything designed or sold for incorporation
300into a dwelling. In determining whether a product is a consumer product,
301doubtful cases shall be resolved in favor of coverage. For a particular
302product received by a particular user, "normally used" refers to a
303typical or common use of that class of product, regardless of the status
304of the particular user or of the way in which the particular user
305actually uses, or expects or is expected to use, the product. A product
306is a consumer product regardless of whether the product has substantial
307commercial, industrial or non-consumer uses, unless such uses represent
308the only significant mode of use of the product.
309
310 "Installation Information" for a User Product means any methods,
311procedures, authorization keys, or other information required to install
312and execute modified versions of a covered work in that User Product from
313a modified version of its Corresponding Source. The information must
314suffice to ensure that the continued functioning of the modified object
315code is in no case prevented or interfered with solely because
316modification has been made.
317
318 If you convey an object code work under this section in, or with, or
319specifically for use in, a User Product, and the conveying occurs as
320part of a transaction in which the right of possession and use of the
321User Product is transferred to the recipient in perpetuity or for a
322fixed term (regardless of how the transaction is characterized), the
323Corresponding Source conveyed under this section must be accompanied
324by the Installation Information. But this requirement does not apply
325if neither you nor any third party retains the ability to install
326modified object code on the User Product (for example, the work has
327been installed in ROM).
328
329 The requirement to provide Installation Information does not include a
330requirement to continue to provide support service, warranty, or updates
331for a work that has been modified or installed by the recipient, or for
332the User Product in which it has been modified or installed. Access to a
333network may be denied when the modification itself materially and
334adversely affects the operation of the network or violates the rules and
335protocols for communication across the network.
336
337 Corresponding Source conveyed, and Installation Information provided,
338in accord with this section must be in a format that is publicly
339documented (and with an implementation available to the public in
340source code form), and must require no special password or key for
341unpacking, reading or copying.
342
343 7. Additional Terms.
344
345 "Additional permissions" are terms that supplement the terms of this
346License by making exceptions from one or more of its conditions.
347Additional permissions that are applicable to the entire Program shall
348be treated as though they were included in this License, to the extent
349that they are valid under applicable law. If additional permissions
350apply only to part of the Program, that part may be used separately
351under those permissions, but the entire Program remains governed by
352this License without regard to the additional permissions.
353
354 When you convey a copy of a covered work, you may at your option
355remove any additional permissions from that copy, or from any part of
356it. (Additional permissions may be written to require their own
357removal in certain cases when you modify the work.) You may place
358additional permissions on material, added by you to a covered work,
359for which you have or can give appropriate copyright permission.
360
361 Notwithstanding any other provision of this License, for material you
362add to a covered work, you may (if authorized by the copyright holders of
363that material) supplement the terms of this License with terms:
364
365 a) Disclaiming warranty or limiting liability differently from the
366 terms of sections 15 and 16 of this License; or
367
368 b) Requiring preservation of specified reasonable legal notices or
369 author attributions in that material or in the Appropriate Legal
370 Notices displayed by works containing it; or
371
372 c) Prohibiting misrepresentation of the origin of that material, or
373 requiring that modified versions of such material be marked in
374 reasonable ways as different from the original version; or
375
376 d) Limiting the use for publicity purposes of names of licensors or
377 authors of the material; or
378
379 e) Declining to grant rights under trademark law for use of some
380 trade names, trademarks, or service marks; or
381
382 f) Requiring indemnification of licensors and authors of that
383 material by anyone who conveys the material (or modified versions of
384 it) with contractual assumptions of liability to the recipient, for
385 any liability that these contractual assumptions directly impose on
386 those licensors and authors.
387
388 All other non-permissive additional terms are considered "further
389restrictions" within the meaning of section 10. If the Program as you
390received it, or any part of it, contains a notice stating that it is
391governed by this License along with a term that is a further
392restriction, you may remove that term. If a license document contains
393a further restriction but permits relicensing or conveying under this
394License, you may add to a covered work material governed by the terms
395of that license document, provided that the further restriction does
396not survive such relicensing or conveying.
397
398 If you add terms to a covered work in accord with this section, you
399must place, in the relevant source files, a statement of the
400additional terms that apply to those files, or a notice indicating
401where to find the applicable terms.
402
403 Additional terms, permissive or non-permissive, may be stated in the
404form of a separately written license, or stated as exceptions;
405the above requirements apply either way.
406
407 8. Termination.
408
409 You may not propagate or modify a covered work except as expressly
410provided under this License. Any attempt otherwise to propagate or
411modify it is void, and will automatically terminate your rights under
412this License (including any patent licenses granted under the third
413paragraph of section 11).
414
415 However, if you cease all violation of this License, then your
416license from a particular copyright holder is reinstated (a)
417provisionally, unless and until the copyright holder explicitly and
418finally terminates your license, and (b) permanently, if the copyright
419holder fails to notify you of the violation by some reasonable means
420prior to 60 days after the cessation.
421
422 Moreover, your license from a particular copyright holder is
423reinstated permanently if the copyright holder notifies you of the
424violation by some reasonable means, this is the first time you have
425received notice of violation of this License (for any work) from that
426copyright holder, and you cure the violation prior to 30 days after
427your receipt of the notice.
428
429 Termination of your rights under this section does not terminate the
430licenses of parties who have received copies or rights from you under
431this License. If your rights have been terminated and not permanently
432reinstated, you do not qualify to receive new licenses for the same
433material under section 10.
434
435 9. Acceptance Not Required for Having Copies.
436
437 You are not required to accept this License in order to receive or
438run a copy of the Program. Ancillary propagation of a covered work
439occurring solely as a consequence of using peer-to-peer transmission
440to receive a copy likewise does not require acceptance. However,
441nothing other than this License grants you permission to propagate or
442modify any covered work. These actions infringe copyright if you do
443not accept this License. Therefore, by modifying or propagating a
444covered work, you indicate your acceptance of this License to do so.
445
446 10. Automatic Licensing of Downstream Recipients.
447
448 Each time you convey a covered work, the recipient automatically
449receives a license from the original licensors, to run, modify and
450propagate that work, subject to this License. You are not responsible
451for enforcing compliance by third parties with this License.
452
453 An "entity transaction" is a transaction transferring control of an
454organization, or substantially all assets of one, or subdividing an
455organization, or merging organizations. If propagation of a covered
456work results from an entity transaction, each party to that
457transaction who receives a copy of the work also receives whatever
458licenses to the work the party's predecessor in interest had or could
459give under the previous paragraph, plus a right to possession of the
460Corresponding Source of the work from the predecessor in interest, if
461the predecessor has it or can get it with reasonable efforts.
462
463 You may not impose any further restrictions on the exercise of the
464rights granted or affirmed under this License. For example, you may
465not impose a license fee, royalty, or other charge for exercise of
466rights granted under this License, and you may not initiate litigation
467(including a cross-claim or counterclaim in a lawsuit) alleging that
468any patent claim is infringed by making, using, selling, offering for
469sale, or importing the Program or any portion of it.
470
471 11. Patents.
472
473 A "contributor" is a copyright holder who authorizes use under this
474License of the Program or a work on which the Program is based. The
475work thus licensed is called the contributor's "contributor version".
476
477 A contributor's "essential patent claims" are all patent claims
478owned or controlled by the contributor, whether already acquired or
479hereafter acquired, that would be infringed by some manner, permitted
480by this License, of making, using, or selling its contributor version,
481but do not include claims that would be infringed only as a
482consequence of further modification of the contributor version. For
483purposes of this definition, "control" includes the right to grant
484patent sublicenses in a manner consistent with the requirements of
485this License.
486
487 Each contributor grants you a non-exclusive, worldwide, royalty-free
488patent license under the contributor's essential patent claims, to
489make, use, sell, offer for sale, import and otherwise run, modify and
490propagate the contents of its contributor version.
491
492 In the following three paragraphs, a "patent license" is any express
493agreement or commitment, however denominated, not to enforce a patent
494(such as an express permission to practice a patent or covenant not to
495sue for patent infringement). To "grant" such a patent license to a
496party means to make such an agreement or commitment not to enforce a
497patent against the party.
498
499 If you convey a covered work, knowingly relying on a patent license,
500and the Corresponding Source of the work is not available for anyone
501to copy, free of charge and under the terms of this License, through a
502publicly available network server or other readily accessible means,
503then you must either (1) cause the Corresponding Source to be so
504available, or (2) arrange to deprive yourself of the benefit of the
505patent license for this particular work, or (3) arrange, in a manner
506consistent with the requirements of this License, to extend the patent
507license to downstream recipients. "Knowingly relying" means you have
508actual knowledge that, but for the patent license, your conveying the
509covered work in a country, or your recipient's use of the covered work
510in a country, would infringe one or more identifiable patents in that
511country that you have reason to believe are valid.
512
513 If, pursuant to or in connection with a single transaction or
514arrangement, you convey, or propagate by procuring conveyance of, a
515covered work, and grant a patent license to some of the parties
516receiving the covered work authorizing them to use, propagate, modify
517or convey a specific copy of the covered work, then the patent license
518you grant is automatically extended to all recipients of the covered
519work and works based on it.
520
521 A patent license is "discriminatory" if it does not include within
522the scope of its coverage, prohibits the exercise of, or is
523conditioned on the non-exercise of one or more of the rights that are
524specifically granted under this License. You may not convey a covered
525work if you are a party to an arrangement with a third party that is
526in the business of distributing software, under which you make payment
527to the third party based on the extent of your activity of conveying
528the work, and under which the third party grants, to any of the
529parties who would receive the covered work from you, a discriminatory
530patent license (a) in connection with copies of the covered work
531conveyed by you (or copies made from those copies), or (b) primarily
532for and in connection with specific products or compilations that
533contain the covered work, unless you entered into that arrangement,
534or that patent license was granted, prior to 28 March 2007.
535
536 Nothing in this License shall be construed as excluding or limiting
537any implied license or other defenses to infringement that may
538otherwise be available to you under applicable patent law.
539
540 12. No Surrender of Others' Freedom.
541
542 If conditions are imposed on you (whether by court order, agreement or
543otherwise) that contradict the conditions of this License, they do not
544excuse you from the conditions of this License. If you cannot convey a
545covered work so as to satisfy simultaneously your obligations under this
546License and any other pertinent obligations, then as a consequence you may
547not convey it at all. For example, if you agree to terms that obligate you
548to collect a royalty for further conveying from those to whom you convey
549the Program, the only way you could satisfy both those terms and this
550License would be to refrain entirely from conveying the Program.
551
552 13. Use with the GNU Affero General Public License.
553
554 Notwithstanding any other provision of this License, you have
555permission to link or combine any covered work with a work licensed
556under version 3 of the GNU Affero General Public License into a single
557combined work, and to convey the resulting work. The terms of this
558License will continue to apply to the part which is the covered work,
559but the special requirements of the GNU Affero General Public License,
560section 13, concerning interaction through a network will apply to the
561combination as such.
562
563 14. Revised Versions of this License.
564
565 The Free Software Foundation may publish revised and/or new versions of
566the GNU General Public License from time to time. Such new versions will
567be similar in spirit to the present version, but may differ in detail to
568address new problems or concerns.
569
570 Each version is given a distinguishing version number. If the
571Program specifies that a certain numbered version of the GNU General
572Public License "or any later version" applies to it, you have the
573option of following the terms and conditions either of that numbered
574version or of any later version published by the Free Software
575Foundation. If the Program does not specify a version number of the
576GNU General Public License, you may choose any version ever published
577by the Free Software Foundation.
578
579 If the Program specifies that a proxy can decide which future
580versions of the GNU General Public License can be used, that proxy's
581public statement of acceptance of a version permanently authorizes you
582to choose that version for the Program.
583
584 Later license versions may give you additional or different
585permissions. However, no additional obligations are imposed on any
586author or copyright holder as a result of your choosing to follow a
587later version.
588
589 15. Disclaimer of Warranty.
590
591 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
600 16. Limitation of Liability.
601
602 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610SUCH DAMAGES.
611
612 17. Interpretation of Sections 15 and 16.
613
614 If the disclaimer of warranty and limitation of liability provided
615above cannot be given local legal effect according to their terms,
616reviewing courts shall apply local law that most closely approximates
617an absolute waiver of all civil liability in connection with the
618Program, unless a warranty or assumption of liability accompanies a
619copy of the Program in return for a fee.
620
621 END OF TERMS AND CONDITIONS
622
623 How to Apply These Terms to Your New Programs
624
625 If you develop a new program, and you want it to be of the greatest
626possible use to the public, the best way to achieve this is to make it
627free software which everyone can redistribute and change under these terms.
628
629 To do so, attach the following notices to the program. It is safest
630to attach them to the start of each source file to most effectively
631state the exclusion of warranty; and each file should have at least
632the "copyright" line and a pointer to where the full notice is found.
633
634 <one line to give the program's name and a brief idea of what it does.>
635 Copyright (C) <year> <name of author>
636
637 This program is free software: you can redistribute it and/or modify
638 it under the terms of the GNU General Public License as published by
639 the Free Software Foundation, either version 3 of the License, or
640 (at your option) any later version.
641
642 This program is distributed in the hope that it will be useful,
643 but WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 GNU General Public License for more details.
646
647 You should have received a copy of the GNU General Public License
648 along with this program. If not, see <http://www.gnu.org/licenses/>.
649
650Also add information on how to contact you by electronic and paper mail.
651
652 If the program does terminal interaction, make it output a short
653notice like this when it starts in an interactive mode:
654
655 <program> Copyright (C) <year> <name of author>
656 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 This is free software, and you are welcome to redistribute it
658 under certain conditions; type `show c' for details.
659
660The hypothetical commands `show w' and `show c' should show the appropriate
661parts of the General Public License. Of course, your program's commands
662might be different; for a GUI interface, you would use an "about box".
663
664 You should also get your employer (if you work as a programmer) or school,
665if any, to sign a "copyright disclaimer" for the program, if necessary.
666For more information on this, and how to apply and follow the GNU GPL, see
667<http://www.gnu.org/licenses/>.
668
669 The GNU General Public License does not permit incorporating your program
670into proprietary programs. If your program is a subroutine library, you
671may consider it more useful to permit linking proprietary applications with
672the library. If this is what you want to do, use the GNU Lesser General
673Public License instead of this License. But first, please read
674<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ChangeLog
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..2099840
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,370 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
5Inc.
6
7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright
9notice and this notice are preserved. This file is offered as-is,
10without warranty of any kind.
11
12Basic Installation
13==================
14
15 Briefly, the shell command `./configure && make && make install'
16should configure, build, and install this package. The following
17more-detailed instructions are generic; see the `README' file for
18instructions specific to this package. Some packages provide this
19`INSTALL' file but do not implement all of the features documented
20below. The lack of an optional feature in a given package is not
21necessarily a bug. More recommendations for GNU packages can be found
22in *note Makefile Conventions: (standards)Makefile Conventions.
23
24 The `configure' shell script attempts to guess correct values for
25various system-dependent variables used during compilation. It uses
26those values to create a `Makefile' in each directory of the package.
27It may also create one or more `.h' files containing system-dependent
28definitions. Finally, it creates a shell script `config.status' that
29you can run in the future to recreate the current configuration, and a
30file `config.log' containing compiler output (useful mainly for
31debugging `configure').
32
33 It can also use an optional file (typically called `config.cache'
34and enabled with `--cache-file=config.cache' or simply `-C') that saves
35the results of its tests to speed up reconfiguring. Caching is
36disabled by default to prevent problems with accidental use of stale
37cache files.
38
39 If you need to do unusual things to compile the package, please try
40to figure out how `configure' could check whether to do them, and mail
41diffs or instructions to the address given in the `README' so they can
42be considered for the next release. If you are using the cache, and at
43some point `config.cache' contains results you don't want to keep, you
44may remove or edit it.
45
46 The file `configure.ac' (or `configure.in') is used to create
47`configure' by a program called `autoconf'. You need `configure.ac' if
48you want to change it or regenerate `configure' using a newer version
49of `autoconf'.
50
51 The simplest way to compile this package is:
52
53 1. `cd' to the directory containing the package's source code and type
54 `./configure' to configure the package for your system.
55
56 Running `configure' might take a while. While running, it prints
57 some messages telling which features it is checking for.
58
59 2. Type `make' to compile the package.
60
61 3. Optionally, type `make check' to run any self-tests that come with
62 the package, generally using the just-built uninstalled binaries.
63
64 4. Type `make install' to install the programs and any data files and
65 documentation. When installing into a prefix owned by root, it is
66 recommended that the package be configured and built as a regular
67 user, and only the `make install' phase executed with root
68 privileges.
69
70 5. Optionally, type `make installcheck' to repeat any self-tests, but
71 this time using the binaries in their final installed location.
72 This target does not install anything. Running this target as a
73 regular user, particularly if the prior `make install' required
74 root privileges, verifies that the installation completed
75 correctly.
76
77 6. You can remove the program binaries and object files from the
78 source code directory by typing `make clean'. To also remove the
79 files that `configure' created (so you can compile the package for
80 a different kind of computer), type `make distclean'. There is
81 also a `make maintainer-clean' target, but that is intended mainly
82 for the package's developers. If you use it, you may have to get
83 all sorts of other programs in order to regenerate files that came
84 with the distribution.
85
86 7. Often, you can also type `make uninstall' to remove the installed
87 files again. In practice, not all packages have tested that
88 uninstallation works correctly, even though it is required by the
89 GNU Coding Standards.
90
91 8. Some packages, particularly those that use Automake, provide `make
92 distcheck', which can by used by developers to test that all other
93 targets like `make install' and `make uninstall' work correctly.
94 This target is generally not run by end users.
95
96Compilers and Options
97=====================
98
99 Some systems require unusual options for compilation or linking that
100the `configure' script does not know about. Run `./configure --help'
101for details on some of the pertinent environment variables.
102
103 You can give `configure' initial values for configuration parameters
104by setting variables in the command line or in the environment. Here
105is an example:
106
107 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
108
109 *Note Defining Variables::, for more details.
110
111Compiling For Multiple Architectures
112====================================
113
114 You can compile the package for more than one kind of computer at the
115same time, by placing the object files for each architecture in their
116own directory. To do this, you can use GNU `make'. `cd' to the
117directory where you want the object files and executables to go and run
118the `configure' script. `configure' automatically checks for the
119source code in the directory that `configure' is in and in `..'. This
120is known as a "VPATH" build.
121
122 With a non-GNU `make', it is safer to compile the package for one
123architecture at a time in the source code directory. After you have
124installed the package for one architecture, use `make distclean' before
125reconfiguring for another architecture.
126
127 On MacOS X 10.5 and later systems, you can create libraries and
128executables that work on multiple system types--known as "fat" or
129"universal" binaries--by specifying multiple `-arch' options to the
130compiler but only a single `-arch' option to the preprocessor. Like
131this:
132
133 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
134 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
135 CPP="gcc -E" CXXCPP="g++ -E"
136
137 This is not guaranteed to produce working output in all cases, you
138may have to build one architecture at a time and combine the results
139using the `lipo' tool if you have problems.
140
141Installation Names
142==================
143
144 By default, `make install' installs the package's commands under
145`/usr/local/bin', include files under `/usr/local/include', etc. You
146can specify an installation prefix other than `/usr/local' by giving
147`configure' the option `--prefix=PREFIX', where PREFIX must be an
148absolute file name.
149
150 You can specify separate installation prefixes for
151architecture-specific files and architecture-independent files. If you
152pass the option `--exec-prefix=PREFIX' to `configure', the package uses
153PREFIX as the prefix for installing programs and libraries.
154Documentation and other data files still use the regular prefix.
155
156 In addition, if you use an unusual directory layout you can give
157options like `--bindir=DIR' to specify different values for particular
158kinds of files. Run `configure --help' for a list of the directories
159you can set and what kinds of files go in them. In general, the
160default for these options is expressed in terms of `${prefix}', so that
161specifying just `--prefix' will affect all of the other directory
162specifications that were not explicitly provided.
163
164 The most portable way to affect installation locations is to pass the
165correct locations to `configure'; however, many packages provide one or
166both of the following shortcuts of passing variable assignments to the
167`make install' command line to change installation locations without
168having to reconfigure or recompile.
169
170 The first method involves providing an override variable for each
171affected directory. For example, `make install
172prefix=/alternate/directory' will choose an alternate location for all
173directory configuration variables that were expressed in terms of
174`${prefix}'. Any directories that were specified during `configure',
175but not in terms of `${prefix}', must each be overridden at install
176time for the entire installation to be relocated. The approach of
177makefile variable overrides for each directory variable is required by
178the GNU Coding Standards, and ideally causes no recompilation.
179However, some platforms have known limitations with the semantics of
180shared libraries that end up requiring recompilation when using this
181method, particularly noticeable in packages that use GNU Libtool.
182
183 The second method involves providing the `DESTDIR' variable. For
184example, `make install DESTDIR=/alternate/directory' will prepend
185`/alternate/directory' before all installation names. The approach of
186`DESTDIR' overrides is not required by the GNU Coding Standards, and
187does not work on platforms that have drive letters. On the other hand,
188it does better at avoiding recompilation issues, and works well even
189when some directory options were not specified in terms of `${prefix}'
190at `configure' time.
191
192Optional Features
193=================
194
195 If the package supports it, you can cause programs to be installed
196with an extra prefix or suffix on their names by giving `configure' the
197option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
198
199 Some packages pay attention to `--enable-FEATURE' options to
200`configure', where FEATURE indicates an optional part of the package.
201They may also pay attention to `--with-PACKAGE' options, where PACKAGE
202is something like `gnu-as' or `x' (for the X Window System). The
203`README' should mention any `--enable-' and `--with-' options that the
204package recognizes.
205
206 For packages that use the X Window System, `configure' can usually
207find the X include and library files automatically, but if it doesn't,
208you can use the `configure' options `--x-includes=DIR' and
209`--x-libraries=DIR' to specify their locations.
210
211 Some packages offer the ability to configure how verbose the
212execution of `make' will be. For these packages, running `./configure
213--enable-silent-rules' sets the default to minimal output, which can be
214overridden with `make V=1'; while running `./configure
215--disable-silent-rules' sets the default to verbose, which can be
216overridden with `make V=0'.
217
218Particular systems
219==================
220
221 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
222CC is not installed, it is recommended to use the following options in
223order to use an ANSI C compiler:
224
225 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228
229 HP-UX `make' updates targets which have the same time stamps as
230their prerequisites, which makes it generally unusable when shipped
231generated files such as `configure' are involved. Use GNU `make'
232instead.
233
234 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
235parse its `<wchar.h>' header file. The option `-nodtk' can be used as
236a workaround. If GNU CC is not installed, it is therefore recommended
237to try
238
239 ./configure CC="cc"
240
241and if that doesn't work, try
242
243 ./configure CC="cc -nodtk"
244
245 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
246directory contains several dysfunctional programs; working variants of
247these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
248in your `PATH', put it _after_ `/usr/bin'.
249
250 On Haiku, software installed for all users goes in `/boot/common',
251not `/usr/local'. It is recommended to use the following options:
252
253 ./configure --prefix=/boot/common
254
255Specifying the System Type
256==========================
257
258 There may be some features `configure' cannot figure out
259automatically, but needs to determine by the type of machine the package
260will run on. Usually, assuming the package is built to be run on the
261_same_ architectures, `configure' can figure that out, but if it prints
262a message saying it cannot guess the machine type, give it the
263`--build=TYPE' option. TYPE can either be a short name for the system
264type, such as `sun4', or a canonical name which has the form:
265
266 CPU-COMPANY-SYSTEM
267
268where SYSTEM can have one of these forms:
269
270 OS
271 KERNEL-OS
272
273 See the file `config.sub' for the possible values of each field. If
274`config.sub' isn't included in this package, then this package doesn't
275need to know the machine type.
276
277 If you are _building_ compiler tools for cross-compiling, you should
278use the option `--target=TYPE' to select the type of system they will
279produce code for.
280
281 If you want to _use_ a cross compiler, that generates code for a
282platform different from the build platform, you should specify the
283"host" platform (i.e., that on which the generated programs will
284eventually be run) with `--host=TYPE'.
285
286Sharing Defaults
287================
288
289 If you want to set default values for `configure' scripts to share,
290you can create a site shell script called `config.site' that gives
291default values for variables like `CC', `cache_file', and `prefix'.
292`configure' looks for `PREFIX/share/config.site' if it exists, then
293`PREFIX/etc/config.site' if it exists. Or, you can set the
294`CONFIG_SITE' environment variable to the location of the site script.
295A warning: not all `configure' scripts look for a site script.
296
297Defining Variables
298==================
299
300 Variables not defined in a site shell script can be set in the
301environment passed to `configure'. However, some packages may run
302configure again during the build, and the customized values of these
303variables may be lost. In order to avoid this problem, you should set
304them in the `configure' command line, using `VAR=value'. For example:
305
306 ./configure CC=/usr/local2/bin/gcc
307
308causes the specified `gcc' to be used as the C compiler (unless it is
309overridden in the site shell script).
310
311Unfortunately, this technique does not work for `CONFIG_SHELL' due to
312an Autoconf limitation. Until the limitation is lifted, you can use
313this workaround:
314
315 CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
316
317`configure' Invocation
318======================
319
320 `configure' recognizes the following options to control how it
321operates.
322
323`--help'
324`-h'
325 Print a summary of all of the options to `configure', and exit.
326
327`--help=short'
328`--help=recursive'
329 Print a summary of the options unique to this package's
330 `configure', and exit. The `short' variant lists options used
331 only in the top level, while the `recursive' variant lists options
332 also present in any nested packages.
333
334`--version'
335`-V'
336 Print the version of Autoconf used to generate the `configure'
337 script, and exit.
338
339`--cache-file=FILE'
340 Enable the cache: use and save the results of the tests in FILE,
341 traditionally `config.cache'. FILE defaults to `/dev/null' to
342 disable caching.
343
344`--config-cache'
345`-C'
346 Alias for `--cache-file=config.cache'.
347
348`--quiet'
349`--silent'
350`-q'
351 Do not print messages saying which checks are being made. To
352 suppress all normal output, redirect it to `/dev/null' (any error
353 messages will still be shown).
354
355`--srcdir=DIR'
356 Look for the package's source code in directory DIR. Usually
357 `configure' can determine that directory automatically.
358
359`--prefix=DIR'
360 Use DIR as the installation prefix. *note Installation Names::
361 for more details, including other options available for fine-tuning
362 the installation locations.
363
364`--no-create'
365`-n'
366 Run the configure checks, but stop before creating any output
367 files.
368
369`configure' also accepts some other, not widely useful, options. Run
370`configure --help' for more details.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..c7aa120
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,80 @@
1ACLOCAL_AMFLAGS = -I m4
2AUTOMAKE_OPTIONS = subdir-objects
3
4MAINTAINERCLEANFILES = \
5ar-lib \
6Makefile.in \
7aclocal.m4 \
8compile \
9config.guess \
10config.h.in \
11config.h.in~ \
12config.sub \
13configure \
14depcomp \
15install-sh \
16ltconfig \
17ltmain.sh \
18missing \
19soap_model*doc*tar* \
20m4/l*
21
22CLEANFILES = \
23$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
24$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
25$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2
26
27pkgconfigdir = $(libdir)/pkgconfig
28pkgconfig_DATA = soap_model.pc soap_model-cxx.pc
29
30EXTRA_DIST = \
31AUTHORS \
32COPYING \
33README \
34$(pkgconfig_DATA) \
35autogen.sh \
36soap_model.pc.in \
37m4/efl.m4 \
38m4/efl_compiler_flag.m4 \
39m4/efl_doxygen.m4
40
41moddir = $(libdir)/soap_model/$(MODULE_ARCH)
42mod_LTLIBRARIES =
43
44MOD_CFLAGS = \
45-I$(top_builddir) \
46@EFL_CFLAGS@ \
47-I$(top_srcdir)/src/lib \
48-I$(top_builddir)/src/lib \
49-DEFL_BETA_API_SUPPORT
50
51MOD_LIBS = \
52$(top_builddir)/src/lib/libsoap_model.la \
53@EFL_LIBS@
54
55LD_FLAGS = -no-undefined -module -avoid-version
56LT_FLAGS = --tag=disable-static
57
58.PHONY: doc
59
60# Documentation
61
62# Eolian
63if HAVE_EOLIAN_CXX
64EOLIAN_CXX = @eolian_cxx@
65_EOLIAN_CXX_DEP = @eolian_cxx@
66else
67EOLIAN_CXX = eolian_cxx${EXEEXT}
68_EOLIAN_CXX_DEP = eolian_cxx${EXEEXT}
69endif
70if HAVE_EOLIAN_GEN
71EOLIAN_GEN = @eolian_gen@
72_EOLIAN_GEN_DEP = @eolian_gen@
73else
74EOLIAN_GEN = eolian_gen${EXEEXT}
75_EOLIAN_GEN_DEP = eolian_gen${EXEEXT}
76endif
77
78#include doc/Makefile.am
79include src/lib/Makefile.am
80include src/tests/Makefile.am
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/README
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..0481d71
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,39 @@
1#!/bin/sh
2
3test -n "$srcdir" || srcdir=`dirname "$0"`
4test -n "$srcdir" || srcdir=.
5(
6 cd "$srcdir" &&
7 (
8 rm -rf autom4te.cache
9 rm -f aclocal.m4 ltmain.sh
10
11 autoreconf -vif
12 )
13
14 W=0
15
16 rm -f config.cache-env.tmp
17 echo "OLD_PARM=\"$@\"" >> config.cache-env.tmp
18 echo "OLD_CFLAGS=\"$CFLAGS\"" >> config.cache-env.tmp
19 echo "OLD_PATH=\"$PATH\"" >> config.cache-env.tmp
20 echo "OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" >> config.cache-env.tmp
21 echo "OLD_LDFLAGS=\"$LDFLAGS\"" >> config.cache-env.tmp
22
23 cmp config.cache-env.tmp config.cache-env >> /dev/null
24 if [ $? -ne 0 ]; then
25 W=1;
26 fi
27
28 if [ $W -ne 0 ]; then
29 echo "Cleaning configure cache...";
30 rm -f config.cache config.cache-env
31 mv config.cache-env.tmp config.cache-env
32 else
33 rm -f config.cache-env.tmp
34 fi
35)
36
37if [ -z "$NOCONFIGURE" ]; then
38 exec $srcdir/configure -C "$@"
39fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..868ae22
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,109 @@
1EFL_VERSION([1], [0], [0], [release])
2AC_INIT([soap_model], [efl_version], [contato@expertisesolutions.com.br], [soap_model])
3AC_PREREQ([2.57])
4AC_CONFIG_SRCDIR([configure.ac])
5AC_CONFIG_MACRO_DIR([m4])
6AC_CONFIG_HEADERS([config.h])
7
8AC_USE_SYSTEM_EXTENSIONS
9AC_ISC_POSIX
10
11AC_LIBTOOL_WIN32_DLL
12define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
13define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
14m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
15LT_INIT([win32-dll disable-static pic-only])
16EFL_INIT
17
18## the BSD echo does not have the -e option (it is the default behaviour)
19echo_e=
20if test "`echo -e x`" = "x"; then
21 echo_e=-e
22fi
23AC_SUBST([ECHO_E], [${echo_e}])
24
25AM_INIT_AUTOMAKE([1.6 dist-bzip2])
26m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
27
28AC_PROG_LIBTOOL
29AC_PROG_INSTALL
30AC_LANG(C)
31AC_PROG_CC_C99
32AM_PROG_CC_C_O
33AC_PROG_MAKE_SET
34AC_FUNC_ALLOCA
35
36if test "x${ac_cv_prog_cc_c99}" = "xno" ; then
37 AC_MSG_ERROR([soap_model requires a c99-capable compiler])
38fi
39
40m4_ifdef([v_mic],
41 [
42 EFL_CHECK_COMPILER_FLAGS([SOAP_MODEL], [-Wshadow])
43 EFL_CHECK_COMPILER_FLAGS([SOAP_MODEL], [-Wall])
44 EFL_CHECK_COMPILER_FLAGS([SOAP_MODEL], [-W])
45 ])
46
47case "$host_os" in
48 mingw32ce*)
49 MODULE_ARCH="$host_os-$host_cpu"
50 ;;
51 *)
52 MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
53 ;;
54esac
55AC_SUBST(MODULE_ARCH)
56AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
57
58case "$host_os" in
59 mingw*)
60 MODULE_EXT=".dll"
61 ;;
62 *)
63 MODULE_EXT=".so"
64 ;;
65esac
66
67AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "${MODULE_EXT}", [Suffix for shared objects])
68
69requirement_soap_model="eina >= 1.10.0 ecore >= 1.10.0 eo >= 1.10.0 emodel >= 1.10.0 eio >= 1.10.0 eolian >= 1.10.0 eflat_xml_model >= 1.0.0 libcurl >= 7.40 axis2c >= 1.7"
70AC_SUBST(requirement_soap_model)
71
72PKG_CHECK_MODULES([EFL], [$requirement_soap_model])
73
74EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
75
76PKG_CHECK_MODULES([CHECK], [check >= 0.9.5])
77
78EFL_WITH_BIN([eolian], [eolian-gen], [eolian_gen])
79EFL_WITH_BIN([eolian-cxx], [eolian-cxx], [eolian_cxx])
80
81AC_OUTPUT([
82Makefile
83soap_model.pc
84soap_model-cxx.pc
85])
86
87
88#####################################################################
89## Info
90
91echo
92echo
93echo
94echo "------------------------------------------------------------------------"
95echo "$PACKAGE $VERSION"
96echo "------------------------------------------------------------------------"
97echo
98echo "Configuration Options Summary:"
99echo
100echo "Documentation..........: ${build_doc}"
101echo
102echo "Compilation............: make (or gmake)"
103echo " CPPFLAGS.............: $CPPFLAGS"
104echo " CFLAGS...............: $CFLAGS"
105echo " LDFLAGS..............: $LDFLAGS"
106echo
107echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
108echo " prefix...............: $prefix"
109echo
diff --git a/m4/efl.m4 b/m4/efl.m4
new file mode 100644
index 0000000..3598ce7
--- /dev/null
+++ b/m4/efl.m4
@@ -0,0 +1,449 @@
1dnl file to manage modules in efl
2
3dnl EFL_VERSION(major, minor, micro, release)
4dnl This setup EFL version information and should be called BEFORE AC_INIT().
5dnl
6dnl release parameter is 'dev' to use from SVN or libtool -release field.
7dnl It may be empty if not dev (svn/live build) and no -release is to be used.
8dnl
9dnl Examples:
10dnl EFL_VERSION(1, 7, 99, dev)
11dnl EFL_VERSION(1, 7, 99, ver-1234)
12dnl This will define couple of m4 symbols:
13dnl v_maj = given major number (first parameter)
14dnl v_min = given minor number (second parameter)
15dnl v_mic = given micro number (third parameter)
16dnl v_rev = if release, it's 0, otherwise it's dev_version.
17dnl v_rel = if release, it's -release followed by fourth parameter,
18dnl otherwise it's empty. (mostly for libtool)
19dnl efl_version = if release, it's major.minor.micro, otherwise it's
20dnl major.minor.micro.dev_version
21dnl dev_version = development version (svn revision).
22dnl def_build_profile = dev or release based on 'dev' release parameter.
23AC_DEFUN([EFL_VERSION],
24[dnl
25m4_define([v_maj], [$1])dnl
26m4_define([v_min], [$2])dnl
27m4_define([v_mic], [$3])dnl
28m4_define([dev_version], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
29m4_define([v_rev], m4_if($4, dev, [dev_version], [0]))dnl
30m4_define([v_rel], [])dnl
31m4_define([def_build_profile], m4_if($4, dev, [dev], [release]))dnl
32m4_define([efl_version], m4_if($4, dev, [v_maj.v_min.v_mic.v_rev], [v_maj.v_min.v_mic]))dnl
33dnl m4_define([efl_version], [v_maj.v_min.v_mic])dnl
34])
35
36dnl EFL_COLOR
37dnl will check if terminal supports color and if color is wanted by user.
38dnl
39dnl Used Variables:
40dnl WANT_COLOR: if no, forces no color output.
41dnl TERM: used to check if color should be enabled.
42dnl
43dnl Defined Variables:
44dnl COLOR_YES: to be used in positive/yes conditions
45dnl COLOR_NO: to be used in negative/no conditions
46dnl COLOR_OTHER: to be used to highlight some other condition
47dnl COLOR_RESET: to reset color
48dnl want_color: yes or no
49AC_DEFUN([EFL_COLOR],
50[dnl
51case "$TERM" in
52 xterm|xterm-color|xterm-256color|Eterm|aterm|kterm|rxvt*|screen|gnome|interix)
53 want_color="${WANT_COLOR:-yes}"
54 ;;
55 *)
56 want_color="no"
57 ;;
58esac
59
60### echo compatibility
61
62## the BSD echo does not have the -e option (it is the default behaviour)
63echo_e=
64if test "`echo -e x`" = "x"; then
65 echo_e=-e
66fi
67AC_SUBST([ECHO_E], [${echo_e}])
68
69if test "${want_color}" = "yes"; then
70 COLOR_YES=`echo $echo_e "\033@<:@1;32m"`
71 COLOR_NO=`echo $echo_e "\033@<:@1;31m"`
72 COLOR_OTHER=`echo $echo_e "\033@<:@1;36m"`
73 COLOR_RESET=`echo $echo_e "\033@<:@0m"`
74else
75 COLOR_YES=""
76 COLOR_NO=""
77 COLOR_OTHER=""
78 COLOR_RESET=""
79fi
80])
81
82dnl EFL_INIT()
83dnl Will AC_DEFINE() the following:
84dnl VMAJ = v_maj
85dnl VMIN = v_min
86dnl VMIC = v_mic
87dnl VREV = v_rev
88dnl Will AC_SUBST() the following:
89dnl VMAJ = v_maj
90dnl VMIN = v_min
91dnl VMIC = v_mic
92dnl EFL_LTLIBRARY_FLAGS="-no-undefined -version-info ..."
93dnl EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
94dnl Will define the following m4:
95dnl lt_cur = libtool 'current' field of libtool's -version-info
96dnl lt_rev = libtool 'revision' field of libtool's -version-info
97dnl lt_age = libtool 'age' field of libtool's -version-info
98AC_DEFUN([EFL_INIT],
99[dnl
100AC_REQUIRE([EFL_COLOR])dnl
101AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])dnl
102AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])dnl
103AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])dnl
104AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])dnl
105VMAJ=v_maj
106VMIN=v_min
107VMIC=v_mic
108AC_SUBST([VMAJ])dnl
109AC_SUBST([VMIN])dnl
110AC_SUBST([VMIC])dnl
111dnl
112dnl TODO: warning - lt_cur:
113dnl the previous code assumed v_maj + v_min, but this will be a problem when
114dnl we bump v_maj and reset v_min. 1 + 7 == 7 + 1, so if v_maj is bumped
115dnl we multiply it by 100.
116m4_define([lt_cur], m4_if(m4_cmp(v_maj, 1), 0, m4_eval(v_maj + v_min), m4_eval(v_maj * 100 + v_min)))dnl
117m4_define([lt_rev], v_mic)dnl
118m4_define([lt_age], v_min)dnl
119dnl
120EFL_LTLIBRARY_FLAGS="-no-undefined -version-info lt_cur:lt_rev:lt_age v_rel"
121AC_SUBST(EFL_LTLIBRARY_FLAGS)dnl
122EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
123AC_SUBST([EFL_LTMODULE_FLAGS])dnl
124AC_MSG_NOTICE([Initialized AC_PACKAGE_NAME (AC_PACKAGE_VERSION) development=dev_version v_rel])
125])
126
127dnl EFL_EVAL_PKGS(EFL)
128dnl does PKG_CHECK_MODULES() for given EFL
129AC_DEFUN([EFL_EVAL_PKGS],
130[dnl
131m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
132if test "x${requirements_pc_deps_[]m4_defn([DOWNEFL])}" != "x"; then
133 PKG_CHECK_MODULES([$1], [${requirements_pc_deps_[]m4_defn([DOWNEFL])}])
134fi
135m4_popdef([DOWNEFL])dnl
136])
137
138dnl EFL_INTERNAL_DEPEND_PKG(EFL, OTHEREFL)
139dnl Adds a pkg-config dependency on another EFL.
140AC_DEFUN([EFL_INTERNAL_DEPEND_PKG],
141[dnl
142m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
143m4_pushdef([DOWNOTHER], m4_translit([$2], [-A-Z], [_a-z]))dnl
144dnl TODO: we need to fix the package config names for 2.0
145dnl TODO: and make them uniform in scheme.
146depname="$2"
147libdirname="m4_defn([DOWNOTHER])"
148libname="m4_defn([DOWNOTHER])"
149case "m4_defn([DOWNOTHER])" in
150 ethumb_client)
151 depname="ethumb_client"
152 ;;
153esac
154requirements_pc_[]m4_defn([DOWNEFL])="${depname} >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
155requirements_cflags_[]m4_defn([DOWNEFL])="-I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
156requirements_internal_libs_[]m4_defn([DOWNEFL])="lib/${libdirname}/lib${libname}.la ${requirements_internal_libs_[][]m4_defn([DOWNEFL])}"
157requirements_internal_deps_libs_[]m4_defn([DOWNEFL])="${requirements_public_libs_[]m4_defn([DOWNOTHER])} ${requirements_internal_deps_libs_[][]m4_defn([DOWNEFL])}"
158m4_popdef([DOWNOTHER])dnl
159m4_popdef([DOWNEFL])dnl
160])
161
162dnl EFL_PLATFORM_DEPEND(EFL, PLATFORM)
163dnl PLATFORM is one of: all, evil, escape, exotic
164AC_DEFUN([EFL_PLATFORM_DEPEND],
165[dnl
166m4_pushdef([DOWNOTHER], m4_translit([$2], [-A-Z], [_a-z]))dnl
167case "m4_defn([DOWNOTHER])" in
168 all)
169 if test "x${efl_lib_optional_evil}" = "xyes"; then
170 EFL_INTERNAL_DEPEND_PKG([$1], [evil])
171 elif test "x${efl_lib_optional_escape}" = "xyes"; then
172 EFL_INTERNAL_DEPEND_PKG([$1], [escape])
173 elif test "x${efl_lib_optional_exotic}" = "xyes"; then
174 EFL_INTERNAL_DEPEND_PKG([$1], [exotic])
175 fi
176 ;;
177 *)
178 if test "x${efl_lib_optional_[]m4_defn([DOWNOTHER])}" = "xyes"; then
179 EFL_INTERNAL_DEPEND_PKG([$1], [$2])
180 fi
181 ;;
182esac
183m4_popdef([DOWNOTHER])dnl
184])
185
186dnl EFL_CRYPTO_DEPEND(EFL)
187dnl the given EFL will use/depend on system crypto settings
188AC_DEFUN([EFL_CRYPTO_DEPEND],
189[dnl
190m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
191requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_crypto} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
192requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_crypto} ${requirements_pc_deps_[][]m4_defn([DOWNEFL])}"
193requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_crypto} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
194requirements_cflags_[]m4_defn([DOWNEFL])="${requirements_cflags_crypto} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
195m4_popdef([DOWNEFL])dnl
196])
197
198dnl EFL_DEPEND_PKG(EFL, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
199dnl Adds a pkg-config dependency to an efl, AC_DEFINE() HAVE_NAME,
200dnl and inserts dependencies in proper variables
201AC_DEFUN([EFL_DEPEND_PKG],
202[dnl
203m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
204m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
205m4_pushdef([UPNAME], m4_translit([$2], [-a-z], [_A-Z]))dnl
206m4_pushdef([DOWNNAME], m4_translit([$2], [-A-Z], [_a-z]))dnl
207
208 have_[]m4_defn([DOWNNAME])="no"
209
210 EFL_PKG_CHECK_STRICT([$3], [
211 AC_DEFINE([HAVE_]m4_defn([UPNAME]), [1], [Have `]m4_defn([DOWNNAME])[' pkg-config installed.])
212 requirements_pc_[]m4_defn([DOWNEFL])="$3 ${requirements_pc_[][]m4_defn([DOWNEFL])}"
213 requirements_pc_deps_[]m4_defn([DOWNEFL])="$3 ${requirements_pc_deps_[]m4_defn([DOWNEFL])}"
214 have_[]m4_defn([DOWNNAME])="yes"
215
216 $4
217
218 ], [$5])
219
220m4_popdef([DOWNNAME])
221m4_popdef([UPNAME])
222m4_popdef([DOWNEFL])
223m4_popdef([UPEFL])
224])
225
226dnl EFL_OPTIONAL_DEPEND_PKG(EFL, VARIABLE, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
227AC_DEFUN([EFL_OPTIONAL_DEPEND_PKG],
228[dnl
229m4_pushdef([DOWN], m4_translit([$3], [-A-Z], [_a-z]))dnl
230
231 have_[]m4_defn([DOWN])="no"
232 if test "x$2" = "xyes"; then
233 EFL_DEPEND_PKG([$1], [$3], [$4], [$5], [$6])
234 fi
235m4_popdef([DOWN])dnl
236])
237
238dnl EFL_OPTIONAL_INTERNAL_DEPEND_PKG(EFL, VARIABLE, NAME)
239AC_DEFUN([EFL_OPTIONAL_INTERNAL_DEPEND_PKG],
240[dnl
241 if test "x$2" = "xyes"; then
242 EFL_INTERNAL_DEPEND_PKG([$1], [$3])
243 fi
244])
245
246dnl EFL_ADD_LIBS(PKG, LIBS)
247dnl Add libraries that the EFL library will depend on
248dnl See EFL_DEPEND_PKG() for pkg-config version.
249AC_DEFUN([EFL_ADD_LIBS],
250[dnl
251m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
252requirements_libs_[]m4_defn([DOWN])="${requirements_libs_[]m4_defn([DOWN])} $2"
253m4_popdef([DOWN])dnl
254])
255
256dnl EFL_ADD_PUBLIC_LIBS(PKG, PUBLIC_LIBS)
257dnl Add libraries that the EFL library will depend on when used.
258dnl
259dnl Unlike EFL_ADD_LIBS(), that is only used when generating PKG,
260dnl this one is used when linking PKG to other libraries or applications.
261dnl
262dnl For instance if you use some other library in your header that user
263dnl inclues.
264AC_DEFUN([EFL_ADD_PUBLIC_LIBS],
265[dnl
266m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
267requirements_public_libs_[]m4_defn([DOWN])="${requirements_public_libs_[]m4_defn([DOWN])} $2"
268m4_popdef([DOWN])dnl
269])
270
271dnl EFL_ADD_CFLAGS(PKG, CFLAGS)
272dnl Add CFLAGS that the EFL library will use
273dnl See EFL_DEPEND_PKG() for pkg-config version.
274AC_DEFUN([EFL_ADD_CFLAGS],
275[dnl
276m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
277requirements_cflags_[]m4_defn([DOWN])="${requirements_cflags_[]m4_defn([DOWN])} $2"
278m4_popdef([DOWN])dnl
279])
280
281dnl EFL_LIB_START(PKG)
282dnl start the setup of an EFL library, defines variables and prints a notice
283dnl
284dnl Exports (AC_SUBST)
285dnl PKG_CFLAGS: what to use for CFLAGS
286dnl
287dnl PKG_LDFLAGS: what to use for LDFLAGS
288dnl
289dnl PKG_LIBS: what to use in automake's _LIBADD or _LDADD. Includes
290dnl everything else.
291dnl
292dnl PKG_INTERNAL_LIBS: all other EFL as lib/name/libname.la that this
293dnl package depend. Used in automake's _DEPENDENCIES.
294dnl
295dnl USE_PKG_LIBS: what to use in automake's _LIBADD or _LDADD when using
296dnl this PKG (PKG_LIBS + libpkg.la)
297dnl
298dnl USE_PKG_INTERNAL_LIBS: extends PKG_INTERNAL_LIBS with lib/pkg/libpkg.la
299dnl
300dnl requirements_pc_pkg: all pkg-config (pc) files used by this pkg,
301dnl includes internal EFL (used in 'Requires.private' in pkg.pc)
302dnl
303dnl requirements_libs_pkg: external libraries this package needs when
304dnl linking (used in 'Libs.private' in pkg.pc)
305dnl
306dnl requirements_public_libs_pkg: external libraries other packages need
307dnl when using this (used in 'Libs' in pkg.pc)
308dnl
309dnl requirements_cflags_pkg: what to use for CFLAGS (same as PKG_CFLAGS).
310dnl
311dnl Variables:
312dnl requirements_pc_deps_pkg: external pkg-config (pc) files used by this
313dnl pkg (used in EFL_EVAL_PKGS())
314dnl
315dnl requirements_internal_libs_pkg: all other EFL as lib/name/libname.la
316dnl that this package depend.
317dnl
318dnl requirements_internal_deps_libs_pkg: external libraries that are public
319dnl dependencies (due internal libs).
320dnl
321AC_DEFUN([EFL_LIB_START],
322[dnl
323m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
324m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
325
326requirements_internal_libs_[]m4_defn([DOWN])=""
327requirements_internal_deps_libs_[]m4_defn([DOWN])=""
328requirements_libs_[]m4_defn([DOWN])=""
329requirements_public_libs_[]m4_defn([DOWN])=""
330requirements_cflags_[]m4_defn([DOWN])=""
331requirements_pc_[]m4_defn([DOWN])=""
332requirements_pc_deps_[]m4_defn([DOWN])=""
333
334m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}"
335m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS}"
336USE_[]m4_defn([UP])_LIBS="${USE_[]m4_defn([UP])_LIBS}"
337USE_[]m4_defn([UP])_INTERNAL_LIBS="${USE_[]m4_defn([UP])_INTERNAL_LIBS}"
338m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS}"
339m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
340
341AC_SUBST([requirements_libs_]m4_defn([DOWN]))dnl
342AC_SUBST([requirements_public_libs_]m4_defn([DOWN]))dnl
343AC_SUBST([requirements_cflags_]m4_defn([DOWN]))dnl
344AC_SUBST([requirements_pc_]m4_defn([DOWN]))dnl
345AC_SUBST(m4_defn([UP])[_LIBS])dnl
346AC_SUBST(m4_defn([UP])[_INTERNAL_LIBS])dnl
347AC_SUBST([USE_]m4_defn([UP])[_LIBS])dnl
348AC_SUBST([USE_]m4_defn([UP])[_INTERNAL_LIBS])dnl
349AC_SUBST(m4_defn([UP])[_LDFLAGS])dnl
350AC_SUBST(m4_defn([UP])[_CFLAGS])dnl
351AC_MSG_NOTICE([Start $1 checks])dnl
352m4_popdef([UP])dnl
353m4_popdef([DOWN])dnl
354])
355
356dnl EFL_LIB_END(PKG)
357dnl finishes the setup of an EFL library
358AC_DEFUN([EFL_LIB_END],
359[dnl
360m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
361m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
362
363libdirname="m4_defn([DOWN])"
364libname="m4_defn([DOWN])"
365
366m4_defn([UP])_LDFLAGS="${EFLALL_COV_LDFLAGS} ${EFLALL_LDFLAGS} ${m4_defn([UP])_LDFLAGS}"
367m4_defn([UP])_LIBS=" ${m4_defn([UP])_LDFLAGS} ${EFLALL_COV_LIBS} ${EFLALL_LIBS} ${m4_defn([UP])_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])} ${requirements_internal_deps_libs_[]m4_defn([DOWN])} ${requirements_public_libs_[]m4_defn([DOWN])} ${requirements_libs_[]m4_defn([DOWN])} ${requirements_libs_eflall} "
368m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])}"
369USE_[]m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} lib/${libdirname}/lib${libname}.la"
370USE_[]m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} lib/${libdirname}/lib${libname}.la"
371m4_defn([UP])_CFLAGS="${EFLALL_COV_CFLAGS} ${EFLALL_CFLAGS} ${m4_defn([UP])_CFLAGS} -I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} -I\$(top_srcdir)/src/bindings/${libdirname} -I\$(top_builddir)/src/bindings/${libdirname} ${requirements_cflags_[]m4_defn([DOWN])} ${requirements_cflags_eflall} -DEFL_[]m4_defn([UP])_BUILD=1"
372requirements_pc_[]m4_defn([DOWN])="${requirements_pc_[]m4_defn([DOWN])} ${requirements_pc_eflall}"
373requirements_pc_deps_[]m4_defn([DOWN])="${requirements_pc_deps_[]m4_defn([DOWN])} ${requirements_pc_deps_eflall}"
374
375AC_MSG_NOTICE([Finished $1 checks])dnl
376m4_popdef([UP])dnl
377m4_popdef([DOWN])dnl
378])
379
380dnl EFL_LIB_START_OPTIONAL(PKG, TEST)
381dnl test if library should be build and then EFL_LIB_START()
382dnl must call EFL_LIB_END_OPTIONAL() to close it.
383AC_DEFUN([EFL_LIB_START_OPTIONAL],
384[dnl
385m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
386m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
387
388if $2; then
389 efl_lib_optional_[]m4_defn([DOWN])="yes"
390else
391 efl_lib_optional_[]m4_defn([DOWN])="no"
392 AC_MSG_NOTICE([Skipping $1 checks (disabled)])
393fi
394
395if test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"; then
396 EFL_LIB_START([$1])
397 AC_DEFINE([HAVE_]m4_defn([UP]), [1], [optional EFL $1 is enabled])
398dnl closed at EFL_LIB_END_OPTIONAL()
399m4_popdef([UP])dnl
400m4_popdef([DOWN])dnl
401])
402
403dnl EFL_LIB_END_OPTIONAL(PKG)
404dnl closes block started by EFL_LIB_START_OPTIONAL() and then
405dnl defines AM_CONDITIONAL([HAVE_PKG]) and AC_DEFINE([HAVE_PKG])
406AC_DEFUN([EFL_LIB_END_OPTIONAL],
407[dnl
408m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
409m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
410
411dnl close if started at EFL_LIB_START_OPTIONAL()
412 EFL_LIB_END([$1])
413fi
414
415AM_CONDITIONAL([HAVE_]m4_defn([UP]), [test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"])dnl
416m4_popdef([UP])dnl
417m4_popdef([DOWN])dnl
418])
419
420dnl EFL_ADD_FEATURE(PKG, NAME, [VALUE])
421dnl if VALUE is not specified, will use ${have_name} instead.
422dnl
423dnl Defined Variables:
424dnl features_pkg
425AC_DEFUN([EFL_ADD_FEATURE],
426[dnl
427m4_pushdef([DOWNPKG], m4_translit([$1], [-A-Z], [_a-z]))dnl
428m4_pushdef([DOWNNAME], m4_translit([$2], [-A-Z], [_a-z]))dnl
429
430value="m4_if($3, , [${have_]m4_defn([DOWNNAME])[:-${want_]m4_defn([DOWNNAME])[}}], [$3])"
431case "${value}" in
432 yes)
433 tmp="${COLOR_YES}+$2${COLOR_RESET}"
434 ;;
435 no)
436 tmp="${COLOR_NO}-$2${COLOR_RESET}"
437 ;;
438 *)
439 tmp="${COLOR_OTHER}$2=${value}${COLOR_RESET}"
440 ;;
441esac
442if test -z "${features_[]m4_defn([DOWNPKG])}"; then
443 features_[]m4_defn([DOWNPKG])="${tmp}"
444else
445 features_[]m4_defn([DOWNPKG])="${features_[]m4_defn([DOWNPKG])} ${tmp}"
446fi
447m4_popdef([DOWNNAME])dnl
448m4_popdef([DOWNPKG])dnl
449])
diff --git a/m4/efl_binary.m4 b/m4/efl_binary.m4
new file mode 100644
index 0000000..d11e1db
--- /dev/null
+++ b/m4/efl_binary.m4
@@ -0,0 +1,42 @@
1dnl Usage: EFL_WITH_BIN_SUFFIX(package, binary, suffix)
2dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user)
3
4AC_DEFUN([EFL_WITH_BIN_SUFFIX],
5[
6
7m4_pushdef([DOWN], m4_translit([[$2]], [-A-Z], [_a-z]))dnl
8m4_pushdef([UP], m4_translit([[$2]], [-a-z], [_A-Z]))dnl
9dnl configure option
10
11_efl_with_binary=""
12_efl_binary_define="no"
13
14AC_ARG_WITH([$2],
15 [AC_HELP_STRING([--with-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=]DOWN[@:>@])],
16 [
17 _efl_with_binary=${withval}
18 _efl_binary_define="yes"
19 ], [])
20
21AC_ARG_WITH([bin-$2],
22 [AC_HELP_STRING([--with-bin-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=]DOWN[@:>@ DEPRECATED])],
23 [
24 _efl_with_binary=${withval}
25 _efl_binary_define="yes"
26 efl_deprecated_option="yes"
27 ], [])
28
29DOWN[]$3=${_efl_with_binary}
30AC_MSG_NOTICE(DOWN[ set to ${_efl_with_binary}])
31
32with_binary_[]m4_defn([DOWN])[]$3=${_efl_with_binary}
33
34AM_CONDITIONAL(HAVE_[]UP[]m4_translit([[$3]], [a-z], [A-Z]), [test "x${_efl_binary_define}" = "xyes"])
35AC_SUBST(DOWN[]$3)
36
37])
38
39dnl Usage: EFL_WITH_BIN(package, binary)
40dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user)
41
42AC_DEFUN([EFL_WITH_BIN], [EFL_WITH_BIN_SUFFIX([$1], [$2], [])])
diff --git a/m4/efl_compiler.m4 b/m4/efl_compiler.m4
new file mode 100644
index 0000000..32819f2
--- /dev/null
+++ b/m4/efl_compiler.m4
@@ -0,0 +1,90 @@
1dnl Copyright (C) 2012 Vincent Torri <vincent dot torri at gmail dot com>
2dnl This code is public domain and can be freely used or copied.
3
4dnl Macro that check if compiler of linker flags are available
5
6
7dnl Macro that checks for a compiler flag availability
8dnl
9dnl _EFL_CHECK_COMPILER_FLAGS(EFL, FLAGS)
10dnl AC_SUBST : EFL_CFLAGS (EFL being replaced by its value)
11dnl have_flag: yes or no.
12AC_DEFUN([_EFL_CHECK_COMPILER_FLAGS],
13[dnl
14m4_pushdef([UPEFL], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
15
16dnl store in options -Wfoo if -Wno-foo is passed
17option="m4_bpatsubst([[$2]], [-Wno-], [-W])"
18CFLAGS_save="${CFLAGS}"
19CFLAGS="${CFLAGS} ${option}"
20AC_LANG_PUSH([C])
21
22AC_MSG_CHECKING([whether the compiler supports $2])
23AC_COMPILE_IFELSE(
24 [AC_LANG_PROGRAM([[]])],
25 [have_flag="yes"],
26 [have_flag="no"])
27AC_MSG_RESULT([${have_flag}])
28
29AC_LANG_POP([C])
30CFLAGS="${CFLAGS_save}"
31if test "x${have_flag}" = "xyes" ; then
32 UPEFL[_CFLAGS]="${UPEFL[_CFLAGS]} [$2]"
33fi
34AC_SUBST(UPEFL[_CFLAGS])dnl
35m4_popdef([UPEFL])dnl
36])
37
38dnl EFL_CHECK_COMPILER_FLAGS(EFL, FLAGS)
39dnl Checks if FLAGS are supported and add to EFL_CLFAGS.
40dnl
41dnl It will first try every flag at once, if one fails will try them one by one.
42AC_DEFUN([EFL_CHECK_COMPILER_FLAGS],
43[dnl
44_EFL_CHECK_COMPILER_FLAGS([$1], [$2])
45if test "${have_flag}" != "yes"; then
46m4_foreach_w([flag], [$2], [_EFL_CHECK_COMPILER_FLAGS([$1], m4_defn([flag]))])
47fi
48])
49
50
51dnl Macro that checks for a linker flag availability
52dnl
53dnl _EFL_CHECK_LINKER_FLAGS(EFL, FLAGS)
54dnl AC_SUBST : EFL_LDFLAGS (EFL being replaced by its value)
55dnl have_flag: yes or no
56AC_DEFUN([_EFL_CHECK_LINKER_FLAGS],
57[dnl
58m4_pushdef([UPEFL], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
59
60LDFLAGS_save="${LDFLAGS}"
61LDFLAGS="${LDFLAGS} $2"
62AC_LANG_PUSH([C])
63
64AC_MSG_CHECKING([whether the linker supports $2])
65AC_LINK_IFELSE(
66 [AC_LANG_PROGRAM([[]])],
67 [have_flag="yes"],
68 [have_flag="no"])
69AC_MSG_RESULT([${have_flag}])
70
71AC_LANG_POP([C])
72LDFLAGS="${LDFLAGS_save}"
73if test "x${have_flag}" = "xyes" ; then
74 UPEFL[_LDFLAGS]="${UPEFL[_LDFLAGS]} [$2]"
75fi
76AC_SUBST(UPEFL[_LDFLAGS])dnl
77m4_popdef([UPEFL])dnl
78])
79
80dnl EFL_CHECK_LINKER_FLAGS(EFL, FLAGS)
81dnl Checks if FLAGS are supported and add to EFL_CLFAGS.
82dnl
83dnl It will first try every flag at once, if one fails will try them one by one.
84AC_DEFUN([EFL_CHECK_LINKER_FLAGS],
85[dnl
86_EFL_CHECK_LINKER_FLAGS([$1], [$2])
87if test "${have_flag}" != "yes"; then
88m4_foreach_w([flag], [$2], [_EFL_CHECK_LINKER_FLAGS([$1], m4_defn([flag]))])
89fi
90])dnl
diff --git a/m4/efl_doxygen.m4 b/m4/efl_doxygen.m4
new file mode 100644
index 0000000..0c1452f
--- /dev/null
+++ b/m4/efl_doxygen.m4
@@ -0,0 +1,98 @@
1dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if doxygen is available or not.
5
6dnl EFL_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Test for the doxygen program
8dnl Defines efl_doxygen
9dnl Defines the automake conditionnal EFL_BUILD_DOC
10dnl
11AC_DEFUN([EFL_CHECK_DOXYGEN],
12[
13
14dnl
15dnl Disable the build of the documentation
16dnl
17AC_ARG_ENABLE([doc],
18 [AC_HELP_STRING(
19 [--disable-doc],
20 [Disable documentation build @<:@default=enabled@:>@])],
21 [
22 if test "x${enableval}" = "xyes" ; then
23 efl_enable_doc="yes"
24 else
25 efl_enable_doc="no"
26 fi
27 ],
28 [efl_enable_doc="yes"]
29)
30
31if test "x${efl_enable_doc}" = "xyes" ; then
32
33dnl
34dnl Specify the full file name, with path
35dnl
36
37 efl_doxygen="doxygen"
38
39 AC_ARG_WITH([doxygen],
40 [AC_HELP_STRING(
41 [--with-doxygen=FILE],
42 [doxygen program to use @<:@default=doxygen@:>@])],
43dnl
44dnl Check the given doxygen program.
45dnl
46 [efl_doxygen=${withval}
47 AC_CHECK_PROG([efl_have_doxygen],
48 [${efl_doxygen}],
49 [yes],
50 [no])
51 if test "x${efl_have_doxygen}" = "xno" ; then
52 echo "WARNING:"
53 echo "The doxygen program you specified:"
54 echo "$efl_doxygen"
55 echo "was not found. Please check the path and make sure "
56 echo "the program exists and is executable."
57 AC_MSG_WARN([Warning: no doxygen detected. Documentation will not be built])
58 fi
59 ],
60 [AC_CHECK_PROG([efl_have_doxygen],
61 [${efl_doxygen}],
62 [yes],
63 [no])
64 if test "x${efl_have_doxygen}" = "xno" ; then
65 echo "WARNING:"
66 echo "The doxygen program was not found in your execute"
67 echo "You may have doxygen installed somewhere not covered by your path."
68 echo ""
69 echo "If this is the case make sure you have the packages installed, AND"
70 echo "that the doxygen program is in your execute path (see your"
71 echo "shell manual page on setting the \$PATH environment variable), OR"
72 echo "alternatively, specify the program to use with --with-doxygen."
73 AC_MSG_WARN([Warning: no doxygen detected. Documentation will not be built])
74 fi
75 ]
76 )
77fi
78
79dnl
80dnl Substitution
81dnl
82AC_SUBST([efl_doxygen])
83
84if ! test "x${efl_have_doxygen}" = "xyes" ; then
85 efl_enable_doc="no"
86fi
87
88AM_CONDITIONAL(EFL_BUILD_DOC, test "x${efl_enable_doc}" = "xyes")
89
90if test "x${efl_enable_doc}" = "xyes" ; then
91 ifelse([$1], , :, [$1])
92else
93 ifelse([$2], , :, [$2])
94fi
95
96])
97
98dnl End of doxygen.m4
diff --git a/soap_model-cxx.pc.in b/soap_model-cxx.pc.in
new file mode 100644
index 0000000..b1a3893
--- /dev/null
+++ b/soap_model-cxx.pc.in
@@ -0,0 +1,11 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: soap_model-cxx
7Description: Soap-Model convenience library for efl
8@pkgconfig_requires_private@: @requirement_soap_model@
9Version: @VERSION@
10Libs: -L${libdir} -lsoap_model
11Cflags: -I${includedir}/soap_model-cxx-@VMAJ@
diff --git a/soap_model.pc.in b/soap_model.pc.in
new file mode 100644
index 0000000..b79360d
--- /dev/null
+++ b/soap_model.pc.in
@@ -0,0 +1,11 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: soap_model
7Description: Soap-Model convenience library for efl
8@pkgconfig_requires_private@: @requirement_soap_model@
9Version: @VERSION@
10Libs: -L${libdir} -lsoap_model
11Cflags: -I${includedir}/soap_model-@VMAJ@
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
new file mode 100644
index 0000000..2edf5b5
--- /dev/null
+++ b/src/lib/Makefile.am
@@ -0,0 +1,84 @@
1pkginclude_HEADERS = src/lib/Soap_Model.h
2pkgincludedir = @includedir@/soap_model-@VMAJ@
3
4### eolian directives - begin
5SUFFIXES = .eo .eo.c .eo.h .eo.legacy.h
6
7EOLIAN_EOS_INCLUDE = $(datadir)/eolian/include
8
9%.eo.c: %.eo
10 $(EOLIAN_GEN) --eo --legacy `pkg-config --variable=eolian_flags eo emodel` --gc -I $(EOLIAN_EOS_INCLUDE)/emodel-1 -I $(EOLIAN_EOS_INCLUDE)/eflat_xml_model-1 -o $@ $< # temporary workaround for -I path
11
12%.eo.h: %.eo
13 $(EOLIAN_GEN) --eo `pkg-config --variable=eolian_flags eo emodel` --gh -I $(EOLIAN_EOS_INCLUDE)/emodel-1 -I $(EOLIAN_EOS_INCLUDE)/eflat_xml_model-1 -o $@ $<
14
15%.eo.legacy.h: %.eo
16 $(EOLIAN_GEN) --legacy `pkg-config --variable=eolian_flags eo emodel` --gh -I $(EOLIAN_EOS_INCLUDE)/emodel-1 -I $(EOLIAN_EOS_INCLUDE)/eflat_xml_model-1 -o $@ $<
17
18CLEANFILES += $(BUILT_SOURCES)
19
20soap_model_eolian_files = \
21 src/lib/soap_model.eo
22
23soap_model_eolian_c = $(soap_model_eolian_files:%.eo=%.eo.c)
24soap_model_eolian_h = $(soap_model_eolian_files:%.eo=%.eo.h)
25
26SOAP_MODEL_EO_GENERATED = \
27 $(soap_model_eolian_c) \
28 $(soap_model_eolian_h)
29
30BUILT_SOURCES = $(SOAP_MODEL_EO_GENERATED)
31
32soap_modeleolianfilesdir = $(datadir)/eolian/include/soap_model-@VMAJ@
33soap_modeleolianfiles_DATA = $(soap_model_eolian_files)
34
35EXTRA_DIST += $(soap_modeleolianfiles_DATA)
36
37installed_soap_modelmainheadersdir = $(includedir)/soap_model-@VMAJ@
38dist_installed_soap_modelmainheaders_DATA = src/lib/Soap_Model.h
39nodist_installed_soap_modelmainheaders_DATA = $(SOAP_MODEL_EO_GENERATED)
40### eolian directives - end
41
42
43lib_LTLIBRARIES = src/lib/libsoap_model.la
44
45src_lib_libsoap_model_la_CFLAGS = \
46$(MOD_CFLAGS)
47
48src_lib_libsoap_model_la_CPPFLAGS = -I$(top_builddir)/src/lib
49
50src_lib_libsoap_model_la_LIBADD = \
51@EFL_LIBS@
52
53src_lib_libsoap_model_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
54
55src_lib_libsoap_model_la_SOURCES = \
56src/lib/Soap_Model.h \
57src/lib/soap_model.c
58
59AM_V_EOLCXX = $(am__v_EOLCXX_@AM_V@)
60am__v_EOLCXX_ = $(am__v_EOLCXX_@AM_DEFAULT_V@)
61am__v_EOLCXX_0 = @echo " EOLCXX " $@;
62
63SUFFIXES += .eo.hh
64%.eo.hh: %.eo
65 $(AM_V_EOLCXX) $(EOLIAN_CXX) `pkg-config --variable=eolian_flags eo emodel` -I $(EOLIAN_EOS_INCLUDE)/emodel-1 -I $(EOLIAN_EOS_INCLUDE)/eflat_xml_model-1 -o $@ $<
66
67generated_soap_model_cxx_bindings = \
68src/lib/soap_model.eo.hh
69
70src/lib/Soap_Model.hh: $(generated_soap_model_cxx_bindings)
71 @echo @ECHO_E@ "#ifndef SOAP_model_CXX_MODEL_HH\n#define SOAP_model_CXX_MODEL_HH\n" > $(top_builddir)/src/lib/Soap_Model.hh
72 @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/Soap_Model.hh
73 @echo @ECHO_E@ "#include <Soap_Model.h>" >> $(top_builddir)/src/lib/Soap_Model.hh
74 @for i in $(generated_soap_model_cxx_bindings); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/Soap_Model.hh; done
75 @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/Soap_Model.hh
76
77generated_soap_model_cxx_all = $(generated_soap_model_cxx_bindings) \
78 src/lib/Soap_Model.hh
79
80CLEANFILES += \
81$(generated_soap_model_cxx_all)
82
83installed_soap_modelcxxmainheadersdir = $(includedir)/soap_model-cxx-@VMAJ@/
84nodist_installed_soap_modelcxxmainheaders_DATA = ${generated_soap_model_cxx_all}
diff --git a/src/lib/Soap_Model.h b/src/lib/Soap_Model.h
new file mode 100644
index 0000000..a8eccd8
--- /dev/null
+++ b/src/lib/Soap_Model.h
@@ -0,0 +1,30 @@
1#ifndef SOAP_H
2#define SOAP_H
3
4#include <Ecore.h>
5#include <Emodel.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11/**
12 * @brief Initialize soap.
13 *
14 * @return 1 or greater on success, 0 otherwise
15 */
16EAPI int soap_model_init(void);
17/**
18 * @brief Shutdown soap.
19 *
20 * @return 0 if e_dbus shuts down, greater than 0 otherwise.
21 */
22EAPI int soap_model_shutdown(void);
23
24#include <soap_model.eo.h>
25
26#ifdef __cplusplus
27}
28#endif
29
30#endif
diff --git a/src/lib/soap_model.c b/src/lib/soap_model.c
new file mode 100644
index 0000000..1dadcc7
--- /dev/null
+++ b/src/lib/soap_model.c
@@ -0,0 +1,451 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include "soap_model_private.h"
6
7#include <curl/curl.h>
8
9#include <stdbool.h>
10#include <stdint.h>
11#include <stdlib.h>
12
13#define MY_CLASS SOAP_MODEL_CLASS
14#define MY_CLASS_NAME "Soap_Model"
15
16typedef struct _Soap_Model_Perform_Data
17{
18 Soap_Model_Data *pd;
19 Eina_Strbuf *response;
20 struct curl_slist *header;
21 CURL *curl;
22 Ecore_Thread *thread;
23} Soap_Model_Perform_Data;
24
25static void _soap_model_properties_load(Soap_Model_Data *);
26static void _soap_model_children_load(Soap_Model_Data *);
27static bool _soap_model_init(Soap_Model_Data *);
28static void _soap_model_clear(Soap_Model_Data *);
29static void _soap_model_send(Soap_Model_Data *, const char *);
30static void _soap_model_perform_cb(Soap_Model_Perform_Data *, Ecore_Thread *);
31static void _soap_model_perform_end_cb(Soap_Model_Perform_Data *, Ecore_Thread *);
32static void _soap_model_perform_cancel_cb(Soap_Model_Perform_Data *, Ecore_Thread *);
33static Eina_Bool _soap_model_properties_changed_cb(void *, Eo *, const Eo_Event_Description *, void *);
34static size_t _soap_model_write_data_cb(void *, size_t, size_t, void *);
35static void _soap_model_perform_data_free(Soap_Model_Perform_Data *data);
36
37static int _soap_model_init_count = 0;
38int _soap_model_log_dom = -1;
39
40EAPI int
41soap_model_init(void)
42{
43 if (_soap_model_init_count++ > 0)
44 return _soap_model_init_count;
45
46 if (!eina_init())
47 {
48 fputs("Soap_Model: Unable to initialize eina\n", stderr);
49 return 0;
50 }
51
52 _soap_model_log_dom = eina_log_domain_register("soap_model", EINA_COLOR_CYAN);
53 if (_soap_model_log_dom < 0)
54 {
55 EINA_LOG_ERR("Unable to create an 'soap_model' log domain");
56 _soap_model_log_dom = -1;
57 eina_shutdown();
58 return 0;
59 }
60
61 if (!ecore_init())
62 {
63 ERR("Unable to initialize ecore");
64 goto on_error;
65 }
66
67 if (!eflat_xml_model_init())
68 {
69 ERR("Unable to initialize eflat_xml_model");
70 goto on_error;
71 }
72
73 CURLcode code = curl_global_init(CURL_GLOBAL_ALL);
74 if (CURLE_OK != code)
75 {
76 ERR("Unable to initialize curl");
77 goto on_error;
78 }
79
80 return _soap_model_init_count;
81
82on_error:
83 eina_log_domain_unregister(_soap_model_log_dom);
84 _soap_model_log_dom = -1;
85 eina_shutdown();
86 return 0;
87}
88
89EAPI int
90soap_model_shutdown(void)
91{
92 if (_soap_model_init_count <= 0)
93 {
94 ERR("Init count not greater than 0 in shutdown.");
95 _soap_model_init_count = 0;
96 return 0;
97 }
98
99 if (--_soap_model_init_count)
100 return _soap_model_init_count;
101
102 curl_global_cleanup();
103 eflat_xml_model_shutdown();
104 ecore_shutdown();
105 eina_log_domain_unregister(_soap_model_log_dom);
106 _soap_model_log_dom = -1;
107 eina_shutdown();
108 return 0;
109}
110
111static void
112_soap_model_eo_base_constructor(Eo *obj, Soap_Model_Data *pd)
113{
114 DBG("(%p)", obj);
115 eo_do_super(obj, MY_CLASS, eo_constructor());
116
117 pd->obj = obj;
118 pd->load.status = EMODEL_LOAD_STATUS_UNLOADED;
119 pd->children_list = NULL;
120 pd->xml = NULL;
121}
122
123static void
124_soap_model_constructor(Eo *obj EINA_UNUSED,
125 Soap_Model_Data *pd EINA_UNUSED)
126{
127 DBG("(%p)", obj);
128}
129
130static void
131_soap_model_eo_base_destructor(Eo *obj, Soap_Model_Data *pd)
132{
133 DBG("(%p)", obj);
134
135 _soap_model_clear(pd);
136
137 eo_do_super(obj, MY_CLASS, eo_destructor());
138}
139
140static Emodel_Load_Status
141_soap_model_emodel_properties_list_get(Eo *obj EINA_UNUSED,
142 Soap_Model_Data *pd,
143 Eina_Array * const* properties_array)
144{
145 DBG("(%p)", obj);
146 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EMODEL_LOAD_STATUS_ERROR);
147 EINA_SAFETY_ON_NULL_RETURN_VAL(pd->obj, EMODEL_LOAD_STATUS_ERROR);
148
149 eo_do(pd->xml, emodel_properties_list_get(properties_array));
150 return pd->load.status;
151}
152
153static void
154_soap_model_emodel_properties_load(Eo *obj, Soap_Model_Data *pd)
155{
156 DBG("(%p)", obj);
157
158 if (pd->load.status & EMODEL_LOAD_STATUS_LOADED_PROPERTIES)
159 return;
160
161 if (!_soap_model_init(pd))
162 return;
163
164 emodel_load_set(pd->obj, &pd->load, EMODEL_LOAD_STATUS_LOADING_PROPERTIES);
165
166 _soap_model_properties_load(pd);
167
168 emodel_load_set(pd->obj, &pd->load, EMODEL_LOAD_STATUS_LOADED_PROPERTIES);
169}
170
171static void
172_soap_model_properties_load(Soap_Model_Data *pd)
173{
174 DBG("(%p)", pd->obj);
175 eo_do(pd->xml, emodel_properties_load());
176}
177
178static Emodel_Load_Status
179_soap_model_emodel_property_set(Eo *obj,
180 Soap_Model_Data *pd,
181 const char *property,
182 Eina_Value value)
183{
184 Emodel_Load_Status status = eo_do(pd->xml,
185 emodel_property_set(property, value));
186 EINA_SAFETY_ON_FALSE_RETURN_VAL(status != EMODEL_LOAD_STATUS_ERROR, EMODEL_LOAD_STATUS_ERROR);
187 return pd->load.status;
188}
189
190static Emodel_Load_Status
191_soap_model_emodel_property_get(Eo *obj EINA_UNUSED,
192 Soap_Model_Data *pd,
193 const char *property,
194 Eina_Value *value)
195{
196 Emodel_Load_Status status = eo_do(pd->xml,
197 emodel_property_get(property, value));
198 EINA_SAFETY_ON_FALSE_RETURN_VAL(status != EMODEL_LOAD_STATUS_ERROR, EMODEL_LOAD_STATUS_ERROR);
199 return pd->load.status;
200}
201
202static void
203_soap_model_emodel_load(Eo *obj EINA_UNUSED, Soap_Model_Data *pd)
204{
205 DBG("(%p)", obj);
206
207 if ((pd->load.status & EMODEL_LOAD_STATUS_LOADED) == EMODEL_LOAD_STATUS_LOADED)
208 return;
209
210 if (!_soap_model_init(pd))
211 return;
212
213 if (!(pd->load.status & EMODEL_LOAD_STATUS_LOADED_PROPERTIES))
214 {
215 emodel_load_set(pd->obj, &pd->load, EMODEL_LOAD_STATUS_LOADING_PROPERTIES);
216 _soap_model_properties_load(pd);
217 }
218
219 if (!(pd->load.status & EMODEL_LOAD_STATUS_LOADED_CHILDREN))
220 {
221 emodel_load_set(pd->obj, &pd->load, EMODEL_LOAD_STATUS_LOADING_CHILDREN);
222 _soap_model_children_load(pd);
223 }
224
225 emodel_load_set(pd->obj, &pd->load, EMODEL_LOAD_STATUS_LOADED);
226}
227
228static Emodel_Load_Status
229_soap_model_emodel_load_status_get(Eo *obj EINA_UNUSED, Soap_Model_Data *pd)
230{
231 DBG("(%p)", obj);
232 return pd->load.status;
233}
234
235static void
236_soap_model_emodel_unload(Eo *obj EINA_UNUSED, Soap_Model_Data *pd)
237{
238 DBG("(%p)", obj);
239
240 _soap_model_clear(pd);
241
242 emodel_load_set(pd->obj, &pd->load, EMODEL_LOAD_STATUS_UNLOADED);
243}
244
245Eo *
246_soap_model_emodel_child_add(Eo *obj, Soap_Model_Data *pd EINA_UNUSED)
247{
248 DBG("(%p)", obj);
249 return NULL;
250}
251
252static Emodel_Load_Status
253_soap_model_emodel_child_del(Eo *obj,
254 Soap_Model_Data *pd EINA_UNUSED,
255 Eo *child EINA_UNUSED)
256{
257 DBG("(%p)", obj);
258 return EMODEL_LOAD_STATUS_ERROR;
259}
260
261static Emodel_Load_Status
262_soap_model_emodel_children_slice_get(Eo *obj EINA_UNUSED,
263 Soap_Model_Data *pd,
264 unsigned start EINA_UNUSED,
265 unsigned count EINA_UNUSED,
266 Eina_Accessor **children_accessor)
267{
268 DBG("(%p)", obj);
269
270 if (!(pd->load.status & EMODEL_LOAD_STATUS_LOADED_CHILDREN))
271 {
272 WRN("(%p): Children not loaded", obj);
273 *children_accessor = NULL;
274 return pd->load.status;
275 }
276
277 *children_accessor = emodel_list_slice(pd->children_list, start, count);
278 return pd->load.status;
279}
280
281static Emodel_Load_Status
282_soap_model_emodel_children_count_get(Eo *obj EINA_UNUSED,
283 Soap_Model_Data *pd,
284 unsigned *children_count)
285{
286 DBG("(%p)", obj);
287 *children_count = eina_list_count(pd->children_list);
288 return pd->load.status;
289}
290
291static void
292_soap_model_emodel_children_load(Eo *obj EINA_UNUSED, Soap_Model_Data *pd)
293{
294 DBG("(%p)", obj);
295
296 if (pd->load.status & EMODEL_LOAD_STATUS_LOADED_CHILDREN)
297 return;
298
299 if (!_soap_model_init(pd))
300 return;
301
302 emodel_load_set(pd->obj, &pd->load, EMODEL_LOAD_STATUS_LOADING_CHILDREN);
303
304 _soap_model_children_load(pd);
305
306 //emodel_load_set(pd->obj, &pd->load, EMODEL_LOAD_STATUS_LOADED_CHILDREN);
307}
308
309static void
310_soap_model_children_load(Soap_Model_Data *pd)
311{
312 DBG("(%p)", pd->obj);
313
314 Eina_Value xml_value;
315 Emodel_Load_Status status = eo_do(pd->xml, emodel_property_get("/", &xml_value));
316 EINA_SAFETY_ON_FALSE_RETURN(EMODEL_LOAD_STATUS_LOADED_PROPERTIES & status);
317
318 const char *xml = NULL;
319 eina_value_get(&xml_value, &xml);
320 _soap_model_send(pd, xml);
321 eina_value_flush(&xml_value);
322}
323
324static Eina_Bool
325_soap_model_properties_changed_cb(void *data,
326 Eo *child,
327 const Eo_Event_Description *desc EINA_UNUSED,
328 void *event_info)
329{
330 eo_do(data, eo_event_callback_call(EMODEL_EVENT_PROPERTIES_CHANGED, event_info));
331 return EO_CALLBACK_CONTINUE;
332}
333
334static bool
335_soap_model_init(Soap_Model_Data *pd)
336{
337 if (pd->xml)
338 return true;
339
340 pd->xml = eo_add(EFLAT_XML_MODEL_CLASS, NULL,
341 eflat_xml_model_constructor());
342
343 eo_do(pd->xml, eo_event_callback_add(EMODEL_EVENT_PROPERTIES_CHANGED,
344 _soap_model_properties_changed_cb,
345 pd->obj));
346 return true;
347}
348
349static void
350_soap_model_clear(Soap_Model_Data *pd)
351{
352 EINA_SAFETY_ON_NULL_RETURN(pd);
353
354 if (pd->xml)
355 {
356 eo_unref(pd->xml);
357 pd->xml = NULL;
358 }
359
360 Eo *child;
361 EINA_LIST_FREE(pd->children_list, child)
362 eo_del(child);
363}
364
365static size_t
366_soap_model_write_data_cb(void *ptr, size_t size, size_t nmeb, void *data)
367{
368 Eina_Strbuf *buf = (Eina_Strbuf *)data;
369 Eina_Bool ret = eina_strbuf_append_length(buf, ptr, size * nmeb);
370 EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, 0);
371 return size * nmeb;
372}
373
374static void
375_soap_model_send(Soap_Model_Data *pd, const char *xml)
376{
377 Soap_Model_Perform_Data *data = calloc(1, sizeof(Soap_Model_Perform_Data));
378 data->pd = pd;
379 data->response = eina_strbuf_new();
380
381 data->header = curl_slist_append(data->header, "Content-Type:application/soap+xml");
382 data->header = curl_slist_append(data->header, "SOAPAction:http://ws.apache.org/axis2/c/samples/echoString");
383 data->header = curl_slist_append(data->header, "Transfer-Encoding: chunked");
384 data->header = curl_slist_append(data->header, "Expect:");
385
386 data->curl = curl_easy_init();
387 EINA_SAFETY_ON_NULL_RETURN(data->curl);
388
389 curl_easy_setopt(data->curl, CURLOPT_URL, "http://127.0.0.1:9090/axis2/services/echo");
390 curl_easy_setopt(data->curl, CURLOPT_POST, 1L);
391 curl_easy_setopt(data->curl, CURLOPT_WRITEFUNCTION, _soap_model_write_data_cb);
392 curl_easy_setopt(data->curl, CURLOPT_WRITEDATA, data->response);
393 curl_easy_setopt(data->curl, CURLOPT_HTTPHEADER, data->header);
394 curl_easy_setopt(data->curl, CURLOPT_COPYPOSTFIELDS, xml);
395 curl_easy_setopt(data->curl, CURLOPT_VERBOSE, 1L);
396
397 data->thread = ecore_thread_run((Ecore_Thread_Cb)_soap_model_perform_cb,
398 (Ecore_Thread_Cb)_soap_model_perform_end_cb,
399 (Ecore_Thread_Cb)_soap_model_perform_cancel_cb, data);
400 EINA_SAFETY_ON_NULL_RETURN(data->thread);
401}
402
403static void
404_soap_model_perform_cb(Soap_Model_Perform_Data *data, Ecore_Thread *thread)
405{
406 CURLcode res = curl_easy_perform(data->curl);
407 if (CURLE_OK != res)
408 {
409 ERR("Could not perform: %d", res);
410 ecore_thread_cancel(thread);
411 return;
412 }
413}
414
415static void
416_soap_model_perform_end_cb(Soap_Model_Perform_Data *data,
417 Ecore_Thread *thread EINA_UNUSED)
418{
419 const char *response = eina_strbuf_string_get(data->response);
420
421 Eo *child = eo_add(EFLAT_XML_MODEL_CLASS, NULL,
422 eflat_xml_model_constructor());
423 data->pd->children_list = eina_list_append(data->pd->children_list, child);
424
425 unsigned int count = eina_list_count(data->pd->children_list);
426 Emodel_Children_Event evt = {.child = child, .index = count};
427 eo_do(data->pd->obj, eo_event_callback_call(EMODEL_EVENT_CHILD_ADDED, &evt),
428 eo_event_callback_call(EMODEL_EVENT_CHILDREN_COUNT_CHANGED, &count));
429
430 emodel_load_set(data->pd->obj, &data->pd->load, EMODEL_LOAD_STATUS_LOADED_CHILDREN);
431
432 _soap_model_perform_data_free(data);
433}
434
435static void
436_soap_model_perform_cancel_cb(Soap_Model_Perform_Data *data,
437 Ecore_Thread *thread EINA_UNUSED)
438{
439 emodel_error_notify(data->pd->obj);
440 _soap_model_perform_data_free(data);
441}
442
443static void
444_soap_model_perform_data_free(Soap_Model_Perform_Data *data)
445{
446 curl_easy_cleanup(data->curl);
447 eina_strbuf_free(data->response);
448 free(data);
449}
450
451#include "soap_model.eo.c"
diff --git a/src/lib/soap_model.eo b/src/lib/soap_model.eo
new file mode 100644
index 0000000..37105d4
--- /dev/null
+++ b/src/lib/soap_model.eo
@@ -0,0 +1,31 @@
1class Soap.Model (Eo.Base, Emodel) {
2 legacy_prefix: null;
3 methods {
4 constructor {
5 /*@
6 Custom Soap_Model constructor.
7 @def soap_model_constructor
8 @since 1.13
9 */
10 }
11 }
12 implements {
13 Eo.Base.constructor;
14 Eo.Base.destructor;
15 Emodel.properties_list.get;
16 Emodel.properties_load;
17 Emodel.property.set;
18 Emodel.property.get;
19 Emodel.load;
20 Emodel.load_status.get;
21 Emodel.unload;
22 Emodel.child_add;
23 Emodel.child_del;
24 Emodel.children_slice.get;
25 Emodel.children_count.get;
26 Emodel.children_load;
27 }
28 constructors {
29 .constructor;
30 }
31}
diff --git a/src/lib/soap_model_private.h b/src/lib/soap_model_private.h
new file mode 100644
index 0000000..db25bfd
--- /dev/null
+++ b/src/lib/soap_model_private.h
@@ -0,0 +1,36 @@
1#ifndef _SOAP_MODEL_PRIVATE_H
2#define _SOAP_MODEL_PRIVATE_H
3
4#include "Soap_Model.h"
5
6#include <EFlat_Xml_Model.h>
7
8#include <Eo.h>
9#include <Emodel.h>
10
11#include <stdbool.h>
12
13/* logging support */
14extern int _soap_model_log_dom;
15
16#define CRI(...) EINA_LOG_DOM_CRIT(_soap_model_log_dom, __VA_ARGS__)
17#define ERR(...) EINA_LOG_DOM_ERR(_soap_model_log_dom, __VA_ARGS__)
18#define WRN(...) EINA_LOG_DOM_WARN(_soap_model_log_dom, __VA_ARGS__)
19#define INF(...) EINA_LOG_DOM_INFO(_soap_model_log_dom, __VA_ARGS__)
20#define DBG(...) EINA_LOG_DOM_DBG(_soap_model_log_dom, __VA_ARGS__)
21
22typedef struct _Soap_Model_Data Soap_Model_Data;
23
24/**
25 * soap_model
26 */
27struct _Soap_Model_Data
28{
29 Eo *obj;
30 Emodel_Load load;
31 Eina_List *children_list;
32 EFlat_Xml_Model *xml;
33};
34
35#endif
36
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
new file mode 100644
index 0000000..b0d9554
--- /dev/null
+++ b/src/tests/Makefile.am
@@ -0,0 +1,11 @@
1check_PROGRAMS = \
2 src/tests/soap_model_suite
3TESTS = src/tests/soap_model_suite
4
5src_tests_soap_model_suite_SOURCES = \
6 src/tests/soap_model_suite.c \
7 src/tests/soap_model_test_soap_model.c
8src_tests_soap_model_suite_CFLAGS = $(MOD_CFLAGS) \
9 -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests\"
10src_tests_soap_model_suite_LDADD = $(MOD_LIBS) $(CHECK_LIBS)
11
diff --git a/src/tests/soap_model_suite.c b/src/tests/soap_model_suite.c
new file mode 100644
index 0000000..e4bf326
--- /dev/null
+++ b/src/tests/soap_model_suite.c
@@ -0,0 +1,121 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include "soap_model_suite.h"
6
7#include <Eina.h>
8
9#include <stdbool.h>
10#include <stdio.h>
11#include <stdlib.h>
12
13int _test_soap_model_log_dom = -1;
14
15typedef struct _Soap_Test_Case Soap_Test_Case;
16
17struct _Soap_Test_Case
18{
19 const char *test_case;
20 void (*build)(TCase *tc);
21};
22
23static const Soap_Test_Case etc[] = {
24 { "Soap_Model", soap_test_soap_model },
25 { NULL, NULL }
26};
27
28static void
29_list_tests(void)
30{
31 const Soap_Test_Case *it = etc;
32 fputs("Available Test Cases:\n", stderr);
33 for (; it->test_case; it++)
34 fprintf(stderr, "\t%s\n", it->test_case);
35}
36
37static bool
38_use_test(int argc, const char **argv, const char *test_case)
39{
40 if (argc < 1)
41 return true;
42
43 for (; argc > 0; argc--, argv++)
44 if (strcmp(test_case, *argv) == 0)
45 return true;
46 return false;
47}
48
49static Suite *
50_soap_suite_build(int argc, const char **argv)
51{
52 Suite *s = suite_create("Soap");
53
54 for (int i = 0; etc[i].test_case; ++i)
55 {
56 if (!_use_test(argc, argv, etc[i].test_case)) continue;
57 TCase *tc = tcase_create(etc[i].test_case);
58
59 etc[i].build(tc);
60
61 suite_add_tcase(s, tc);
62 //tcase_set_timeout(tc, 0);
63 }
64
65 return s;
66}
67
68static void
69_init_logging(void)
70{
71 _test_soap_model_log_dom = eina_log_domain_register("test_soap_model", EINA_COLOR_LIGHTBLUE);
72 if (_test_soap_model_log_dom < 0)
73 ck_abort_msg("Could not register log domain: test_soap_model");
74
75 //eina_log_domain_level_set("esskyuehl", EINA_LOG_LEVEL_DBG);
76 //eina_log_domain_level_set("soap_model", EINA_LOG_LEVEL_DBG);
77 eina_log_domain_level_set("test_soap_model", EINA_LOG_LEVEL_DBG);
78}
79
80static void
81_shutdown_logging(void)
82{
83 eina_log_domain_unregister(_test_soap_model_log_dom);
84 _test_soap_model_log_dom = -1;
85}
86
87int
88main(int argc, char **argv)
89{
90 for (int i = 1; i < argc; ++i)
91 {
92 if ((strcmp(argv[i], "-h") == 0) ||
93 (strcmp(argv[i], "--help") == 0))
94 {
95 fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n", argv[0]);
96 _list_tests();
97 return 0;
98 }
99 else if ((strcmp(argv[i], "-l") == 0) ||
100 (strcmp(argv[i], "--list") == 0))
101 {
102 _list_tests();
103 return 0;
104 }
105 }
106
107 _init_logging();
108
109 Suite *s = _soap_suite_build(argc - 1, (const char **)argv + 1);
110 SRunner *sr = srunner_create(s);
111
112 srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml");
113
114 srunner_run_all(sr, CK_ENV);
115 int failed_count = srunner_ntests_failed(sr);
116 srunner_free(sr);
117
118 _shutdown_logging();
119
120 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
121}
diff --git a/src/tests/soap_model_suite.h b/src/tests/soap_model_suite.h
new file mode 100644
index 0000000..1e82c9f
--- /dev/null
+++ b/src/tests/soap_model_suite.h
@@ -0,0 +1,16 @@
1#ifndef _SOAP_SUITE_H
2#define _SOAP_SUITE_H
3
4#include <check.h>
5
6extern int _test_soap_model_log_dom;
7
8#define CRI(...) EINA_LOG_DOM_CRIT(_test_soap_model_log_dom, __VA_ARGS__)
9#define ERR(...) EINA_LOG_DOM_ERR(_test_soap_model_log_dom, __VA_ARGS__)
10#define WRN(...) EINA_LOG_DOM_WARN(_test_soap_model_log_dom, __VA_ARGS__)
11#define INF(...) EINA_LOG_DOM_INFO(_test_soap_model_log_dom, __VA_ARGS__)
12#define DBG(...) EINA_LOG_DOM_DBG(_test_soap_model_log_dom, __VA_ARGS__)
13
14void soap_test_soap_model(TCase *tc);
15
16#endif
diff --git a/src/tests/soap_model_test_soap_model.c b/src/tests/soap_model_test_soap_model.c
new file mode 100644
index 0000000..798964d
--- /dev/null
+++ b/src/tests/soap_model_test_soap_model.c
@@ -0,0 +1,218 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include "soap_model_test_soap_model.h"
6#include "soap_model_suite.h"
7
8#include <Ecore.h>
9#include <Eina.h>
10#include <Soap_Model.h>
11
12#include <stdbool.h>
13
14static void
15_setup(void)
16{
17 int ret = soap_model_init();
18 ck_assert_int_ge(ret, 1);
19}
20
21static void
22_teardown(void)
23{
24 int ret = soap_model_shutdown();
25 ck_assert_int_eq(ret, 0);
26}
27
28static Eina_Bool
29_eo_event_load_status_cb(void *data, Eo *obj EINA_UNUSED,
30 const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
31{
32 Emodel_Load_Status expected_status = *((Emodel_Load_Status*)data);
33 Emodel_Load load = *((Emodel_Load*)event_info);
34 if ((load.status & expected_status) != expected_status)
35 return EINA_TRUE;
36
37 ecore_main_loop_quit();
38 return EINA_FALSE;
39}
40
41static void
42_wait_until_load_status(Emodel *emodel, Emodel_Load_Status expected_status)
43{
44 Emodel_Load_Status actual_status = eo_do(emodel, emodel_load_status_get());
45 if ((expected_status & actual_status) == expected_status) return;
46
47 eo_do(emodel, eo_event_callback_add(EMODEL_EVENT_LOAD_STATUS, _eo_event_load_status_cb, &expected_status));
48 ecore_main_loop_begin();
49 eo_do(emodel, eo_event_callback_del(EMODEL_EVENT_LOAD_STATUS, _eo_event_load_status_cb, &expected_status));
50}
51
52static void
53_check_value_type_cannot_have_children(Emodel *model)
54{
55 Emodel *child = eo_do(model, emodel_child_add());
56 ck_assert_ptr_eq(NULL, child);
57}
58
59static void
60_check_emodel_children_count_eq(Emodel *model, unsigned int expected_children_count)
61{
62 unsigned int actual_children_count = 0;
63 eo_do(model, emodel_children_count_get(&actual_children_count));
64 ck_assert_int_eq(expected_children_count, actual_children_count);
65}
66
67static void
68_check_emodel_property_int_eq(Emodel *emodel, const char *property, int64_t expected_value)
69{
70 Eina_Value value;
71 Emodel_Load_Status status = eo_do(emodel, emodel_property_get(property, &value));
72 ck_assert_int_eq(EMODEL_LOAD_STATUS_LOADED, status);
73
74 const Eina_Value_Type *property_type = eina_value_type_get(&value);
75 ck_assert_ptr_eq(EINA_VALUE_TYPE_INT64, property_type);
76
77 int64_t actual_value = 0;
78 eina_value_get(&value, &actual_value);
79 ck_assert_int_eq(expected_value, actual_value);
80
81 eina_value_flush(&value);
82}
83
84static void
85_check_emodel_property_str_eq(Emodel *emodel, const char *property, const char *expected_value)
86{
87 Eina_Value value;
88 Emodel_Load_Status status = eo_do(emodel, emodel_property_get(property, &value));
89 ck_assert_int_eq(EMODEL_LOAD_STATUS_LOADED, status);
90
91 const Eina_Value_Type *property_type = eina_value_type_get(&value);
92 fail_if(EINA_VALUE_TYPE_STRING != property_type && EINA_VALUE_TYPE_STRINGSHARE != property_type);
93
94 const char *actual_value = NULL;
95 eina_value_get(&value, &actual_value);
96 ck_assert_str_eq(expected_value, actual_value);
97
98 eina_value_flush(&value);
99}
100
101static Emodel *
102_emodel_nth_child_get(Emodel *emodel, unsigned int n)
103{
104 Eina_Accessor *accessor;
105 Emodel_Load_Status status = eo_do(emodel, emodel_children_slice_get(n, 1, &accessor));
106 ck_assert_int_eq(EMODEL_LOAD_STATUS_LOADED, status);
107 ck_assert_ptr_ne(NULL, accessor);
108 Emodel *child = NULL;
109 Eina_Bool ret = eina_accessor_data_get(accessor, 0, (void**)&child);
110 eina_accessor_free(accessor);
111 ck_assert(ret);
112 ck_assert_ptr_ne(NULL, child);
113 return child;
114}
115
116static void
117_check_emodel_load(Emodel *model)
118{
119 eo_do(model, emodel_load());
120 _wait_until_load_status(model, EMODEL_LOAD_STATUS_LOADED);
121}
122
123static void
124_check_emodel_properties(Emodel *model, const char *expected_properties[])
125{
126 Eina_Array *properties = NULL;
127 Emodel_Load_Status status = eo_do(model, emodel_properties_list_get(&properties));
128 ck_assert_int_eq(EMODEL_LOAD_STATUS_LOADED, status);
129 ck_assert_ptr_ne(NULL, properties);
130
131 unsigned int actual_properties_count = eina_array_count(properties);
132
133 unsigned int expected_properties_count = 0;
134 const char *expected_property = NULL;
135 while ((expected_property = *expected_properties++))
136 {
137 const char *actual_property = eina_array_data_get(properties,
138 expected_properties_count);
139 ck_assert_str_eq(expected_property, actual_property);
140 ++expected_properties_count;
141 ck_assert_int_le(expected_properties_count, actual_properties_count);
142 }
143
144 ck_assert_int_eq(expected_properties_count, actual_properties_count);
145}
146
147static void
148_check_properties_count_eq(Emodel *model, unsigned int expected_properties_count)
149{
150 Eina_Array *properties = NULL;
151 Emodel_Load_Status status = eo_do(model, emodel_properties_list_get(&properties));
152 ck_assert_int_ne(EMODEL_LOAD_STATUS_ERROR, status);
153 if (!expected_properties_count && !properties)
154 return;
155
156 ck_assert_ptr_ne(NULL, properties);
157
158 unsigned int actual_properties_count = eina_array_count(properties);
159 ck_assert_int_eq(expected_properties_count, actual_properties_count);
160}
161
162static Soap_Model *
163_create_soap_model()
164{
165 Emodel *soap = eo_add(SOAP_MODEL_CLASS, NULL,
166 soap_model_constructor());
167 ck_assert_ptr_ne(NULL, soap);
168 return soap;
169}
170
171START_TEST(smoke)
172{
173 Emodel *soap = _create_soap_model();
174 eo_unref(soap);
175}
176END_TEST
177
178static void
179_check_string_property_set(Emodel *model, const char *property, const char *v)
180{
181 Eina_Value value;
182 eina_value_setup(&value, EINA_VALUE_TYPE_STRING);
183 eina_value_set(&value, v);
184 Emodel_Load_Status status = eo_do(model, emodel_property_set(property, value));
185 eina_value_flush(&value);
186 ck_assert(EMODEL_LOAD_STATUS_LOADED_PROPERTIES & status);
187}
188
189START_TEST(load_children)
190{
191 Emodel *soap = _create_soap_model();
192
193 //_check_emodel_load(soap);
194 eo_do(soap, emodel_properties_load());
195 _wait_until_load_status(soap, EMODEL_LOAD_STATUS_LOADED_PROPERTIES);
196
197 _check_string_property_set(soap, "soap:Envelope@xmlns:soap", "http://www.w3.org/2003/05/soap-envelope");
198 _check_string_property_set(soap, "soap:Envelope@soap:encodingStyle", "http://www.w3.org/2001/12/soap-encoding");
199 _check_string_property_set(soap, "soap:Envelope/soap:Body/ns1:echoString@xmlns:ns1", "http://ws.apache.org/axis2/services/echo");
200 _check_string_property_set(soap, "soap:Envelope/soap:Body/ns1:echoString/ns1:text", "Hello World!");
201
202 // make the call loading the children
203 eo_do(soap, emodel_children_load());
204 _wait_until_load_status(soap, EMODEL_LOAD_STATUS_LOADED_CHILDREN);
205
206 // TODO: Check child for response
207
208 eo_unref(soap);
209}
210END_TEST
211
212void
213soap_test_soap_model(TCase *tc)
214{
215 tcase_add_checked_fixture(tc, _setup, _teardown);
216 tcase_add_test(tc, smoke);
217 tcase_add_test(tc, load_children);
218}
diff --git a/src/tests/soap_model_test_soap_model.h b/src/tests/soap_model_test_soap_model.h
new file mode 100644
index 0000000..6b4148a
--- /dev/null
+++ b/src/tests/soap_model_test_soap_model.h
@@ -0,0 +1,6 @@
1#ifndef _ESQL_TEST_SOAP_MODEL_H
2#define _ESQL_TEST_SOAP_MODEL_H
3
4#include <Soap_Model.h>
5
6#endif