00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 #include "udanax.h"
00091
00092 bool getspecset(Session * sess, typespecset * specsetptr);
00093 void prompt(Session * sess, char *string);
00094 bool getisa(Session * sess, IStreamAddr * isaptr);
00095 bool getvsa(Session * sess, Tumbler * vsaptr);
00096 bool gettextset(Session * sess, typetextset * textsetptr);
00097 bool getnumber(Session * sess, int * numptr);
00098 bool getcutseq(Session * sess, typecutseq * cutseqptr);
00099 bool getspanset(Session * sess, typespanset * spansetptr, typeitemid id);
00100 bool getspan(Session * sess, typespan * spanptr, typeitemid id);
00101 bool gettumbler(Session * sess, Tumbler * tumblerptr);
00102 bool validaccount(Session * sess, IStreamAddr * accountptr);
00103
00111 bool
00112 getfinddocscontaining(
00113 Session *sess,
00114 typespecset *specsetptr)
00115 {
00116 return getspecset(sess, specsetptr);
00117 }
00118
00126 bool
00127 getcopy(
00128 Session *sess,
00129 IStreamAddr *docisaptr,
00130 IStreamAddr *vsaptr,
00131 typespecset *localspecsetptr)
00132 {
00133 prompt(sess, "copy to this document=> ");
00134 if (!getisa(sess, docisaptr))
00135 return false;
00136
00137 prompt(sess, "at this address=> ");
00138 if (!(getvsa(sess, vsaptr) && getspecset(sess, localspecsetptr)))
00139 return false;
00140
00141 return true;
00142 }
00143
00151 bool
00152 getinsert(
00153 Session *sess,
00154 IStreamAddr *docisaptr,
00155 Tumbler *vsaptr,
00156 typetextset *textsetptr)
00157 {
00158 prompt(sess, "text=>\n\n");
00159 if (!gettextset(sess, textsetptr))
00160 return false;
00161
00162 prompt(sess, "document=> ");
00163 if (!getisa(sess, docisaptr))
00164 return false;
00165
00166 prompt(sess, "address=> ");
00167 if (!getvsa(sess, vsaptr))
00168 return false;
00169
00170 return true;
00171 }
00172
00180 bool
00181 getcreatelink(
00182 Session *sess,
00183 IStreamAddr *docisaptr,
00184 typespecset *fromspecsetptr,
00185 typespecset *tospecsetptr,
00186 typespecset *threespecsetptr)
00187 {
00188 prompt(sess, "home document=> ");
00189 if (!getisa(sess, docisaptr))
00190 return false;
00191
00192 prompt(sess, "fromset\n");
00193 if (!getspecset(sess, fromspecsetptr))
00194 return false;
00195
00196 prompt(sess, "toset\n");
00197 if (!getspecset(sess, tospecsetptr))
00198 return false;
00199
00200 prompt(sess, "threeset\n");
00201 if (!getspecset(sess, threespecsetptr))
00202 return false;
00203
00204 return true;
00205 }
00206
00214 bool
00215 getfollowlink(
00216 Session *sess,
00217 IStreamAddr *linkisaptr,
00218 int *whichendptr)
00219 {
00220 prompt(sess, "enter link=> ");
00221 if (!getisa(sess, linkisaptr))
00222 return false;
00223
00224 prompt(sess, "enter endset=> ");
00225 if (!(getnumber(sess, whichendptr) && (*whichendptr == 1 || *whichendptr == 2 || *whichendptr == 3)))
00226 return false;
00227
00228 return true;
00229 }
00230
00238 bool
00239 getcreatenewversion(
00240 Session *sess,
00241 IStreamAddr *docisaptr)
00242 {
00243 prompt(sess, "enter document=> ");
00244 return getisa(sess, docisaptr);
00245 }
00246
00254 bool
00255 getretrievedocvspanset(
00256 Session *sess,
00257 IStreamAddr *docisaptr)
00258 {
00259 prompt(sess, "enter document=> ");
00260 return getisa(sess, docisaptr);
00261 }
00262
00270 bool
00271 getretrievedocvspan(
00272 Session *sess,
00273 IStreamAddr *docisaptr)
00274 {
00275 prompt(sess, "enter document=> ");
00276 return getisa(sess, docisaptr);
00277 }
00278
00286 bool
00287 getrearrange(
00288 Session *sess,
00289 IStreamAddr *docisaptr,
00290 typecutseq *cutseqptr)
00291 {
00292 prompt(sess, "enter document=> ");
00293 if (!getisa(sess, docisaptr))
00294 return false;
00295
00296 prompt(sess, "enter cutseq=>\n");
00297 if (!getcutseq(sess, cutseqptr))
00298 return false;
00299
00300 return true;
00301 }
00302
00310 bool
00311 getretrievev(
00312 Session *sess,
00313 typespecset *specsetptr)
00314 {
00315 return getspecset(sess, specsetptr);
00316 }
00317
00325 bool
00326 getfindlinksfromtothree(
00327 Session *sess,
00328 typespecset *fromvspecsetptr,
00329 typespecset *tovspecsetptr,
00330 typespecset *threevspecsetptr,
00331 typeispanset *homesetptr)
00332 {
00333 prompt(sess, "fromset\n");
00334 if (!getspecset(sess, fromvspecsetptr))
00335 return false;
00336
00337 prompt(sess, "toset\n");
00338 if (!getspecset(sess, tovspecsetptr))
00339 return false;
00340
00341 prompt(sess, "threeset\n");
00342 if (!getspecset(sess, threevspecsetptr))
00343 return false;
00344
00345 prompt(sess, "home documents\n");
00346 if (!getspanset(sess, homesetptr, ISPANID))
00347 return false;
00348
00349 return true;
00350 }
00351
00359 bool
00360 getfindnumoflinksfromtothree(
00361 Session *sess,
00362 typespecset *fromvspecsetptr,
00363 typespecset *tovspecsetptr,
00364 typespecset *threevspecsetptr,
00365 typeispanset *homesetptr)
00366 {
00367 return getfindlinksfromtothree(sess, fromvspecsetptr, tovspecsetptr, threevspecsetptr, homesetptr);
00368 }
00369
00377 bool
00378 getfindnextnlinksfromtothree(
00379 Session *sess,
00380 typespecset *fromvspecsetptr,
00381 typespecset *tovspecsetptr,
00382 typespecset *threevspecsetptr,
00383 typeispanset *homesetptr,
00384 IStreamAddr *lastlinkptr,
00385 int *nptr)
00386 {
00387 if (!getfindlinksfromtothree(sess, fromvspecsetptr, tovspecsetptr, threevspecsetptr, homesetptr))
00388 return false;
00389
00390 prompt(sess, "last link=> ");
00391 if (!getisa(sess, lastlinkptr))
00392 return false;
00393
00394 prompt(sess, "number of links => ");
00395 if (!getnumber(sess, nptr))
00396 return false;
00397
00398 return true;
00399 }
00400
00408 bool
00409 getshowrelationof2versions(
00410 Session *sess,
00411 typespecset *version1ptr,
00412 typespecset *version2ptr)
00413 {
00414 prompt(sess, "version1\n");
00415 if (!getspecset(sess, version1ptr))
00416 return false;
00417
00418 prompt(sess, "version2\n");
00419 if (!getspecset(sess, version2ptr))
00420 return false;
00421
00422 return true;
00423 }
00424
00432 void
00433 getcreatenewdocument()
00434 {
00435 }
00436
00444 bool
00445 getdeletevspan(
00446 Session *sess,
00447 IStreamAddr *docisaptr,
00448 typevspan *vspanptr)
00449 {
00450 prompt(sess, "document=> ");
00451 if (!getisa(sess, docisaptr))
00452 return false;
00453
00454 prompt(sess, "delete this part\n");
00455 if (!getspan(sess, vspanptr, VSPANID ))
00456 return false;
00457
00458 return true;
00459 }
00460
00468 void
00469 setdebug(
00470 Session *sess)
00471 {
00472 prompt(sess, "set debug => ");
00473 getnumber(sess, &debug);
00474 }
00475
00483 void
00484 playwithalloc(
00485 Session *sess)
00486 {
00487 prompt(sess, "playwithalloc\n");
00488 lookatalloc();
00489 }
00490
00498 bool
00499 getretrieveendsets(
00500 Session *sess,
00501 typespecset *specsetptr)
00502 {
00503 return getspecset(sess, specsetptr);
00504 }
00505
00513 bool
00514 getxaccount(
00515 Session *sess,
00516 IStreamAddr *accountptr)
00517 {
00518
00519
00520
00521
00522 gettumbler(sess, accountptr) && validaccount(sess, accountptr);
00523 sess->account = *accountptr;
00524
00525 L("in get xaccount \n");
00526
00527 return true;
00528 }
00529
00537 bool
00538 getcreatenode_or_account(
00539 Session *sess,
00540 Tumbler *tp)
00541 {
00542 gettumbler(sess, tp);
00543 return true;
00544 }
00545
00553 bool
00554 getopen(
00555 Session *sess,
00556 Tumbler *tp,
00557 int *typep,
00558 int *modep)
00559 {
00560
00561 gettumbler(sess, tp);
00562 getnumber(sess, typep);
00563 getnumber(sess, modep);
00564
00565 return true;
00566 }
00567
00575 bool
00576 getclose(
00577 Session *sess,
00578 Tumbler *tp)
00579 {
00580 gettumbler(sess, tp);
00581
00582 return true;
00583 }