File: group__Backend.html

package info (click to toggle)
qof 0.5.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,376 kB
  • ctags: 2,995
  • sloc: ansic: 14,210; sh: 7,273; makefile: 204; yacc: 184; lex: 123
file content (826 lines) | stat: -rw-r--r-- 45,136 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>QOF: Backend</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6-20040222 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>Backend<br>
<small>
[<a class="el" href="group__Object.html">Object: Dynamic Object Class Framework</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The QOF Backend is a pseudo-object providing an interface between the engine and a persistant data store (e.g. a server, a database, or a file). Backends are not meant to be used directly by an application; instead the Session should be used to make a connection with some particular backend. There are no backend functions that are 'public' to users of the engine. The backend can, however, report errors to the GUI &amp; other front-end users. This file defines these errors.<p>
Backends are used to save and restore Entities in a Book.<p>
The QOF Session encapsulates a connection to a storage backend. That is, it manages the connection to a persistant data store; whereas the backend is the thing that performs the actual datastore access.<p>
This class provides several important services:<p>
1) It resolves and loads the appropriate backend, based on the URL.<p>
2) It reports backend errors (e.g. network errors, storage corruption errors) through a single, backend-independent API.<p>
3) It reports non-error events received from the backend.<p>
4) It helps manage global dataset locks. For example, for the file backend, the lock prevents multiple users from editing the same file at the same time, thus avoiding lost data due to race conditions. Thus, an open session implies that the associated file is locked.<p>
5) Misc utilities, such as a search path for the file to be edited, and/or other URL resolution utilities. This should simplify install &amp; maintenance problems for naive users who may not have a good grasp on what a file system is, or where they want to keep their data files.<p>
6) In the future, this class is probably a good place to manage a portion of the user authentication process, and hold user credentials/cookies/keys/tokens. This is because at the coarsest level, authorization can happen at the datastore level: i.e. does this user even have the authority to connect to and open this datastore?<p>
A brief note about books &amp; sessions: A book encapsulates the datasets manipulated by GnuCash. A book holds the actual data. By contrast, the session mediates the connection between a book (the thing that lives in virtual memory in the local process) and the datastore (the place where book data lives permanently, e.g., file, database).<p>
In the current design, a session may hold multiple books. For now, exactly what this means is somewhat vague, and code in various places makes some implicit assumptions: first, only one book is 'current' and open for editing. Next, its assumed that all of the books in a session are related in some way. i.e. that they are all earlier accounting periods of the currently open book. In particular, the backends probably make that assumption, in order to store the different accounting periods in a clump so that one can be found, given another. 
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="qofbackend_8h.html">qofbackend.h</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">API for data storage Backend. <br><br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="qofsession_8h.html">qofsession.h</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Encapsulates a connection to a backend (persistent store). <br><br></td></tr>

<p>
<tr><td colspan=2><br><h2>Session Errors</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__Backend.html#ga28">QofBackendError</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga12">qof_session_get_error</a> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga13" doxytag="Backend::qof_session_get_error_message" ></a>
const char *&nbsp;</td><td class="memItemRight" valign=bottom><b>qof_session_get_error_message</b> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__Backend.html#ga28">QofBackendError</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga14">qof_session_pop_error</a> (QofSession *session)</td></tr>

<tr><td colspan=2><br><h2>Event Handling</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>gboolean&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga23">qof_session_events_pending</a> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>gboolean&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga24">qof_session_process_events</a> (QofSession *session)</td></tr>

<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="struct__QofBackend.html">_QofBackend</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga0">QofBackend</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pseudo-object providing an interface between the engine and a persistant data store (e.g. a server, a database, or a file).  <a href="#ga0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga1" doxytag="Backend::QofBePercentageFunc" ></a>
typedef void(*&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga1">QofBePercentageFunc</a> )(const char *message, double percent)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">DOCUMENT ME! <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga2" doxytag="Backend::QofSession" ></a>
typedef _QofSession&nbsp;</td><td class="memItemRight" valign=bottom><b>QofSession</b></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>typedef void(*&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga3">QofPercentageFunc</a> )(const char *message, double percent)</td></tr>

<tr><td colspan=2><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga28">QofBackendError</a> { <br>
&nbsp;&nbsp;<b>ERR_BACKEND_NO_ERR</b> =  0, 
<a class="el" href="group__Backend.html#gga28a3">ERR_BACKEND_NO_BACKEND</a>, 
<a class="el" href="group__Backend.html#gga28a4">ERR_BACKEND_BAD_URL</a>, 
<a class="el" href="group__Backend.html#gga28a5">ERR_BACKEND_NO_SUCH_DB</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a6">ERR_BACKEND_CANT_CONNECT</a>, 
<a class="el" href="group__Backend.html#gga28a7">ERR_BACKEND_CONN_LOST</a>, 
<a class="el" href="group__Backend.html#gga28a8">ERR_BACKEND_LOCKED</a>, 
<a class="el" href="group__Backend.html#gga28a9">ERR_BACKEND_READONLY</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a10">ERR_BACKEND_TOO_NEW</a>, 
<a class="el" href="group__Backend.html#gga28a11">ERR_BACKEND_DATA_CORRUPT</a>, 
<a class="el" href="group__Backend.html#gga28a12">ERR_BACKEND_SERVER_ERR</a>, 
<a class="el" href="group__Backend.html#gga28a13">ERR_BACKEND_ALLOC</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a14">ERR_BACKEND_PERM</a>, 
<a class="el" href="group__Backend.html#gga28a15">ERR_BACKEND_MODIFIED</a>, 
<a class="el" href="group__Backend.html#gga28a16">ERR_BACKEND_MOD_DESTROY</a>, 
<a class="el" href="group__Backend.html#gga28a17">ERR_BACKEND_MISC</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a18">ERR_FILEIO_FILE_BAD_READ</a> =  1000, 
<a class="el" href="group__Backend.html#gga28a19">ERR_FILEIO_FILE_EMPTY</a>, 
<a class="el" href="group__Backend.html#gga28a20">ERR_FILEIO_FILE_LOCKERR</a>, 
<a class="el" href="group__Backend.html#gga28a21">ERR_FILEIO_FILE_NOT_FOUND</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a22">ERR_FILEIO_FILE_TOO_OLD</a>, 
<a class="el" href="group__Backend.html#gga28a23">ERR_FILEIO_UNKNOWN_FILE_TYPE</a>, 
<a class="el" href="group__Backend.html#gga28a24">ERR_FILEIO_PARSE_ERROR</a>, 
<a class="el" href="group__Backend.html#gga28a25">ERR_FILEIO_BACKUP_ERROR</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a26">ERR_NETIO_SHORT_READ</a> =  2000, 
<a class="el" href="group__Backend.html#gga28a27">ERR_NETIO_WRONG_CONTENT_TYPE</a>, 
<a class="el" href="group__Backend.html#gga28a28">ERR_NETIO_NOT_GNCXML</a>, 
<a class="el" href="group__Backend.html#gga28a29">ERR_SQL_MISSING_DATA</a> =  3000, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a30">ERR_SQL_DB_TOO_OLD</a>, 
<a class="el" href="group__Backend.html#gga28a31">ERR_SQL_DB_BUSY</a>, 
<a class="el" href="group__Backend.html#gga28a32">ERR_RPC_HOST_UNK</a> =  4000, 
<a class="el" href="group__Backend.html#gga28a33">ERR_RPC_CANT_BIND</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a34">ERR_RPC_CANT_ACCEPT</a>, 
<a class="el" href="group__Backend.html#gga28a35">ERR_RPC_NO_CONNECTION</a>, 
<a class="el" href="group__Backend.html#gga28a36">ERR_RPC_BAD_VERSION</a>, 
<a class="el" href="group__Backend.html#gga28a37">ERR_RPC_FAILED</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="group__Backend.html#gga28a38">ERR_RPC_NOT_ADDED</a>
<br>
 }</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The errors that can be reported to the GUI &amp; other front-end users.  <a href="#ga28">More...</a><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga4" doxytag="Backend::qof_session_new" ></a>
QofSession *&nbsp;</td><td class="memItemRight" valign=bottom><b>qof_session_new</b> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga5" doxytag="Backend::qof_session_destroy" ></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><b>qof_session_destroy</b> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga6" doxytag="Backend::qof_session_get_current_session" ></a>
QofSession *&nbsp;</td><td class="memItemRight" valign=bottom><b>qof_session_get_current_session</b> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga7" doxytag="Backend::qof_session_set_current_session" ></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><b>qof_session_set_current_session</b> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga8">qof_session_swap_data</a> (QofSession *session_1, QofSession *session_2)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga9">qof_session_begin</a> (QofSession *session, const char *book_id, gboolean ignore_lock, gboolean create_if_nonexistent)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga10" doxytag="Backend::qof_session_load" ></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><b>qof_session_load</b> (QofSession *session, <a class="el" href="group__Backend.html#ga3">QofPercentageFunc</a> percentage_func)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>gboolean&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga11">qof_session_export</a> (QofSession *tmp_session, QofSession *real_session, <a class="el" href="group__Backend.html#ga3">QofPercentageFunc</a> percentage_func)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga15">qof_session_add_book</a> (QofSession *session, <a class="el" href="struct__QofBook.html">QofBook</a> *book)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga16" doxytag="Backend::qof_session_get_book" ></a>
<a class="el" href="struct__QofBook.html">QofBook</a> *&nbsp;</td><td class="memItemRight" valign=bottom><b>qof_session_get_book</b> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>const char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga17">qof_session_get_file_path</a> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga18" doxytag="Backend::qof_session_get_url" ></a>
const char *&nbsp;</td><td class="memItemRight" valign=bottom><b>qof_session_get_url</b> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>gboolean&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga19">qof_session_not_saved</a> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>gboolean&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga20">qof_session_save_may_clobber_data</a> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga21">qof_session_save</a> (QofSession *session, <a class="el" href="group__Backend.html#ga3">QofPercentageFunc</a> percentage_func)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga22">qof_session_end</a> (QofSession *session)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga25">xaccResolveFilePath</a> (const char *filefrag)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga26" doxytag="Backend::xaccResolveURL" ></a>
char *&nbsp;</td><td class="memItemRight" valign=bottom><b>xaccResolveURL</b> (const char *pathfrag)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group__Backend.html#ga27">gnc_run_rpc_server</a> (void)</td></tr>

</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga0" doxytag="qofbackend.h::QofBackend" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> typedef struct <a class="el" href="struct__QofBackend.html">_QofBackend</a> <a class="el" href="struct__QofBackend.html">QofBackend</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Pseudo-object providing an interface between the engine and a persistant data store (e.g. a server, a database, or a file). 
<p>
There are no backend functions that are 'public' to users of the engine. The backend can, however, report errors to the GUI &amp; other front-end users.     </td>
  </tr>
</table>
<a class="anchor" name="ga3" doxytag="qofsession.h::QofPercentageFunc" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> typedef void(* <a class="el" href="group__Backend.html#ga3">QofPercentageFunc</a>)(const char *message, double percent)
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The qof_session_load() method causes the QofBook to be made ready to to use with this URL/datastore. When the URL points at a file, then this routine would load the data from the file. With remote backends, e.g. network or SQL, this would load only enough data to make the book actually usable; it would not cause *all* of the data to be loaded.     </td>
  </tr>
</table>
<hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="ga28" doxytag="qofbackend.h::QofBackendError" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> enum <a class="el" href="group__Backend.html#ga28">QofBackendError</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The errors that can be reported to the GUI &amp; other front-end users. 
<p>
<dl compact><dt><b>Warning:</b></dt><dd>If you modify QofBackendError, please update src/engine/gw-engine-spec.scm </dd></dl>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="gga28a3" doxytag="ERR_BACKEND_NO_BACKEND" ></a>ERR_BACKEND_NO_BACKEND</em>&nbsp;</td><td>
Backend * pointer was null the err routine or no backend handler (ENOSYS) </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a4" doxytag="ERR_BACKEND_BAD_URL" ></a>ERR_BACKEND_BAD_URL</em>&nbsp;</td><td>
Can't parse url </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a5" doxytag="ERR_BACKEND_NO_SUCH_DB" ></a>ERR_BACKEND_NO_SUCH_DB</em>&nbsp;</td><td>
the named database doesn't exist </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a6" doxytag="ERR_BACKEND_CANT_CONNECT" ></a>ERR_BACKEND_CANT_CONNECT</em>&nbsp;</td><td>
bad dbname/login/passwd or network failure </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a7" doxytag="ERR_BACKEND_CONN_LOST" ></a>ERR_BACKEND_CONN_LOST</em>&nbsp;</td><td>
Lost connection to server </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a8" doxytag="ERR_BACKEND_LOCKED" ></a>ERR_BACKEND_LOCKED</em>&nbsp;</td><td>
in use by another user (ETXTBSY) </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a9" doxytag="ERR_BACKEND_READONLY" ></a>ERR_BACKEND_READONLY</em>&nbsp;</td><td>
cannot write to file/directory </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a10" doxytag="ERR_BACKEND_TOO_NEW" ></a>ERR_BACKEND_TOO_NEW</em>&nbsp;</td><td>
file/db version newer than what we can read </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a11" doxytag="ERR_BACKEND_DATA_CORRUPT" ></a>ERR_BACKEND_DATA_CORRUPT</em>&nbsp;</td><td>
data in db is corrupt </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a12" doxytag="ERR_BACKEND_SERVER_ERR" ></a>ERR_BACKEND_SERVER_ERR</em>&nbsp;</td><td>
error in response from server </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a13" doxytag="ERR_BACKEND_ALLOC" ></a>ERR_BACKEND_ALLOC</em>&nbsp;</td><td>
internal memory allocation failure </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a14" doxytag="ERR_BACKEND_PERM" ></a>ERR_BACKEND_PERM</em>&nbsp;</td><td>
user login successful, but no permissions to access the desired object </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a15" doxytag="ERR_BACKEND_MODIFIED" ></a>ERR_BACKEND_MODIFIED</em>&nbsp;</td><td>
commit of object update failed because another user has modified the object </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a16" doxytag="ERR_BACKEND_MOD_DESTROY" ></a>ERR_BACKEND_MOD_DESTROY</em>&nbsp;</td><td>
commit of object update failed because another user has deleted the object </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a17" doxytag="ERR_BACKEND_MISC" ></a>ERR_BACKEND_MISC</em>&nbsp;</td><td>
undetermined error </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a18" doxytag="ERR_FILEIO_FILE_BAD_READ" ></a>ERR_FILEIO_FILE_BAD_READ</em>&nbsp;</td><td>
read failed or file prematurely truncated </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a19" doxytag="ERR_FILEIO_FILE_EMPTY" ></a>ERR_FILEIO_FILE_EMPTY</em>&nbsp;</td><td>
file exists, is readable, but is empty </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a20" doxytag="ERR_FILEIO_FILE_LOCKERR" ></a>ERR_FILEIO_FILE_LOCKERR</em>&nbsp;</td><td>
mangled locks (unspecified error) </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a21" doxytag="ERR_FILEIO_FILE_NOT_FOUND" ></a>ERR_FILEIO_FILE_NOT_FOUND</em>&nbsp;</td><td>
not found / no such file </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a22" doxytag="ERR_FILEIO_FILE_TOO_OLD" ></a>ERR_FILEIO_FILE_TOO_OLD</em>&nbsp;</td><td>
file version so old we can't read it </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a23" doxytag="ERR_FILEIO_UNKNOWN_FILE_TYPE" ></a>ERR_FILEIO_UNKNOWN_FILE_TYPE</em>&nbsp;</td><td>
didn't recognize the file type </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a24" doxytag="ERR_FILEIO_PARSE_ERROR" ></a>ERR_FILEIO_PARSE_ERROR</em>&nbsp;</td><td>
couldn't parse the data in the file </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a25" doxytag="ERR_FILEIO_BACKUP_ERROR" ></a>ERR_FILEIO_BACKUP_ERROR</em>&nbsp;</td><td>
couldn't make a backup of the file </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a26" doxytag="ERR_NETIO_SHORT_READ" ></a>ERR_NETIO_SHORT_READ</em>&nbsp;</td><td>
not enough bytes received </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a27" doxytag="ERR_NETIO_WRONG_CONTENT_TYPE" ></a>ERR_NETIO_WRONG_CONTENT_TYPE</em>&nbsp;</td><td>
wrong kind of server, wrong data served </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a28" doxytag="ERR_NETIO_NOT_GNCXML" ></a>ERR_NETIO_NOT_GNCXML</em>&nbsp;</td><td>
whatever it is, we can't parse it. </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a29" doxytag="ERR_SQL_MISSING_DATA" ></a>ERR_SQL_MISSING_DATA</em>&nbsp;</td><td>
database doesn't contain expected data </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a30" doxytag="ERR_SQL_DB_TOO_OLD" ></a>ERR_SQL_DB_TOO_OLD</em>&nbsp;</td><td>
database is old and needs upgrading </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a31" doxytag="ERR_SQL_DB_BUSY" ></a>ERR_SQL_DB_BUSY</em>&nbsp;</td><td>
database is busy, cannot upgrade version </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a32" doxytag="ERR_RPC_HOST_UNK" ></a>ERR_RPC_HOST_UNK</em>&nbsp;</td><td>
Host unknown </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a33" doxytag="ERR_RPC_CANT_BIND" ></a>ERR_RPC_CANT_BIND</em>&nbsp;</td><td>
can't bind to address </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a34" doxytag="ERR_RPC_CANT_ACCEPT" ></a>ERR_RPC_CANT_ACCEPT</em>&nbsp;</td><td>
can't accept connection </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a35" doxytag="ERR_RPC_NO_CONNECTION" ></a>ERR_RPC_NO_CONNECTION</em>&nbsp;</td><td>
no connection to server </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a36" doxytag="ERR_RPC_BAD_VERSION" ></a>ERR_RPC_BAD_VERSION</em>&nbsp;</td><td>
RPC Version Mismatch </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a37" doxytag="ERR_RPC_FAILED" ></a>ERR_RPC_FAILED</em>&nbsp;</td><td>
Operation failed </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga28a38" doxytag="ERR_RPC_NOT_ADDED" ></a>ERR_RPC_NOT_ADDED</em>&nbsp;</td><td>
object not added </td></tr>
</table>
</dl>
    </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga27" doxytag="qofsession.h::gnc_run_rpc_server" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void gnc_run_rpc_server </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Run the RPC Server <dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>will go away</dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga15" doxytag="qofsession.h::qof_session_add_book" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void qof_session_add_book </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname" nowrap> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="struct__QofBook.html">QofBook</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>book</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga18">qof_session_add_book()</a> allows additional books to be added to a session. XXX Under construction, clarify the following when done: XXX There must already be an open book in the session already!? XXX Only one open bok at a time per session is alowed!? XXX each book gets its own unique backend ???     </td>
  </tr>
</table>
<a class="anchor" name="ga9" doxytag="qofsession.h::qof_session_begin" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void qof_session_begin </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname" nowrap> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>book_id</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>gboolean&nbsp;</td>
          <td class="mdname" nowrap> <em>ignore_lock</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>gboolean&nbsp;</td>
          <td class="mdname" nowrap> <em>create_if_nonexistent</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The qof_session_begin () method begins a new session. It takes as an argument the book id. The book id must be a string in the form of a URI/URL. In the current implementation, the following URL's are supported -- File URI of the form "file:/home/somewhere/somedir/file.xac" The path part must be a valid path. The file-part must be a valid old-style-xacc or new-style-gnucash-format file. Paths may be relative or absolute. If the path is relative; that is, if the argument is "file:somefile.xac" then a sequence of search paths are checked for a file of this name.<p>
-- Postgres URI of the form "postgres://hostname.com/dbname" See the src/backend/postgres subdirectory for more info.<p>
-- RPC URI of the form rpc://hostname.com/rpcserver.<p>
The 'ignore_lock' argument, if set to TRUE, will cause this routine to ignore any global-datastore locks (e.g. file locks) that it finds. If set to FALSE, then file/database-global locks will be tested and obeyed.<p>
If the datastore exists, can be reached (e.g over the net), connected to, opened and read, and a lock can be obtained then a lock will be obtained. Note that multi-user datastores (e.g. the SQL backend) typically will not need to get a global lock, and thus, the user will not be locked out. That's the whole point of 'multi-user'.<p>
If the file/database doesn't exist, and the create_if_nonexistent flag is set to TRUE, then the database is created.<p>
If an error occurs, it will be pushed onto the session error stack, and that is where it should be examined.     </td>
  </tr>
</table>
<a class="anchor" name="ga22" doxytag="qofsession.h::qof_session_end" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void qof_session_end </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>session</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga31">qof_session_end()</a> method will release the session lock. For the file backend, it will *not* save the account group to a file. Thus, this method acts as an "abort" or "rollback" primitive. However, for other backends, such as the sql backend, the data would have been written out before this, and so this routines wouldn't roll-back anything; it would just shut the connection.     </td>
  </tr>
</table>
<a class="anchor" name="ga23" doxytag="qofsession.h::qof_session_events_pending" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> gboolean qof_session_events_pending </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>session</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga34">qof_session_events_pending()</a> method will return TRUE if the backend has pending events which must be processed to bring the engine up to date with the backend.     </td>
  </tr>
</table>
<a class="anchor" name="ga11" doxytag="qofsession.h::qof_session_export" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> gboolean qof_session_export </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname" nowrap> <em>tmp_session</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>QofSession *&nbsp;</td>
          <td class="mdname" nowrap> <em>real_session</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group__Backend.html#ga3">QofPercentageFunc</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>percentage_func</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
XXX session_export really doesn't belong here     </td>
  </tr>
</table>
<a class="anchor" name="ga12" doxytag="qofsession.h::qof_session_get_error" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group__Backend.html#ga28">QofBackendError</a> qof_session_get_error </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>session</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga9">qof_session_get_error()</a> routine can be used to obtain the reason for any failure. Calling this routine returns the current error.     </td>
  </tr>
</table>
<a class="anchor" name="ga17" doxytag="qofsession.h::qof_session_get_file_path" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> const char* qof_session_get_file_path </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>session</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga20">qof_session_get_file_path()</a> routine returns the fully-qualified file path for the session. That is, if a relative or partial filename was for the session, then it had to have been fully resolved to open the session. This routine returns the result of this resolution. The path is always guarenteed to reside in the local file system, even if the session itself was opened as a URL. (currently, the filepath is derived from the url by substituting commas for slashes).<p>
The qof_session_get_url() routine returns the url that was opened. URL's for local files take the form of <a href="file:/some/where/some/file.gml">file:/some/where/some/file.gml</a>     </td>
  </tr>
</table>
<a class="anchor" name="ga19" doxytag="qofsession.h::qof_session_not_saved" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> gboolean qof_session_not_saved </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>session</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga19">qof_session_not_saved()</a> subroutine will return TRUE if any data in the session hasn't been saved to long-term storage.     </td>
  </tr>
</table>
<a class="anchor" name="ga14" doxytag="qofsession.h::qof_session_pop_error" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group__Backend.html#ga28">QofBackendError</a> qof_session_pop_error </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>session</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga12">qof_session_pop_error()</a> routine can be used to obtain the reason for any failure. Calling this routine resets the error value.<p>
This routine allows an implementation of multiple error values, e.g. in a stack, where this routine pops the top value. The current implementation has a stack that is one-deep.<p>
See <a class="el" href="qofbackend_8h.html">qofbackend.h</a> for a listing of returned errors.     </td>
  </tr>
</table>
<a class="anchor" name="ga24" doxytag="qofsession.h::qof_session_process_events" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> gboolean qof_session_process_events </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>session</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga35">qof_session_process_events()</a> method will process any events indicated by the <a class="el" href="group__Backend.html#ga34">qof_session_events_pending()</a> method. It returns TRUE if the engine was modified while engine events were suspended.     </td>
  </tr>
</table>
<a class="anchor" name="ga21" doxytag="qofsession.h::qof_session_save" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void qof_session_save </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname" nowrap> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group__Backend.html#ga3">QofPercentageFunc</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>percentage_func</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga29">qof_session_save()</a> method will commit all changes that have been made to the session. For the file backend, this is nothing more than a write to the file of the current AccountGroup &amp; etc. For the SQL backend, this is typically a no-op (since all data has already been written out to the database.     </td>
  </tr>
</table>
<a class="anchor" name="ga20" doxytag="qofsession.h::qof_session_save_may_clobber_data" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> gboolean qof_session_save_may_clobber_data </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>session</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
FIXME: This isn't as thorough as we might want it to be...     </td>
  </tr>
</table>
<a class="anchor" name="ga8" doxytag="qofsession.h::qof_session_swap_data" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void qof_session_swap_data </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QofSession *&nbsp;</td>
          <td class="mdname" nowrap> <em>session_1</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>QofSession *&nbsp;</td>
          <td class="mdname" nowrap> <em>session_2</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The qof_session_swap_data () method swaps the book of the two given sessions. It is useful for 'Save As' type functionality.     </td>
  </tr>
</table>
<a class="anchor" name="ga25" doxytag="qofsession.h::xaccResolveFilePath" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char* xaccResolveFilePath </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const char *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>filefrag</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__Backend.html#ga41">xaccResolveFilePath()</a> routine is a utility that will accept a fragmentary filename as input, and resolve it into a fully qualified path in the file system, i.e. a path that begins with a leading slash. First, the current working directory is searched for the file. Next, the directory $HOME/.gnucash/data, and finally, a list of other (configurable) paths. If the file is not found, then the path $HOME/.gnucash/data is used. If $HOME is not defined, then the current working directory is used.     </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun May 23 15:41:48 2004 for QOF by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.6-20040222 </small></address>
</body>
</html>