Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From 0.7 To 0.6
2022-01-08 13:33 | Bump version number: 0.8 (check-in: 9918bb8dab user: mark tags: trunk) | |
2022-01-08 13:30 | CHANGES for 0.7 (check-in: 2c45034580 user: mark tags: trunk, 0.7) | |
2022-01-08 13:10 | Bump year in license headers (check-in: 277b68b64f user: mark tags: trunk) | |
2021-11-21 15:32 | Bump version number: 0.7 (check-in: f3d6c2ff7b user: mark tags: trunk) | |
2021-11-21 15:28 | CHANGES for 0.6 (check-in: bbf8590008 user: mark tags: trunk, 0.6) | |
2021-11-21 14:40 | Add user-defined colour support to the branch view. (check-in: 3d1f3389a3 user: mark tags: trunk) | |
Changes to CHANGES.md.
| 1 2 3 4 5 6 7 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
︙ |
Changes to GNUmakefile.
1 | 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 | - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # |
Changes to LICENSE.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + |
|
Changes to Makefile.
1 2 3 4 | 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 | - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # # FNC Makefile # |
Changes to README.md.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | # README |
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | - - - - - - - - - - | ![diff removed file](https://fnc.bsdbox.org/uv/resources/img/fnc-diff-split-file-removed.png "fnc diff file removed") ![blame split screen](https://fnc.bsdbox.org/uv/resources/img/fnc-blame-splitscreen.png "fnc blame split screen") ![tree split screen](https://fnc.bsdbox.org/uv/resources/img/fnc-tree-splitscreen.png "fnc tree split screen") ![branch split screen](https://fnc.bsdbox.org/uv/resources/img/fnc-branch-splitscreen.png "fnc branch split screen") ![in-app help](https://fnc.bsdbox.org/uv/resources/img/fnc-inapp_help.png "fnc in-app help") ![timeline help](https://fnc.bsdbox.org/uv/resources/img/fnc-timeline-help.png "fnc timeline help") |
︙ |
Deleted fnc.bld.mk.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to include/settings.h.
︙ | |||
10 11 12 13 14 15 16 | 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 | - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + - - - - - + + - - + - - - - | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ |
Changes to lib/libfossil-config.h.
︙ | |||
51 52 53 54 55 56 57 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + | #if !defined(HAVE_STDINT_H) # define HAVE_STDINT_H 1 #endif #if !defined(_DEFAULT_SOURCE) # define _DEFAULT_SOURCE 1 #endif #if !defined(_XOPEN_SOURCE) |
︙ |
Changes to lib/libfossil.c.
1 | 1 2 3 4 5 6 7 8 9 | - + | #include "libfossil.h" |
︙ | |||
44 45 46 47 48 49 50 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - - | const fsl_buffer fsl_buffer_empty = fsl_buffer_empty_m; const fsl_card_F fsl_card_F_empty = fsl_card_F_empty_m; const fsl_card_F_list fsl_card_F_list_empty = fsl_card_F_list_empty_m; const fsl_card_J fsl_card_J_empty = fsl_card_J_empty_m; const fsl_card_Q fsl_card_Q_empty = fsl_card_Q_empty_m; const fsl_card_T fsl_card_T_empty = fsl_card_T_empty_m; const fsl_checkin_opt fsl_checkin_opt_empty = fsl_checkin_opt_empty_m; |
︙ | |||
377 378 379 380 381 382 383 | 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | - - - + + + | } int fsl_stricmp_cmp( void const * lhs, void const * rhs ){ return fsl_stricmp((char const *)lhs, (char const *)rhs); } fsl_size_t fsl_strlen( char const * src ){ |
︙ | |||
924 925 926 927 928 929 930 | 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 | - + - - + + | } /** Convenience form of fsl_simplify_sql() which assumes b holds an SQL string. It gets processed by fsl_simplify_sql() and its 'used' length potentially gets adjusted to match the adjusted SQL string. */ |
︙ | |||
1020 1021 1022 1023 1024 1025 1026 | 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 | - - - - - - + + | } default:{ return false; } } } |
︙ | |||
1327 1328 1329 1330 1331 1332 1333 | 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 | - + - - - - - + | if(NULL==x){ rc = FSL_RC_OOM; goto end; } a->aVers = x; a->naVers = n; } |
︙ | |||
1497 1498 1499 1500 1501 1502 1503 | 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 | - - + + | fsl__cx_scratchpad_yield(f, scratch); fsl__annotator_clean(&ann); return rc; } #undef MARKER #undef blob_to_utf8_no_bom |
︙ | |||
2279 2280 2281 2282 2283 2284 2285 | 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 | - - + - - - - - - - - - - - - + + + + + + + + + + + - - | && (c=fsl_utf8_read_char(z, zEnd, &zNext)); z = zNext ){ if( c=='\\' || c=='"' ){ out("\\", 1); outc; }else if( c<' ' ){ out("\\",1); |
︙ | |||
2942 2943 2944 2945 2946 2947 2948 | 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 | - + - + | } case etSTRING: { bufpt = va_arg(ap,char*); length = bufpt ? StrNLen32(bufpt, (precision>0 && flag_alternateform) ? precision*4/*max bytes per char*/ |
︙ | |||
3229 3230 3231 3232 3233 3234 3235 | 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 | - - + + - + - | va_start( vargs, fmt ); rc = fsl_snprintfv( dest, n, fmt, vargs ); va_end( vargs ); return rc; } #undef MARKER |
︙ | |||
3281 3282 3283 3284 3285 3286 3287 | 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 | - + - + - + | fsl_sha1_update(&hash, zPw, fsl_strlen(zPw)); fsl_sha1_final(&hash, zResult); fsl_sha1_digest_to_base16(zResult, zDigest); return fsl_strndup( zDigest, FSL_STRLEN_SHA1 ); } } |
︙ | |||
3329 3330 3331 3332 3333 3334 3335 | 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 | - + - - + + | " AND login NOT IN ('anonymous','nobody','developer','reader')" " AND (pw=%Q OR (length(pw)<>40 AND pw=%Q))", zUsername, zSecret, zPasswd); fsl_free(zSecret); return rc; } |
︙ | |||
3550 3551 3552 3553 3554 3555 3556 | 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 | - - + + | void fsl_id_bag_swap(fsl_id_bag * const lhs, fsl_id_bag * const rhs){ fsl_id_bag x = *lhs; *lhs = *rhs; *rhs = x; } #undef fsl_id_bag_hash |
︙ | |||
3578 3579 3580 3581 3582 3583 3584 | 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + + - - - + + - - - - - - - + + + + + + + + - - + - - + - - - - - - - - - + + - - - - - + - - + - - - - - - - - - + - - - - - - - - - + + + - + - + - + - - - - + + + + - + - + - - + + + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + | #define MARKER(pfexp) \ do{ printf("MARKER: %s:%d:%s():\t",__FILE__,__LINE__,__func__); \ printf pfexp; \ } while(0) |
︙ | |||
3777 3778 3779 3780 3781 3782 3783 | 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 | - + - + - - + + - - - + + - - + + - - + | va_start(args,fmt); rc = fsl_buffer_appendfv( b, fmt, args ); va_end(args); return rc; } } |
︙ | |||
3973 3974 3975 3976 3977 3978 3979 | 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 | - + - + - + - - - - - - + - - - - - - - - - - - - - - - - - + + - - - - + - - - - - + + + + + - - - + + + - - + + - - - - + + + + - - + + - - + - - - - - + + + - - - - - - - - - - - | }else{ fsl_buffer_reserve(&temp, 0); } return rc; } } |
︙ | |||
4140 4141 4142 4143 4144 4145 4146 | 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 | - - - - + + + + - - - - + + + + + + - - - + + + - - - - - + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + + - - + + + | fsl_buffer const * const src ){ fsl_buffer_reuse(dest); return src->used ? fsl_buffer_append( dest, src->mem, src->used ) : 0; } |
︙ | |||
4350 4351 4352 4353 4354 4355 4356 | 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 | - - - - + + - | fsl_buffer_clear(&fc); #endif return rc; } } char * fsl_buffer_take(fsl_buffer * const b){ |
︙ | |||
4410 4411 4412 4413 4414 4415 4416 | 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 | - - - + - - - - + - - - - + + | if(i++) rc = fsl_buffer_append(b, separator, sepLen); if(!rc) rc = fsl_buffer_appendf(b, "%" FSL_ID_T_PFMT, e); } return rc; } int fsl_buffer_append_tcl_literal(fsl_buffer * const b, |
︙ | |||
4603 4604 4605 4606 4607 4608 4609 | 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 | - - + + | } assert(!"delta-loop in repository"); return fsl_cx_err_set(f, FSL_RC_CONSISTENCY, "Serious problem: delta-loop in repository"); } #undef MARKER |
︙ | |||
4652 4653 4654 4655 4656 4657 4658 | 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 | - + - - - + - + | ignore if (e.g.) the parent content is already a delta of something else. The wise caller will have a transaction in place when calling this. Returns 0 on success. On error rid and uuid are not modified. */ |
︙ | |||
4897 4898 4899 4900 4901 4902 4903 | 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 | - + | if(rc) fsl_db_transaction_rollback(db); else{ rc = fsl_cx_uplift_db_error2(f, db, fsl_db_transaction_commit(db)); } return rc; } |
︙ | |||
4938 4939 4940 4941 4942 4943 4944 | 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 | - + + - - + + | if(rc) fsl_db_transaction_rollback(db); else{ rc = fsl_cx_uplift_db_error2(f, db, fsl_db_transaction_commit(db)); } return rc; } |
︙ | |||
4966 4967 4968 4969 4970 4971 4972 | 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 | + - + | : false); } fsl__cx_scratchpad_yield(f, canon); return rv; } } |
︙ | |||
5789 5790 5791 5792 5793 5794 5795 | 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 | - + | "WHERE fsl_is_enqueued(id)", vid, d->rid); if(!rc) rc = fsl__ckout_version_write(f, d->rid, NULL); RC; assert(d->f == f); rc = fsl_checkin_add_unsent(f, d->rid); RC; |
︙ | |||
5883 5884 5885 5886 5887 5888 5889 | 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 | - - + + | fsl_checkin_discard(f); fsl_deck_finalize(d); return rc; } #undef MARKER |
︙ | |||
5920 5921 5922 5923 5924 5925 5926 | 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 | - - + + - + | /** Kludge for type-safe strncmp/strnicmp inconsistency. */ static int fsl_strnicmp_int(char const *zA, char const * zB, fsl_size_t nByte){ return fsl_strnicmp( zA, zB, (fsl_int_t)nByte); } |
︙ | |||
5967 5968 5969 5970 5971 5972 5973 | 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 | - + | "file name: %s\n", rc, fsl_rc_cstr(rc), zOrigName); } goto end; } zFull = fsl_buffer_cstr2(full, &nFull); |
︙ | |||
6147 6148 6149 6150 6151 6152 6153 | 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 | - - - - - - - - - - - - - + + + | return fsl_db_exists(fsl_cx_db_ckout(f), "SELECT 1 FROM vfile" " WHERE vid=%"FSL_ID_T_PFMT " AND pathname=%Q %s", f->ckout.rid, zFilename, fsl_cx_filename_collation(f)); } |
︙ | |||
6223 6224 6225 6226 6227 6228 6229 | 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 | - + | static int fsl_dircrawl_f_add(fsl_dircrawl_state const *); /** Attempts to add file or directory (recursively) cas->absBuf to the current repository. isCrawling must be true if this is a fsl_dircrawl()-invoked call, else false. */ |
︙ | |||
6254 6255 6256 6257 6258 6259 6260 | 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 | - - + - - - + | }else if(cas->opt->checkIgnoreGlobs){ char const * m = fsl_cx_glob_matches(cas->f, FSL_GLOBS_IGNORE, zCoRel); if(m) skipped = true; } if(!skipped && cas->opt->callback){ bool yes = false; |
︙ | |||
6304 6305 6306 6307 6308 6309 6310 | 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 | - - - - - - - - - + + + + - - - - - - - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - | "fsl_fstat_type_e #%d", cas->fst.type); break; } end: return rc; } |
︙ | |||
6417 6418 6419 6420 6421 6422 6423 | 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 | - - - - - - - - | return rc; dberr: assert(rc); rc = fsl_cx_uplift_db_error2(f, db, rc); goto end; } |
︙ | |||
6507 6508 6509 6510 6511 6512 6513 | 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 | - - - - + - - - - - + | "/*%s()*/", vid, zNorm, zNorm, vid, __func__); if(rc) goto dberr; } }/*opt->filename*/ if(q.stmt){ |
︙ | |||
6551 6552 6553 6554 6555 6556 6557 | 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 | - + - + | } int fsl_ckout_changes_scan(fsl_cx * const f){ return fsl_vfile_changes_scan(f, -1, 0); } |
︙ | |||
6592 6593 6594 6595 6596 6597 6598 | 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 | - + + - - + + + - - - - - - - - - - - - + + + + - + | return fsl_db_exists(db, "SELECT 1 FROM vfile WHERE chnged " "OR coalesce(origname != pathname, 0) " "/*%s()*/", __func__) || fsl_db_exists(db,"SELECT 1 FROM vmerge /*%s()*/", __func__); } |
︙ | |||
6657 6658 6659 6660 6661 6662 6663 | 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 | - + - + + + + + + + + - - - - - - - - - | /*MARKER(("Updated ckout.dir: %d %s\n", (int)f->ckout.dirLen, f->ckout.dir));*/ } return rc; } |
︙ | |||
6728 6729 6730 6731 6732 6733 6734 | 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 | + + - + - + + + + - + - - + - - + + | /** Create and attach ckout db... */ assert(!fsl_cx_db_ckout(f)); const char * dbName = opt->ckoutDbFile ? opt->ckoutDbFile : fsl_preferred_ckout_db_name(); fsl_cx_err_reset(f); int fsl_cx_attach_role(fsl_cx * const , const char *, fsl_dbrole_e) /* defined in cx.c */; |
︙ | |||
6996 6997 6998 6999 7000 7001 7002 | 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 | - + | RepoExtractCkup * const rec = (RepoExtractCkup *)xs->callbackState; const char * zFilename; fsl_ckup_state coState = fsl_ckup_state_empty; fsl_time_t mtime = 0; fsl_fstat fst = fsl_fstat_empty; fsl_ckup_localmod_e modType = FSL_RECO_MOD_UNKNOWN; bool loadedContent = false; |
︙ | |||
7343 7344 7345 7346 7347 7348 7349 | 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 | - + | if(rc) goto end; while(FSL_RC_STEP_ROW==(rc = fsl_stmt_step(&q))){ fsl_size_t nFn = 0; char const * fn = fsl_stmt_g_text(&q, 0, &nFn); absPath->used = ckdirLen; rc = fsl_buffer_append(absPath, fn, nFn); if(rc) break; |
︙ | |||
7459 7460 7461 7462 7463 7464 7465 | 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 | - + | if(rc) goto end; } rc = fsl_ckout_manifest_write(f, -1, -1, -1, NULL); end: if(!rc){ rc = fsl_vfile_unload_except(f, cOpt->checkinRid); |
︙ | |||
7533 7534 7535 7536 7537 7538 7539 | 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 | + - + - + - | } /* ** The record.fn field is used to match files against each other. The ** FV table contains one row for each each unique filename in ** in the current checkout, the pivot, and the version being merged. */ rc = fsl_db_exec_multi(dbC, "DROP TABLE IF EXISTS fv;" |
︙ | |||
8131 8132 8133 8134 8135 8136 8137 | 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 | - - - + + + - + - + - - + + | || 0==fsl_strncmp(z,"true",4)){ z = "ru"/*historical default*/; }else if(!fsl_str_bool(z)){ z = ""; } for(;*z;++z){ switch(*z){ |
︙ | |||
8374 8375 8376 8377 8378 8379 8380 | 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 | - + - + | (int)errLen, zFilename); } end: fsl__cx_scratchpad_yield(f, fn); return rc; } |
︙ | |||
8421 8422 8423 8424 8425 8426 8427 | 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 | - + - - + + - - - - + + + + + - - - + + - + + + + - + - + + - + + - + + + + + | } /** Queues the directory part of the given filename into temp table fx_revert_rmdir for an eventual rmdir() attempt on it in fsl_revert_rmdir_fini(). */ |
︙ | |||
8506 8507 8508 8509 8510 8511 8512 | 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 | - - + + | if(fname->used) fsl_buffer_strip_slashes(fname); if(1==fname->used && '.'==*zNorm){ /* Special case: handle "." from ckout root intuitively */ fsl_buffer_reuse(fname); assert(0==*zNorm); } } |
︙ | |||
8546 8547 8548 8549 8550 8551 8552 | 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 | - + + + + - + + - + - + | " OR deleted<>0" " OR rid=0" " OR coalesce(origname,pathname)" " <>pathname" ")", -1); } assert(!rc); |
︙ | |||
8591 8592 8593 8594 8595 8596 8597 | 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 | - + - + | } } /* Ignore any errors: this operation is an optimization, not a requirement. Worse case, the entry with the old name is left in the filesystem. */ } if(!vfUpdate.stmt){ |
︙ | |||
8630 8631 8632 8633 8634 8635 8636 | 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 | - + - - - | end: if(fname) fsl__cx_scratchpad_yield(f, fname); if(sql) fsl__cx_scratchpad_yield(f, sql); fsl_stmt_finalize(&q); fsl_stmt_finalize(&vfUpdate); if(qRmdir.stmt){ fsl_stmt_finalize(&qRmdir); |
︙ | |||
8718 8719 8720 8721 8722 8723 8724 | 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 | - + | fsl_time_t * repoMtime, fsl_time_t * localMtime){ int rc = 0; fsl_id_t fid = 0; fsl_fstat fst = fsl_fstat_empty; if(!fsl_needs_ckout(f)) return FSL_RC_NOT_A_CKOUT; |
︙ | |||
8748 8749 8750 8751 8752 8753 8754 | 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 | - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - | if(repoMtime){ rc = fsl_mtime_of_manifest_file(f, vid, fid, repoMtime); } return rc; } |
︙ | |||
8871 8872 8873 8874 8875 8876 8877 | 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 | - + + + + + | assert(f); if(fcli.transient.repoDbArg){ FCLI_V3(("Trying to open repo db file [%s]...\n", fcli.transient.repoDbArg)); rc = fsl_repo_open( f, fcli.transient.repoDbArg ); } else if(fcli.clientFlags.checkoutDir){ fsl_buffer dir = fsl_buffer_empty; |
︙ | |||
8939 8940 8941 8942 8943 8944 8945 | 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 | - + - + | static struct { fsl_list list; } FCliFree = { fsl_list_empty_m }; static void fcli_shutdown(void){ |
︙ | |||
9090 9091 9092 9093 9094 9095 9096 | 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 | - + - - - + + + | if(fcli.appHelp && fcli.appHelp->callback){ fcli.appHelp->callback(); f_out("\n"); } } if(showGlobal){ if(!showApp){ |
︙ | |||
9564 9565 9566 9567 9568 9569 9570 | 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 | - - + + + + + + + - + - - - - - - - - - - - - - - + + + + + + - - + + + - + | fsl_cx_user_set(f, u); fsl_free(u); } } return rc; } |
︙ | |||
9840 9841 9842 9843 9844 9845 9846 | 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 | - + - | f_out(" (aliases: "); while ( *alias!=0 ){ f_out("%s%s", alias, *(strchr(alias, 0) + 1) ? ", " : ")\n"); alias = strchr(alias, 0) + 1; } } |
︙ | |||
9870 9871 9872 9873 9874 9875 9876 | 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 | - + - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + | assert((uuid && (rid>0)) || (!uuid && (0==rid))); f_out("%*s %s\n", lblWidth, "repository-db:", fsl_cx_db_file_repo(f, NULL)); f_out("%*s %s\n", lblWidth, "checkout-root:", fsl_cx_ckout_dir_name(f, NULL)); |
︙ | |||
10039 10040 10041 10042 10043 10044 10045 | 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 | - + - | fsl_db * fcli_needs_repo(void){ if(fcli.f) return fsl_needs_repo(fcli.f); fcli_err_set(FSL_RC_NOT_A_REPO, "No repository db is opened."); return NULL; } |
︙ | |||
10083 10084 10085 10086 10087 10088 10089 | 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 | - + | return zEnd+1; default: break; } } return zEnd; } |
︙ | |||
10138 10139 10140 10141 10142 10143 10144 | 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 | - - + + | } #undef FCLI_V3 #undef fcli_empty_m #undef fcli__error #undef MARKER #undef FCLI_USE_SIGACTION |
︙ | |||
10166 10167 10168 10169 10170 10171 10172 | 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 | - - - + + + + + - + - + - - - - - + + + + + - - - - - - + + + + + + + + - + - + - + - + - - - + + + + - - - - - + + - - - - - - + + + + + - - - - - - + + + + + - - - - - - - - - + + + + + + + + - - - - - + - - - - + + + - - - - - - - - - - + + + + + + + - - - - - - + + + + + + + | #include <stdio.h> #define MARKER(pfexp) \ do{ printf("MARKER: %s:%d:%s():\t",__FILE__,__LINE__,__func__); \ printf pfexp; \ } while(0) |
︙ | |||
10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 | 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 | + + - - - - + + + + - - - + - - + - - - + - + - - + + - - - + - + - + - + + + + + + + + + + + + | "Fossil has no repo opened."); } else{ int rc; bool gotIt = 0; fsl_id_t nextRid; fsl__bccache * const ac = &f->cache.blobContent; fsl_buffer_reuse(tgt); if(fsl_id_bag_contains(&ac->missing, rid)){ /* Early out if we know the content is not available */ return FSL_RC_NOT_FOUND; } /* Look for the artifact in the cache first */ if(0!=(FSL_CX_F_BLOB_CACHE & f->flags) && fsl_id_bag_contains(&ac->inCache, rid) ){ fsl_size_t i; fsl__bccache_line * line; for(i=0; i<ac->used; ++i){ line = &ac->list[i]; if( line->rid==rid ){ ++ac->metrics.hits; rc = fsl_buffer_copy(tgt, &line->content); line->age = ac->nextAge++; return rc; } } } |
︙ | |||
10444 10445 10446 10447 10448 10449 10450 10451 | 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 | + - | #else if(mx){/*unused var*/} fsl_buffer_clear(tgt); #endif *tgt = next; } end_delta: fsl_buffer_clear(&delta); fsl_free(a); |
︙ | |||
10476 10477 10478 10479 10480 10481 10482 | 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 | - + + - + - + + | /** Mark artifact rid as being available now. Update f's cache to show that everything that was formerly unavailable because rid was missing is now available. Returns 0 on success. f must have an opened repo and rid must be valid. */ |
︙ | |||
10810 10811 10812 10813 10814 10815 10816 | 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 | - + | if(!rc){ rc = fsl_db_exec(dbR, "DELETE FROM phantom " "WHERE rid=%"FSL_ID_T_PFMT, rid /* FIXME? use cached statement? */); if( !rc && (srcId==0 || 0==fsl__bccache_check_available(f, srcId)) ){ isDephantomize = true; |
︙ | |||
10874 10875 10876 10877 10878 10879 10880 | 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 | - + | if( !isDephantomize && fsl_id_bag_contains(&f->cache.blobContent.missing, rid) && (srcId==0 || (0==fsl__bccache_check_available(f,srcId)))){ /* TODO: document what this is for. TODO: figure out what that is. */ |
︙ | |||
10938 10939 10940 10941 10942 10943 10944 | 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 | - - + + | } /* TODO? cached query */ return 1==fsl_db_g_int32( db, 0, "SELECT 1 FROM shun WHERE uuid=%Q", zUuid); } |
︙ | |||
11018 11019 11020 11021 11022 11023 11024 | 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 | - + + - + - + + + - + + + + + - - + + + | } } return rc; } int fsl__content_undeltify(fsl_cx * const f, fsl_id_t rid){ int rc; |
︙ | |||
11083 11084 11085 11086 11087 11088 11089 | 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 | - - + + + - + | } int fsl__content_deltify(fsl_cx * f, fsl_id_t rid, fsl_id_t srcid, bool force){ fsl_id_t s; fsl_buffer data = fsl_buffer_empty; fsl_buffer src = fsl_buffer_empty; |
︙ | |||
11133 11134 11135 11136 11137 11138 11139 | 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 | + - + - - + + - + - + | break; } } if(rc) return rc; /* As of here, don't return on error. Use (goto end) instead, or be really careful, b/c buffers might need cleaning. */ rc = fsl_content_get(f, srcid, &src); if(rc |
︙ | |||
11180 11181 11182 11183 11184 11185 11186 | 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 | - + - + - - + | } end: if(rc && db->error.code && !f->error.code){ fsl_cx_uplift_db_error(f,db); } fsl_buffer_clear(&src); fsl_buffer_clear(&data); |
︙ | |||
11249 11250 11251 11252 11253 11254 11255 | 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 | - - + + + + + - + + + + - + - - - + - - + - + | return rc ? fsl_cx_uplift_db_error(f, db) : 0; } /** Load the record ID rid and up to N-1 closest ancestors into the "fsl_computed_ancestors" table. */ |
︙ | |||
11324 11325 11326 11327 11328 11329 11330 | 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 | - - - + + + - - + | /* Computing (and keeping) ancestors is relatively costly, so we keep only the copy associated with f->cache.mtimeManifest around. For the general case, we will be feeding this function files from the same manifest. */ f->cache.mtimeManifest = vid; |
︙ | |||
11353 11354 11355 11356 11357 11358 11359 | 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 | - - - + | rc = 0; if(pMTime) *pMTime = (fsl_time_t)fsl_stmt_g_int64(q, 0); }else{ assert(rc); if(FSL_RC_STEP_DONE==rc) rc = FSL_RC_NOT_FOUND; } fsl_stmt_cached_yield(q); |
︙ | |||
11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 | 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 | + - + | */ int fsl_import_file( fsl_cx * f, char relativeToCwd, char const * zName, fsl_id_t parentRid, fsl_id_t *rid, fsl_uuid_str * uuid ){ fsl_buffer * canon = 0; // canonicalized filename fsl_buffer * nbuf = 0; // filename buffer fsl_buffer * fbuf = &f->fileContent; // file content buffer char const * fn; int rc; fsl_id_t fnid = 0; fsl_id_t rcRid = 0; fsl_db * db = f ? fsl_needs_repo(f) : NULL; char inTrans = 0; if(!zName || !*zName) return FSL_RC_MISUSE; else if(!f->ckout.dir) return FSL_RC_NOT_A_CKOUT; else if(!db) return FSL_RC_NOT_A_REPO; |
︙ | |||
11582 11583 11584 11585 11586 11587 11588 | 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 | - - + + | ); end: fsl_stmt_finalize(&q); return rc; } #undef MARKER |
︙ | |||
12731 12732 12733 12734 12735 12736 12737 | 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 | - - + + + - - + | #undef fsl__configs_get_v #undef fsl__configs_get_x1 #undef fsl__configs_get_x2 #undef SELECT_FROM_CONFIG #undef MARKER #undef ARRAYLEN |
︙ | |||
12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 | 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 | + - + | This function does not trigger any finializers set for f's client state or output channel. Results are undefined if !f or f's memory has not been properly initialized. */ static void fsl__cx_reset( fsl_cx * const f, bool closeDatabases ); int fsl_cx_init( fsl_cx ** tgt, fsl_cx_init_opt const * param ){ static fsl_cx_init_opt paramDefaults = fsl_cx_init_opt_default_m; int rc = 0; fsl_cx * f; |
︙ | |||
12880 12881 12882 12883 12884 12885 12886 | 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 | + + - + + + + - - + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - + + - - - + + | /* Clean up pseudo-leak valgrind complains about: https://www.sqlite.org/c3ref/auto_extension.html */; } #endif #if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 sqlite3_mutex_leave(sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER)); #endif f->dbMem.f = f /* so that dbMem gets fsl_xxx() SQL funcs installed. */; rc = fsl_db_open( &f->dbMem, "", 0 ); |
︙ | |||
12980 12981 12982 12983 12984 12985 12986 | 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 | - + + - + | void fsl__cx_clear_mf_seen(fsl_cx * const f, bool freeMemory){ if(freeMemory) fsl_id_bag_clear(&f->cache.mfSeen); else fsl_id_bag_reset(&f->cache.mfSeen); } void fsl_cx_finalize( fsl_cx * const f ){ |
︙ | |||
13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 | 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 | + | sqlite3_mutex_leave(sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER)); #endif } void fsl_cx_err_reset(fsl_cx * const f){ //f->interrupted = 0; // No! ONLY modify this via fsl_cx_interrupt() fsl_error_reset(&f->error); fsl_db_err_reset(&f->dbMem); fsl_db_err_reset(&f->repo.db); fsl_db_err_reset(&f->config.db); fsl_db_err_reset(&f->ckout.db); } int fsl_cx_err_set_e( fsl_cx * const f, fsl_error * const err ){ if(!f) return FSL_RC_MISUSE; |
︙ | |||
13116 13117 13118 13119 13120 13121 13122 | 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 | + + - + + + - + | assert(db && "misuse: no DB handle to uplift error from!"); if(db->error.code) rc = fsl_cx_uplift_db_error(f, db); } return rc; } fsl_db * fsl_cx_db_config( fsl_cx * const f ){ if(!f) return NULL; else if(f->dbMain && (FSL_DBROLE_CONFIG & f->dbMain->role)) return f->dbMain; |
︙ | |||
13144 13145 13146 13147 13148 13149 13150 | 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 | + - + - + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - + + - - - - + - - - + - - - - + - - + - - - - - - + + + + - - - - - - - - - - - - + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + - + - - - - - + + - + - - - - + + + + - - - - - - - - - - + - - - - - + + - - + - - - - - - - - + - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - + + + + + + - - + - + - - + + - - - - + + + + + - + - - - - - + - - - - - + - + - - - - - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + - + + - + - + | fsl_cx_err_set(f, FSL_RC_NOT_A_CKOUT, "Fossil context has no opened checkout db."); } return db; } fsl_db * fsl_cx_db_ckout( fsl_cx * const f ){ if(!f) return NULL; |
︙ | |||
13488 13489 13490 13491 13492 13493 13494 | 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 | - + - + | schema's tables. */ static int fsl_config_file_reset(fsl_cx * const f, char const * dbName){ fsl_db DB = fsl_db_empty; fsl_db * db = &DB; int rc = 0; bool isAttached = false; |
︙ | |||
13585 13586 13587 13588 13589 13590 13591 | 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 | - + - | int fsl_config_open( fsl_cx * const f, char const * openDbName ){ int rc = 0; const char * zDbName = 0; char * zPrefName = 0; if(fsl_cx_db_config(f)){ if(NULL==openDbName || 0==*openDbName) return 0/*nothing to do*/; |
︙ | |||
13615 13616 13617 13618 13619 13620 13621 | 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 | - - - - - - - - + - - - - - - | rc = fsl_cx_err_set(f, FSL_RC_ACCESS, "Configuration database [%s] " "must be writeable.", zDbName); goto end; } #endif assert(NULL==fsl_cx_db_config(f)); |
︙ | |||
13722 13723 13724 13725 13726 13727 13728 | 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + | case FSL_HPOLICY_SHA1: p = FSL_HPOLICY_SHA1; break; case FSL_HPOLICY_SHUN_SHA1: p = FSL_HPOLICY_SHUN_SHA1; break; default: p = FSL_HPOLICY_AUTO; break; } f->cxConfig.hashPolicy = p; } |
︙ | |||
13857 13858 13859 13860 13861 13862 13863 | 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 | - - - - - - - + - + + + | ? fsl_db_g_double(fsl_cx_db_repo(f), 0.0, "SELECT mtime FROM event " "WHERE objid=%" FSL_ID_T_PFMT, f->ckout.rid) : 0.0; } |
︙ | |||
13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 | 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 | + | fsl_buffer * const pOut ){ int rc; fsl_int_t dLen = 0, i; enum { DbCount = 2 }; const char aDbName[DbCount][10] = { "_FOSSIL_", ".fslckout" }; fsl_buffer Buf = fsl_buffer_empty; fsl_buffer * buf = &Buf; buf->used = 0; if(dirName){ dLen = fsl_strlen(dirName); if(0==dLen) return FSL_RC_RANGE; rc = fsl_buffer_reserve( buf, (fsl_size_t)(dLen + 10) ); if(!rc) rc = fsl_buffer_append( buf, dirName, dLen ); if(rc){ fsl_buffer_clear(buf); |
︙ | |||
14070 14071 14072 14073 14074 14075 14076 | 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 | - + - + - - + + - - - + + + - - - - - - + - + - - + + + + + | } } } fsl_buffer_clear(buf); return FSL_RC_NOT_FOUND; } |
︙ | |||
14138 14139 14140 14141 14142 14143 14144 | 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 | - - - - - + + - + - - - - + + + + + - - - - + | rc = fsl_repo_open_for_ckout(f); f->flags &= ~FSL_CX_F_IS_OPENING_CKOUT; if(!rc) rc = fsl_cx_after_open(f); if(rc){ /* Is this sane? Is not doing it sane? */ fsl_ckout_close(f); } |
︙ | |||
14376 14377 14378 14379 14380 14381 14382 | 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 | - - - - - + - - - - - + + - + - - + - - - + - - + - - + - - - - - + - - - - + - - - + + + - + - + - + - - + - + + + + + + + + - - + + + + + + + + + + + + + + + | } int fsl_cx_stat(fsl_cx * const f, bool relativeToCwd, char const * zName, fsl_fstat * const tgt){ return fsl_cx_stat2(f, relativeToCwd, zName, tgt, NULL, false); } |
︙ | |||
14491 14492 14493 14494 14495 14496 14497 | 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 | - + | } int fsl_cx_hash_filename( fsl_cx * f, bool useAlternate, const char * zFilename, fsl_buffer * pOut){ /* FIXME: reimplement this to stream the content in bite-sized chunks. That requires duplicating most of fsl_buffer_fill_from() and fsl_cx_hash_buffer(). */ |
︙ | |||
14599 14600 14601 14602 14603 14604 14605 | 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 | - + - - + + - + - - - + | f->cache.seenDeltaManifest = 1; rc = fsl_config_set_bool(f, FSL_CONFDB_REPO, "seen-delta-manifest", 1); } return rc; } |
︙ | |||
14730 14731 14732 14733 14734 14735 14736 | 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 | - + | "Fatal internal fsl_cx::scratchpads misuse: " "passed a non-scratchpad buffer."); } /** @internal |
︙ | |||
14753 14754 14755 14756 14757 14758 14759 | 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 | - + - - - + + - + - + - - + - + - + + + + + + - + | Results are undefined if tgtDir is not an absolute path or does not have coRoot as its initial prefix. There are any number of valid reasons removal of a directory might fail, and this routine stops at the first one which does. */ |
︙ | |||
14898 14899 14900 14901 14902 14903 14904 | 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 | - - + + | struct tm * tm = fsl_cx_localtime(f, &clock); return tm ? mktime(tm) : 0; } #endif #undef MARKER #undef FSL_CX_NSCRATCH |
︙ | |||
14943 14944 14945 14946 14947 14948 14949 | 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - + + + + + + + + + + + + + + + + + + - + + | */ static int fsl_list_v_fsl_stmt_finalize(void * obj, void * visitorState ){ if(obj) fsl_stmt_finalize( (fsl_stmt*)obj ); return 0; } #endif |
︙ | |||
15044 15045 15046 15047 15048 15049 15050 | 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 | + - + - - - - + + + | } db->cacheHead = 0; } return rc; } void fsl_db_close( fsl_db * const db ){ if(!db) return; |
︙ | |||
15107 15108 15109 15110 15111 15112 15113 | 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 | - + + | char const * fsl_db_name(fsl_db const * const db){ return db ? db->name : NULL; } /** Returns the db name for the given role. */ |
︙ | |||
15352 15353 15354 15355 15356 15357 15358 | 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 | - + | st->flags = FSL_STMT_F_CACHE_HELD; *rv = st; } end: return rc; } |
︙ | |||
15405 15406 15407 15408 15409 15410 15411 | 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 | - + | return rc; } int fsl_stmt_finalize( fsl_stmt * const stmt ){ if(!stmt) return FSL_RC_MISUSE; else{ void const * allocStamp = stmt->allocStamp; |
︙ | |||
15486 15487 15488 15489 15490 15491 15492 | 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 | - + + + - + - + - + - + - + - + - + - + - + | fsl_stmt_finalize(s); break; } return rc; } int fsl_stmt_step( fsl_stmt * const stmt ){ |
︙ | |||
15715 15716 15717 15718 15719 15720 15721 | 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 | - + - + - + - + - + - + - + | #define BIND_PARAM_CHECK \ if(!(stmt && stmt->stmt && stmt->db && stmt->db->dbh)) return FSL_RC_MISUSE; else #define BIND_PARAM_CHECK2 BIND_PARAM_CHECK \ if(ndx<1 || ndx>stmt->paramCount) return FSL_RC_RANGE; else int fsl_stmt_bind_null( fsl_stmt * const stmt, int ndx ){ BIND_PARAM_CHECK2 { int const rc = sqlite3_bind_null( stmt->stmt, ndx ); |
︙ | |||
15886 15887 15888 15889 15890 15891 15892 | 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 | - + - + | ? sqlite3_column_text(stmt->stmt, ndx) : NULL; if(out) *out = (char const *)t; if(outLen){ int const x = sqlite3_column_bytes(stmt->stmt, ndx); *outLen = (x>0) ? (fsl_size_t)x : 0; } |
︙ | |||
15940 15941 15942 15943 15944 15945 15946 | 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 | - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - + + - + + + + - - - - - - - - - - + + + + + + + + + + + | char const * rv = NULL; fsl_stmt_get_text(stmt, index, &rv, outLen); return rv; } /** |
︙ | |||
16071 16072 16073 16074 16075 16076 16077 | 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 | + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + - + - + - - + - - + - - + + + - - - + - - - - - + + + - - - - + - + - + | goto end; }else if(!db->filename){ rc = FSL_RC_OOM; goto end; } } db->dbh = dbh; if(FSL_OPEN_F_SCHEMA_VALIDATE & openFlags){ int check; check = fsl__db_repo_verify_schema(db); if(0 != check){ rc = (check<0) ? fsl_error_set(&db->error, FSL_RC_NOT_A_REPO, "DB file [%s] does not appear to be " "a repository.", dbFile) : fsl_error_set(&db->error, FSL_RC_REPO_NEEDS_REBUILD, "DB file [%s] appears to be a fossil " "repsitory, but is out-of-date and needs " "a rebuild.", dbFile); assert(rc == db->error.code); |
︙ | |||
16227 16228 16229 16230 16231 16232 16233 | 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 | - + - + - + - - + - + - - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - | } int fsl_db_transaction_level(fsl_db * const db){ return db->doRollback ? -db->beginCount : db->beginCount; } int fsl_db_transaction_commit(fsl_db * const db){ |
︙ | |||
16393 16394 16395 16396 16397 16398 16399 | 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 | - + | va_list args; va_start(args,sql); rc = fsl_db_get_int32v(db, rv, sql, args); va_end(args); return rc; } |
︙ | |||
16418 16419 16420 16421 16422 16423 16424 | 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 | - + - + + - + - + | break; } fsl_stmt_finalize(&st); return rc; } } |
︙ | |||
16496 16497 16498 16499 16500 16501 16502 | 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 | - + - + | break; } fsl_stmt_finalize(&st); return rc; } } |
︙ | |||
16532 16533 16534 16535 16536 16537 16538 | 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706 16707 16708 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 | - + - + | break; } fsl_stmt_finalize(&st); return rc; } } |
︙ | |||
16587 16588 16589 16590 16591 16592 16593 | 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 | - + - + | break; } fsl_stmt_finalize(&st); return rc; } } |
︙ | |||
16639 16640 16641 16642 16643 16644 16645 | 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 16846 16847 16848 16849 16850 16851 16852 16853 16854 16855 16856 16857 16858 16859 16860 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939 16940 16941 16942 16943 16944 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 | - + - - + + - - - - - - + + + - + - - + + - + - + - + - + - + - + - + - + | break; } fsl_stmt_finalize(&st); return rc; } } |
︙ | |||
16821 16822 16823 16824 16825 16826 16827 | 16978 16979 16980 16981 16982 16983 16984 16985 16986 16987 16988 16989 16990 16991 16992 | - + | return rc; } bool fsl_db_table_exists(fsl_db * const db, fsl_dbrole_e whichDb, const char *zTable ){ |
︙ | |||
16848 16849 16850 16851 16852 16853 16854 | 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 | - - + + - + - - + | break; } } fsl_stmt_finalize(&q); return rv; } |
︙ | |||
16892 16893 16894 16895 16896 16897 16898 | 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 | - + - - + + - | } } fsl_stmt_finalize(&st); return rc; } } |
︙ | |||
16973 16974 16975 16976 16977 16978 16979 | 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157 17158 17159 | - - + + - + - - - - - - + + + + + + + + + + - - + | } fsl_output(f, "\n", 1); return 0; } #undef MARKER |
︙ | |||
17016 17017 17018 17019 17020 17021 17022 | 17174 17175 17176 17177 17178 17179 17180 17181 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 | - + - - + | FSL_CARD_F_LIST_NEEDS_SORT = 0x01 }; /** Transfers the contents of d into f->cache.mcache. If d is dynamically allocated then it is also freed. In any case, after calling this the caller must behave as if the deck had been passed |
︙ | |||
17057 17058 17059 17060 17061 17062 17063 | 17214 17215 17216 17217 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 | - + | mc->decks[i] = *d; *d = fsl_deck_empty; if(&fsl_deck_empty == mc->decks[i].allocStamp){ /* d was fsl_deck_malloc()'d so we need to free it, but cannot send it through fsl_deck_finalize() because that would try to clean up the memory we just transferred ownership of to mc->decks[i]. So... */ |
︙ | |||
17442 17443 17444 17445 17446 17447 17448 | 17599 17600 17601 17602 17603 17604 17605 17606 17607 17608 17609 17610 17611 17612 17613 | - - + - - - | static void fsl_deck_clean_T(fsl_deck * const m){ fsl_list_clear(&m->T, fsl_list_v_card_T_free, NULL); } static void fsl_deck_clean_U(fsl_deck * const m){ fsl_deck_clean_string(m, &m->U); } static void fsl_deck_clean_W(fsl_deck * const m){ |
︙ | |||
17745 17746 17747 17748 17749 17750 17751 | 17898 17899 17900 17901 17902 17903 17904 17905 17906 17907 17908 17909 17910 17911 17912 | - + | /** If fsl_card_is_legal(d->type, card), returns true, else updates d->f->error with a description of the constraint violation and returns 0. */ |
︙ | |||
17888 17889 17890 17891 17892 17893 17894 | 18041 18042 18043 18044 18045 18046 18047 18048 18049 18050 18051 18052 18053 18054 18055 18056 18057 18058 18059 18060 18061 18062 18063 18064 18065 18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 | - + - - - - - + + + + - - - - - - - | int fsl_deck_I_set( fsl_deck * const mf, fsl_uuid_cstr uuid){ if(uuid && mf->H) return FSL_RC_SYNTAX; int const uLen = uuid ? fsl_is_uuid(uuid) : 0; return fsl_deck_sethex_impl(mf, uuid, 'I', uLen, &mf->I); } |
︙ | |||
18085 18086 18087 18088 18089 18090 18091 | 18230 18231 18232 18233 18234 18235 18236 18237 18238 18239 18240 18241 18242 18243 18244 | - + | }else if(!mf->F.used){ theHash = FSL_MD5_INITIAL_HASH; /* fall through and set hash */ }else{ int rc = 0; fsl_card_F const * fc; fsl_id_t fileRid; |
︙ | |||
18243 18244 18245 18246 18247 18248 18249 | 18388 18389 18390 18391 18392 18393 18394 18395 18396 18397 18398 18399 18400 18401 18402 | - + | unsigned len = 0; for(; z[len]; ++len){ if(z[len] <= 32) return false; } return len>0; } |
︙ | |||
18399 18400 18401 18402 18403 18404 18405 | 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 | - + | if(rc){ fsl_card_F_list_pop(&mf->F); } return rc; } } |
︙ | |||
18498 18499 18500 18501 18502 18503 18504 | 18643 18644 18645 18646 18647 18648 18649 18650 18651 18652 18653 18654 18655 18656 18657 18658 18659 18660 18661 18662 18663 18664 18665 18666 18667 18668 18669 18670 18671 18672 18673 18674 18675 18676 18677 18678 18679 18680 18681 18682 18683 18684 18685 18686 18687 18688 18689 18690 18691 18692 18693 18694 18695 18696 18697 18698 18699 18700 18701 18702 18703 18704 18705 18706 18707 18708 18709 18710 18711 18712 18713 18714 18715 18716 18717 18718 | - + - + - + - + - + - + | return os->rc; } /** Internal helper for fsl_deck_output(). Appends formatted output to os->out() via fsl_output_f_mf(). Returns os->rc (0 on success). */ |
︙ | |||
18595 18596 18597 18598 18599 18600 18601 | 18740 18741 18742 18743 18744 18745 18746 18747 18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 | - + - + - + - + | /** Internal helper for outputing cards which are simple strings. str is the card to output (NULL values are ignored), letter is the card letter being output. If doFossilize is true then the output gets fossilize-formatted. */ |
︙ | |||
18656 18657 18658 18659 18660 18661 18662 | 18801 18802 18803 18804 18805 18806 18807 18808 18809 18810 18811 18812 18813 18814 18815 18816 18817 18818 18819 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 | - + - + - + | fsl_deck_append(os, "E %s %s\n", ds, os->d->E.uuid); } } return os->rc; } /* Appends the G card to os from os->d->G. */ |
︙ | |||
18742 18743 18744 18745 18746 18747 18748 | 18887 18888 18889 18890 18891 18892 18893 18894 18895 18896 18897 18898 18899 18900 18901 18902 18903 18904 18905 18906 18907 18908 18909 18910 18911 | - + - + | if(!rc) rc = fsl_deck_append( os, " %b", os->scratch); } } if(!rc) fsl_output_f_mf(os, "\n", 1); return os->rc; } |
︙ | |||
18793 18794 18795 18796 18797 18798 18799 | 18938 18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 18963 18964 18965 18966 18967 18968 18969 18970 18971 18972 18973 18974 18975 18976 18977 18978 18979 18980 18981 18982 18983 18984 18985 18986 18987 18988 18989 18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 19002 19003 19004 19005 19006 19007 19008 19009 19010 19011 19012 19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 | - + - + - + - + - + - + - + | } /** fsl_list_visitor_f() impl for outputing J cards. obj must be a (fsl_card_J *). */ static int fsl_list_v_mf_output_card_J(void * obj, void * visitorState ){ |
︙ | |||
18909 18910 18911 18912 18913 18914 18915 | 19054 19055 19056 19057 19058 19059 19060 19061 19062 19063 19064 19065 19066 19067 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 19083 | - + + - + | assert(l); assert(r); if(!l) return r ? 1 : 0; else if(!r) return -1; else{ /* Lexical sorting must account for the +/- characters, and a '+' sorts before '-', which is why this next part may seem |
︙ | |||
18955 18956 18957 18958 18959 18960 18961 | 19101 19102 19103 19104 19105 19106 19107 19108 19109 19110 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 19139 19140 19141 19142 | - + - + - + | } }else{ fsl_deck_append(os, "Q %c%s\n", prefix, cp->target); } return os->rc; } |
︙ | |||
19184 19185 19186 19187 19188 19189 19190 | 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 19450 19451 19452 19453 19454 19455 19456 19457 19458 19459 19460 19461 19462 19463 19464 19465 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + | } } return rc; } } /* Appends the T cards to os from os->d->T. */ |
︙ | |||
19367 19368 19369 19370 19371 19372 19373 | 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 | - + | DOUT(W); return os->rc; } #undef DOUT |
︙ | |||
19409 19410 19411 19412 19413 19414 19415 | 19555 19556 19557 19558 19559 19560 19561 19562 19563 19564 19565 19566 19567 19568 19569 19570 19571 19572 19573 19574 19575 19576 19577 19578 19579 19580 | - + - - - - - | */; } } } return rc; } |
︙ | |||
19516 19517 19518 19519 19520 19521 19522 19523 | 19657 19658 19659 19660 19661 19662 19663 19664 19665 19666 19667 19668 19669 19670 19671 19672 19673 19674 19675 19676 19677 19678 | + - + + + | /** Adds a record in the pending_xlink temp table, to be processed when crosslinking is completed. Returns 0 on success, non-0 for db error. */ static int fsl__deck_crosslink_add_pending(fsl_cx * f, char cType, fsl_uuid_cstr uuid){ int rc = 0; assert(f->cache.isCrosslinking); |
︙ | |||
19830 19831 19832 19833 19834 19835 19836 | 19974 19975 19976 19977 19978 19979 19980 19981 19982 19983 19984 19985 19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003 | - - + + - - - - - | fc->perm = perms; return 0; }else{ return fsl_deck_F_add(d, zName, uuid, perms, priorName); } } |
︙ | |||
20588 20589 20590 20591 20592 20593 20594 | 20727 20728 20729 20730 20731 20732 20733 20734 20735 20736 20737 20738 20739 20740 20741 20742 20743 20744 20745 20746 20747 20748 20749 20750 20751 20752 20753 20754 20755 20756 20757 20758 20759 20760 20761 20762 20763 20764 20765 20766 20767 20768 20769 20770 20771 20772 20773 20774 20775 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 20787 20788 20789 20790 20791 20792 20793 20794 20795 20796 20797 20798 20799 20800 20801 20802 20803 20804 20805 20806 20807 20808 20809 20810 20811 20812 20813 20814 20815 20816 | - - - - - - - - - - - - - - - - - - - - + + - + - + - + - + - + - + - + - + | } if(!rc && parentId){ rc = fsl__tag_propagate_all(d->f, parentId); } return rc; } |
︙ | |||
20748 20749 20750 20751 20752 20753 20754 | 20869 20870 20871 20872 20873 20874 20875 20876 20877 20878 20879 20880 20881 20882 20883 | - + | construct. Note that we are using a lot of historical code which hard-codes english-lanuage text and links which only work in fossil(1). i would prefer to farm this out to a crosslink callback, and provide a default implementation which more or less mimics fossil(1). */ int rc = 0; |
︙ | |||
20785 20786 20787 20788 20789 20790 20791 | 20906 20907 20908 20909 20910 20911 20912 20913 20914 20915 20916 20917 20918 20919 20920 20921 20922 20923 20924 20925 20926 20927 20928 20929 20930 20931 20932 20933 20934 20935 20936 20937 20938 20939 20940 20941 20942 20943 20944 20945 20946 20947 20948 20949 20950 20951 20952 20953 20954 20955 20956 20957 20958 20959 20960 20961 20962 20963 20964 20965 20966 20967 20968 20969 20970 20971 20972 20973 20974 20975 20976 20977 20978 20979 20980 20981 20982 20983 20984 20985 20986 20987 20988 20989 20990 20991 20992 20993 20994 20995 20996 20997 20998 20999 21000 21001 21002 21003 21004 21005 21006 21007 21008 21009 21010 21011 21012 21013 21014 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + | That said, sorting by UUID would have a nice side-effect on the output of grouping tags by the UUID they tag. So far (201404) such groups of tags have not appeared in the wild because fossil(1) has no mechanism for creating them. */ for( i = 0; !rc && (i < li->used); ++i, prevTag = tag){ |
︙ | |||
21077 21078 21079 21080 21081 21082 21083 | 21198 21199 21200 21201 21202 21203 21204 21205 21206 21207 21208 21209 21210 21211 21212 | - + | to do all updates to the event (timeline) table via these crosslinkers and perform the core, UI-agnostic, crosslinking bits in the internal fsl__deck_crosslink_XXX() functions. That should allow clients to override how the timeline is updated without requiring them to understand the rest of the required schema updates. */ |
︙ | |||
21379 21380 21381 21382 21383 21384 21385 | 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 21513 21514 21515 21516 21517 21518 21519 21520 21521 21522 21523 21524 21525 21526 21527 21528 21529 21530 21531 21532 | - - - - + + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - + + + + - - - - - - + + + | end: return rc; } static int fsl__deck_crosslink_ticket(fsl_deck * const d){ int rc; fsl_cx * const f = d->f; |
︙ | |||
21512 21513 21514 21515 21516 21517 21518 21519 | 21606 21607 21608 21609 21610 21611 21612 21613 21614 21615 21616 21617 21618 21619 21620 21621 21622 21623 21624 21625 21626 21627 21628 21629 21630 21631 21632 21633 21634 21635 21636 21637 21638 21639 21640 21641 21642 21643 21644 21645 21646 21647 21648 21649 21650 21651 21652 21653 21654 21655 21656 | + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + - + + | rc = fsl__deck_crosslink_attachment(d); break; /* FSL_SATYPE_CONTROL is handled above except for the timeline update, which is handled by a callback below */ default: break; } if(rc) goto end; /* Call any crosslink callbacks... */ |
︙ | |||
21632 21633 21634 21635 21636 21637 21638 | 21745 21746 21747 21748 21749 21750 21751 21752 21753 21754 21755 21756 21757 21758 21759 21760 21761 21762 21763 21764 21765 21766 21767 21768 21769 21770 21771 21772 21773 21774 21775 21776 21777 21778 21779 21780 21781 21782 21783 21784 21785 21786 21787 21788 21789 21790 21791 21792 21793 21794 21795 21796 21797 21798 21799 21800 21801 21802 21803 21804 21805 21806 21807 21808 21809 21810 21811 | - + - + - + - - + + - + - - - + + - - + - - - - - - + + + + + + - + - + - + - + | *pn = (fsl_size_t)n; return; } /** Internal helper for parsing manifests. Holds a source file (memory |
︙ | |||
21767 21768 21769 21770 21771 21772 21773 | 21878 21879 21880 21881 21882 21883 21884 21885 21886 21887 21888 21889 21890 21891 21892 21893 21894 21895 21896 21897 21898 21899 21900 21901 21902 21903 21904 21905 21906 21907 21908 21909 21910 21911 21912 21913 21914 21915 21916 21917 21918 21919 21920 21921 21922 21923 21924 21925 21926 21927 21928 21929 21930 21931 21932 21933 21934 21935 21936 21937 21938 21939 21940 21941 21942 21943 21944 21945 21946 21947 21948 21949 21950 21951 21952 21953 21954 21955 21956 21957 21958 21959 21960 21961 21962 21963 21964 21965 21966 21967 21968 | - + + - - + + - - + + + + + + + + + - - - - - - - - + + + + + + + + + + - - - + - - + + + + + + - + - + + + - - - | #ifdef ERROR # undef ERROR #endif #define ERROR(RC,MSG) do{ rc = (RC); zMsg = (MSG); goto bailout; } while(0) #define SYNTAX(MSG) ERROR(rc ? rc : FSL_RC_SYNTAX,MSG) bool isRepeat = 0/* , hasSelfRefTag = 0 */; int rc = 0; |
︙ | |||
21858 21859 21860 21861 21862 21863 21864 | 21980 21981 21982 21983 21984 21985 21986 21987 21988 21989 21990 21991 21992 21993 21994 21995 21996 21997 21998 21999 22000 22001 22002 22003 22004 22005 22006 22007 22008 22009 22010 22011 22012 22013 22014 22015 22016 22017 22018 22019 22020 22021 | - + - + - + - + | if( !isRepeat ) g.parseCnt[0]++; */ /* Reminder: parsing modifies the input (to simplify the tokenization/parsing). As of mid-201403, we recycle as much as possible from the source |
︙ | |||
21907 21908 21909 21910 21911 21912 21913 | 22029 22030 22031 22032 22033 22034 22035 22036 22037 22038 22039 22040 22041 22042 22043 | - + | ++lettersSeen[cType-'A']; }else{ SYNTAX("Invalid card name"); } switch(cType){ /* A <filename> <target> ?<source>? |
︙ | |||
21942 21943 21944 21945 21946 21947 21948 | 22064 22065 22066 22067 22068 22069 22070 22071 22072 22073 22074 22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 22089 22090 22091 22092 22093 22094 22095 22096 22097 22098 22099 22100 22101 22102 22103 22104 22105 22106 22107 22108 22109 22110 22111 22112 22113 22114 | - + - + - + | /*rc = fsl_deck_A_set(d, (char const *)name, (char const *)uuid, (char const *)src);*/ d->type = FSL_SATYPE_ATTACHMENT; break; } /* B <uuid> |
︙ | |||
22001 22002 22003 22004 22005 22006 22007 | 22123 22124 22125 22126 22127 22128 22129 22130 22131 22132 22133 22134 22135 22136 22137 22138 22139 22140 22141 22142 22143 22144 22145 22146 22147 22148 22149 22150 22151 22152 22153 22154 22155 22156 22157 22158 22159 22160 22161 22162 22163 22164 22165 22166 22167 22168 22169 22170 22171 22172 22173 22174 22175 22176 22177 22178 | - - - - + + + + - - - + + - + - - - - - - + + + + - - + + + | TOKEN_DATETIME(D,D); rc = fsl_deck_D_set(d, ts); break; } /* E <timestamp> <uuid> |
︙ | |||
22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 | 22195 22196 22197 22198 22199 22200 22201 22202 22203 22204 22205 22206 22207 22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 22228 22229 22230 22231 22232 22233 22234 22235 22236 22237 22238 22239 22240 22241 22242 22243 22244 22245 22246 22247 22248 22249 22250 22251 22252 22253 22254 22255 22256 22257 22258 22259 22260 22261 22262 22263 22264 22265 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 | + - - + - + - + - - + + | /*MARKER(("Unmatched perms string character: %d / %c !", (int)*perms, *perms));*/ SYNTAX("Invalid perms string character"); } TOKEN(0); if(token) priorName = (char *)token; } fsl_bytes_defossilize( (unsigned char *)name, 0 ); if(priorName) fsl_bytes_defossilize( (unsigned char *)priorName, 0 ); if(fsl_is_reserved_fn(name, -1)){ /* Some historical (pre-late-2020) manifests contain files they really shouldn't, like _FOSSIL_ and .fslckout. Since late 2020, fossil simply skips over these when parsing manifests, so we'll do the same. */ break; } |
︙ | |||
22178 22179 22180 22181 22182 22183 22184 | 22298 22299 22300 22301 22302 22303 22304 22305 22306 22307 22308 22309 22310 22311 22312 22313 22314 22315 22316 22317 22318 22319 22320 22321 22322 22323 22324 22325 22326 22327 22328 22329 22330 22331 22332 22333 22334 22335 22336 22337 22338 22339 22340 22341 22342 22343 22344 22345 22346 22347 22348 22349 22350 22351 22352 22353 22354 22355 22356 22357 22358 22359 22360 22361 22362 22363 22364 22365 22366 22367 22368 22369 22370 22371 22372 22373 22374 22375 22376 22377 22378 22379 22380 22381 22382 22383 22384 | - - + + - - + + - - + + - - + + - - + + | TOKEN(1); rc = fsl_deck_J_add(d, isAppend, field, (char const *)token); d->type = FSL_SATYPE_TICKET; break; } /* |
︙ | |||
22280 22281 22282 22283 22284 22285 22286 | 22400 22401 22402 22403 22404 22405 22406 22407 22408 22409 22410 22411 22412 22413 22414 22415 | - - + + | if(!rc){ TOKEN(0); } } break; } /* |
︙ | |||
22308 22309 22310 22311 22312 22313 22314 | 22428 22429 22430 22431 22432 22433 22434 22435 22436 22437 22438 22439 22440 22441 22442 22443 22444 22445 22446 22447 22448 22449 22450 22451 22452 22453 22454 22455 22456 22457 22458 22459 22460 22461 22462 22463 22464 22465 22466 22467 22468 22469 22470 22471 | - - + + - - - + + + - - - + + + - + | } d->type = FSL_SATYPE_CHECKIN; rc = fsl_deck_Q_add(d, qType, (char const *)uuid, (char const *)token); break; } /* |
︙ | |||
22374 22375 22376 22377 22378 22379 22380 | 22494 22495 22496 22497 22498 22499 22500 22501 22502 22503 22504 22505 22506 22507 22508 22509 22510 22511 22512 22513 22514 22515 22516 22517 22518 22519 | - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + | case '+': tagType = FSL_TAGTYPE_ADD; ++nSimpleTag; break; case '-': tagType = FSL_TAGTYPE_CANCEL; break; default: SYNTAX("Malformed tag name"); } ++name /* skip type marker byte */; |
︙ | |||
22446 22447 22448 22449 22450 22451 22452 | 22543 22544 22545 22546 22547 22548 22549 22550 22551 22552 22553 22554 22555 22556 22557 22558 22559 22560 22561 22562 22563 22564 22565 22566 22567 22568 22569 | - - + + - - - + | wlen = fsl_str_to_size((char const *)token); if((fsl_size_t)-1==wlen){ SYNTAX("Wiki size token is invalid"); } if( (&x.z[wlen+1]) > x.zEnd){ SYNTAX("Not enough content after W-card"); } |
︙ | |||
22515 22516 22517 22518 22519 22520 22521 | 22610 22611 22612 22613 22614 22615 22616 22617 22618 22619 22620 22621 22622 22623 22624 22625 | - + + | rc = d->f->error.code; goto bailout; } if(FSL_SATYPE_ANY==d->type){ rc = fsl_cx_err_set(f, FSL_RC_ERROR, "Internal error: could not determine type of " |
︙ | |||
22549 22550 22551 22552 22553 22554 22555 | 22645 22646 22647 22648 22649 22650 22651 22652 22653 22654 22655 22656 22657 22658 22659 22660 22661 22662 22663 22664 22665 22666 22667 22668 22669 22670 22671 22672 22673 22674 22675 | - + - + - + - + | FSL_SATYPE_FORUMPOST==d->type); assert(0==rc); /* Additional checks based on artifact type */ switch( d->type ){ case FSL_SATYPE_CONTROL: { if( nSelfTag ){ |
︙ | |||
22834 22835 22836 22837 22838 22839 22840 | 22930 22931 22932 22933 22934 22935 22936 22937 22938 22939 22940 22941 22942 22943 22944 | - + | #undef FCARD } int fsl_deck_save( fsl_deck * const d, bool isPrivate ){ int rc; fsl_cx * const f = d->f; fsl_db * const db = fsl_needs_repo(f); |
︙ | |||
23012 23013 23014 23015 23016 23017 23018 | 23108 23109 23110 23111 23112 23113 23114 23115 23116 23117 23118 23119 23120 23121 23122 23123 23124 23125 23126 23127 23128 23129 23130 23131 23132 23133 23134 23135 23136 23137 23138 23139 23140 | + - + + - + - + - - + | if(rc) break; } fsl_stmt_finalize(&q); if(rc) goto end; /* Process entries from pending_xlink temp table... */ rc = fsl_cx_prepare(f, &q, "SELECT id FROM pending_xlink"); if(rc) goto end; |
︙ | |||
23067 23068 23069 23070 23071 23072 23073 | 23164 23165 23166 23167 23168 23169 23170 23171 23172 23173 23174 23175 23176 23177 23178 23179 23180 23181 23182 23183 23184 23185 23186 23187 23188 23189 23190 23191 23192 23193 23194 23195 23196 23197 23198 23199 23200 23201 23202 23203 23204 23205 23206 23207 23208 23209 23210 23211 23212 23213 23214 23215 23216 23217 | + - + + - - - + + - + - - - - + + | rc = fsl_cx_exec(f, "UPDATE event SET" " mtime=(SELECT m1 FROM time_fudge WHERE mid=objid)" " WHERE objid IN (SELECT mid FROM time_fudge)" " AND (mtime=omtime OR omtime IS NULL)" ); } end: if(!rc){ |
︙ | |||
23358 23359 23360 23361 23362 23363 23364 23365 23366 23367 23368 23369 23370 23371 23372 23373 | 23454 23455 23456 23457 23458 23459 23460 23461 23462 23463 23464 23465 23466 23467 23468 23469 23470 23471 23472 23473 23474 23475 23476 23477 23478 | + - + | unsigned int i, base; unsigned int nHash; /* Number of hash table entries */ unsigned int *landmark; /* Primary hash table */ unsigned int *collide = NULL; /* Collision chain */ int lastRead = -1; /* Last byte of zSrc read by a COPY command */ int rc; /* generic return code checker. */ unsigned int olen = 0; /* current output length. */ unsigned int total = 0; /* total byte count. */ fsl_delta_hash h; unsigned char theBuf[IntegerBufSize] = {0,}; unsigned char * intBuf = theBuf; if(!zSrc || !zOut || !out) return FSL_RC_MISUSE; /* Add the target file size to the beginning of the delta */ #ifdef OUT #undef OUT #endif |
︙ | |||
23753 23754 23755 23756 23757 23758 23759 | 23850 23851 23852 23853 23854 23855 23856 23857 23858 23859 23860 23861 23862 23863 23864 23865 | - - + + | ){ return fsl_delta_apply2(zSrc, lenSrc_, zDelta, lenDelta_, zOut, NULL); } #undef NHASH #undef DEBUG1 #undef DEBUG2 |
︙ | |||
23776 23777 23778 23779 23780 23781 23782 23783 23784 23785 23786 23787 23788 23789 23790 23791 23792 23793 23794 23795 23796 | 23873 23874 23875 23876 23877 23878 23879 23880 23881 23882 23883 23884 23885 23886 23887 23888 23889 23890 23891 23892 23893 23894 23895 23896 23897 23898 23899 23900 23901 23902 23903 23904 23905 23906 23907 23908 23909 23910 23911 23912 23913 23914 23915 23916 23917 23918 23919 23920 23921 23922 23923 23924 23925 23926 23927 23928 23929 23930 23931 23932 23933 23934 23935 23936 23937 23938 23939 23940 23941 23942 23943 23944 23945 23946 23947 23948 23949 23950 23951 23952 23953 23954 23955 23956 23957 23958 23959 23960 23961 23962 23963 23964 23965 23966 23967 23968 23969 23970 23971 23972 23973 23974 23975 23976 23977 23978 23979 23980 23981 23982 23983 23984 23985 23986 23987 23988 23989 23990 23991 23992 23993 23994 23995 23996 23997 23998 23999 24000 24001 24002 24003 24004 24005 24006 24007 24008 24009 24010 24011 24012 24013 24014 24015 24016 24017 24018 24019 24020 24021 24022 24023 24024 24025 24026 24027 24028 24029 24030 24031 24032 24033 24034 24035 24036 24037 24038 24039 24040 24041 24042 24043 24044 24045 24046 24047 24048 24049 24050 24051 24052 24053 24054 24055 24056 24057 24058 24059 24060 24061 24062 24063 24064 24065 24066 24067 24068 24069 24070 24071 24072 24073 24074 24075 24076 24077 24078 24079 24080 24081 24082 24083 24084 24085 24086 24087 24088 24089 24090 24091 24092 24093 24094 24095 24096 24097 24098 24099 24100 24101 24102 24103 24104 24105 24106 24107 24108 24109 24110 24111 24112 24113 24114 24115 24116 24117 24118 24119 24120 24121 24122 24123 24124 24125 24126 24127 24128 24129 24130 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | the delta-generation). */ #include <assert.h> #include <memory.h> #include <stdlib.h> #include <string.h> /* for memmove()/strlen() */ #define MARKER(pfexp) \ do{ printf("MARKER: %s:%d:%s():\t",__FILE__,__LINE__,__func__); \ printf pfexp; \ } while(0) typedef uint64_t u64; typedef void ReCompiled /* porting crutch. i would strongly prefer to replace the regex support with a stateful predicate callback. */; #define DIFF_CONTEXT_MASK ((u64)0x0000ffff) /* Lines of context. Default if 0 */ #define DIFF_WIDTH_MASK ((u64)0x00ff0000) /* side-by-side column width */ #define DIFF_IGNORE_EOLWS ((u64)0x01000000) /* Ignore end-of-line whitespace */ #define DIFF_IGNORE_ALLWS ((u64)0x03000000) /* Ignore all whitespace */ #define DIFF_SIDEBYSIDE ((u64)0x04000000) /* Generate a side-by-side diff */ #define DIFF_VERBOSE ((u64)0x08000000) /* Missing shown as empty files */ #define DIFF_BRIEF ((u64)0x10000000) /* Show filenames only */ #define DIFF_HTML ((u64)0x20000000) /* Render for HTML */ #define DIFF_LINENO ((u64)0x40000000) /* Show line numbers */ #define DIFF_NOOPT (((u64)0x01)<<32) /* Suppress optimizations (debug) */ #define DIFF_INVERT (((u64)0x02)<<32) /* Invert the diff (debug) */ #define DIFF_CONTEXT_EX (((u64)0x04)<<32) /* Use context even if zero */ #define DIFF_NOTTOOBIG (((u64)0x08)<<32) /* Only display if not too big */ #define DIFF_STRIP_EOLCR (((u64)0x10)<<32) /* Strip trailing CR */ /* Annotation flags (any DIFF flag can be used as Annotation flag as well) */ #define ANN_FILE_VERS (((u64)0x20)<<32) /* Show file vers rather than commit vers */ #define ANN_FILE_ANCEST (((u64)0x40)<<32) /* Prefer check-ins in the ANCESTOR table */ /* ANSI escape codes: https://en.wikipedia.org/wiki/ANSI_escape_code */ #define ANSI_COLOR_BLACK(BOLD) ((BOLD) ? "\x1b[30m" : "\x1b[30m") #define ANSI_COLOR_RED(BOLD) ((BOLD) ? "\x1b[31;1m" : "\x1b[31m") #define ANSI_COLOR_GREEN(BOLD) ((BOLD) ? "\x1b[32;1m" : "\x1b[32m") #define ANSI_COLOR_YELLOW(BOLD) ((BOLD) ? "\x1b[33;1m" : "\x1b[33m") #define ANSI_COLOR_BLUE(BOLD) ((BOLD) ? "\x1b[34;1m" : "\x1b[34m") #define ANSI_COLOR_MAGENTA(BOLD) ((BOLD) ? "\x1b[35;1m" : "\x1b[35m") #define ANSI_COLOR_CYAN(BOLD) ((BOLD) ? "\x1b[36;1m" : "\x1b[36m") #define ANSI_COLOR_WHITE(BOLD) ((BOLD) ? "\x1b[37;1m" : "\x1b[37m") #define ANSI_DIFF_ADD(BOLD) ANSI_COLOR_GREEN(BOLD) #define ANSI_DIFF_RM(BOLD) ANSI_COLOR_RED(BOLD) #define ANSI_DIFF_MOD(BOLD) ANSI_COLOR_BLUE(BOLD) #define ANSI_BG_BLACK(BOLD) ((BOLD) ? "\x1b[40;1m" : "\x1b[40m") #define ANSI_BG_RED(BOLD) ((BOLD) ? "\x1b[41;1m" : "\x1b[41m") #define ANSI_BG_GREEN(BOLD) ((BOLD) ? "\x1b[42;1m" : "\x1b[42m") #define ANSI_BG_YELLOW(BOLD) ((BOLD) ? "\x1b[43;1m" : "\x1b[43m") #define ANSI_BG_BLUE(BOLD) ((BOLD) ? "\x1b[44;1m" : "\x1b[44m") #define ANSI_BG_MAGENTA(BOLD) ((BOLD) ? "\x1b[45;1m" : "\x1b[45m") #define ANSI_BG_CYAN(BOLD) ((BOLD) ? "\x1b[46;1m" : "\x1b[46m") #define ANSI_BG_WHITE(BOLD) ((BOLD) ? "\x1b[47;1m" : "\x1b[47m") #define ANSI_RESET_COLOR "\x1b[39;49m" #define ANSI_RESET_ALL "\x1b[0m" #define ANSI_RESET ANSI_RESET_ALL /*#define ANSI_BOLD ";1m"*/ /** Extract the number of lines of context from diffFlags. */ static int diff_context_lines(uint64_t diffFlags){ int n = diffFlags & DIFF_CONTEXT_MASK; if( n==0 && (diffFlags & DIFF_CONTEXT_EX)==0 ) n = 5; return n; } /* Extract the width of columns for side-by-side diff. Supply an appropriate default if no width is given. */ static int diff_width(uint64_t diffFlags){ int w = (diffFlags & DIFF_WIDTH_MASK)/(DIFF_CONTEXT_MASK+1); if( w==0 ) w = 80; return w; } /** Converts mask of public fsl_diff_flag_t (32-bit) values to the Fossil-internal 64-bit bitmask used by the DIFF_xxx macros. Why? (A) fossil(1) uses the macro approach and a low-level encoding of data in the bitmask (e.g. the context lines count). The public API hides the lower-level flags and allows the internal API to take care of the encoding. */ static uint64_t fsl_diff_flags_convert( int mask ){ uint64_t rc = 0U; #define DO(F) if( (mask & F)==F ) rc |= (((u64)F) << 24) DO(FSL_DIFF_IGNORE_EOLWS); DO(FSL_DIFF_IGNORE_ALLWS); DO(FSL_DIFF_SIDEBYSIDE); DO(FSL_DIFF_VERBOSE); DO(FSL_DIFF_BRIEF); DO(FSL_DIFF_HTML); DO(FSL_DIFF_LINENO); DO(FSL_DIFF_NOOPT); DO(FSL_DIFF_INVERT); DO(FSL_DIFF_NOTTOOBIG); DO(FSL_DIFF_STRIP_EOLCR); #undef DO return rc; } /* Length of a dline */ #define LENGTH(X) ((X)->n) /** Holds output state for diff generation. */ struct DiffOutState { /** Output callback. */ fsl_output_f out; /** State for this->out(). */ void * oState; /** For propagating output errors. */ int rc; char ansiColor; }; typedef struct DiffOutState DiffOutState; static const DiffOutState DiffOutState_empty = { NULL/*out*/, NULL/*oState*/, 0/*rc*/, 0/*useAnsiColor*/ }; /** Internal helper. Sends src to o->out(). If n is negative, fsl_strlen() is used to determine the length. */ static int diff_out( DiffOutState * const o, void const * src, fsl_int_t n ){ return o->rc = n ? o->out(o->oState, src, n<0 ? fsl_strlen((char const *)src) : (fsl_size_t)n) : 0; } /** fsl_output_f() impl for use with diff_outf(). state must be a (DiffOutState*). */ static int fsl_output_f_diff_out( void * state, void const * src, fsl_size_t n ){ DiffOutState * const os = (DiffOutState *)state; return os->rc = os->out(os->oState, src, n); } static int diff_outf( DiffOutState * o, char const * fmt, ... ){ va_list va; va_start(va,fmt); fsl_appendfv(fsl_output_f_diff_out, o, fmt, va); va_end(va); return o->rc; } /* Append a single line of context-diff output to pOut. */ static int appendDiffLine( DiffOutState *const pOut, /* Where to write the line of output */ char cPrefix, /* One of " ", "+", or "-" */ fsl_dline *pLine, /* The line to be output */ int html, /* True if generating HTML. False for plain text */ ReCompiled *pRe /* Colorize only if line matches this Regex */ ){ int rc = 0; char const * ansiPrefix = !pOut->ansiColor ? NULL : (('+'==cPrefix) ? ANSI_DIFF_ADD(0) : (('-'==cPrefix) ? ANSI_DIFF_RM(0) : NULL)) ; if(ansiPrefix) rc = diff_out(pOut, ansiPrefix, -1 ); if(!rc) rc = diff_out(pOut, &cPrefix, 1); if(rc) return rc; else if( html ){ #if 0 if( pRe /*MISSING: && re_dline_match(pRe, pLine, 1)==0 */ ){ cPrefix = ' '; }else #endif if( cPrefix=='+' ){ rc = diff_out(pOut, "<span class=\"fsl-diff-add\">", -1); }else if( cPrefix=='-' ){ rc = diff_out(pOut, "<span class=\"fsl-diff-rm\">", -1); } if(!rc){ /* unsigned short n = pLine->n; */ /* while( n>0 && (pLine->z[n-1]=='\n' || pLine->z[n-1]=='\r') ) n--; */ rc = pOut->rc = fsl_htmlize(pOut->out, pOut->oState, pLine->z, pLine->n); if( !rc && cPrefix!=' ' ){ rc = diff_out(pOut, "</span>", -1); } } }else{ rc = diff_out(pOut, pLine->z, pLine->n); } if(!rc){ if(ansiPrefix){ rc = diff_out(pOut, ANSI_RESET, -1 ); } if(!rc) rc = diff_out(pOut, "\n", 1); } return rc; } /* Add two line numbers to the beginning of an output line for a context diff. One or the other of the two numbers might be zero, which means to leave that number field blank. The "html" parameter means to format the output for HTML. */ static int appendDiffLineno(DiffOutState *pOut, int lnA, int lnB, int html){ int rc = 0; if( html ){ rc = diff_out(pOut, "<span class=\"fsl-diff-lineno\">", -1); } if(!rc){ if( lnA>0 ){ rc = diff_outf(pOut, "%6d ", lnA); }else{ rc = diff_out(pOut, " ", 7); } } if(!rc){ if( lnB>0 ){ rc = diff_outf(pOut, "%6d ", lnB); }else{ rc = diff_out(pOut, " ", 8); } if( !rc && html ){ rc = diff_out(pOut, "</span>", -1); } } return rc; } /* Minimum of two values */ static int minInt(int a, int b){ return a<b ? a : b; } /** Compute the optimal longest common subsequence (LCS) using an exhaustive search. This version of the LCS is only used for |
︙ | |||
23866 23867 23868 23869 23870 23871 23872 | 24200 24201 24202 24203 24204 24205 24206 24207 24208 24209 24210 24211 24212 24213 24214 24215 24216 24217 24218 24219 24220 24221 24222 24223 24224 24225 24226 24227 24228 24229 24230 24231 24232 24233 24234 24235 24236 24237 24238 24239 24240 24241 24242 24243 24244 24245 24246 24247 24248 24249 24250 24251 24252 24253 24254 24255 24256 24257 24258 24259 24260 24261 24262 24263 24264 24265 24266 24267 24268 24269 24270 24271 24272 24273 24274 24275 24276 24277 24278 24279 24280 24281 24282 24283 24284 24285 | - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | int dist = 0; /* Distance of match from center */ int mid; /* Center of the chng */ int iSXb, iSYb, iEXb, iEYb; /* Best match so far */ int iSXp, iSYp, iEXp, iEYp; /* Previous match */ sqlite3_int64 bestScore; /* Best score so far */ sqlite3_int64 score; /* Score for current candidate LCS */ int span; /* combined width of the input sequences */ |
︙ | |||
24194 24195 24196 24197 24198 24199 24200 | 24534 24535 24536 24537 24538 24539 24540 24541 24542 24543 24544 24545 24546 24547 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | lnFrom += del; lnTo += ins; } //fsl__dump_triples(p, __FILE__, __LINE__); } |
︙ | |||
25329 25330 25331 25332 25333 25334 25335 25336 25337 25338 25339 25340 25341 25342 | 25435 25436 25437 25438 25439 25440 25441 25442 25443 25444 25445 25446 25447 25448 25449 | + | int rc = 0; int a = 0; /* Index of next line in A[] */ int b = 0; /* Index of next line in B[] */ int *R; /* Array of COPY/DELETE/INSERT triples */ int r; /* Index into R[] */ int nr; /* Number of COPY/DELETE/INSERT triples to process */ int mxr; /* Maximum value for r */ int na, nb; /* Number of lines shown from A and B */ int i, j; /* Loop counters */ int m, ma, mb;/* Number of lines to output */ int skip; /* Number of lines to skip */ static int nChunk = 0; /* Number of chunks of diff output seen so far */ SbsLine s; /* Output line buffer */ int nContext; /* Lines of context above and below each change */ int showDivider = 0; /* True to show the divider */ |
︙ | |||
25398 25399 25400 25401 25402 25403 25404 | 25505 25506 25507 25508 25509 25510 25511 25512 25513 25514 25515 25516 25517 25518 25519 25520 25521 25522 25523 25524 25525 25526 25527 25528 25529 25530 25531 25532 25533 25534 25535 25536 25537 25538 25539 25540 25541 | - + + + + + + + + + + + + + + + + + + + | a = xa; b = xb; continue; } } #endif /* For the current block comprising nr triples, figure out |
︙ | |||
25716 25717 25718 25719 25720 25721 25722 25723 25724 25725 25726 25727 25728 25729 | 25841 25842 25843 25844 25845 25846 25847 25848 25849 25850 25851 25852 25853 25854 25855 25856 | + + | fsl_output_f out, void * outState, short contextLines, short sbsWidth, int diffFlags ){ return fsl_diff_text_impl(pA, pB, out, outState, contextLines, sbsWidth, diffFlags, NULL ); } int fsl_diff_text_to_buffer(fsl_buffer const *pA, fsl_buffer const *pB, fsl_buffer * pOut, short contextLines, short sbsWidth, int diffFlags ){ return (pA && pB && pOut) |
︙ | |||
25749 25750 25751 25752 25753 25754 25755 25756 25757 25758 25759 25760 25761 25762 | 25876 25877 25878 25879 25880 25881 25882 25883 25884 25885 25886 25887 25888 25889 25890 25891 | + + | #undef DIFF_NOTTOOBIG #undef DIFF_STRIP_EOLCR #undef SBS_LNA #undef SBS_TXTA #undef SBS_MKR #undef SBS_LNB #undef SBS_TXTB #undef ANN_FILE_VERS #undef ANN_FILE_ANCEST #undef ANSI_COLOR_BLACK #undef ANSI_COLOR_RED #undef ANSI_COLOR_GREEN #undef ANSI_COLOR_YELLOW #undef ANSI_COLOR_BLUE #undef ANSI_COLOR_MAGENTA |
︙ | |||
25772 25773 25774 25775 25776 25777 25778 | 25901 25902 25903 25904 25905 25906 25907 25908 25909 25910 25911 25912 25913 25914 25915 25916 25917 25918 25919 25920 25921 25922 25923 25924 25925 25926 25927 25928 25929 25930 25931 25932 25933 25934 25935 25936 25937 25938 25939 25940 25941 25942 25943 25944 25945 25946 25947 25948 | - - - + + + - - + + | #undef ANSI_BG_WHITE #undef ANSI_RESET_COLOR #undef ANSI_RESET_ALL #undef ANSI_RESET #undef ANSI_DIFF_ADD #undef ANSI_DIFF_MOD #undef ANSI_DIFF_RM |
︙ | |||
26258 26259 26260 26261 26262 26263 26264 | 26387 26388 26389 26390 26391 26392 26393 26394 26395 26396 26397 26398 26399 26400 26401 26402 26403 26404 26405 26406 26407 26408 26409 26410 26411 26412 26413 26414 26415 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | /* ** The threshold at which diffBlockAlignment transitions from the ** O(N*N) Wagner minimum-edit-distance algorithm to a less process ** O(NlogN) divide-and-conquer approach. */ #define DIFF_ALIGN_MX 1225 |
︙ | |||
26521 26522 26523 26524 26525 26526 26527 | 26520 26521 26522 26523 26524 26525 26526 26527 26528 26529 26530 26531 26532 26533 26534 | - + | ** each other. Insertion and deletion costs are 50. Match costs ** are between 0 and 100 where 0 is a perfect match 100 is a complete ** mismatch. */ static int diffBlockAlignment( const fsl_dline *aLeft, int nLeft, /* Text on the left */ const fsl_dline *aRight, int nRight, /* Text on the right */ |
︙ | |||
26704 26705 26706 26707 26708 26709 26710 | 26703 26704 26705 26706 26707 26708 26709 26710 26711 26712 26713 26714 26715 26716 26717 26718 26719 26720 26721 26722 26723 26724 26725 26726 26727 26728 26729 26730 26731 26732 26733 26734 26735 26736 26737 26738 26739 26740 26741 26742 26743 26744 26745 26746 26747 26748 26749 26750 26751 26752 26753 26754 26755 26756 26757 26758 26759 26760 26761 26762 26763 26764 26765 | - + - + - + - + - - - + + - + | end: fsl_free(pToFree); return rc; } /* |
︙ | |||
26808 26809 26810 26811 26812 26813 26814 | 26806 26807 26808 26809 26810 26811 26812 26813 26814 26815 26816 26817 26818 26819 26820 26821 26822 26823 26824 | + - - - + + + - - - - - + - - - - - - - - - - - | for(i=1; i<nr; i++){ na += R[r+i*3]; nb += R[r+i*3]; } //MARKER(("Chunk header... a=%u, b=%u, na=%u, nb=%u, skip=%d\n", a, b, na, nb, skip)); if(pBuilder->chunkHeader #if 0 |
︙ | |||
26850 26851 26852 26853 26854 26855 26856 | 26834 26835 26836 26837 26838 26839 26840 26841 26842 26843 26844 26845 26846 26847 26848 26849 | - - + + - - | //MARKER(("Show the initial common... a=%u, b=%u, m=%u, r=%u, skip=%d\n", a, b, m, r, skip)); if( skip>0 ){ if( NULL==pBuilder->chunkHeader && skip<(int)contextLines ){ /* 2021-09-27: BUG: this is incompatible with unified diff format. The generated header lines say we're skipping X lines but we then end up including lines which that header says to skip. As a workaround, we'll only run this when |
︙ | |||
26889 26890 26891 26892 26893 26894 26895 | 26871 26872 26873 26874 26875 26876 26877 26878 26879 26880 26881 26882 26883 26884 26885 26886 26887 26888 26889 26890 26891 26892 26893 26894 26895 26896 26897 26898 26899 26900 26901 26902 26903 26904 26905 26906 26907 26908 26909 26910 26911 26912 26913 26914 26915 26916 26917 26918 26919 26920 26921 26922 26923 26924 26925 26926 26927 26928 26929 26930 26931 26932 26933 26934 26935 | - - + - - - - + - - | /* Show the differences */ for(i=0; i<nr; i++){ unsigned int nAlign; unsigned char *alignment = 0; ma = R[r+i*3+1]; /* Lines on left but not on right */ mb = R[r+i*3+2]; /* Lines on right but not on left */ |
︙ | |||
26990 26991 26992 26993 26994 26995 26996 | 26966 26967 26968 26969 26970 26971 26972 26973 26974 26975 26976 26977 26978 26979 | - | RC; } if( R[r]>(int)contextLines ){ rc = pBuilder->skip(pBuilder, R[r] - contextLines); } end: #undef RC |
︙ | |||
27019 27020 27021 27022 27023 27024 27025 | 26994 26995 26996 26997 26998 26999 27000 27001 27002 27003 27004 27005 27006 27007 27008 27009 27010 27011 27012 27013 27014 27015 | - - + + - + | it. On error, *outRaw is not modified but pBuilder may have emitted partial output. That is not knowable for the general case. Ownership of pBuilder is not changed. If pBuilder is not NULL then pBuilder->opt must be non-NULL. */ static int fsl_diff2_text_impl(fsl_buffer const *pA, fsl_buffer const *pB, |
︙ | |||
27107 27108 27109 27110 27111 27112 27113 | 27082 27083 27084 27085 27086 27087 27088 27089 27090 27091 27092 27093 27094 27095 27096 27097 27098 27099 27100 27101 27102 27103 27104 27105 27106 27107 27108 27109 27110 27111 27112 27113 27114 27115 27116 27117 27118 27119 27120 27121 27122 27123 27124 27125 27126 27127 27128 27129 27130 27131 27132 27133 27134 27135 27136 27137 27138 27139 27140 27141 27142 27143 27144 27145 27146 27147 27148 27149 27150 27151 27152 27153 27154 27155 27156 27157 27158 27159 27160 27161 27162 27163 27164 27165 27166 27167 27168 27169 27170 27171 27172 27173 27174 27175 27176 27177 27178 27179 27180 27181 27182 27183 27184 27185 27186 27187 27188 27189 27190 27191 27192 27193 27194 27195 27196 27197 27198 27199 27200 27201 27202 27203 27204 27205 27206 27207 27208 27209 27210 27211 27212 27213 27214 27215 27216 27217 27218 27219 27220 27221 27222 27223 27224 27225 27226 27227 27228 27229 27230 27231 27232 27233 27234 27235 27236 27237 27238 27239 27240 27241 27242 27243 27244 27245 27246 27247 27248 27249 27250 27251 27252 27253 27254 27255 27256 27257 27258 27259 27260 27261 27262 27263 27264 27265 27266 27267 27268 27269 27270 27271 27272 27273 27274 27275 27276 27277 27278 27279 27280 27281 27282 27283 27284 27285 27286 27287 27288 27289 27290 27291 27292 27293 27294 27295 27296 27297 27298 27299 27300 27301 27302 27303 27304 27305 27306 27307 27308 27309 27310 27311 27312 27313 27314 27315 27316 27317 27318 27319 27320 27321 27322 27323 27324 | - + - + - + - + - - + + + + + - - - + + + - + - + - - + + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + - - - - - - - + + - + - - - - - - - - - - - + + + + - + - - - + + - - - - - - - - + + - + - - + - - - - - - - + + - + - - + - - - - - - - + + - - - + + + - - - - + - - - - + + - - - - - - - - + + - - + + - - - - + + + - - - - - - - - - - - - - - - + + - + - + - + - + - + - + - + - - + - - - - - - - + - - + - - - - - - - + - - - + + - - - - + + - - + - - + - - | - DIFF_NUMSTAT flag is not implemented. For that matter, flags which result in output going anywhere except for pBuilder->out are not implemented here, e.g. DIFF_RAW. That last point makes this impl tiny compared to the original! */ if(pBuilder){ |
︙ | |||
27530 27531 27532 27533 27534 27535 27536 | 27342 27343 27344 27345 27346 27347 27348 27349 27350 27351 27352 27353 27354 27355 27356 27357 27358 27359 27360 27361 27362 27363 27364 27365 27366 27367 27368 27369 27370 27371 27372 27373 27374 27375 27376 27377 27378 27379 27380 27381 27382 27383 27384 27385 27386 27387 27388 27389 27390 27391 27392 27393 27394 27395 27396 27397 27398 27399 27400 27401 27402 27403 27404 27405 27406 27407 27408 27409 27410 27411 27412 27413 27414 27415 27416 27417 27418 27419 27420 27421 27422 27423 27424 27425 27426 27427 27428 27429 27430 27431 27432 27433 27434 27435 27436 27437 27438 27439 27440 27441 27442 27443 27444 27445 27446 27447 27448 27449 27450 27451 27452 27453 27454 27455 27456 27457 27458 27459 27460 27461 27462 27463 27464 27465 27466 27467 27468 27469 27470 27471 27472 27473 27474 27475 27476 27477 27478 27479 27480 27481 27482 27483 27484 27485 27486 27487 27488 27489 27490 27491 27492 27493 27494 27495 27496 27497 27498 27499 27500 27501 27502 27503 27504 27505 27506 27507 27508 27509 27510 27511 27512 27513 27514 27515 27516 27517 27518 27519 27520 27521 27522 27523 27524 27525 27526 27527 27528 27529 27530 27531 27532 27533 27534 27535 27536 27537 27538 27539 27540 27541 27542 27543 27544 27545 27546 27547 27548 27549 27550 27551 27552 27553 27554 27555 27556 27557 27558 27559 27560 27561 27562 27563 27564 27565 27566 27567 27568 27569 27570 27571 27572 27573 27574 27575 27576 27577 27578 27579 27580 27581 27582 27583 27584 27585 27586 27587 27588 27589 27590 27591 27592 27593 27594 27595 27596 27597 27598 27599 27600 27601 27602 27603 27604 27605 27606 27607 27608 27609 27610 27611 27612 27613 27614 27615 27616 27617 27618 27619 27620 27621 27622 27623 27624 27625 27626 27627 27628 27629 27630 27631 27632 27633 27634 27635 27636 27637 27638 27639 27640 27641 27642 27643 27644 27645 27646 27647 27648 27649 27650 27651 27652 27653 27654 27655 27656 27657 27658 27659 27660 27661 27662 27663 27664 27665 27666 27667 27668 27669 27670 27671 27672 27673 27674 27675 27676 27677 27678 27679 27680 27681 27682 27683 27684 27685 27686 27687 27688 27689 27690 27691 27692 27693 27694 27695 27696 27697 27698 27699 27700 27701 27702 27703 27704 27705 27706 27707 27708 27709 27710 27711 27712 27713 27714 27715 27716 27717 27718 27719 27720 27721 27722 27723 27724 27725 27726 27727 27728 27729 27730 27731 27732 27733 27734 27735 27736 27737 27738 27739 27740 27741 27742 27743 27744 27745 27746 27747 27748 27749 27750 27751 27752 27753 27754 27755 27756 27757 27758 27759 27760 27761 27762 27763 27764 27765 27766 27767 27768 27769 27770 27771 27772 27773 27774 27775 27776 27777 27778 27779 27780 27781 27782 27783 27784 27785 27786 27787 27788 27789 27790 27791 27792 27793 27794 27795 27796 27797 27798 27799 27800 27801 27802 27803 27804 27805 27806 27807 27808 27809 27810 27811 27812 27813 27814 27815 27816 27817 27818 27819 27820 27821 27822 27823 27824 27825 27826 27827 27828 27829 27830 27831 27832 27833 27834 27835 27836 27837 27838 27839 27840 27841 27842 27843 27844 27845 27846 27847 27848 27849 27850 27851 27852 27853 27854 27855 27856 27857 27858 27859 27860 27861 27862 27863 27864 27865 27866 27867 27868 27869 27870 27871 27872 27873 27874 27875 27876 27877 27878 27879 27880 27881 27882 27883 27884 27885 27886 27887 27888 27889 27890 27891 27892 27893 27894 27895 27896 27897 27898 27899 27900 27901 27902 27903 27904 27905 27906 27907 27908 27909 27910 27911 27912 27913 27914 27915 27916 27917 27918 27919 27920 27921 27922 27923 27924 27925 27926 27927 27928 27929 27930 27931 27932 27933 27934 27935 27936 27937 27938 27939 27940 27941 27942 27943 27944 27945 27946 27947 27948 27949 27950 27951 27952 27953 27954 27955 27956 27957 27958 27959 27960 27961 27962 27963 27964 27965 27966 27967 27968 27969 27970 27971 27972 27973 27974 27975 27976 27977 27978 27979 27980 27981 27982 27983 27984 27985 27986 27987 27988 27989 27990 27991 27992 27993 27994 27995 27996 27997 27998 27999 28000 28001 28002 28003 28004 28005 28006 28007 28008 28009 28010 28011 28012 28013 28014 28015 28016 28017 28018 28019 28020 28021 28022 28023 28024 28025 28026 28027 28028 28029 28030 28031 28032 28033 28034 28035 28036 28037 28038 28039 28040 28041 28042 28043 28044 28045 28046 28047 28048 28049 28050 28051 28052 28053 28054 28055 28056 28057 28058 28059 28060 28061 28062 28063 28064 28065 28066 28067 28068 28069 28070 28071 28072 28073 28074 28075 28076 28077 28078 28079 28080 28081 28082 | - + - + - + - + - + - + - + - - - + + + - + - - - - + - + - + - + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + + + - + - - - + - - + - - + - - - - - - + - - - - - - + + + + + - - - - + - - - + - - - - - - - + + + + - - - - + + + - - + - - - - - + + + - - - + - - + - - - - - - - - - - - - - + + + + + - - - - + - - - - - - + + - - + - + - - - - - - - - + - - - + - - - - + - - - - + - - + - + - + - + - - - + - - - - - + + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - - + - - - - - - - - - - - - + - + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - + - - + + - + - + - - - + + + - + - + - + - - + + - + + + + + + + + + + + + + + + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - - + + - + - - + + - + - - + + - - - + + + - - + + - - + + - + - + - + - + - + - + - - + - - - + + | ** ** The SUBARRAY is an array of 3*N+1 strings with N>=0. The triples ** represent common-text, left-text, and right-text. The last string ** in SUBARRAY is the common-suffix. Any string can be empty if it does ** not apply. */ |
︙ | |||
28621 28622 28623 28624 28625 28626 28627 | 28347 28348 28349 28350 28351 28352 28353 28354 28355 28356 28357 28358 28359 28360 28361 28362 | - - + + | return (char *)b.mem /* transfer ownership */; }else{ fsl_buffer_clear(&b); return NULL; } } |
︙ | |||
28668 28669 28670 28671 28672 28673 28674 | 28394 28395 28396 28397 28398 28399 28400 28401 28402 28403 28404 28405 28406 28407 28408 28409 | - - + + | } return rc; } } #undef MARKER |
︙ | |||
28692 28693 28694 28695 28696 28697 28698 | 28418 28419 28420 28421 28422 28423 28424 28425 28426 28427 28428 28429 28430 28431 28432 28433 28434 28435 28436 28437 28438 28439 28440 28441 28442 28443 28444 28445 | - + - + | #include <assert.h> #include <string.h> /* strlen() */ #include <stddef.h> /* NULL on linux */ #include <ctype.h> #include <errno.h> #include <dirent.h> |
︙ | |||
28808 28809 28810 28811 28812 28813 28814 | 28534 28535 28536 28537 28538 28539 28540 28541 28542 28543 28544 28545 28546 28547 28548 28549 | - + + | memcpy(zBuf, zPwdUtf8, nPwd+1); fsl_filename_free(zPwdUtf8); if(outLen) *outLen = nPwd; return 0; #else if(!zBuf) return FSL_RC_MISUSE; else if(!nBuf) return FSL_RC_RANGE; |
︙ | |||
28837 28838 28839 28840 28841 28842 28843 | 28564 28565 28566 28567 28568 28569 28570 28571 28572 28573 28574 28575 28576 28577 28578 | - + | #if !defined(S_ISLNK) # define S_ISLNK(x) (0) #endif /* Reminder: the semantics of the 3rd parameter are reversed from v1's fossil_stat(). */ |
︙ | |||
28936 28937 28938 28939 28940 28941 28942 | 28663 28664 28665 28666 28667 28668 28669 28670 28671 28672 28673 28674 28675 28676 28677 28678 28679 28680 | - - - - - - + + + - - | fsl_fstat fst; return ( 0 != fsl_stat(zFilename, &fst, 1) ) ? false : (FSL_FSTAT_TYPE_FILE == fst.type); } bool fsl_is_symlink(const char *zFilename){ |
︙ | |||
29055 29056 29057 29058 29059 29060 29061 | 28777 28778 28779 28780 28781 28782 28783 28784 28785 28786 28787 28788 28789 28790 28791 28792 28793 28794 28795 28796 28797 28798 28799 28800 | - + - + + | fsl_size_t fsl_file_simplify_name(char *z, fsl_int_t n_, bool slash){ fsl_size_t i; fsl_size_t n = (n_<0) ? fsl_strlen(z) : (fsl_size_t)n_; fsl_int_t j; |
︙ | |||
29099 29100 29101 29102 29103 29104 29105 | 28822 28823 28824 28825 28826 28827 28828 28829 28830 28831 28832 28833 28834 28835 28836 28837 28838 28839 28840 28841 28842 | - - + | continue; } } if( j>=0 ) z[j] = z[i]; j++; } if( j==0 ) z[j++] = '.'; |
︙ | |||
29158 29159 29160 29161 29162 29163 29164 | 28880 28881 28882 28883 28884 28885 28886 28887 28888 28889 28890 28891 28892 28893 28894 28895 28896 28897 28898 28899 28900 | - - + - + | pOut->used = newLen; } return rc; } int fsl_file_canonical_name(const char *zOrigName, |
︙ | |||
29445 29446 29447 29448 29449 29450 29451 | 29166 29167 29168 29169 29170 29171 29172 29173 29174 29175 29176 29177 29178 29179 | - - - - - - | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED ); return dwAttributes==FILE_ATTRIBUTE_DIRECTORY; } #endif |
︙ | |||
29802 29803 29804 29805 29806 29807 29808 | 29517 29518 29519 29520 29521 29522 29523 29524 29525 29526 29527 29528 29529 29530 29531 29532 29533 | - - - - - - - + + + | } } if(err) rc = fsl_errno_to_rc(errno, FSL_RC_IO); return rc; #endif } |
︙ | |||
29856 29857 29858 29859 29860 29861 29862 | 29567 29568 29569 29570 29571 29572 29573 29574 29575 29576 29577 29578 29579 29580 | - - | rc = cb( dst ); if(!rc){ dbuf->mem[dbuf->used] = '/'; dbuf->used = newLen; if(FSL_FSTAT_TYPE_DIR==fst->type){ rc = fsl_dircrawl_impl( dbuf, fst, cb, cbState, dst, depth+1 ); } |
︙ | |||
29892 29893 29894 29895 29896 29897 29898 | 29601 29602 29603 29604 29605 29606 29607 29608 29609 29610 29611 29612 29613 29614 29615 29616 29617 | - + - - - + + | } fsl_buffer_clear(&dbuf); return rc; } bool fsl_is_file_or_link(const char *zFilename){ fsl_fstat fst = fsl_fstat_empty; |
︙ | |||
29920 29921 29922 29923 29924 29925 29926 | 29628 29629 29630 29631 29632 29633 29634 29635 29636 29637 29638 29639 29640 29641 29642 29643 29644 29645 29646 29647 29648 29649 29650 29651 29652 29653 29654 29655 29656 29657 29658 29659 29660 29661 | - + - - - + + + - + + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | (fsl_int_t)b->used); } int fsl_file_rename(const char *zFrom, const char *zTo){ int rc; #if defined(_WIN32) /** 2021-03-24: fossil's impl of this routine has 2 additional |
︙ | |||
30169 30170 30171 30172 30173 30174 30175 | 29672 29673 29674 29675 29676 29677 29678 29679 29680 29681 29682 29683 29684 29685 29686 29687 | - - + + | #ifdef _WIN32 # undef DIR # undef dirent # undef opendir # undef readdir # undef closedir #endif |
︙ | |||
30215 30216 30217 30218 30219 30220 30221 | 29718 29719 29720 29721 29722 29723 29724 29725 29726 29727 29728 29729 29730 29731 29732 29733 | - - + + | } return rc; } #undef MARKER |
︙ | |||
30304 30305 30306 30307 30308 30309 30310 | 29807 29808 29809 29810 29811 29812 29813 29814 29815 29816 29817 29818 29819 29820 29821 29822 | - - + + | } } return *z==0; #endif } |
︙ | |||
30361 30362 30363 30364 30365 30366 30367 | 29864 29865 29866 29867 29868 29869 29870 29871 29872 29873 29874 29875 29876 29877 29878 29879 29880 29881 29882 29883 29884 29885 29886 29887 29888 29889 29890 29891 29892 29893 29894 29895 29896 29897 | - + - - + + | glob = (char const *)globList->list[i]; if( fsl_str_glob( glob, zNeedle ) ) return glob; } return NULL; } } |
︙ | |||
30520 30521 30522 30523 30524 30525 30526 | 30023 30024 30025 30026 30027 30028 30029 30030 30031 30032 30033 30034 30035 30036 30037 30038 | - - + + | if(rc) break; rn1 = rn2 = BufSize; } return rc; } #undef MARKER |
︙ | |||
30547 30548 30549 30550 30551 30552 30553 | 30050 30051 30052 30053 30054 30055 30056 30057 30058 30059 30060 30061 30062 30063 30064 30065 30066 30067 30068 30069 30070 30071 30072 30073 30074 30075 30076 30077 | - - - + + + - | /* Only for debugging */ #define MARKER(pfexp) \ do{ printf("MARKER: %s:%d:%s():\t",__FILE__,__LINE__,__func__); \ printf pfexp; \ } while(0) |
︙ | |||
30699 30700 30701 30702 30703 30704 30705 | 30201 30202 30203 30204 30205 30206 30207 30208 30209 30210 30211 30212 30213 30214 30215 | - + | !rc && rid; rid=fsl_id_bag_next(&f->cache.leafCheck,rid)){ rc = fsl__repo_leafcheck(f, rid); } fsl_id_bag_reset(&f->cache.leafCheck); return rc; } |
︙ | |||
30841 30842 30843 30844 30845 30846 30847 | 30343 30344 30345 30346 30347 30348 30349 30350 30351 30352 30353 30354 30355 30356 30357 30358 30359 30360 30361 30362 30363 30364 30365 30366 30367 30368 30369 30370 30371 30372 30373 30374 30375 30376 30377 30378 30379 30380 30381 30382 30383 30384 30385 30386 30387 30388 30389 30390 30391 30392 30393 30394 30395 30396 30397 30398 30399 30400 30401 30402 30403 30404 30405 30406 30407 30408 30409 30410 30411 30412 30413 30414 30415 30416 30417 30418 30419 | - + - + - + - - - + + + - - + + - - - - - - - + + - + | return rc; dberr: assert(rc); rc = fsl_cx_uplift_db_error2(f, db, rc); goto end; } |
︙ | |||
30931 30932 30933 30934 30935 30936 30937 | 30428 30429 30430 30431 30432 30433 30434 30435 30436 30437 30438 30439 30440 30441 30442 30443 30444 30445 30446 30447 30448 30449 30450 30451 30452 30453 30454 30455 30456 30457 30458 30459 30460 30461 30462 30463 30464 30465 30466 30467 30468 30469 30470 30471 30472 30473 30474 30475 30476 30477 30478 30479 30480 30481 30482 | - + - + - + - + | memset( m + self->capacity, 0, (sizeof(void*)*(n-self->capacity))); self->capacity = n; self->list = m; return 0; } } |
︙ | |||
31000 31001 31002 31003 31004 31005 31006 | 30497 30498 30499 30500 30501 30502 30503 30504 30505 30506 30507 30508 30509 30510 30511 | - + | } } } return rc; } |
︙ | |||
31032 31033 31034 31035 31036 31037 31038 | 30529 30530 30531 30532 30533 30534 30535 30536 30537 30538 30539 30540 30541 30542 30543 | - + | } } } } return rc; } |
︙ | |||
31064 31065 31066 31067 31068 31069 31070 | 30561 30562 30563 30564 30565 30566 30567 30568 30569 30570 30571 30572 30573 30574 30575 30576 | - - + + | } fsl_int_t fsl_list_index_of_cstr( fsl_list const * li, char const * key ){ return fsl_list_index_of(li, key, fsl_strcmp_cmp); } |
︙ | |||
31123 31124 31125 31126 31127 31128 31129 | 30620 30621 30622 30623 30624 30625 30626 30627 30628 30629 30630 30631 30632 30633 | - - - - - | #undef US3A #undef US3B #undef US4A #undef US4B #undef US4C #undef US0A |
︙ | |||
31217 31218 31219 31220 31221 31222 31223 | 30709 30710 30711 30712 30713 30714 30715 30716 30717 30718 30719 30720 30721 30722 30723 30724 | - - + + | c = (c>=0xC0) ? (c|3) : ' '; /* determine next lead byte */ } else { c = *++z; } } return c<0x80 /* Final lead byte must be ASCII. */; } |
︙ | |||
31660 31661 31662 31663 31664 31665 31666 | 31152 31153 31154 31155 31156 31157 31158 31159 31160 31161 31162 31163 31164 31165 31166 31167 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | #undef F1 #undef F2 #undef F3 #undef F4 #undef MD5STEP #undef byteReverse |
︙ | |||
33050 33051 33052 33053 33054 33055 33056 | 31269 31270 31271 31272 31273 31274 31275 31276 31277 31278 31279 31280 31281 31282 31283 31284 31285 31286 31287 31288 31289 31290 31291 31292 31293 31294 31295 31296 31297 31298 31299 31300 31301 31302 31303 31304 31305 31306 31307 31308 31309 31310 31311 31312 31313 31314 31315 31316 | - - - - + + + + - + - - + - - - - - + - - | sz -= aC[1]; aC += 3; } return true; } /** |
︙ | |||
33126 33127 33128 33129 33130 33131 33132 | 31338 31339 31340 31341 31342 31343 31344 31345 31346 31347 31348 31349 31350 31351 31352 31353 | + - + | } /** Ensure that the text in p, if not empty, ends with a new line. If useCrLf is true adds "\r\n" otherwise "\n". Returns 0 on success or p is empty, and FSL_RC_OOM on OOM. */ static |
︙ | |||
33173 33174 33175 33176 33177 33178 33179 | 31386 31387 31388 31389 31390 31391 31392 31393 31394 31395 31396 31397 31398 31399 31400 31401 31402 31403 31404 31405 31406 31407 31408 31409 31410 31411 31412 31413 31414 31415 31416 31417 31418 31419 31420 31421 31422 31423 31424 31425 31426 31427 31428 31429 31430 31431 31432 31433 | - - - - + + + + - + - - - - - - - - + + - - - - + + + + - - - - - - - - - - - - - - - - - + - - + | NEVER, EVER change these. They MUST match the ones used by fossil. */ static const char *const mergeMarker[] = { /*123456789 123456789 123456789 123456789 123456789 123456789 123456789*/ |
︙ | |||
33261 33262 33263 33264 33265 33266 33267 | 31451 31452 31453 31454 31455 31456 31457 31458 31459 31460 31461 31462 31463 31464 31465 31466 | - - + + | ** and pPivot => pV2 (into aC2). Each of the aC1 and aC2 arrays is ** an array of integer triples. Within each triple, the first integer ** is the number of lines of text to copy directly from the pivot, ** the second integer is the number of lines of text to omit from the ** pivot, and the third integer is the number of lines of text that are ** inserted. The edit array ends with a triple of 0,0,0. */ |
︙ | |||
33292 33293 33294 33295 33296 33297 33298 | 31482 31483 31484 31485 31486 31487 31488 31489 31490 31491 31492 31493 31494 31495 31496 31497 31498 31499 31500 31501 31502 31503 31504 31505 31506 31507 31508 31509 31510 31511 31512 31513 31514 31515 31516 31517 31518 31519 31520 31521 31522 31523 31524 31525 31526 31527 31528 31529 31530 31531 31532 31533 31534 31535 31536 31537 31538 31539 31540 31541 31542 31543 31544 31545 31546 31547 31548 31549 31550 31551 31552 31553 31554 31555 31556 31557 31558 31559 31560 31561 31562 31563 31564 31565 31566 31567 31568 31569 31570 31571 31572 31573 31574 31575 31576 31577 31578 | - - - - - - - - - - - - - - + + - - + + + + + + - - + + - + - - - - + + + + + + + - + | /* Loop over the two edit vectors and use them to compute merged text ** which is written into pOut. i1 and i2 are multiples of 3 which are ** indices into aC1[] and aC2[] to the edit triple currently being ** processed */ i1 = i2 = 0; |
︙ | |||
33424 33425 33426 33427 33428 33429 33430 | 31609 31610 31611 31612 31613 31614 31615 31616 31617 31618 31619 31620 31621 31622 31623 31624 31625 31626 31627 31628 31629 31630 31631 31632 31633 31634 31635 31636 31637 | - - + + - - - + + | fsl_size_t const len = (fsl_size_t)assert_mema_lengths(); if(p->used <= len) return false; fsl_size_t j; const char * const z = (const char *)p->mem; fsl_size_t const n = p->used - len + 1; for(i=0; i<n; ){ for(j=0; j<4; ++j){ |
︙ | |||
33467 33468 33469 33470 33471 33472 33473 | 31651 31652 31653 31654 31655 31656 31657 31658 31659 31660 31661 31662 31663 31664 31665 31666 31667 31668 31669 31670 31671 31672 31673 | - + + + + + + + | */ /************************************************************************* This copy has been modified slightly for use in the libfossil project. */ #undef __STRICT_ANSI__ #include <errno.h> |
︙ | |||
33504 33505 33506 33507 33508 33509 33510 | 31694 31695 31696 31697 31698 31699 31700 31701 31702 31703 31704 31705 31706 31707 31708 | - + | # define PTR_TO_INT(X) ((int)(intptr_t)(X)) #else /* Generates a warning - but it always works */ # define INT_TO_PTR(X) ((void*)(X)) # define PTR_TO_INT(X) ((int)(X)) #endif |
︙ | |||
33548 33549 33550 33551 33552 33553 33554 | 31738 31739 31740 31741 31742 31743 31744 31745 31746 31747 31748 31749 31750 31751 31752 31753 31754 31755 31756 31757 31758 31759 31760 31761 31762 31763 31764 31765 31766 31767 31768 31769 31770 31771 31772 31773 31774 31775 31776 31777 31778 31779 31780 31781 31782 31783 31784 31785 31786 31787 31788 31789 31790 | - + - - + - + - - + - | &pi /* Process Info */ ); if( rc ){ CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); *pChildPid = pi.dwProcessId; }else{ |
︙ | |||
33643 33644 33645 33646 33647 33648 33649 | 31830 31831 31832 31833 31834 31835 31836 31837 31838 31839 31840 31841 31842 31843 31844 31845 31846 31847 31848 31849 31850 31851 31852 31853 31854 31855 31856 31857 31858 31859 31860 31861 31862 31863 31864 31865 31866 31867 31868 31869 31870 31871 31872 31873 31874 31875 31876 31877 | - + - - - - - + - - - - - - + - - - + + - - + + | close(pout[0]); close(pout[1]); close(1); fd = dup(pin[1]); if( fd!=1 ) nErr++; close(pin[0]); close(pin[1]); |
︙ | |||
33762 33763 33764 33765 33766 33767 33768 | 31939 31940 31941 31942 31943 31944 31945 31946 31947 31948 31949 31950 31951 31952 31953 31954 | - - + + | if( pp ) *pp = p->list[0].data; for(i=0; i<((fsl_id_t)p->used-1); ++i){ p->list[i] = p->list[i+1]; } --p->used; return e; } |
︙ | |||
33825 33826 33827 33828 33829 33830 33831 | 32002 32003 32004 32005 32006 32007 32008 32009 32010 32011 32012 32013 32014 32015 32016 32017 32018 32019 32020 32021 32022 32023 32024 32025 32026 32027 32028 32029 32030 32031 32032 32033 32034 32035 32036 32037 32038 32039 32040 32041 32042 32043 32044 32045 32046 32047 32048 | + + + + - - + + + + + - + - - + - + - - - - + + + + + + + - - + + - - + - - + - - + - - - - + | " WHERE tagid=%d AND tagxref.rid=ancestor.rid" " AND value=%Q AND tagtype>0)" " LIMIT 1", rid, rid, FSL_TAGID_BRANCH, zBranch ); } /** TODO: figure out if this needs to be in the public API and, if it does, change its signature to: |
︙ | |||
33935 33936 33937 33938 33939 33940 33941 | 32115 32116 32117 32118 32119 32120 32121 32122 32123 32124 32125 32126 32127 32128 32129 32130 32131 32132 | - - - + + + + | */ static fsl_id_t fsl_start_of_branch(fsl_cx * f, fsl_id_t rid, enum fsl_stobr_type eType){ fsl_db * db; fsl_stmt q = fsl_stmt_empty; int rc; fsl_id_t ans = rid; |
︙ | |||
33969 33970 33971 33972 33973 33974 33975 | 32150 32151 32152 32153 32154 32155 32156 32157 32158 32159 32160 32161 32162 32163 32164 32165 32166 32167 32168 32169 | - - + + - + + | break; } ans = fsl_stmt_g_id(&q, 0); }while( fsl_stmt_g_int32(&q, 1)==1 && ans>0 ); fsl_stmt_finalize(&q); end: if( ans>0 && eType==FSL_STOBR_YOAN ){ |
︙ | |||
34275 34276 34277 34278 34279 34280 34281 | 32457 32458 32459 32460 32461 32462 32463 32464 32465 32466 32467 32468 32469 32470 32471 32472 32473 32474 32475 32476 32477 32478 32479 32480 32481 32482 32483 32484 32485 32486 32487 32488 32489 32490 32491 32492 32493 32494 32495 32496 32497 32498 32499 32500 32501 32502 32503 32504 32505 32506 32507 32508 32509 32510 32511 32512 32513 32514 32515 32516 32517 32518 32519 32520 32521 32522 32523 32524 32525 32526 32527 32528 32529 32530 32531 32532 32533 32534 32535 32536 32537 32538 32539 32540 32541 | + - - - - - + + + + + + + + - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + | } else if(uuidLen>FSL_STRLEN_K256){ fsl_cx_err_set(f, FSL_RC_RANGE, "UUID is too long: %s", uuid); return -4; } else { fsl_id_t rid = -5; fsl_stmt q = fsl_stmt_empty; |
︙ | |||
34410 34411 34412 34413 34414 34415 34416 | 32601 32602 32603 32604 32605 32606 32607 32608 32609 32610 32611 32612 32613 32614 32615 32616 32617 32618 32619 32620 32621 32622 32623 32624 32625 32626 32627 32628 32629 32630 32631 32632 32633 32634 32635 32636 32637 32638 32639 32640 | - - - - - + + + + + + + + - - - - - + + + + - - - - - - + + + + + - - - - + + + - - - - - - + + + + + + | }else if(db->error.code){ fsl_cx_uplift_db_error(f, db); } return rc; } int fsl_delta_src_id( fsl_cx * const f, fsl_id_t deltaRid, |
︙ | |||
34677 34678 34679 34680 34681 34682 34683 | 32868 32869 32870 32871 32872 32873 32874 32875 32876 32877 32878 32879 32880 32881 32882 32883 32884 32885 32886 32887 32888 32889 32890 32891 32892 32893 32894 32895 32896 32897 32898 32899 32900 32901 32902 32903 32904 32905 32906 32907 32908 32909 32910 32911 32912 32913 32914 32915 32916 32917 32918 32919 32920 32921 32922 32923 32924 32925 32926 32927 32928 32929 32930 32931 32932 32933 32934 32935 32936 32937 32938 | - - + + + + + + + + + + + + + + + + + + - + - | int fsl_repo_create(fsl_cx * f, fsl_repo_create_opt const * opt ){ fsl_db * db = 0; fsl_cx F = fsl_cx_empty /* used if !f */; int rc = 0; char const * userName = 0; fsl_time_t const unixNow = (fsl_time_t)time(0); |
︙ | |||
34753 34754 34755 34756 34757 34758 34759 | 32959 32960 32961 32962 32963 32964 32965 32966 32967 32968 32969 32970 32971 32972 32973 32974 32975 32976 32977 32978 32979 32980 32981 32982 32983 32984 32985 32986 32987 32988 32989 32990 32991 32992 32993 32994 | - + - + - - + + + + - + - + | in fossil this is optional, so we will presumably eventually have to make it so here as well. Not yet sure where this routine is used in fossil (i.e. whether the option is actually exercised). */ rc = fsl_db_exec_multi(db, |
︙ | |||
34811 34812 34813 34814 34815 34816 34817 | 33019 33020 33021 33022 33023 33024 33025 33026 33027 33028 33029 33030 33031 33032 33033 | - + | rc = fsl_cx_uplift_db_error(f, db); } if(inTrans){ if(!rc) rc = fsl_db_transaction_end(db, 0); else fsl_db_transaction_end(db, 1); inTrans = 0; } |
︙ | |||
34868 34869 34870 34871 34872 34873 34874 | 33076 33077 33078 33079 33080 33081 33082 33083 33084 33085 33086 33087 33088 33089 33090 33091 33092 33093 33094 33095 33096 33097 33098 33099 33100 33101 33102 33103 33104 33105 33106 33107 33108 33109 33110 33111 33112 33113 33114 33115 33116 33117 33118 33119 33120 33121 33122 33123 33124 33125 33126 33127 33128 33129 33130 33131 33132 33133 33134 33135 33136 33137 33138 33139 33140 33141 33142 33143 33144 | - + - + - - + + - - + - - + + + - + + + + + + + + + + | goto detach; } inTrans2 = 1; /* Copy all settings from the supplied template repository. */ rc = fsl_db_exec(db, |
︙ | |||
34944 34945 34946 34947 34948 34949 34950 | 33161 33162 33163 33164 33165 33166 33167 33168 33169 33170 33171 33172 33173 33174 33175 | - + - | if(f == &F){ fsl_cx_finalize(f); if(rc) fsl_file_unlink(opt->filename); } return rc; } |
︙ | |||
34972 34973 34974 34975 34976 34977 34978 34979 34980 34981 | 33188 33189 33190 33191 33192 33193 33194 33195 33196 33197 33198 33199 33200 33201 33202 33203 33204 33205 33206 33207 33208 33209 33210 | + - + - + | } rc = fsl_buffer_appendf(&tname, "tmp_filelist_for_rid_%d", (int)rid); if(rc) goto end; rc = fsl_deck_F_rewind(d); while( !rc && !(rc=fsl_deck_F_next(d, &fc)) && fc ){ //if(!fc->name) continue; assert(fc->name && *fc->name); if(!st.stmt){ rc = fsl_db_exec(dbR, "CREATE TEMP TABLE IF NOT EXISTS " |
︙ | |||
35001 35002 35003 35004 35005 35006 35007 | 33218 33219 33220 33221 33222 33223 33224 33225 33226 33227 33228 33229 33230 33231 33232 | - + | fsl_stmt_reset(&st); fc = 0; } if(!rc && (count>0)){ fsl_stmt_finalize(&st); rc = fsl_db_prepare(dbR, &st, |
︙ | |||
35034 35035 35036 35037 35038 35039 35040 | 33251 33252 33253 33254 33255 33256 33257 33258 33259 33260 33261 33262 33263 33264 33265 33266 33267 33268 33269 33270 33271 33272 33273 33274 33275 | - + - + - - + + + - | end: if(rc && !f->error.code && dbR->error.code){ fsl_cx_uplift_db_error(f, dbR); } fsl_stmt_finalize(&st); fsl_deck_clean(d); if(tname.used){ |
︙ | |||
35098 35099 35100 35101 35102 35103 35104 | 33315 33316 33317 33318 33319 33320 33321 33322 33323 33324 33325 33326 33327 33328 33329 | - + | /* UNTESTED */ char fsl_repo_is_readonly(fsl_cx const * f){ if(!f || !f->dbMain) return 0; else{ int const roleId = f->ckout.db.dbh ? FSL_DBROLE_MAIN : FSL_DBROLE_REPO /* If CKOUT is attached, it is the main DB and REPO is ATTACHed. */ ; |
︙ | |||
35131 35132 35133 35134 35135 35136 35137 | 33348 33349 33350 33351 33352 33353 33354 33355 33356 33357 33358 33359 33360 33361 33362 33363 33364 33365 33366 33367 33368 33369 33370 33371 33372 33373 33374 33375 33376 33377 33378 33379 33380 33381 33382 33383 33384 33385 33386 33387 33388 33389 33390 33391 33392 33393 33394 33395 33396 33397 33398 33399 | - + - + - - - - + - + - + | dbConf = fsl_cx_db_config(f); if(dbConf){ int const dbRole = (f->dbMain==&f->config.db) ? FSL_DBROLE_MAIN : FSL_DBROLE_CONFIG; rc = fsl_db_exec(dbConf, "INSERT OR IGNORE INTO %s.global_config(name,value) " "VALUES('repo:%q',1)", |
︙ | |||
35219 35220 35221 35222 35223 35224 35225 | 33433 33434 33435 33436 33437 33438 33439 33440 33441 33442 33443 33444 33445 33446 33447 33448 33449 33450 33451 33452 33453 33454 33455 33456 | - + - - + + | if(db->error.code){ fsl_cx_uplift_db_error(f, db); } return rv; } } |
︙ | |||
35275 35276 35277 35278 35279 35280 35281 | 33489 33490 33491 33492 33493 33494 33495 33496 33497 33498 33499 33500 33501 33502 | - | }else if(!fid){ rc = fsl_cx_err_set(f, FSL_RC_NOT_FOUND, "Could not resolve RID for UUID: %s", fc->uuid); }else if(opt.extractContent){ fsl_buffer_reuse(content); rc = fsl_content_get(f, fid, content); |
︙ | |||
35343 35344 35345 35346 35347 35348 35349 | 33556 33557 33558 33559 33560 33561 33562 33563 33564 33565 33566 33567 33568 33569 33570 33571 | - - + + | rid, uuid ); assert(cursorKludge.mem == in->mem); return rc; } } |
︙ | |||
35467 35468 35469 35470 35471 35472 35473 | 33680 33681 33682 33683 33684 33685 33686 33687 33688 33689 33690 33691 33692 33693 33694 | - + | } end: fsl__cx_scratchpad_yield(f, sql); fsl_stmt_finalize(&q); return rc; } |
︙ | |||
35607 35608 35609 35610 35611 35612 35613 | 33820 33821 33822 33823 33824 33825 33826 33827 33828 33829 33830 33831 33832 33833 33834 | - + | /** Update the repository schema for Fossil version 2.0. (2017-02-28) (1) Change the CHECK constraint on BLOB.UUID so that the length is greater than or equal to 40, not exactly equal to 40. */ zBlobSchema = fsl_db_g_text(frs->db, NULL, "SELECT sql FROM %!Q.sqlite_schema" |
︙ | |||
35630 35631 35632 35633 35634 35635 35636 | 33843 33844 33845 33846 33847 33848 33849 33850 33851 33852 33853 33854 33855 33856 33857 33858 33859 33860 33861 33862 33863 33864 33865 33866 33867 33868 33869 | - + - + | int rc2 = 0; zBlobSchema[i] = '>'; sqlite3_db_config(frs->db->dbh, SQLITE_DBCONFIG_DEFENSIVE, 0, &rc2); rc = fsl_cx_exec_multi(frs->f, "PRAGMA writable_schema=ON;" "UPDATE %!Q.sqlite_schema SET sql=%Q WHERE name LIKE 'blob';" "PRAGMA writable_schema=OFF;", |
︙ | |||
35811 35812 35813 35814 35815 35816 35817 | 34024 34025 34026 34027 34028 34029 34030 34031 34032 34033 34034 34035 34036 34037 34038 34039 34040 34041 34042 34043 34044 34045 34046 34047 34048 34049 34050 34051 | - + + + + + + + + - + + - | fsl_stmt_bind_id(&frs->qChild, 1, cid); if( FSL_RC_STEP_ROW==fsl_stmt_step(&frs->qChild) && (sz = fsl_stmt_g_int64(&frs->qChild, 1))>=0 ){ fsl_buffer next = fsl_buffer_empty; fsl_buffer delta = fsl_buffer_empty; void const * blob = 0; fsl_size_t deltaBlobSize = 0; |
︙ | |||
35912 35913 35914 35915 35916 35917 35918 35919 35920 35921 35922 35923 35924 35925 | 34132 34133 34134 34135 34136 34137 34138 34139 34140 34141 34142 34143 34144 34145 34146 34147 34148 34149 34150 34151 34152 34153 34154 34155 34156 34157 34158 34159 34160 34161 34162 34163 34164 34165 34166 34167 34168 34169 34170 34171 34172 34173 34174 34175 34176 34177 34178 34179 34180 34181 34182 34183 34184 34185 34186 34187 34188 34189 34190 34191 34192 34193 34194 34195 | + + + - + - + - - + + - + - + - - + + + + | default: break; } fsl__cx_scratchpad_yield(frs->f, b); return rc; } #define FSL__REBUILD_SKIP_TICKETS 1 /* remove this once crosslinking does something useful with tickets. */ static int fsl__rebuild(fsl_cx * const f, fsl_rebuild_opt const * const opt){ fsl_stmt s = fsl_stmt_empty; fsl_stmt q = fsl_stmt_empty; fsl_db * const db = fsl_cx_db_repo(f); int rc; FslRebuildState frs = FslRebuildState_empty; |
︙ | |||
35986 35987 35988 35989 35990 35991 35992 | 34211 34212 34213 34214 34215 34216 34217 34218 34219 34220 34221 34222 34223 34224 | - | } //totalSize += incrSize*2; rc = fsl_cx_prepare(f, &s, "SELECT rid, size FROM blob /*scan*/" " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)" " AND NOT EXISTS(SELECT 1 FROM delta WHERE rid=blob.rid)" |
︙ | |||
36013 36014 36015 36016 36017 36018 36019 | 34237 34238 34239 34240 34241 34242 34243 34244 34245 34246 34247 34248 34249 34250 34251 34252 34253 34254 34255 34256 34257 34258 34259 34260 34261 34262 34263 34264 34265 34266 34267 34268 34269 34270 34271 34272 34273 34274 34275 34276 34277 34278 34279 34280 34281 34282 34283 34284 34285 34286 34287 34288 34289 34290 34291 34292 34293 34294 34295 34296 | - - - - - - - - - - - - - - - - - - - - - - - - - + - + | } } fsl_stmt_finalize(&s); if(rc) goto crosslink_end; rc = fsl_cx_prepare(f, &s, "SELECT rid, size FROM blob" " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)" |
︙ | |||
36105 36106 36107 36108 36109 36110 36111 | 34305 34306 34307 34308 34309 34310 34311 34312 34313 34314 34315 34316 34317 34318 34319 34320 34321 34322 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + | int const rc2 = fsl_cx_transaction_end(f, opt->dryRun || rc!=0); if(0==rc && 0!=rc2) rc = rc2; } fsl_cx_interrupt(f, 0, NULL); return rc; } |
︙ | |||
36264 36265 36266 36267 36268 36269 36270 | 34364 34365 34366 34367 34368 34369 34370 34371 34372 34373 34374 34375 34376 34377 34378 34379 | - - + + | return fsl_schema_ticket_cstr; } char const * fsl_schema_forum(){ extern char const * fsl_schema_forum_cstr; return fsl_schema_forum_cstr; } |
︙ | |||
36365 36366 36367 36368 36369 36370 36371 | 34465 34466 34467 34468 34469 34470 34471 34472 34473 34474 34475 34476 34477 34478 34479 34480 | - - + + | /* All forum posts are always indexed */ end: return rc; #endif } #undef MARKER |
︙ | |||
38269 38270 38271 38272 38273 38274 38275 | 36369 36370 36371 36372 36373 36374 36375 36376 36377 36378 36379 36380 36381 36382 36383 36384 | - - + + | fsl_sha1_init(&ctx); fsl_sha1_update(&ctx, zIn, (len<0) ? fsl_strlen(zIn) : (fsl_size_t)len); fsl_sha1_final_hex(&ctx, zHex); return zHex; } } |
︙ | |||
38904 38905 38906 38907 38908 38909 38910 | 37004 37005 37006 37007 37008 37009 37010 37011 37012 37013 37014 37015 37016 37017 37018 37019 37020 37021 37022 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + | fsl_sha3_end(&ctx); rc = fsl_buffer_append(pCksum, ctx.hex, fsl_strlen(ctx.hex)); return rc; #endif } } |
︙ | |||
39545 39546 39547 39548 39549 39550 39551 | 37619 37620 37621 37622 37623 37624 37625 37626 37627 37628 37629 37630 37631 37632 37633 37634 | - - + + | */ fsl_size_t fsl_strftime_unix(char * dest, fsl_size_t destLen, char const * format, fsl_time_t epochTime, bool convertToLocal){ time_t orig = (time_t)epochTime; struct tm * tim = convertToLocal ? localtime(&orig) : gmtime(&orig); return fsl_strftime( dest, destLen, format, tim ); } |
︙ | |||
40184 40185 40186 40187 40188 40189 40190 | 38258 38259 38260 38261 38262 38263 38264 38265 38266 38267 38268 38269 38270 38271 38272 38273 | - - + + | fsl_deck_finalize(&parent); fsl_deck_finalize(&deck); return rc; } #undef MARKER |
︙ | |||
40213 40214 40215 40216 40217 40218 40219 | 38287 38288 38289 38290 38291 38292 38293 38294 38295 38296 38297 38298 38299 38300 38301 38302 38303 38304 38305 38306 38307 38308 38309 38310 38311 38312 38313 38314 38315 38316 38317 38318 38319 38320 38321 38322 38323 38324 38325 38326 38327 38328 38329 38330 38331 38332 38333 38334 38335 38336 38337 38338 38339 38340 38341 38342 38343 38344 38345 38346 38347 38348 38349 38350 38351 38352 38353 38354 38355 38356 38357 38358 38359 38360 38361 38362 38363 38364 | - + - + + + - + + + - + + - + - - - - + - - - - - - - + - - - - - - - + | int rc; if(!db) return FSL_RC_NOT_A_REPO; rc = fsl_cx_exec_multi(f, "DROP TABLE IF EXISTS ticket;" "DROP TABLE IF EXISTS ticketchng;" ); if(!rc){ |
︙ | |||
40310 40311 40312 40313 40314 40315 40316 | 38374 38375 38376 38377 38378 38379 38380 38381 38382 38383 38384 38385 38386 38387 38388 38389 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + | fsl_stmt_finalize(&q); end: if(!rc){ fsl_list_sort(li, fsl__qsort_cmp_J_cards); } return rc; } |
︙ | |||
41396 41397 41398 41399 41400 41401 41402 | 38642 38643 38644 38645 38646 38647 38648 38649 38650 38651 38652 38653 38654 38655 38656 38657 | - + - + | p[-1] = '/'; } } } return zPath; #elif defined(__APPLE__) && !defined(WITHOUT_ICONV) return fsl_strdup(zUtf8) |
︙ | |||
41446 41447 41448 41449 41450 41451 41452 | 38692 38693 38694 38695 38696 38697 38698 38699 38700 38701 38702 38703 38704 38705 38706 38707 | - - + + | default: break; } } return rc; } } |
︙ | |||
41644 41645 41646 41647 41648 41649 41650 41651 41652 41653 41654 41655 | 38890 38891 38892 38893 38894 38895 38896 38897 38898 38899 38900 38901 38902 38903 38904 38905 38906 38907 38908 38909 38910 38911 38912 38913 38914 38915 38916 38917 38918 38919 38920 38921 38922 38923 38924 38925 38926 38927 38928 38929 38930 38931 38932 38933 38934 38935 38936 38937 38938 | + - + - + - + | } int fsl_vfile_changes_scan(fsl_cx * const f, fsl_id_t vid, unsigned cksigFlags){ fsl_stmt * stUpdate = NULL; fsl_stmt q = fsl_stmt_empty; int rc = 0; fsl_db * const db = fsl_needs_ckout(f); fsl_fstat fst = fsl_fstat_empty; fsl_size_t rootLen; fsl_buffer * fileCksum = fsl__cx_scratchpad(f); bool const useMtime = (cksigFlags & FSL_VFILE_CKSIG_HASH)==0 && fsl_config_get_bool(f, FSL_CONFDB_REPO, true, "mtime-changes"); |
︙ | |||
41838 41839 41840 41841 41842 41843 41844 | 39085 39086 39087 39088 39089 39090 39091 39092 39093 39094 39095 39096 39097 39098 39099 39100 39101 39102 39103 39104 39105 39106 39107 39108 39109 39110 39111 39112 39113 39114 39115 39116 39117 39118 39119 39120 39121 39122 39123 39124 39125 39126 39127 39128 39129 39130 39131 39132 39133 39134 39135 39136 39137 39138 39139 39140 39141 39142 39143 | - + + + + + + - - + + + - - - + + - + - + + + + | }else if( origPerm==FSL_FILE_PERM_LINK ){ changed = FSL_VFILE_CHANGE_NOT_SYMLINK; } } #endif if( currentMtime!=oldMtime || changed!=oldChanged ){ if(!stUpdate){ |
︙ | |||
42022 42023 42024 42025 42026 42027 42028 | 39277 39278 39279 39280 39281 39282 39283 39284 39285 39286 39287 39288 39289 39290 39291 39292 | - - + + | end: fsl_buffer_clear(&content); fsl_stmt_finalize(&q); return rc; } #undef MARKER |
︙ | |||
42228 42229 42230 42231 42232 42233 42234 | 39483 39484 39485 39486 39487 39488 39489 39490 39491 39492 39493 39494 39495 39496 39497 39498 | - + - - + | fsl_stmt_finalize(&s); fsl_vpath_clear(path); return rc; } /** Creates, if needed, the [ancestor] table, else clears its |
︙ | |||
42467 42468 42469 42470 42471 42472 42473 | 39721 39722 39723 39724 39725 39726 39727 39728 39729 39730 39731 39732 39733 39734 39735 39736 | - - + + | dberr: assert(rc); rc = fsl_cx_uplift_db_error2(f, db, rc); goto end; } #undef MARKER |
︙ | |||
42494 42495 42496 42497 42498 42499 42500 | 39748 39749 39750 39751 39752 39753 39754 39755 39756 39757 39758 39759 39760 39761 39762 39763 39764 39765 39766 39767 39768 39769 39770 39771 39772 39773 39774 39775 39776 39777 39778 39779 39780 39781 39782 39783 39784 39785 39786 39787 39788 39789 39790 39791 39792 39793 39794 39795 39796 39797 39798 39799 39800 39801 39802 39803 39804 39805 39806 39807 39808 39809 39810 39811 39812 39813 39814 39815 39816 39817 39818 39819 39820 39821 39822 39823 39824 39825 39826 39827 39828 39829 39830 39831 39832 39833 39834 39835 39836 39837 39838 39839 39840 39841 39842 39843 39844 39845 39846 39847 39848 39849 39850 39851 39852 39853 39854 39855 39856 39857 | - + - + - - - + - + - - - + + + + - - + + - + - + - - - + + + - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - | #include <stdio.h> #define MARKER(pfexp) \ do{ printf("MARKER: %s:%d:%s():\t",__FILE__,__LINE__,__func__); \ printf pfexp; \ } while(0) |
︙ | |||
42666 42667 42668 42669 42670 42671 42672 | 39919 39920 39921 39922 39923 39924 39925 39926 39927 39928 39929 39930 39931 39932 39933 39934 | - - + + | end: fsl_deck_finalize(&d); return rc; } } #undef MARKER |
︙ | |||
43139 43140 43141 43142 43143 43144 43145 | 40392 40393 40394 40395 40396 40397 40398 40399 40400 40401 40402 40403 40404 40405 40406 | - + | } } } return rc; } |
︙ | |||
43188 43189 43190 43191 43192 43193 43194 | 40441 40442 40443 40444 40445 40446 40447 40448 40449 40450 40451 40452 40453 40454 40455 | - + | } /** Always write the manifest files to the zip, regardless of the repo-level settings. This decision is up for debate. */ if(rc) goto end; else { |
︙ | |||
43225 43226 43227 43228 43229 43230 43231 | 40478 40479 40480 40481 40482 40483 40484 40485 40486 40487 40488 40489 40490 40491 40492 40493 40494 40495 40496 40497 40498 40499 40500 40501 40502 40503 40504 40505 40506 40507 40508 40509 | - - - - + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + | fsl_deck_clean(&mf); return rc; } #undef MARKER |
︙ | |||
43964 43965 43966 43967 43968 43969 43970 | 40518 40519 40520 40521 40522 40523 40524 40525 40526 40527 40528 40529 40530 40531 40532 40533 40534 40535 40536 40537 40538 40539 40540 40541 40542 40543 40544 40545 40546 40547 40548 40549 40550 40551 40552 40553 40554 40555 40556 40557 40558 40559 40560 40561 40562 40563 40564 40565 40566 40567 40568 40569 40570 40571 40572 40573 40574 40575 40576 40577 40578 40579 40580 40581 40582 40583 40584 40585 40586 40587 40588 40589 40590 40591 40592 40593 40594 40595 40596 40597 40598 40599 40600 40601 40602 40603 40604 40605 40606 40607 40608 40609 40610 40611 40612 40613 40614 40615 40616 40617 40618 40619 40620 40621 40622 40623 40624 40625 40626 40627 40628 40629 40630 40631 40632 40633 40634 40635 40636 40637 40638 40639 40640 40641 40642 40643 40644 40645 40646 40647 40648 40649 40650 40651 40652 40653 40654 40655 40656 40657 40658 40659 40660 40661 40662 40663 40664 40665 40666 40667 40668 40669 40670 40671 40672 | - - - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | 105, 108, 101, 32, 116, 121, 112, 101, 46, 10, 45, 45, 32, 84, 104, 101, 32, 105, 110, 116, 101, 103, 101, 114, 32, 105, 115, 32, 116, 104, 101, 32, 115, 97, 109, 101, 32, 97, 115, 32, 39, 70, 83, 76, 71, 39, 46, 10, 80, 82, 65, 71, 77, 65, 32, 99, 102, 103, 46, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 95, 105, 100, 61, 50, 53, 50, 48, 48, 54, 54, 55, 53, 59, 10, 0}; char const * fsl_schema_config_cstr = fsl_schema_config_cstr_a; |
︙ | |||
44261 44262 44263 44264 44265 44266 44267 | 40949 40950 40951 40952 40953 40954 40955 40956 40957 40958 40959 40960 40961 40962 40963 40964 40965 40966 40967 40968 40969 40970 40971 40972 40973 40974 40975 40976 40977 40978 40979 40980 40981 40982 40983 40984 40985 40986 40987 40988 40989 40990 40991 40992 40993 40994 40995 40996 40997 40998 40999 41000 41001 41002 41003 41004 41005 41006 41007 41008 41009 41010 41011 41012 41013 41014 41015 41016 41017 41018 41019 41020 41021 41022 41023 41024 41025 41026 41027 41028 41029 41030 41031 41032 41033 41034 41035 41036 41037 41038 41039 41040 41041 41042 41043 41044 41045 41046 41047 41048 41049 41050 41051 41052 41053 41054 41055 41056 41057 41058 41059 41060 41061 41062 41063 41064 41065 41066 41067 41068 41069 41070 41071 41072 41073 41074 41075 41076 41077 41078 41079 41080 41081 41082 41083 41084 41085 41086 41087 41088 41089 41090 41091 41092 41093 41094 41095 41096 41097 41098 41099 41100 41101 41102 41103 41104 41105 41106 41107 41108 41109 41110 41111 41112 41113 41114 41115 41116 41117 41118 41119 41120 41121 41122 41123 41124 41125 41126 41127 41128 41129 41130 41131 41132 41133 41134 41135 41136 41137 41138 41139 41140 41141 41142 41143 41144 41145 41146 41147 41148 41149 41150 41151 41152 41153 41154 41155 41156 41157 41158 41159 41160 41161 41162 41163 41164 41165 41166 41167 41168 41169 41170 41171 41172 41173 41174 41175 41176 41177 41178 41179 41180 41181 41182 41183 41184 | - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + | 32, 99, 111, 109, 109, 97, 110, 100, 32, 116, 111, 32, 105, 100, 101, 110, 116, 105, 102, 121, 32, 116, 104, 101, 10, 45, 45, 32, 100, 97, 116, 97, 98, 97, 115, 101, 32, 97, 115, 32, 97, 32, 102, 111, 115, 115, 105, 108, 32, 114, 101, 112, 111, 115, 105, 116, 111, 114, 121, 46, 10, 80, 82, 65, 71, 77, 65, 32, 114, 101, 112, 111, 46, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 95, 105, 100, 61, 50, 53, 50, 48, 48, 54, 54, 55, 51, 59, 10, 0}; char const * fsl_schema_repo1_cstr = fsl_schema_repo1_cstr_a; |
︙ | |||
44757 44758 44759 44760 44761 44762 44763 | 41660 41661 41662 41663 41664 41665 41666 41667 41668 41669 41670 41671 41672 41673 41674 41675 41676 41677 41678 41679 41680 41681 41682 41683 41684 41685 41686 41687 41688 41689 41690 41691 41692 41693 41694 41695 41696 41697 41698 41699 41700 41701 41702 41703 41704 41705 41706 41707 41708 41709 41710 41711 41712 41713 41714 41715 41716 41717 41718 41719 41720 41721 41722 41723 41724 41725 41726 41727 41728 41729 41730 41731 41732 41733 41734 41735 41736 41737 41738 41739 41740 41741 41742 41743 41744 41745 41746 41747 41748 41749 41750 41751 41752 41753 41754 41755 41756 41757 | - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | 105, 108, 100, 105, 100, 41, 10, 41, 32, 87, 73, 84, 72, 79, 85, 84, 32, 82, 79, 87, 73, 68, 59, 10, 67, 82, 69, 65, 84, 69, 32, 73, 78, 68, 69, 88, 32, 114, 101, 112, 111, 46, 99, 104, 101, 114, 114, 121, 112, 105, 99, 107, 95, 99, 105, 100, 32, 79, 78, 32, 99, 104, 101, 114, 114, 121, 112, 105, 99, 107, 40, 99, 104, 105, 108, 100, 105, 100, 41, 59, 10, 0}; char const * fsl_schema_repo2_cstr = fsl_schema_repo2_cstr_a; |
︙ | |||
44951 44952 44953 44954 44955 44956 44957 | 41931 41932 41933 41934 41935 41936 41937 41938 41939 41940 41941 41942 41943 41944 41945 41946 41947 41948 41949 41950 41951 41952 41953 41954 41955 41956 41957 41958 41959 41960 41961 41962 41963 41964 41965 41966 41967 41968 41969 41970 41971 41972 41973 41974 41975 41976 41977 41978 41979 41980 41981 41982 41983 | - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | 115, 32, 102, 105, 108, 101, 32, 116, 121, 112, 101, 46, 10, 45, 45, 32, 84, 104, 101, 32, 105, 110, 116, 101, 103, 101, 114, 32, 105, 115, 32, 116, 104, 101, 32, 115, 97, 109, 101, 32, 97, 115, 32, 39, 70, 83, 76, 67, 39, 46, 10, 80, 82, 65, 71, 77, 65, 32, 99, 107, 111, 117, 116, 46, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 95, 105, 100, 61, 50, 53, 50, 48, 48, 54, 54, 55, 52, 59, 10, 0}; char const * fsl_schema_ckout_cstr = fsl_schema_ckout_cstr_a; |
︙ | |||
45003 45004 45005 45006 45007 45008 45009 | 42015 42016 42017 42018 42019 42020 42021 42022 42023 42024 42025 42026 42027 42028 42029 42030 42031 42032 42033 42034 42035 42036 42037 42038 42039 42040 42041 42042 42043 42044 42045 42046 42047 42048 42049 42050 42051 42052 42053 42054 42055 42056 42057 | - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | 109, 101, 110, 116, 32, 84, 69, 88, 84, 10, 41, 59, 10, 67, 82, 69, 65, 84, 69, 32, 73, 78, 68, 69, 88, 32, 114, 101, 112, 111, 46, 116, 105, 99, 107, 101, 116, 99, 104, 110, 103, 95, 105, 100, 120, 49, 32, 79, 78, 32, 116, 105, 99, 107, 101, 116, 99, 104, 110, 103, 40, 116, 107, 116, 95, 105, 100, 44, 32, 116, 107, 116, 95, 109, 116, 105, 109, 101, 41, 59, 10, 0}; char const * fsl_schema_ticket_cstr = fsl_schema_ticket_cstr_a; |
︙ | |||
45047 45048 45049 45050 45051 45052 45053 | 42081 42082 42083 42084 42085 42086 42087 42088 42089 42090 42091 42092 42093 42094 42095 42096 42097 42098 42099 42100 42101 42102 42103 42104 42105 42106 42107 42108 42109 42110 | - - - - - - - + + + + + + + + + + + + + + + + | 100, 97, 116, 101, 116, 105, 109, 101, 40, 116, 107, 116, 95, 109, 116, 105, 109, 101, 41, 32, 65, 83, 32, 39, 39, 109, 116, 105, 109, 101, 39, 39, 44, 10, 32, 32, 116, 121, 112, 101, 44, 10, 32, 32, 115, 116, 97, 116, 117, 115, 44, 10, 32, 32, 115, 117, 98, 115, 121, 115, 116, 101, 109, 44, 10, 32, 32, 116, 105, 116, 108, 101, 10, 70, 82, 79, 77, 32, 116, 105, 99, 107, 101, 116, 39, 41, 59, 10, 0}; char const * fsl_schema_ticket_reports_cstr = fsl_schema_ticket_reports_cstr_a; |
︙ | |||
45079 45080 45081 45082 45083 45084 45085 | 42122 42123 42124 42125 42126 42127 42128 42129 42130 | - - + + | 104, 101, 110, 32, 112, 111, 115, 116, 101, 100, 46, 32, 32, 74, 117, 108, 105, 97, 110, 32, 100, 97, 121, 10, 41, 59, 10, 67, 82, 69, 65, 84, 69, 32, 73, 78, 68, 69, 88, 32, 114, 101, 112, 111, 46, 102, 111, 114, 117, 109, 116, 104, 114, 101, 97, 100, 32, 79, 78, 32, 102, 111, 114, 117, 109, 112, 111, 115, 116, 40, 102, 114, 111, 111, 116, 44, 102, 109, 116, 105, 109, 101, 41, 59, 10, 0}; char const * fsl_schema_forum_cstr = fsl_schema_forum_cstr_a; |
Changes to lib/libfossil.h.
1 2 3 4 5 6 7 | 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 | - - + + | #if !defined(FSL_AMALGAMATION_BUILD) #define FSL_AMALGAMATION_BUILD 1 #endif #if defined(HAVE_CONFIG_H) # include "config.h" #endif #include "libfossil-config.h" |
︙ | |||
246 247 248 249 250 251 252 | 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 | + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | otherwise they do not. */ #define FSL_CONFIG_ENABLE_TIMER 1 #endif /* ORG_FOSSIL_SCM_FSL_CONFIG_H_INCLUDED */ /* end of file ../include/fossil-scm/fossil-config.h */ |
︙ | |||
831 832 833 834 835 836 837 | 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 | - - + + - - - - + - + - + - - - - - + + + - - + + - - - + - - - - + + + + + + + + + + + + + + + + - - - + - - - - + - - - - - - - - - - - - - - - + + + - + - - - - - | initialize them properly leads to undefined behaviour. - ALWAYS fsl_buffer_clear() buffers when done with them. Remember that failed routines which output to buffers might partially populate the buffer, so be sure to clean up on error cases. |
︙ | |||
1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 | 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 | + - - - - - - - - - - - - - - - - - - + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - - - - - - - + + + - - - + - - - - + - - - - - - - - - - - + - - - + | (z+5), and a positive value means the MM part starts at (z+6). z need not be NUL terminated - this function does not read past the first invalid byte. Thus is can be used on, e.g., full ISO8601-format strings. If z is NULL, 0 is returned. */ FSL_EXPORT int fsl_str_is_date2(const char *z); /** Reserves at least n bytes of capacity in buf. Returns 0 on success, FSL_RC_OOM if allocation fails, FSL_RC_MISUSE if !buf. |
︙ | |||
1336 1337 1338 1339 1340 1341 1342 | 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 | - - - - - + + + + - + - - + + + - + | /** Appends the first n bytes of src, plus a NUL byte, to b, expanding b as necessary and incrementing b->used by n. If n is less than 0 then the equivalent of fsl_strlen((char const*)src) is used to calculate the length. |
︙ | |||
1421 1422 1423 1424 1425 1426 1427 | 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 | - - + + - - - + - - - + - - - + - - - + - - + - - - - - - - + + + + + + + - - - + - - - + + + + - + - - - - - - - - - - - + - - - - + - - - - - + - - - + - - - - - + + - + | */ FSL_EXPORT int fsl_buffer_compress2(fsl_buffer const *pIn1, fsl_buffer const *pIn2, fsl_buffer *pOut); /** Uncompress buffer pIn and store the result in pOut. It is ok for |
︙ | |||
1592 1593 1594 1595 1596 1597 1598 | 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 | - + | where the timing/duration of fsl_buffer_compare() (or an equivalent memcmp()) might inadvertently leak security-relevant information. Specifically, it address the concern that attackers can use timing differences to check for password misses, to narrow down an attack to passwords of a specific length or content properties. */ |
︙ | |||
1617 1618 1619 1620 1621 1622 1623 | 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 | - - - + + + - - - - + + + + | Return 0 on success. @see fsl_buffer_delta_apply() @see fsl_delta_apply() @see fsl_delta_apply2() */ |
︙ | |||
1738 1739 1740 1741 1742 1743 1744 | 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 | - + | /** Writes the given buffer to the given filename. Returns 0 on success, FSL_RC_MISUSE if !b or !fname, FSL_RC_IO if opening or writing fails. Uses fsl_fopen() to open the file, so it supports the name '-' as an alias for stdout. */ |
︙ | |||
1886 1887 1888 1889 1890 1891 1892 | 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 | - - - - - - - | */ FSL_EXPORT int fsl_strncmp(const char *zA, const char *zB, fsl_size_t nByte); /** BSD strlcpy() variant which is less error prone than strncpy. Copy up to dstsz - 1 characters from src to dst and NUL-terminate the resulting string if dstsz is not 0. |
︙ | |||
2159 2160 2161 2162 2163 2164 2165 | 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 | - + - + - + | int const rc = fsl_list_reserve( myList, n ); if( rc ) { ... error ... } ``` @see fsl_list_clear() @see fsl_list_visit_free() */ |
︙ | |||
2243 2244 2245 2246 2247 2248 2249 | 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 | - + - - + - + - - + | the client has no way (unless the finalizer somehow accounts for it) to know which entries in the list were cleaned up. Thus it is highly recommended that finalizer functions follow the conventional wisdom of "destructors do not throw." @see fsl_list_visit_free() */ |
︙ | |||
2361 2362 2363 2364 2365 2366 2367 | 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 | - - + - + | } assert(0 == fsl_strcmp( "/a/b/foo.bar, fsl_buffer_cstr(&buf))); fsl_buffer_clear(&buf); ``` */ FSL_EXPORT int fsl_file_canonical_name2(const char *zRoot, const char *zOrigName, |
︙ | |||
2398 2399 2400 2401 2402 2403 2404 | 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 | - + | separator and leaveSlash is false then only a NUL terminator is appended to pOut if it is not already NUL-terminated. This function does no filesystem-level validation of the the given path - only string evaluation. */ FSL_EXPORT int fsl_file_dirpart(char const * zFilename, fsl_int_t nLen, |
︙ | |||
2489 2490 2491 2492 2493 2494 2495 | 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 | - + - | for directories, devices, fifos, symlinks, etc. The name may be absolute or relative to the current working dir. */ FSL_EXPORT bool fsl_is_file(const char *zFilename); /** Returns true if the given file is a symlink, else false. The name |
︙ | |||
2517 2518 2519 2520 2521 2522 2523 | 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 | - - - - + + + + - - - - - - - | Simplify a filename by: * converting all \ into / on windows and cygwin * removing any trailing and duplicate / * removing /./ * removing /A/../ |
︙ | |||
2572 2573 2574 2575 2576 2577 2578 | 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 | - + - + | "*.c *.h, *.sh, '*.in'" ``` @see fsl_glob_list_append() @see fsl_glob_list_matches() @see fsl_glob_list_clear() */ |
︙ | |||
2783 2784 2785 2786 2787 2788 2789 | 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | the more widespread OSes often have to be converted to something portable and this requires allocation on such platforms, but not on Unix. For API transparency, that means all platforms get the copy(-like) behaviour. */ FSL_EXPORT char *fsl_getenv(const char *zName); |
︙ | |||
2917 2918 2919 2920 2921 2922 2923 2924 2925 | 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 | + - - - - - - + + + + + | Results are undefined if zFilename is NULL. Potential TODO: if it refers to a dir, forward the call to fsl_rmdir(). */ FSL_EXPORT int fsl_file_unlink(const char *zFilename); /** |
︙ | |||
2965 2966 2967 2968 2969 2970 2971 | 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 | - - - - - - - - - - - - - - - - - - - - - | returning 0. If the target is a directory or a symlink, this is a no-op and returns 0. */ FSL_EXPORT int fsl_file_exec_set(const char *zFilename, bool isExec); |
︙ | |||
3043 3044 3045 3046 3047 3048 3049 | 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - | "/foo/bar" creates (if needed) /foo, but assumes "bar" is a file component. "/foo/bar/" creates /foo/bar. However "foo" will not create a directory - because the string has no path component, it is assumed to be a filename. Both "/foo/bar/my.doc" and "/foo/bar/" result in the directories |
︙ | |||
3249 3250 3251 3252 3253 3254 3255 | 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 | - + | #define fsl_fstat_empty_m {FSL_FSTAT_TYPE_UNKNOWN,0,0,-1,0} /** Empty-initialized fsl_fstat instance, intended for non-const copy construction. */ FSL_EXPORT const fsl_fstat fsl_fstat_empty; /** |
︙ | |||
3272 3273 3274 3275 3276 3277 3278 | 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 | - + | to differentiate between symlinks and files. The fsl_fstat_type_e family of flags can be used to determine the type of the filesystem object being stat()'d (file, directory, or symlink). It does not apply any special logic for platform-specific oddities other than symlinks (e.g. character devices and such). */ |
︙ | |||
3367 3368 3369 3370 3371 3372 3373 | 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 | - + - + - - - + + + - + - - - - + + + | number of times to emit delta output. Each time it is called it should append the new bytes to its output channel. The semantics of the return value and the first four arguments are identical to fsl_delta_create(), with these ammendments regarding the return value: |
︙ | |||
3520 3521 3522 3523 3524 3525 3526 | 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 | - + | */ FSL_EXPORT void fsl_bytes_defossilize( unsigned char * inp, fsl_size_t * resultLen ); /** Defossilizes the contents of b. Equivalent to: fsl_bytes_defossilize( b->mem, &b->used ); */ |
︙ | |||
3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 | 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - + - - - - - - - - - - - - - | untransformed characters and the strlen of *xlate for others. Bytes returned via xlate are static and immutable. Results are undefined if xlate is NULL. */ FSL_EXPORT fsl_size_t fsl_htmlize_xlate(int c, char const ** xlate); /** Flags for use with text-diff generation APIs, e.g. fsl_diff_text(). Maintenance reminder: these values are holy and must not be changed without also changing the corresponding code in diff.c. @deprecated Prefer fsl_diff2_flag_e and fsl_diff_v2() instead. */ enum fsl_diff_flag_e { /** Ignore end-of-line whitespace */ FSL_DIFF_IGNORE_EOLWS = 0x01, /** Ignore end-of-line whitespace */ FSL_DIFF_IGNORE_ALLWS = 0x03, /** Generate a side-by-side diff */ FSL_DIFF_SIDEBYSIDE = 0x04, /** Missing shown as empty files */ FSL_DIFF_VERBOSE = 0x08, /** Show filenames only. Not used in this impl! */ FSL_DIFF_BRIEF = 0x10, /** Render HTML. */ FSL_DIFF_HTML = 0x20, /** Show line numbers. */ FSL_DIFF_LINENO = 0x40, /** Suppress optimizations (debug). */ FSL_DIFF_NOOPT = 0x0100, /** Invert the diff (debug). */ FSL_DIFF_INVERT = 0x0200, /** Only display if not "too big." */ FSL_DIFF_NOTTOOBIG = 0x0800, /** Strip trailing CR */ FSL_DIFF_STRIP_EOLCR = 0x1000, /** This flag tells text-mode diff generation to add ANSI color sequences to some output. The colors are currently hard-coded and non-configurable. This has no effect for HTML output, and that flag trumps this one. It also currently only affects unified diffs, not side-by-side. Maintenance reminder: this one currently has no counterpart in fossil(1), is not tracked in the same way, and need not map to an internal flag value. */ FSL_DIFF_ANSI_COLOR = 0x2000 }; /** Generates a textual diff from two text inputs and writes it to the given output function. pA and pB are the buffers to diff. contextLines is the number of lines of context to output. This parameter has a built-in limit of 2^16, and values larger than that get truncated. A value of 0 is legal, in which case no surrounding context is provided. A negative value translates to some unspecified default value. sbsWidth specifies the width (in characters) of the side-by-side columns. If sbsWidth is not 0 then this function behaves as if diffFlags contains the FSL_DIFF_SIDEBYSIDE flag. If sbsWidth is negative, OR if diffFlags explicitly contains FSL_DIFF_SIDEBYSIDE and sbsWidth is 0, then some default width is used. This parameter has a built-in limit of 255, and values larger than that get truncated to 255. diffFlags is a mask of fsl_diff_flag_t values. Not all of the fsl_diff_flag_t flags are yet [sup]ported. The output is sent to out(outState,...). If out() returns non-0 during processing, processing stops and that result is returned to the caller of this function. Returns 0 on success, FSL_RC_OOM on allocation error, FSL_RC_MISUSE if any arguments are invalid, FSL_RC_TYPE if any of the content appears to be binary (contains embedded NUL bytes), FSL_RC_RANGE if some range is exceeded (e.g. the maximum number of input lines). None of (pA, pB, out) may be NULL. TODOs: - Add a predicate function for outputing only matching differences, analog to fossil(1)'s regex support (but more flexible). - Expose the raw diff-generation bits via the internal API to facilitate/enable the creation of custom diff formats. @see fsl_diff_v2() @deprecated Prefer fsl_diff_v2() for new code. */ FSL_EXPORT int fsl_diff_text(fsl_buffer const *pA, fsl_buffer const *pB, fsl_output_f out, void * outState, short contextLines, short sbsWidth, int diffFlags ); /** Functionally equivalent to: ``` fsl_diff_text(pA, pB, fsl_output_f_buffer, pOut, contextLines, sbsWidth, diffFlags); ``` Except that it returns FSL_RC_MISUSE if !pOut. @see fsl_diff_v2() @deprecated Prefer fsl_diff_v2() for new code. */ FSL_EXPORT int fsl_diff_text_to_buffer(fsl_buffer const *pA, fsl_buffer const *pB, fsl_buffer *pOut, short contextLines, short sbsWidth, int diffFlags ); /** @enum fsl_diff2_flag_e Flags for use with the 2021-era text-diff generation APIs |
︙ | |||
3695 3696 3697 3698 3699 3700 3701 | 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 | - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + | FSL_RC_RANGE. */ FSL_DIFF2_NOTTOOBIG = 0x0800, /** Strip trailing CR before diffing. Applies to all diff builders. */ FSL_DIFF2_STRIP_EOLCR = 0x1000, |
︙ | |||
3831 3832 3833 3834 3835 3836 3837 | 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 | - - - - - + - + | may be NULL. */ const char * hashRHS; /** Output destination. Any given builder might, depending on how it actually constructs the diff, buffer output and delay calling this until its finish() method is called. |
︙ | |||
3885 3886 3887 3888 3889 3890 3891 | 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 | - + - + - + - + - + - + | were the ANSI code to reset all color attributes. */ char const * reset; } ansiColor; }; /** Convenience typedef. */ |
︙ | |||
3953 3954 3955 3956 3957 3958 3959 | 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 | - + | */ #define fsl_dline_change_max_spans 8 /** This "mostly-internal" type describes zero or more (up to fsl_dline_change_max_spans) areas of difference between two lines of text. This type is only in the public API for use with concrete |
︙ | |||
4001 4002 4003 4004 4005 4006 4007 | 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 | - + | Given two lines of a diff, this routine computes a set of changes between those lines for display purposes and writes a description of those changes into the 3rd argument. After returning, p->n contains the number of elements in p->a which were populated by this routine. This function is only in the public API for use with |
︙ | |||
4057 4058 4059 4060 4061 4062 4063 | 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 | - + - + - + + + + + + + + + + + - + - + - - - - - - - - - - - - + + + + + + - - - + | - FSL_RC_OOM on allocation error. */ FSL_EXPORT int fsl_break_into_dlines(const char *z, fsl_int_t n, uint32_t *pnLine, fsl_dline **pOut, uint64_t diff2Flags); /** Convenience typedef. */ |
︙ | |||
4142 4143 4144 4145 4146 4147 4148 | 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 | - + - + - + - + - + - + - + - - - - - - - + - - - - - - - - - - - - - + + + + - + + + - + - + - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - + + - - + - + - + - + - - - - - + - + | those two chunks together. That "readability optimization" is skipped when this method is set because this method may otherwise report that lines are being skipped which then subsequently get output by the driver. Must return 0 on success, non-0 on error. */ |
︙ | |||
4412 4413 4414 4415 4416 4417 4418 | 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 | - + - + - + - + - + - + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | ``` The SUBARRAY is an array of 3*N+1 strings with N>=0. The triples represent common-text, left-text, and right-text. The last string in SUBARRAY is the common-suffix. Any string can be empty if it does not apply. */ |
︙ | |||
4527 4528 4529 4530 4531 4532 4533 | 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 | - + - + - + - - - + + | - FSL_RC_DIFF_BINARY if the to-diff content appears to be binary, noting that "appears to be" is heuristric-driven and subject to false positives. Specifically, files with extremely long lines will be recognized as binary (and are, in any case, generally less than useful for most graphical diff purposes). |
︙ | |||
5366 5367 5368 5369 5370 5371 5372 | 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 | - + + - - - + + + - - - + + | FSL_EXPORT fsl_size_t fsl_simplify_sql( char * sql, fsl_int_t len ); /** Convenience form of fsl_simplify_sql() which assumes b holds an SQL string. It gets processed by fsl_simplify_sql() and its 'used' length potentially gets adjusted to match the adjusted SQL string. */ |
︙ | |||
5529 5530 5531 5532 5533 5534 5535 | 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 | - + - - - - - - - - - - | If merge conflicts are encountered, it continues as best as it can and injects "indiscrete" markers in the output to denote the nature of each conflict. If conflictCount is not NULL then on success the number of merge conflicts is written to *conflictCount. Returns 0 on success, FSL_RC_OOM on OOM, FSL_RC_TYPE if any input |
︙ | |||
5861 5862 5863 5864 5865 5866 5867 | 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 | - + - - - - - + + - - - | typedef struct fsl_dircrawl_state fsl_dircrawl_state; /** Callback type for use with fsl_dircrawl(). It gets passed the absolute name of the target directory, the name of the directory entry (no path part), the type of the entry, and the client state pointer which is passed to that routine. It must return 0 on |
︙ | |||
5909 5910 5911 5912 5913 5914 5915 | 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 | - + - - + + - | but libfossil does not.) It silently skips any files for which stat() fails or is not of a "basic" file type (e.g. character devices and such). Returns 0 on success, FSL_RC_TYPE if the given name is not a directory, and FSL_RC_RANGE if it recurses "too deep," (some |
︙ | |||
5977 5978 5979 5980 5981 5982 5983 | 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 | - + | FSL_LOOKSLIKE_BINARY = FSL_LOOKSLIKE_NUL | FSL_LOOKSLIKE_LONG | FSL_LOOKSLIKE_SHORT, /* Line separators. */ FSL_LOOKSLIKE_EOL = (FSL_LOOKSLIKE_LONE_CR | FSL_LOOKSLIKE_LONE_LF | FSL_LOOKSLIKE_CRLF) }; /** Returns true if b appears to contain "binary" (non-UTF8/16) content, |
︙ | |||
6045 6046 6047 6048 6049 6050 6051 | 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 | - - - - - - - - | Returns true if b starts with a UTF8 BOM. If the 2nd argument is not NULL, *pBomSize is set to the number of bytes in the BOM (always 3), regardless of whether or not the function returns true or false. */ FSL_EXPORT bool fsl_starts_with_bom_utf8(fsl_buffer const * const b, unsigned int *pBomSize); |
︙ | |||
6088 6089 6090 6091 6092 6093 6094 | 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 | - - + + - + | /* ^^^^ UTF-16 interfaces */ #if defined(__cplusplus) } /*extern "C"*/ #endif #endif /* ORG_FOSSIL_SCM_FSL_UTIL_H_INCLUDED */ |
︙ | |||
6208 6209 6210 6211 6212 6213 6214 | 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 | - + + | fsl_cx_db_repo() and fsl_cx_db_ckout() will always return the same database handle, but they can tell whether a given role has been attached or not and will fail in their documented ways when the role's corresponding database has not yet been attached. e.g. `fsl_cx_db_repo()` will return `NULL` if a repo database is not attached. |
︙ | |||
6304 6305 6306 6307 6308 6309 6310 | 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 | - - - - | FSL_CX_F_CALC_R_CARD = 0x01, /** When encounting artifact types in the crosslinking phase which the library does not currently support crosslinking for, skip over them instead of generating an error. For day-to-day use this is, perhaps counter-intuitively, generally desirable. |
︙ | |||
6622 6623 6624 6625 6626 6627 6628 | 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 | - + | Special case of FSL_RC_TYPE triggered in some diff APIs, indicating that the API cannot diff what appears to be binary data. */ FSL_RC_DIFF_BINARY, /** Triggered by some diff APIs to indicate that only whitespace changes we found and the diff was requested to ignore whitespace. |
︙ | |||
6677 6678 6679 6680 6681 6682 6683 | 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 | - - + + - - + + - - | /** Returns the value of FSL_LIBRARY_VERSION used to compile the library. If this value differs from the value the caller was compiled with, Chaos might ensue. The API does not yet have any mechanism for determining |
︙ | |||
6725 6726 6727 6728 6729 6730 6731 | 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 | - + - - | /** A part of the configuration used by fsl_cx_init() and friends. */ struct fsl_cx_config { /** If true, all SQL which goes through the fossil engine |
︙ | |||
6916 6917 6918 6919 6920 6921 6922 | 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 | - + + + | of the parameters and return value. */ FSL_EXPORT int fsl_cx_err_get( fsl_cx * const f, char const ** str, fsl_size_t * len ); /** Returns f's error state object. This pointer is guaranteed by the API to be stable until f is finalized, but its contents are |
︙ | |||
7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 | 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | FSL_EXPORT int fsl_outputf( fsl_cx * const f, char const * fmt, ... ); /** va_list counterpart to fsl_outputf(). */ FSL_EXPORT int fsl_outputfv( fsl_cx * const f, char const * fmt, va_list args ); /** Opens the given db file name as f's repository. Returns 0 on success. On error it sets f's error state and returns that code unless the error was FSL_RC_MISUSE (which indicates invalid arguments and it does not set the error state). Returns FSL_RC_ACCESS if f already has an opened repo db (use fsl_repo_close() or fsl_ckout_close() to close it). Returns FSL_RC_NOT_FOUND if repoDbFile is not found, as this routine cannot create a new repository db. Results are undefined if any argument is NULL. When a repository is opened, the fossil-level user name associated with f (if any) is overwritten with the default user from the repo's login table (the one with uid=1). Thus fsl_cx_user_get() may return a value even if the client has not called fsl_cx_user_set(). It would be nice to have a parameter specifying that the repo should be opened read-only. That's not as straightforward as it sounds because of how the various dbs are internally managed (via one db handle). Until then, the permissions of the underlying repo file will determine how it is opened. i.e. a read-only repo will be opened read-only. Potentially interesting side-effects: - On success this re-sets several bits of f's configuration to match the repository-side settings. @see fsl_repo_create() @see fsl_repo_close() */ FSL_EXPORT int fsl_repo_open( fsl_cx * const f, char const * repoDbFile/*, char readOnlyCurrentlyIgnored*/ ); /** If fsl_repo_open_xxx() has been used to open a respository db, this call closes that db. Returns 0 on success or if no config db is opened. It may propagate an error from the db layer if closing/detaching the db fails. Returns FSL_RC_MISUSE if f has any transactions pending or if f still has a checkout opened (a checkout db is only valid in conjunction with its repository db). If a repository is opened "indirectly" via fsl_ckout_open_dir() then attempting to close it using this function will result in FSL_RC_MISUSE and f's error state will hold a description of the problem (the checkout must be closed before closing its repository). Such a repository will be closed implicitly when the checkout db is closed. @see fsl_repo_open() @see fsl_repo_create() */ FSL_EXPORT int fsl_repo_close( fsl_cx * const f ); /** Sets or clears (if userName is NULL or empty) the default repository user name for operations which require one. Returns 0 on success, FSL_RC_MISUSE if f is NULL, FSL_RC_OOM if copying of the userName fails. |
︙ | |||
7080 7081 7082 7083 7084 7085 7086 | 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 | + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | be invalidated by any future calls to fsl_cx_user_set(). @see fsl_cx_user_guess() */ FSL_EXPORT char const * fsl_cx_user_get( fsl_cx const * const f ); /** Configuration parameters for fsl_repo_create(). Always copy-construct these from fsl_repo_create_opt_empty resp. fsl_repo_create_opt_empty_m in order to ensure proper behaviour vis-a-vis default values. |
︙ | |||
7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 | 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | Note that the role of FSL_DBROLE_TEMP is invalid here. */ FSL_EXPORT char const * fsl_cx_db_file_for_role(fsl_cx const * f, fsl_dbrole_e r, fsl_size_t * len); /** Similar to fsl_cx_db_file_ckout() and friends except that it applies to DB name (as opposed to DB _file_ name) implied by the specified role (2nd parameter). If no such role is opened, or the role is invalid, NULL is returned. If the 3rd argument is not NULL, it is set to the length, in bytes, of the returned string. The returned strings are static and NUL-terminated. This is the "easiest" way to figure out the DB name of the given role, independent of what order f's databases were opened (because the first-opened DB is always called "main"). The Fossil-standard names of its primary databases are: "localdb" (checkout), "repository", and "configdb" (global config DB), but libfossil uses "ckout", "repo", and "cfg", respective. So long as queries use table names which unambiguously refer to a given database, the DB name is normally not needed. It is needed when creating new non-TEMP db tables and views. By default such tables/views would go into the "main" DB, which is actually a transient DB in this API, so it's important to use the correct DB name when creating such constructs. Note that the role of FSL_DBROLE_TEMP is invalid here. */ FSL_EXPORT char const * fsl_cx_db_name_for_role(fsl_cx const * f, fsl_dbrole_e r, fsl_size_t * len); /** If f has an opened checkout db (from fsl_ckout_open_dir()) then this function returns the directory part of the path for the checkout, including (for historical and internal convenience reasons) a trailing slash. The returned bytes are valid until that db connection is closed. If len is not NULL then *len is (on success) assigned to the length of the returned string, in bytes. |
︙ | |||
7164 7165 7166 7167 7168 7169 7170 | 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 | - - + + - - - - - - - - + + + + - | */ FSL_EXPORT char const * fsl_cx_ckout_dir_name(fsl_cx const * f, fsl_size_t * len); /** Returns a handle to f's main db (which may or may not have any relationship to the repo/checkout/config databases - that's |
︙ | |||
7253 7254 7255 7256 7257 7258 7259 | 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 | - + + + + + + + + + + - - + + - - - + - - - - - - - - + + + + - - - - - + + - - - | /** Opens the given database file as f's configuration database. If f already has a config database opened then: 1) If passed a NULL dbName or dbName is an empty string then this |
︙ | |||
7432 7433 7434 7435 7436 7437 7438 | 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 | - + - - - - + + + + - - - - - + - - + + - - - - + | Returns 0 on success. On stat() error, nameOut is not updated, but after stat()'ing, allocation of memory for nameOut's buffer may fail. If zName ends with a trailing slash, that slash is retained in nameOut. |
︙ | |||
7671 7672 7673 7674 7675 7676 7677 | 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 | - + | - "ignore-glob" = FSL_GLOBS_IGNORE - "binary-glob" = FSL_GLOBS_BINARY - "crnl-glob" = FSL_GLOBS_CRNL - Anything else = FSL_GLOBS_INVALID To simplify this function's use via an SQL-accessible UDF, the `*-glob` names may be passed in without their `-glob` suffix, |
︙ | |||
7758 7759 7760 7761 7762 7763 7764 | 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 | - + | const char * zFilename, fsl_buffer * pOut); /** Works like fsl_getcwd() but updates f's error state on error and appends the current directory's name to the given buffer. Returns 0 on success. */ |
︙ | |||
7907 7908 7909 7910 7911 7912 7913 | 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 | - + - - - - - - - - - - - - - - - - - - - | The va_list counterpart of fsl_cx_interrupt(). */ FSL_EXPORT int fsl_cx_interruptv(fsl_cx * const f, int code, char const * fmt, va_list args); /** If f's is-interrupted flag is set, this function returns its value. Note that there is inherently a race condition when calling |
︙ | |||
7970 7971 7972 7973 7974 7975 7976 | 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 | + - - - + + + | */ FSL_EXPORT time_t fsl_cx_time_adj(fsl_cx const * f, time_t clock); #endif #if defined(__cplusplus) } /*extern "C"*/ #endif #endif |
︙ | |||
7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 | 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 | + | */ /* We don't _really_ want to include sqlite3.h at this point, but if we do not then we have to typedef the sqlite3 struct here and that breaks when client code includes both this file and sqlite3.h. */ #include "sqlite3.h" #if defined(__cplusplus) extern "C" { #endif #if 0 /** |
︙ | |||
8022 8023 8024 8025 8026 8027 8028 | 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 | - + | #define fsl_commit_hook_empty_m {NULL,0,NULL} typedef struct fsl_commit_hook fsl_commit_hook; /* extern const fsl_commit_hook fsl_commit_hook_empty; */ /** Potential TODO. */ |
︙ | |||
8065 8066 8067 8068 8069 8070 8071 | 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 | - - - - - - - - - - - - - - - + + - - + | in read-write mode, but should not create the db if it does not already exist. */ FSL_OPEN_F_RW = 0x02, /** Flag for fsl_db_open() specifying that the db should be opened in read-write mode, creating the db if it does not already exist. |
︙ | |||
8490 8491 8492 8493 8494 8495 8496 | 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 | - - + + + | Returns NULL on allocation error. */ FSL_EXPORT fsl_stmt * fsl_stmt_malloc(); /** |
︙ | |||
8705 8706 8707 8708 8709 8710 8711 | 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 | - - + + - - - - - + + - - + + - - - | copying fsl_stmt_empty so that this function knows whether or not to fsl_free() them). Returns FSL_RC_MISUSE if !stmt or it has already been finalized (but was not freed). */ FSL_EXPORT int fsl_stmt_finalize( fsl_stmt * const stmt ); /** |
︙ | |||
8797 8798 8799 8800 8801 8802 8803 | 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 | - + - - - - - + + + + + | /** Equivalent to fsl_stmt_reset2(stmt, 0). */ FSL_EXPORT int fsl_stmt_reset( fsl_stmt * const stmt ); /** Returns the db handle which prepared the given statement, or |
︙ | |||
8833 8834 8835 8836 8837 8838 8839 | 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 | - - + + - - + | */ FSL_EXPORT char const * fsl_stmt_col_name(fsl_stmt * const stmt, int index); /** Returns the result column count for the given statement, or -1 if !stmt or it has not been prepared. Note that this value is cached when the statement is created. Note that non-fetching queries |
︙ | |||
9035 9036 9037 9038 9039 9040 9041 | 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 | - - + + - - - - + + - - - - - + + + - - - | Gets a string value from the given 0-based result set column, assigns *out (if out is not NULL) to that value, assigns *outLen (if outLen is not NULL) to *out's length in bytes, and returns 0 on success. Ownership of the string memory is unchanged - it is owned by the statement and the caller should immediately copy it if it will be needed for much longer. |
︙ | |||
9132 9133 9134 9135 9136 9137 9138 | 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 | - - - - - - - + + + + + + + - - - - - - - + + + - - - - + + + + + - - - - - - - - - - - - - - | /** Equivalent to fsl_db_transaction_end(db, 1). */ FSL_EXPORT int fsl_db_transaction_rollback(fsl_db * const db); /** |
︙ | |||
9247 9248 9249 9250 9251 9252 9253 | 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 | - + - + - + - + - + - + - + - + - + - - + - + - + - + - + - + - + - + - + - + - + - - - + + + - - - + + + - + - + - + | int32_t defaultValue, char const * sql, ... ); /** The int64 counterpart of fsl_db_get_int32(). See that function for the semantics. */ |
︙ | |||
9476 9477 9478 9479 9480 9481 9482 | 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 | - + - + | bool localTime ); /** Returns the current time in Julian Date format. Returns a negative value if !db or db is not opened. */ |
︙ | |||
9545 9546 9547 9548 9549 9550 9551 | 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 | + - - + + + + + + - - + | - If FSL_OPEN_F_SCHEMA_VALIDATE is set in openFlags then the db is validated to see if it has a fossil schema. If that validation fails, FSL_RC_REPO_NEEDS_REBUILD or FSL_RC_NOT_A_REPO will be returned and db's error state will be updated. db->f does not need to be set for that check to work. |
︙ | |||
9584 9585 9586 9587 9588 9589 9590 | 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 | - + - - - - - - - - - | given code block is getting run. As a special case, if db->f is not NULL _before_ it is is fsl_db_open()ed, then this function automatically gets installed if the SQL tracing option is enabled for that fsl_cx instance before the db is opened. |
︙ | |||
9625 9626 9627 9628 9629 9630 9631 | 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 | + - + - - + + | */ FSL_EXPORT char const * fsl_db_name(fsl_db const * const db); /** Returns a db name string for the given fsl_db_role value. The string is static, guaranteed to live as long as the app. It returns NULL (or asserts in debug builds) if passed |
︙ | |||
9676 9677 9678 9679 9680 9681 9682 | 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 | - + | FSL_EXPORT int fsl_db_detach(fsl_db * const db, const char *zLabel); /** Expects fmt to be a SELECT-style query. For each row in the query, the first column is fetched as a string and appended to the tgt list. |
︙ | |||
9712 9713 9714 9715 9716 9717 9718 | 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 | - + - + - + - + - - - + + + + - + + | fsl_list_visit_free(&li, 1); ``` Of course fsl_list_visit() may be used to traverse the list as well, as long as the visitor expects (char [const]*) list elements. */ |
︙ | |||
9871 9872 9873 9874 9875 9876 9877 | 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 | - - + + | FSL_EXPORT int fsl_stmt_bind_step( fsl_stmt * st, char const * fmt, ... ); #if defined(__cplusplus) } /*extern "C"*/ #endif #endif /* ORG_FOSSIL_SCM_FSL_DB_H_INCLUDED */ |
︙ | |||
10413 10414 10415 10416 10417 10418 10419 | 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 | - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | FSL_EXPORT const char * fsl_hash_type_name(fsl_hash_types_e h, const char *zUnknown); #if defined(__cplusplus) } /*extern "C"*/ #endif #endif /* ORG_FOSSIL_SCM_FSL_HASH_H_INCLUDED */ |
︙ | |||
10623 10624 10625 10626 10627 10628 10629 | 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 | - + | These lists, and F-cards in generally, are typically maintained internally in the library. There's probably "no good reason" for clients to manipulate them. */ struct fsl_card_F_list { /** The list of F-cards. The first this->used elements are in-use. |
︙ | |||
11205 11206 11207 11208 11209 11210 11211 | 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 | - - - - - - - - - - - - + + - - + + + - + - + - - - - + - - - + + + - - - - - - - - + | Returns 0 on success, else an error code propagated by fsl_deck_F_set(), fsl_repo_blob_lookup(), or some other lower-level routine. This routine requires that a transaction is active and returns FSL_RC_MISUSE if none is active. For any non-trivial error's, d->f's error state will be updated with a description of the problem. |
︙ | |||
11305 11306 11307 11308 11309 11310 11311 | 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 | - + - - + | The F-cards will be visited in the order they are declared in d. For loaded-from-a-repo manifests this is always lexical order (for delta manifests, consistent across the delta and baseline). For hand-created decks which have not yet been fsl_deck_unshuffle()'d, the order is unspecified. */ |
︙ | |||
11424 11425 11426 11427 11428 11429 11430 | 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 | - + | On any error but FSL_RC_MISUSE (basic argument validation) f's error state is updated to describe the error. @see fsl_content_get() */ FSL_EXPORT int fsl_card_F_content( fsl_cx * f, fsl_card_F const * fc, |
︙ | |||
11458 11459 11460 11461 11462 11463 11464 | 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 | - + - + - - - - + + | particular if their isAppend values differ. Returns 0 on success, FSL_RC_MISUSE if !mf or !key, FSL_RC_RANGE if !*field, FSL_RC_TYPE if mf is of a type for which J cards are not legal (see fsl_card_is_legal()), FSL_RC_OOM on allocation error. */ |
︙ | |||
11561 11562 11563 11564 11565 11566 11567 | 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 | - - - + + + - + | If uuid is not NULL and fsl_is_uuid(uuid) returns false then this function returns FSL_RC_RANGE. If uuid is NULL then it is assumed to be the UUID of the currently-being-constructed artifact in which the tag is contained (which appears as the '*' character in generated artifacts). |
︙ | |||
11592 11593 11594 11595 11596 11597 11598 | 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 | - - - - - - - + | tags to the given deck: "branch" with a value of branchName and "sym-branchName" with no value. Returns 0 on success. Returns FSL_RC_OOM on allocation error and FSL_RC_RANGE if branchName is empty or contains any characters with ASCII values <=32d. It natively assumes that any characters >=128 are part of multibyte UTF8 characters. |
︙ | |||
11624 11625 11626 11627 11628 11629 11630 | 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 | - + | allows the client to decide on whether to use them (for more (admittedly redundant!) integrity checking) or not (much faster but "not strictly historically correct"), but defaults to having them enabled for symmetry with fossil(1). @see fsl_deck_R_calc2() */ |
︙ | |||
11765 11766 11767 11768 11769 11770 11771 | 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 | - + - - - - + - + | F-cards were used, but it was eventually made optional because (A) the memory cost and (B) it's part of a 3rd or 4th level of integrity-related checks, and is somewhat superfluous. @see fsl_deck_output() @see fsl_deck_save() */ |
︙ | |||
11932 11933 11934 11935 11936 11937 11938 | 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 | - + - - - - - - + - + - - - - - - - - - + - - - - - - - - - | d might be partially populated on error, so regardless of success or failure, the client must eventually pass d to fsl_deck_finalize() to free its memory. Error result codes include: |
︙ | |||
11990 11991 11992 11993 11994 11995 11996 | 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 | - - + + | FSL_EXPORT int fsl_deck_parse2(fsl_deck * const d, fsl_buffer * const src, fsl_id_t rid); /** Quickly determines whether the content held by the given buffer "might" be a structural artifact. It performs a fast sanity check for prominent features which can be checked either in O(1) or very short O(N) time (with a fixed N). If it returns false then the |
︙ | |||
12118 12119 12120 12121 12122 12123 12124 | 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 | - + - + + - + - - - - - | const, but certain operations on a deck are necessarily non-const operations. That includes, but may not be limited to: - Iterating over F-cards, which requires calling fsl_deck_F_rewind() before doing so. - Loading a checkin's baseline (required for F-card iteration and |
︙ | |||
12224 12225 12226 12227 12228 12229 12230 | 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 | - + - - - - - - - | names they register. The library reserves the prefix "fsl/" for its own use, and will happily overwrite client-registered entries with the same names. The name string need not be stable across application sessions and maybe be a randomly-generated string. Caveat: some obscure artifact crosslinking steps do not happen unless crosslinking takes place in the context of a |
︙ | |||
12263 12264 12265 12266 12267 12268 12269 | 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 | - - - - - - - - - - | - Technote artifacts: "fsl/technote/timeline" - Wiki artifacts: "fsl/wiki/timeline" A context registers listeners under those names when it initializes, and clients may override them at any point after that. |
︙ | |||
12316 12317 12318 12319 12320 12321 12322 | 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 | - + | negative value on error (dig around the sources to decode them - this is not expected to fail unless the system is undergoing a catastrophe). @see fsl_content_blob() @see fsl_content_get() */ |
︙ | |||
12428 12429 12430 12431 12432 12433 12434 | 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 | - + - + - + - + | must not hold a pointer to it or its contents. @see fsl_wiki_load_latest() @see fsl_wiki_latest_rid() @see fsl_wiki_names_get() @see fsl_wiki_page_exists() */ |
︙ | |||
12636 12637 12638 12639 12640 12641 12642 | 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 | - + - + | Represents a J card in a Ticket Control Artifact. */ struct fsl_card_J { /** If true, the new value should be appended to any existing one with the same key, else it will replace any old one. */ |
︙ | |||
12830 12831 12832 12833 12834 12835 12836 | 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 | - + - - - + + - - + + - - - - - - + + + + + + + - - - - + + + + - - - - - + + + + + | it is impossible to distinguish between the results "invalid rid" and "empty directory list" (which is a legal result). On success it returns 0 and tgt will have a number of (char *) entries appended to it equal to the number of subdirectories in the repo (possibly 0). |
︙ | |||
13039 13040 13041 13042 13043 13044 13045 | 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 | - + + + + + - - - - + + + + - - + + | /** Initialized-with-defaults fsl_repo_extract_opt instance, intended for intializing new non-const instances. */ FSL_EXPORT const fsl_repo_extract_opt fsl_repo_extract_opt_empty; /** |
︙ | |||
13181 13182 13183 13184 13185 13186 13187 | 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 | - - - + | /** Looks for the delta table record where rid==deltaRid, and returns that record's srcid via *rv. Returns 0 on success, non-0 on error. If no record is found, *rv is set to 0 and 0 is returned (as opposed to FSL_RC_NOT_FOUND) because that generally simplifies the error checking. |
︙ | |||
13220 13221 13222 13223 13224 13225 13226 | 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 | - + - - + - | This routine is much more efficient if used to answer several queries in a row for the same manifest (the vid parameter). It is least efficient when it is passed intermixed manifest IDs, e.g. (1, 3, 1, 4, 1,...). This is a side-effect of the caching used in the computation of ancestors for a given vid. */ |
︙ | |||
13285 13286 13287 13288 13289 13290 13291 | 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 | - + | The julian time of the branch. If 0 or less, default is the current time. */ double mtime; /** If true, the branch will be marked as private. */ |
︙ | |||
13620 13621 13622 13623 13624 13625 13626 | 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 | - + - | problems, another (more serious) result code is returned, e.g. FSL_RC_OOM or FSL_RC_DB. If FSL_RC_NOT_FOUND is returned and hashOut is not NULL, *hashOut is set to the value of f's preferred hash. *ridOut is only modified if 0 is returned, in which case *ridOut will have a positive value. */ |
︙ | |||
13669 13670 13671 13672 13673 13674 13675 | 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 | - - - - - + + + + + + - - + - + + - + - - + | This routine does not require that f have an opened repo, but if it does then this routine compares the canonicalized forms of both the repository db and the given path and fails if zPath refers to the repository db. Be aware that the relativeToCwd flag may influence that test. |
︙ | |||
13737 13738 13739 13740 13741 13742 13743 | 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 | - + - + - + - + - + - + - + | fsl_repo_leaves_rebuild()). @see fsl_leaves_computed_has() @see fsl_leaves_computed_count() @see fsl_leaves_computed_latest() @see fsl_leaves_computed_cleanup() */ |
︙ | |||
13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 | 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 | + + + + | TODO: figure out and explain the difference between versionRid and originRid. */ fsl_id_t originRid; /** The maximum number of versions to search through. Note that fossil(1) offers the ability to limit the calculation based on processing time, e.g. to 1500ms. We may or may not add that in this library. */ uint32_t limitVersions; /** An approximate number of milliseconds of processing time to limit the annotation to. Note that this is measured in CPU time, not "wall clock" time. This value is rough minimum approximation, |
︙ | |||
14162 14163 14164 14165 14166 14167 14168 | 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 | - - + + + - + | /** Options for the rebuild process. */ struct fsl_rebuild_opt { /** Scan artifacts in a random order (generally only of use in testing |
︙ | |||
14193 14194 14195 14196 14197 14198 14199 | 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 | - + + | Optional state for the callback function. */ void * callbackState; }; /** Initialized-with-defaults fsl_rebuild_opt structure, intended for const-copy initialization. */ |
︙ | |||
14247 14248 14249 14250 14251 14252 14253 | 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | artifacts, so this routine does _not_ drop and rebuild the ticket-related tables. If the FSL_CX_F_SKIP_UNKNOWN_CROSSLINKS flag is _not_ set on f, this routine _will fail_ if it encounters any ticket artifacts. */ FSL_EXPORT int fsl_repo_rebuild(fsl_cx * const f, fsl_rebuild_opt const * const opt); |
︙ | |||
14806 14807 14808 14809 14810 14811 14812 | 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 | - - + + - - + + | as those always "seed" the database with an initial commit artifact containing no files. */ FSL_EXPORT void fsl_ckout_version_info(fsl_cx * const f, fsl_id_t * const rid, fsl_uuid_cstr * const uuid ); /** |
︙ | |||
14843 14844 14845 14846 14847 14848 14849 | 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 | - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + + + | This function does not validate whether or not the file actually exists, only that its name is potentially valid as a filename for use in a checkout (though other, downstream rules might prohibit that, e.g. the filename "..../...." is not valid but is not seen as invalid by this function). (Reminder to self: we could run the end result through fsl_is_simple_pathname() to catch that?) */ |
︙ | |||
14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 | 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 | + | any of those globs. - The client-provided callback says not to include the file. */ uint32_t skipped; } counts; }; typedef struct fsl_ckout_manage_opt fsl_ckout_manage_opt; /** Initialized-with-defaults fsl_ckout_manage_opt instance, intended for use in const-copy initialization. */ #define fsl_ckout_manage_opt_empty_m {\ NULL/*filename*/, true/*relativeToCwd*/, true/*checkIgnoreGlobs*/, \ NULL/*callback*/, NULL/*callbackState*/, \ |
︙ | |||
15045 15046 15047 15048 15049 15050 15051 | 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + + + + + + + - + | ``` Returns 0 on success, non-0 on error. Files queued for addition this way can be unqueued before they are committed using fsl_ckout_unmanage(). |
︙ | |||
15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 | 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 | + + | The name it is passed is relative to the checkout root. */ fsl_ckout_unmanage_f callback; /** State to be passed to this->callback. */ void * callbackState; }; typedef struct fsl_ckout_unmanage_opt fsl_ckout_unmanage_opt; /** Initialized-with-defaults fsl_ckout_unmanage_opt instance, intended for use in const-copy initialization. */ #define fsl_ckout_unmanage_opt_empty_m {\ NULL/*filename*/, NULL/*vfileIds*/,\ true/*relativeToCwd*/,true/*scanForChanges*/, \ |
︙ | |||
15643 15644 15645 15646 15647 15648 15649 | 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 | - - + + - - - - - - + + + + + + - - - + - - + | opt->filename must refer to a path within the current checkout. @see fsl_checkin_enqueue() @see fsl_checkin_is_enqueued() @see fsl_checkin_discard() @see fsl_checkin_commit() */ |
︙ | |||
16180 16181 16182 16183 16184 16185 16186 16187 | 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 | + + - - + + - | Empty-initialised fsl_repo_open_ckout_opt instance. Clients should copy this value (or fsl_repo_open_ckout_opt_empty_m) to initialise fsl_repo_open_ckout_opt instances for sane default values. */ FSL_EXPORT const fsl_repo_open_ckout_opt fsl_repo_open_ckout_opt_empty; /** Work in progress... Opens a checkout db for use with the currently-connected repository |
︙ | |||
16205 16206 16207 16208 16209 16210 16211 | 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 | - + - | Pending: - If opening an existing checkout db for a different repo then delete the STASH and UNDO entries, as they're not valid for a different repo. */ |
︙ | |||
16267 16268 16269 16270 16271 16272 16273 | 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 | - + | /** Merge was not performed because at least one of the inputs appears to be binary. The updated-to version overwrites the previous version in this case. */ FSL_CKUP_FCHANGE_UPDATED_BINARY, /** Updated with a merge by the update process. */ FSL_CKUP_FCHANGE_MERGED, |
︙ | |||
16291 16292 16293 16294 16295 16296 16297 | 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 | - + - - - - - - - - - | TODO: use confirmer here to ask user whether to overwrite. */ FSL_CKUP_FCHANGE_CONFLICT_ADDED_UNMANAGED, /** Edited locally but removed from updated-to version. Local edits will be left in the checkout tree. */ FSL_CKUP_FCHANGE_CONFLICT_RM, /** Cannot merge if one or both of the update/updating verions of a |
︙ | |||
16585 16586 16587 16588 16589 16590 16591 | 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 | - + | repo, FSL_RC_NOT_A_CKOUT if no checkout is opened. If cOpt->callback is not NULL and returns a non-0 result code, extraction ends and that result is returned. If it returns non-0 at any point after basic argument validation, it rolls back all changes or sets the current transaction stack into a rollback state. |
︙ | |||
16640 16641 16642 16643 16644 16645 16646 | 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 | - - - | FSL_EXPORT int fsl_ckout_calc_update_version(fsl_cx * f, fsl_id_t * outRid); /** Bitmask used by fsl_ckout_manifest_setting() and fsl_ckout_manifest_write(). */ enum fsl_cx_manifest_mask_e { |
︙ | |||
16730 16731 16732 16733 16734 16735 16736 | 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 | - + - + - + - + | written by this routine and is also not part of the current checkout (i.e. not listed in the vfile table) will be removed from disk, but a failure while attempting to do so will be silently ignored. @see fsl_repo_manifest_write() */ |
︙ | |||
16978 16979 16980 16981 16982 16983 16984 | 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 | - - - - + - - - - - + + + - | filenames in a more flexible form than that routine. This routine works exactly like that one except for the following differences: 1) The given filename and the relativeToCwd arguments are passed to by fsl_ckout_filename_check() to canonicalize the name and ensure that it points to someplace within f's current checkout. |
︙ | |||
17101 17102 17103 17104 17105 17106 17107 | 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 | - + | it should be. TODO: currently the library offers no automated recovery mechanism from a mismatch, the only remedy being to close the checkout database, destroy it, and re-create it. fossil(1) is able, in some cases, to automatically recover from this situation. */ |
︙ | |||
17130 17131 17132 17133 17134 17135 17136 | 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 | - + | char const * zName, fsl_buffer * const dest); /** Fetches the timestamp of the given F-card's name against the filesystem and/or the most recent checkin in which it was modified (as reported by fsl_mtime_of_manifest()). vid is the checkin |
︙ | |||
17154 17155 17156 17157 17158 17159 17160 17161 | 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + - - - + - - - + - - - - - - + - - - - - - - - + + - - - - - - - - + + + + + - - - - - + - - + + - + - + - + - - + - + - + - - - - - + - - - + - - - - - - - - - - - - - - + + - - - + + + - - + + + + + + + + - - + + - - - - + + - - + + - + - + + - + - + - - - - + + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + | - FSL_RC_OOM. */ FSL_EXPORT int fsl_card_F_ckout_mtime(fsl_cx * const f, fsl_id_t vid, fsl_card_F const * const fc, fsl_time_t * repoMtime, fsl_time_t * localMtime); /** |
︙ | |||
17610 17611 17612 17613 17614 17615 17616 | 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 | - - - - - - | were */ enum fsl_confdb_e { /** Sentinel value. Not for use with public APIs. */ FSL_CONFDB_NONE = 0, /** Signfies the global-level (per system user) configuration area. |
︙ | |||
18053 18054 18055 18056 18057 18058 18059 | 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 | - - + + | fsl_size_t * len); #if defined(__cplusplus) } /*extern "C"*/ #endif #endif /* ORG_FOSSIL_SCM_FSL_CONFDB_H_INCLUDED */ |
︙ | |||
18292 18293 18294 18295 18296 18297 18298 | 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 17266 17267 | - - + + | #if defined(__cplusplus) } /*extern "C"*/ #endif #endif /* ORG_FOSSIL_SCM_FSL_VPATH_H_INCLUDED */ |
︙ | |||
18472 18473 18474 18475 18476 18477 18478 | 17432 17433 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 | - + - | */ fsl_uint_t nextAge; /** List of cached content, ordered by age. */ fsl__bccache_line * list; /** |
︙ | |||
18578 18579 18580 18581 18582 18583 18584 | 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 17547 17548 17549 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 17577 17578 17579 17580 17581 17582 17583 17584 17585 17586 17587 17588 17589 17590 17591 17592 17593 17594 17595 17596 17597 17598 17599 17600 17601 17602 17603 17604 17605 17606 17607 17608 17609 17610 17611 17612 17613 17614 17615 17616 17617 17618 17619 17620 17621 17622 | - - + + - + - - - - - - - + + + + - - - + - - - - - - - - - - - - - + + + - - - - + + + - - + + - - + - + + + + + + + + + + + + + + + + + - + + - + - + | /* The fsl_cx class is documented in main public header. */ struct fsl_cx { /** A pointer to the "main" db handle. Exactly which db IS the main db is, because we have three DBs, not generally knowble. |
︙ | |||
18675 18676 18677 18678 18679 18680 18681 | 17634 17635 17636 17637 17638 17639 17640 17641 17642 17643 17644 17645 17646 17647 17648 17649 17650 17651 17652 17653 17654 17655 17656 17657 17658 17659 17660 17661 17662 17663 17664 17665 17666 17667 17668 17669 17670 17671 17672 | - + + - + - - - + - - + | /** Holds info directly related to a repo database. */ struct { /** Holds the filename of the current repo db and possibly related |
︙ | |||
18729 18730 18731 18732 18733 18734 18735 | 17686 17687 17688 17689 17690 17691 17692 17693 17694 17695 17696 17697 17698 17699 | - - - - - - - | /** Output channel used by fsl_output() and friends. This was added primarily so that fossil client apps can share a single output channel which the user can swap out, e.g. to direct all output to a UI widget or a file. |
︙ | |||
18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 | 17710 17711 17712 17713 17714 17715 17716 17717 17718 17719 17720 17721 17722 17723 17724 17725 17726 17727 17728 17729 17730 17731 17732 17733 17734 17735 17736 17737 17738 17739 17740 17741 17742 17743 17744 17745 17746 17747 17748 17749 17750 17751 17752 17753 17754 17755 17756 17757 17758 | + + + + + + + + + + - + - + | db-driver-provided error state. It is not used by "simple" routines for which an integer code always suffices. APIs which set this should denote it with a comment like "updates the context's error state on error." */ fsl_error error; /** A place for temporarily holding file content. We use this in places where we have to loop over files and read their entire contents, so that we can reuse this buffer's memory if possible. The loop and the reading might be happening in different functions, though, and some care must be taken to avoid use in two functions concurrently. */ fsl_buffer fileContent; /** Reuseable scratchpads for low-level file canonicalization buffering and whatnot. Not intended for huge content: use this->fileContent for that. This list should stay relatively |
︙ | |||
18816 18817 18818 18819 18820 18821 18822 | 17776 17777 17778 17779 17780 17781 17782 17783 17784 17785 17786 17787 17788 17789 17790 17791 17792 17793 17794 17795 17796 17797 17798 17799 17800 17801 17802 17803 17804 17805 17806 17807 17808 17809 17810 17811 17812 17813 17814 17815 17816 17817 17818 17819 17820 | - + - - + + + + + + - - + + | flags to the cache member along with the rest of them. */ int flags; /** Error flag which is intended to be set via signal handlers or a UI thread to tell this context to cancel any currently |
︙ | |||
18865 18866 18867 18868 18869 18870 18871 | 17829 17830 17831 17832 17833 17834 17835 17836 17837 17838 17839 17840 17841 17842 | - - - - - - - | /** Is used to tell the content-save internals that a "final verification" (a.k.a. verify-before-commit) is underway. */ bool inFinalVerify; |
︙ | |||
18898 18899 18900 18901 18902 18903 18904 | 17855 17856 17857 17858 17859 17860 17861 17862 17863 17864 17865 17866 17867 17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 17878 17879 17880 17881 17882 17883 17884 17885 17886 17887 17888 17889 17890 17891 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 | - + - + - - - - - - - - - - - - - - - - - | /** Indicates whether or not this repo has ever seen a delta manifest. If none has ever been seen then the repository will prefer to use baseline (non-delta) manifests. Once a delta is seen in the repository, the checkin algorithm is free to choose deltas later on unless its otherwise prohibited, e.g. by the |
︙ | |||
18976 18977 18978 18979 18980 18981 18982 | 17916 17917 17918 17919 17920 17921 17922 17923 17924 17925 17926 17927 17928 17929 17930 17931 17932 17933 17934 17935 17936 17937 17938 17939 | - + - - + + | /** Infrastructure for fsl_mtime_of_manifest_file(). It remembers the previous RID so that it knows when it has to invalidate/rebuild its ancestry cache. */ fsl_id_t mtimeManifest; /** |
︙ | |||
19019 19020 19021 19022 19023 19024 19025 | 17959 17960 17961 17962 17963 17964 17965 17966 17967 17968 17969 17970 17971 17972 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */ fsl_list binary; /** Holds the "crnl-glob" globs. */ fsl_list crnl; } globs; |
︙ | |||
19098 19099 19100 19101 19102 19103 19104 | 18003 18004 18005 18006 18007 18008 18009 18010 18011 18012 18013 18014 18015 18016 18017 18018 18019 18020 18021 18022 18023 18024 18025 18026 18027 18028 18029 18030 18031 18032 18033 18034 18035 18036 18037 18038 18039 18040 18041 18042 18043 18044 18045 18046 18047 18048 18049 18050 18051 18052 18053 18054 18055 18056 18057 18058 18059 18060 18061 18062 18063 18064 18065 18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 18082 18083 18084 18085 18086 18087 18088 18089 18090 18091 18092 18093 18094 18095 | - - - - - - - - - - - + + + - - - - - - - - - - - - + - - + - + - - | */ bool hasChng; /** Gets set to true (at some point) if the client has the ticketchng.rid db field. */ bool hasChngRid; |
︙ | |||
19404 19405 19406 19407 19408 19409 19410 | 18287 18288 18289 18290 18291 18292 18293 18294 18295 18296 18297 18298 18299 18300 18301 18302 18303 18304 18305 18306 18307 18308 18309 18310 18311 18312 18313 18314 18315 18316 18317 18318 18319 | - + - - + + | left untouched. Returns 0 if a delta is successfully made or none needs to be made, non-0 on error. @see fsl__content_undeltify() */ |
︙ | |||
19937 19938 19939 19940 19941 19942 19943 | 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 18830 18831 18832 18833 18834 18835 | - - - - - - - - - - - - - - - + + | operation. It degrades to O(N) if out-of-lexical-order searches are performed. */ fsl_card_F * fsl__deck_F_seek(fsl_deck * const d, const char *zName); /** @internal |
︙ | |||
19978 19979 19980 19981 19982 19983 19984 | 18848 18849 18850 18851 18852 18853 18854 18855 18856 18857 18858 18859 18860 18861 18862 18863 18864 18865 18866 18867 18868 18869 18870 18871 18872 18873 18874 18875 18876 18877 18878 18879 18880 18881 18882 18883 18884 18885 18886 18887 18888 18889 18890 18891 18892 18893 18894 18895 18896 18897 18898 18899 18900 18901 18902 18903 18904 18905 18906 18907 18908 18909 18910 | + + + + + + + + + + + + + + + + + + - - + + + - - + + - - - - - - + + - + | to the db. */ int fsl__search_doc_touch(fsl_cx * const f, fsl_satype_e saType, fsl_id_t rid, const char * docName); /** @internal Performs the same job as fsl_diff_text() but produces the results in the low-level form of an array of "copy/delete/insert triples." This is primarily intended for internal use in other library-internal algorithms, not for client code. Note all FSL_DIFF_xxx flags apply to this form. Returns 0 on success, any number of non-0 codes on error. On success *outRaw will contain the resulting array, which must eventually be fsl_free()'d by the caller. On error *outRaw is not modified. @deprecated Use fsl_diff_v2_raw() instead. */ int fsl__diff_text_raw(fsl_buffer const *p1, fsl_buffer const *p2, int diffFlags, int ** outRaw); /** @internal |
︙ | |||
20033 20034 20035 20036 20037 20038 20039 | 18918 18919 18920 18921 18922 18923 18924 18925 18926 18927 18928 18929 18930 18931 18932 18933 18934 18935 18936 18937 18938 18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 | - + - - + - + | Results are undefined if tgtDir is not an absolute path rooted in f's current checkout. There are any number of valid reasons removal of a directory might fail, and this routine stops at the first one which does. */ |
︙ | |||
20192 20193 20194 20195 20196 20197 20198 | 19076 19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 | - + | 'allow-symlinks' repo-level config setting is true. That said: the addition of symlinks support into fossil was, IMHO, a poor decision for $REASONS. That might (might) be reflected long-term in this API by only supporting them in the way fossil does for platforms which do not support symlinks. */ int fsl__ckout_symlink_create(fsl_cx * const f, char const *zTgtFile, |
︙ | |||
20294 20295 20296 20297 20298 20299 20300 | 19178 19179 19180 19181 19182 19183 19184 19185 19186 19187 19188 19189 19190 19191 19192 | - + | beyond the file size change, is performed. - FSL__LOCALMOD_NOFOUND = file was not found in the local checkout. Noting that: - Combined values of (FSL__LOCALMOD_PERM | FSL__LOCALMOD_CONTENT) are |
︙ | |||
20429 20430 20431 20432 20433 20434 20435 | 19313 19314 19315 19316 19317 19318 19319 19320 19321 19322 19323 19324 19325 19326 19327 19328 19329 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 | - - + + - - - - - - + + - - - - - - - + + + + + + + + - - - - - + + - - - - + + - - - + + + | @see fsl_ckout_fingerprint_check() */ int fsl__repo_fingerprint_search(fsl_cx * const f, fsl_id_t rcvid, char ** zOut); /** |
︙ | |||
20494 20495 20496 20497 20498 20499 20500 | 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 | - + + - + + - + - + - - + | Any common text at the beginning and end of the two files is removed before starting the divide-and-conquer algorithm. Returns 0 on succes, FSL_RC_OOM on an allocation error. */ int fsl__diff_all(fsl__diff_cx * const p); |
︙ | |||
20537 20538 20539 20540 20541 20542 20543 | 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + | As a special case, if role==0 then ALL cached statements are closed, with the caveat that the process will still fail if any statement is currently flagged as active. */ int fsl__db_cached_clear_role(fsl_db * const db, int role); |
︙ | |||
20722 20723 20724 20725 20726 20727 20728 | 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 19504 19505 19506 19507 19508 19509 19510 19511 19512 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 19528 19529 19530 19531 19532 19533 19534 19535 19536 19537 19538 19539 19540 19541 19542 19543 19544 19545 19546 19547 19548 19549 19550 19551 19552 19553 19554 19555 19556 19557 19558 19559 | - + - + - + - + - + - - + + | returns a copy of zPw) if the project code is not set, under the assumption that this is "the first xfer request of a clone." Whether or not that will apply at this level to libfossil remains to be seen. TODO? Does fossil still use SHA1 for this? */ |
︙ | |||
20828 20829 20830 20831 20832 20833 20834 | 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 19598 19599 19600 | - - + + | #if defined(__cplusplus) } /*extern "C"*/ #endif #endif /* ORG_FOSSIL_SCM_FSL_FORUM_H_INCLUDED */ |
︙ | |||
21335 21336 21337 21338 21339 21340 21341 | 20092 20093 20094 20095 20096 20097 20098 20099 20100 20101 20102 20103 20104 20105 20106 | - + | ``` */ /** @page page_code_conventions Code Conventions Project and Code Conventions... |
︙ | |||
21377 21378 21379 21380 21381 21382 21383 | 20134 20135 20136 20137 20138 20139 20140 20141 20142 20143 20144 20145 20146 20147 20148 20149 20150 20151 20152 20153 20154 20155 20156 20157 20158 20159 20160 20161 20162 20163 20164 20165 20166 20167 20168 20169 20170 20171 20172 20173 20174 20175 20176 20177 20178 20179 20180 20181 20182 20183 20184 20185 20186 20187 20188 20189 20190 20191 20192 20193 20194 20195 20196 20197 20198 20199 20200 20201 20202 20203 20204 20205 20206 20207 20208 20209 20210 20211 20212 | - - - - - - - - - + - - + - - + + - - + + - + - - - - - - - - + + + + + + + + | - Public API members have a fsl_ or FSL_ prefix (fossil_ seems too long). For private/static members, anything goes. Optional or "add-on" APIs (e.g. ::fcli) may use other prefixes, but are encouraged use an "f-word" (as it were), simply out of deference to long-standing software naming conventions. |
︙ | |||
21577 21578 21579 21580 21581 21582 21583 | 20325 20326 20327 20328 20329 20330 20331 20332 20333 20334 20335 20336 20337 20338 20339 20340 20341 20342 20343 20344 20345 20346 20347 20348 20349 20350 20351 20352 20353 20354 20355 20356 20357 20358 20359 20360 20361 20362 20363 20364 20365 20366 20367 | - - + + + + + + + + - | executable bit and only does anything useful on platforms which support symlinks. */ #endif /* ORG_FOSSIL_SCM_PAGES_H_INCLUDED */ |
︙ | |||
22023 22024 22025 22026 22027 22028 22029 | 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 20787 20788 20789 20790 | - + | If not NULL then fcli_setup() will attempt to open the checkout for the given dir, including its associated repo db. By default this is "." (the current directory). Applications can set this to NULL _before_ calling fcli_setup() in order to disable the automatic attemp to open a checkout under the current directory. Doing so is |
︙ | |||
22046 22047 22048 22049 22050 22051 22052 | 20799 20800 20801 20802 20803 20804 20805 20806 20807 20808 20809 20810 20811 20812 20813 | - + | */ struct { /** repo db name string from -R/--repo CLI flag. */ const char * repoDbArg; /** |
︙ | |||
22102 22103 22104 22105 22106 22107 22108 22109 22110 22111 22112 22113 22114 22115 22116 22117 22118 22119 22120 22121 22122 22123 22124 22125 | 20855 20856 20857 20858 20859 20860 20861 20862 20863 20864 20865 20866 20867 20868 20869 20870 20871 20872 20873 20874 20875 20876 20877 20878 20879 20880 20881 20882 20883 20884 20885 20886 20887 20888 20889 20890 20891 20892 20893 20894 20895 20896 20897 20898 20899 20900 20901 20902 20903 20904 20905 20906 | + + + + + + + + + + - + - + - - + - - - - + + + - - + | fcli_cx() returns the API's fsl_cx instance. It will be non-NULL (but might not have an opened checkout/repository) if fsl_setup() succeeds. */ FSL_EXPORT fcli_t fcli; /** Equivalent to `fcli_setup_v2(argc,argv,NULL,NULL)`. @see fcli_pre_setup() @see fcli_setup_v2() @see fcli_end_of_main() @deprecated Its signature will change to fcli_setup_v2()'s at some point. */ FSL_EXPORT int fcli_setup(int argc, char const * const * argv ); /** Initializes fcli's state and CLI flags processing. MUST BE CALLED BEFORE fsl_malloc() and friends are used, as this swaps out the allocator with one which aborts on OOM. (But see fcli_pre_setup() for a workaround for that.) Should be called early on in main(), passed the arguments passed to main(). Returns 0 on success. This sets up the ::fcli instance and opens any checkout found in/above the current dir by default. To disable the automatic search for a checkout, assign `fcli.clientFlags.checkoutDir` to `NULL` before calling this. If the 3rd argument is not NULL, this sets `fcli.cliFlags` to its value. If the 4th argument is not NULL, this sets `fcli.appHelp` to that value. |
︙ | |||
22470 22471 22472 22473 22474 22475 22476 | 21230 21231 21232 21233 21234 21235 21236 21237 21238 21239 21240 21241 21242 21243 21244 21245 | - - - - - - - + | complex values like multi-dimensional arrays. "fax" is short for "free at exit." Results are undefined if the same address or overlapping addresses are queued more than once. Once an entry is in this queue, there is no way to remove it. |
︙ | |||
22623 22624 22625 22626 22627 22628 22629 | 21377 21378 21379 21380 21381 21382 21383 21384 21385 21386 21387 21388 21389 21390 21391 21392 21393 21394 21395 21396 21397 | - - - + + + - + - | Returns 0 on success. If there are no more CLI arguments when it is called then it returns FSL_RC_MISUSE and updates the fcli error state with a description of the problem. It may return any number of non-0 codes from the underlying operations. Sidebar: fsl_filename_to_vfile_ids() requires that directory names |
︙ | |||
22673 22674 22675 22676 22677 22678 22679 | 21426 21427 21428 21429 21430 21431 21432 21433 21434 21435 21436 21437 21438 21439 21440 21441 21442 21443 | - + - + | */ FCLI_DIFF_COLORS_RG, FCLI_DIFF_COLORS_DEFAULT = FCLI_DIFF_COLORS_RG }; typedef enum fcli_diff_colors_e fcli_diff_colors_e; /** |
︙ | |||
22708 22709 22710 22711 22712 22713 22714 | 21461 21462 21463 21464 21465 21466 21467 21468 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | #if defined(__cplusplus) } /*extern "C"*/ #endif #endif /* _ORG_FOSSIL_SCM_FCLI_H_INCLUDED_ */ |
Added signify/fnc-05-release.pub.
|
Deleted signify/fnc-07-release.pub.
| - - |
|
Changes to src/fnc.1.
1 | 1 2 3 4 5 6 7 8 9 | - + | .\" |
︙ | |||
23 24 25 26 27 28 29 | 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 | - - - - - - - - - - - + + + + + | .Nm .Op Ar command .Op Fl h | -help .Nm .Op Fl h | -help .Op Fl v | -version .Nm |
︙ | |||
104 105 106 107 108 109 110 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - + + - - - - - - - - | version that last modified the line. .It Branch view Display navigable list of all repository branches. .El .Pp .Nm provides both global and command-specific options and in-app key |
︙ | |||
147 148 149 150 151 152 153 | 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 | - + - + - + - - - - - - - - - - - - - - - - + - - - - + + - + - - - - - | .El .Pp Commands available to .Nm are as follows: .Bl -tag -width 4v .Tg conf |
︙ | |||
258 259 260 261 262 263 264 | 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 | - - - + + + + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + | will open the timeline to the latest leaf on the repository tree. For a complete list of valid arguments this option accepts, see .Lk https://fossil-scm.org/home/doc/trunk/www/checkin_names.wiki \ "Fossil's Check-in Names". .It Fl f , -filter Ar glob Filter timeline by commits containing .Ar glob |
︙ | |||
335 336 337 338 339 340 341 | 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 | - - - - - + - + - - - - | .Nm .Cm timeline .Cm -t e -t t Ns ). .It Fl u , -username Ar user Only display commits authored by .Ar user . |
︙ | |||
400 401 402 403 404 405 406 | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | - - + + | the timeline is consumed. .It Cm N Find the previous commit that matches the current search term. The search will continue until either a match is found or the latest commit on the timeline is consumed. .El .Tg di |
︙ | |||
432 433 434 435 436 437 438 | 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 | - + - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - + - + - - - + | .Ar artifact1 and .Ar artifact2 must be of the same type, which is expected to be either a symbolic check-in name, tag, (unique abbreviated prefix of) a commit or blob artifact UUID SHA1 or SHA3 hash, or an ISO 8601 formatted date. Both artifact arguments must be supplied when diffing blobs; any following non-option arguments are invalid |
︙ | |||
621 622 623 624 625 626 627 | 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 | - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + + - + - + - - - + | to the latest commit on the given branch, or (a unique abbreviated prefix of) a valid commit UUID SHA1 or SHA3 hash. For a complete list of valid arguments this option accepts, see .Lk https://fossil-scm.org/home/doc/trunk/www/checkin_names.wiki \ "Fossil's Check-in Names". .It Fl h , -help Display tree command help and usage information then exit. |
︙ | |||
747 748 749 750 751 752 753 | 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 | - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + - - - - - - - - - - - + + + + + + + - - - - - - - - - - - + + + + - + - - - - + + + + - - - - - + + + + + | .Nm will traverse either as many commits as specified, or as possible in the specified time limit. By default, .Nm will traverse the entire historical record of the file, which can be expensive for large files that span many commits. Use this option for a faster, more targeted annotation. |
︙ | |||
876 877 878 879 880 881 882 | 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 | - + - - - - - - - - - - + - - - - - - - - - - - - - - - - - | .Pp Options for .Cm fnc branch are as follows: .Bl -tag -width Ds .It Fl a , -after Ar date Display only those branches with activity after the specified |
︙ | |||
947 948 949 950 951 952 953 | 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 | - - - - - - - - + + + + - - - - - - | .Cm fnc branch are as follows: .Bl -tag -width Ds .It Cm Arrow-down, j Move selection cursor down one branch. .It Cm Arrow-up, k Move selection cursor up one branch. |
︙ | |||
999 1000 1001 1002 1003 1004 1005 | 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 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + | .It Cm n Find the next branch that matches the current search pattern. .It Cm N Find the previous branch that matches the current search pattern. .El .El .Sh ENVIRONMENT |
︙ | |||
1095 1096 1097 1098 1099 1100 1101 | 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 | - + | .Qq magenta . .It Ev FNC_COLOUR_DIFF_PLUS Added lines displayed in the diff view. If not defined, the default value is .Qq cyan . .It Ev FNC_COLOUR_DIFF_CHUNK Chunk header lines .Po e.g., |
︙ | |||
1132 1133 1134 1135 1136 1137 1138 | 871 872 873 874 875 876 877 878 879 880 881 882 883 884 | - - - - - - - - - - - - | .It Ev FNC_COLOUR_BRANCH_CURRENT The branch corresponding to the current checkout displayed in the branch view. If not defined, the default value is .Qq green . .It Ev FNC_COLOUR_BRANCH_PRIVATE Private branches displayed in the branch view. If not defined, the default value is |
︙ |
Changes to src/fnc.c.
1 | 1 2 3 4 5 6 7 8 9 | - + | /* |
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - - - | # endif # if !defined(_DEFAULT_SOURCE) # define _DEFAULT_SOURCE /* Needed for strsep() on glibc >= 2.19. */ # endif #endif |
︙ | |||
70 71 72 73 74 75 76 | 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 | - - + + - - - - + + - - - - - + + | #include "libfossil.h" #include "settings.h" #define FNC_VERSION VERSION /* cf. Makefile */ /* Utility macros. */ |
︙ | |||
180 181 182 183 184 185 186 | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | - + | /* Timeline options. */ struct artifact_types { const char **values; short nitems; } filter_types; /* Only load commits of <type>. */ union { const char *zlimit; |
︙ | |||
212 213 214 215 216 217 218 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - - - - - - + + + + + + | bool lsconf; /* List all defined settings. */ bool unset; /* Unset the specified setting. */ /* Command line flags and help. */ fcli_help_info fnc_help; /* Global help. */ fcli_cliflag cliflags_global[3]; /* Global options. */ fcli_command cmd_args[7]; /* App commands. */ |
︙ | |||
284 285 286 287 288 289 290 | 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 | - - + + + + - - - - - | {"config", "conf\0cfg\0settings\0set\0", "Configure or view currently available settings.", cmd_config, usage_config, fnc_init.cliflags_config}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel. */ }, { /* cliflags_timeline timeline command related options. */ |
︙ | |||
346 347 348 349 350 351 352 | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | - - - | FCLI_FLAG_BOOL("i", "invert", &fnc_init.invert, "Invert difference between artifacts. Inversion can also be " "toggled\n with the 'i' key binding in diff view."), FCLI_FLAG_BOOL("q", "quiet", &fnc_init.quiet, "Disable verbose diff output; that is, do not output complete" " content\n of newly added or deleted files. Verbosity can also" " be toggled with\n the 'v' key binding in diff view."), |
︙ | |||
378 379 380 381 382 383 384 | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | - - - | "\tISO8601 date\n" "\tISO8601 timestamp\n" "\t{tip,current,prev,next}\n " "For a complete list of symbols see Fossil's Check-in Names:\n " "https://fossil-scm.org/home/doc/trunk/www/checkin_names.wiki"), FCLI_FLAG_BOOL("h", "help", NULL, "Display tree command help and usage."), |
︙ | |||
408 409 410 411 412 413 414 | 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | - - - | FCLI_FLAG_BOOL("h", "help", NULL, "Display blame command help and usage."), FCLI_FLAG("n", "limit", "<n>", &fnc_init.nrecords.zlimit, "Limit depth of blame history to <n> commits or seconds. Denote the" "\n latter by postfixing 's' (e.g., 30s). Useful for large files" " with\n extensive history. Persists for the duration of the " "session."), |
︙ | |||
443 444 445 446 447 448 449 | 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 | - - - - - - - | "Display branch command help and usage."), FCLI_FLAG_BOOL("o", "open", &fnc_init.open, "Show open branches only. Open and closed branches are listed by " "\n default."), FCLI_FLAG_BOOL("p", "no-private", &fnc_init.noprivate, "Do not show private branches, which are otherwise included in the" "\n list of displayed branches by default."), |
︙ | |||
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | 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 | + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - | enum fnc_search_state { SEARCH_WAITING, SEARCH_CONTINUE, SEARCH_COMPLETE, SEARCH_NO_MATCH, SEARCH_FOR_END }; /* * User-definable setting that must map to SETTINGS in "settings.h". */ enum fnc_colour_obj { FNC_COLOUR_COMMIT = 1, FNC_COLOUR_USER, FNC_COLOUR_DATE, FNC_COLOUR_DIFF_META, FNC_COLOUR_DIFF_MINUS, FNC_COLOUR_DIFF_PLUS, FNC_COLOUR_DIFF_CHUNK, FNC_COLOUR_DIFF_TAGS, FNC_COLOUR_TREE_LINK, FNC_COLOUR_TREE_DIR, FNC_COLOUR_TREE_EXEC, FNC_COLOUR_BRANCH_OPEN, FNC_COLOUR_BRANCH_CLOSED, FNC_COLOUR_BRANCH_CURRENT, FNC_COLOUR_BRANCH_PRIVATE }; enum fnc_diff_type { FNC_DIFF_CKOUT, FNC_DIFF_COMMIT, FNC_DIFF_BLOB, FNC_DIFF_WIKI }; |
︙ | |||
633 634 635 636 637 638 639 | 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 | - - + + - - + - - - - - - - - - - - - - + - - - - - | int ncommits_needed; /* * XXX Is there a more elegant solution to retrieving return codes from * thread functions while pinging between, but before we join, threads? */ int rc; bool endjmp; |
︙ | |||
784 785 786 787 788 789 790 | 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 | - - - | fsl_uuid_str commit_id; char *path; int first_line_onscreen; int last_line_onscreen; int selected_line; int matched_line; int spin_idx; |
︙ | |||
836 837 838 839 840 841 842 | 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 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 | - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + - - - - - - - - - - - - - - - - + + - + - + - - + + + + - + - - + - - - + - - - - + + + + - - - + + + - - - - + + - - - - - + - + - + - + - - - + - + + + + - + + - + - - - - + + - - - - + - - - - - - - - - - - + + + + - - - - - + + + | int selected; int when; bool colour; bool show_date; bool show_id; }; |
︙ | |||
1159 1160 1161 1162 1163 1164 1165 | 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 | - - + + + - - - - - - - - - - - - | if (!setlocale(LC_CTYPE, "")) fsl_fprintf(stderr, "[!] Warning: Can't set locale.\n"); fnc_init.cmdarg = argv[1]; /* Which cmd to show usage if needed. */ #if DEBUG fcli.clientFlags.verbose = 2; /* Verbose error reporting. */ #endif |
︙ | |||
1275 1276 1277 1278 1279 1280 1281 | 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 | - + - + - - - - + - + - - - + + - - - + + - - - - - - - - - - - - - - - | fnc_init.sym); } if (fnc_init.glob) glob = fsl_strdup(fnc_init.glob); if (fnc_init.path) path = fsl_strdup(fnc_init.path); |
︙ | |||
1561 1562 1563 1564 1565 1566 1567 | 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 | - - - - - - - - + | { initscr(); cbreak(); noecho(); nonl(); intrflush(stdscr, FALSE); keypad(stdscr, TRUE); |
︙ | |||
1635 1636 1637 1638 1639 1640 1641 | 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 | - - + + + | const char *glob) { struct fnc_tl_view_state *s = &view->state.timeline; fsl_cx *const f = fcli_cx(); fsl_db *db = fsl_cx_db_repo(f); fsl_buffer sql = fsl_buffer_empty; char *startdate = NULL; |
︙ | |||
1735 1736 1737 1738 1739 1740 1741 | 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 | - - - - - + - - - + + + - - - - + + - - - - - - - + + - - - - + + + + - - - - + + - + - - - - - - + + - - + + - - + - - - - + - + - - - + + + + - + | for (idx = 0; idx < fnc_init.filter_types.nitems; ++idx) fsl_buffer_appendf(&sql, " eventtype=%Q%s", fnc_init.filter_types.values[idx], (idx + 1) < fnc_init.filter_types.nitems ? " OR " : ")"); } if (fnc_init.filter_branch) { |
︙ | |||
1853 1854 1855 1856 1857 1858 1859 | 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 | - - + + | if (fnc_init.nrecords.limit > 0) fsl_buffer_appendf(&sql, " LIMIT %d", fnc_init.nrecords.limit); view->show = show_timeline_view; view->input = tl_input_handler; view->close = close_timeline_view; |
︙ | |||
1881 1882 1883 1884 1885 1886 1887 | 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 | - + - + - - - - + - - | s->colour = !fnc_init.nocolour && has_colors(); s->thread_cx.rc = 0; s->thread_cx.db = db; s->thread_cx.spin_idx = 0; s->thread_cx.ncommits_needed = view->nlines - 1; s->thread_cx.commits = &s->commits; |
︙ | |||
1944 1945 1946 1947 1948 1949 1950 | 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 | - - - - - | prev = TAILQ_PREV(view, view_tailhead, entries); else if (view->parent) prev = view->parent; if (view->parent) { view->parent->child = NULL; view->parent->focus_child = false; |
︙ | |||
2013 2014 2015 2016 2017 2018 2019 2020 2021 | 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 | + + + - + - + + + + + | goto end; } rc = view->show(view); if (rc) goto end; if (view->child) { rc = view->child->show(view->child); #ifdef __linux__ wnoutrefresh(view->child->window); #endif if (rc) goto end; |
︙ | |||
2119 2120 2121 2122 2123 2124 2125 | 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 | - + - + | } if ((rc = pthread_mutex_unlock(&fnc_mutex))) rc = RC(fsl_errno_to_rc(rc, FSL_RC_ACCESS), "%s", "pthread_mutex_unlock"); } |
︙ | |||
2149 2150 2151 2152 2153 2154 2155 | 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 | - + - + + - - - - + + + + - + | return RC(fsl_errno_to_rc(errno, FSL_RC_MISUSE), "%s", "sigaddset"); if (pthread_sigmask(SIG_BLOCK, &set, NULL)) return RC(fsl_errno_to_rc(errno, FSL_RC_MISUSE), "%s", "pthread_sigmask"); |
︙ | |||
2355 2356 2357 2358 2359 2360 2361 | 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 | - + | static int signal_tl_thread(struct fnc_view *view, int wait) { struct fnc_tl_thread_cx *cx = &view->state.timeline.thread_cx; int rc = 0; while (cx->ncommits_needed > 0) { |
︙ | |||
2401 2402 2403 2404 2405 2406 2407 | 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 | - - + | struct commit_entry *entry = s->selected_commit; struct fnc_colour *c = NULL; const char *search_str = NULL; char *headln = NULL, *idxstr = NULL; char *branch = NULL, *type = NULL; char *uuid = NULL; wchar_t *wcstr; |
︙ | |||
2472 2473 2474 2475 2476 2477 2478 | 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 | - + - - + + - + - + + + - + - + - - + - + | == NULL) { rc = RC(FSL_RC_RANGE, "%s", "fsl_mprintf"); headln = NULL; goto end; } if (SPINNER[++tcx->spin_idx] == '\0') tcx->spin_idx = 0; |
︙ | |||
2564 2565 2566 2567 2568 2569 2570 | 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 | - + - - - + + - - - - - - - - - + | usr[strcspn(usr, "@>")] = '\0'; *username = usr; } static int formatln(wchar_t **ptr, int *wstrlen, const char *mbstr, int column_limit, |
︙ | |||
2612 2613 2614 2615 2616 2617 2618 | 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 | - + | if (cols + width > column_limit) break; cols += width; i++; } else if (width == -1) { if (wline[i] == L'\t') { width = TABSIZE - |
︙ | |||
2637 2638 2639 2640 2641 2642 2643 | 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | if (rc) free(wline); else *ptr = wline; return rc; } |
︙ | |||
2773 2774 2775 2776 2777 2778 2779 | 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 | - + | */ user = fsl_strdup(commit->user); if (user == NULL) goto end; if (strpbrk(user, "<@>") != NULL) parse_emailaddr_username(&user); rc = formatln(&usr_wcstr, &usrlen, user, view->ncols - col_pos, |
︙ | |||
2800 2801 2802 2803 2804 2805 2806 | 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 | - + - | return RC(FSL_RC_ERROR, "%s", "fsl_strdup"); while (*comment == '\n') ++comment; eol = strchr(comment, '\n'); if (eol) *eol = '\0'; ncols_avail = view->ncols - col_pos; |
︙ | |||
2842 2843 2844 2845 2846 2847 2848 | 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 | - + - + - - + - - + - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + - - + + + + + + + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | if ((rc = pthread_mutex_unlock(&fnc_mutex))) return RC(fsl_errno_to_rc(rc, FSL_RC_ACCESS), "%s", "pthread_mutex_unlock"); sched_yield(); if ((rc = pthread_mutex_lock(&fnc_mutex))) return RC(fsl_errno_to_rc(rc, FSL_RC_ACCESS), "%s", "pthread_mutex_lock"); |
︙ | |||
3033 3034 3035 3036 3037 3038 3039 | 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 | - - - - - - - - - - - - - - - - - - - - - + + - - | {" Enter,Space ", " ❬Enter❭❬Space❭ "}, {" b ", " ❬b❭ "}, {" F ", " ❬F❭ "}, {" t ", " ❬t❭ "}, {""}, {""}, /* Diff */ {" Space ", " ❬Space❭ "}, |
︙ | |||
3117 3118 3119 3120 3121 3122 3123 | 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 | - - - - - - - - - - - - - - - - - - - | "Open diff view of the selected commit", "Open and populate branch view with all repository branches", "Open prompt to enter term with which to filter new timeline view", "Display a tree reflecting the state of the selected commit", "", "Diff", "Scroll down one page of diff output", |
︙ | |||
3260 3261 3262 3263 3264 3265 3266 | 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 | - + - + | case 'j': if (cury < end) ++cury; break; case KEY_PPAGE: case CTRL('b'): if (cury > 0) { |
︙ | |||
3337 3338 3339 3340 3341 3342 3343 | 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 | + + - + - + + + + + - - - - + + + + - + + + - + + + + + + + + - - - - + + + + + + - + + + + + + + - + + - + + + + + - + + + + + + + + + + + + + + + + + + + + + - + + + + - + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + - + + - + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + - + - + - - | refresh(); } static int tl_input_handler(struct fnc_view **new_view, struct fnc_view *view, int ch) { struct fnc_tl_view_state *s = &view->state.timeline; struct fnc_view *branch_view = NULL, *diff_view = NULL; struct fnc_view *tree_view = NULL; |
︙ | |||
3776 3777 3778 3779 3780 3781 3782 | 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 | - + - + - - + - - + - - + - - - - - + - - + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - + + + - - + + + + + + + - - + + + + + - + - - + + - + + | ++ncommits; } } static int make_splitscreen(struct fnc_view *view) { |
︙ | |||
3966 3967 3968 3969 3970 3971 3972 | 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 | - + - - + + | entry = TAILQ_FIRST(&s->commits.head); else entry = TAILQ_LAST(&s->commits.head, commit_tailhead); } while (1) { if (entry == NULL) { |
︙ | |||
4042 4043 4044 4045 4046 4047 4048 | 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 | - + - + | return false; } static int view_close(struct fnc_view *view) { |
︙ | |||
4175 4176 4177 4178 4179 4180 4181 | 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 | - + - - + + - + - + - - - - - - - - - - + - - - + + + | fsl_free(ffa->fc); fsl_free(ffa); return 0; } static int |
︙ | |||
4250 4251 4252 4253 4254 4255 4256 | 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 | - - + + + - + + + + + - - + | free_colours(&s->colours); return rc; } view->show = show_diff; view->input = diff_input_handler; view->close = close_diff_view; |
︙ | |||
4296 4297 4298 4299 4300 4301 4302 | 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 | - - + + + + - - | /* * We'll diff artifacts of type "ci" (i.e., "checkin") separately, as * it's a different process to diff the others (wiki, technote, etc.). */ if (s->selected_commit->diff_type == FNC_DIFF_COMMIT) rc = create_changeset(s->selected_commit); else if (s->selected_commit->diff_type == FNC_DIFF_BLOB) |
︙ | |||
4340 4341 4342 4343 4344 4345 4346 | 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 | - + + - + + - - + - - - - - - - + + + + + + + - + | /* * Diff local changes on disk in the current checkout differently to * checked-in versions: the former compares on disk file content with * file artifacts; the latter compares file artifact blobs only. */ if (s->selected_commit->diff_type == FNC_DIFF_COMMIT) |
︙ | |||
4487 4488 4489 4490 4491 4492 4493 | 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 | - + - - - | if (st == NULL) { RC(FSL_RC_ERROR, "%s", "fsl_strdup"); goto end; } while ((line = fnc_strsep(&st, "\n")) != NULL) { linelen = fsl_strlen(line); if (linelen >= s->ncols) { |
︙ | |||
4542 4543 4544 4545 4546 4547 4548 | 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 | - - - - - - - | file_change->fc->name)) < 0) goto end; lnoff += n; if ((rc = add_line_offset(&s->line_offsets, &s->nlines, lnoff))) goto end; } |
︙ | |||
4629 4630 4631 4632 4633 4634 4635 | 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 | - + + - + - - + - - + - + - + | * exists in both d1 and d2). In cases (1) and (2), we call diff_file_artifact() * to dump the complete content of the added/deleted file if FSL_DIFF_VERBOSE is * set, otherwise only diff metatadata will be output. In case (3), if the * hash (UUID) of each F card is the same, there are no changes; if different, * both artifacts will be passed to diff_file_artifact() to be diffed. */ static int |
︙ | |||
4704 4705 4706 4707 4708 4709 4710 | 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 | - + + + - - + + + - + - + | fsl_deck_F_next(&d2, &fc2); } else if (different < 0) { a = fc1; change = FSL_CKOUT_CHANGE_REMOVED; fsl_deck_F_next(&d1, &fc1); } if (diff) |
︙ | |||
4745 4746 4747 4748 4749 4750 4751 | 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 | - + + - + - | * buf output buffer in which diff content is appended * vid repository database record id of the version to diff against * diff_flags, context, and sbs are the same parameters as diff_file_artifact() * nb. This routine is only called with 'fnc diff [hash]'; that is, one or * zero args—not two—supplied to fnc's diff command line interface. */ static int |
︙ | |||
4881 4882 4883 4884 4885 4886 4887 | 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 | - - - - + + + + - + - + - - + + + - + - + | } if (!xminus) xminus = fsl_strdup(NULL_DEVICE); allow_symlinks = fsl_config_get_bool(f, FSL_CONFDB_REPO, false, "allow-symlinks"); if (!symlink != !(fsl_is_symlink(fsl_buffer_cstr(&abspath)) && allow_symlinks)) { |
︙ | |||
4985 4986 4987 4988 4989 4990 4991 | 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 | - + - - + + - - + - - + + + - + | /* FALL THROUGH */ default: minus = xminus; plus = xplus; break; } |
︙ | |||
5087 5088 5089 5090 5091 5092 5093 | 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 | - - - - - + + - - - - - - + + - + - - - - - + + + + + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | default: RC(FSL_RC_SIZE_MISMATCH, "invalid artifact uuid [%s]", xminus); goto end; } if (rc) goto end; |
︙ | |||
5251 5252 5253 5254 5255 5256 5257 | 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 | - + - - + - - - + + - - - - - - - - + + + - - + - + | else { fsl_buffer_copy(buf, &wiki); goto end; } } /* Diff the artifacts if a parent is found. */ |
︙ | |||
5350 5351 5352 5353 5354 5355 5356 | 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 | - + | } if (b) { rc = fsl_card_F_content(f, b, &fbuf2); if (rc) goto end; zplus = b->name; xplus = b->uuid; |
︙ | |||
5375 5376 5377 5378 5379 5380 5381 | 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 | - - - - - - - - + + + + - - + - - + - - - - - | } xplus0 = fsl_rid_to_uuid(f, vid2); xplus = xplus0; fsl_stmt_finalize(&stmt); fsl_content_get(f, vid2, &fbuf2); } |
︙ | |||
5450 5451 5452 5453 5454 5455 5456 | 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 | - - + + - + - - - - - - - - - - - - - + + - + - + - - + - - + - - - + + + + - + + - + - - - - - - - - - - - - - - - - + + - - + - + - + - + - - - - - + + + - - - + + - - - + + - + - + + + | regmatch_t *regmatch = &view->regmatch; struct fnc_colour *c = NULL; wchar_t *wcstr; char *line; size_t linesz = 0; ssize_t linelen; off_t line_offset; |
︙ | |||
5594 5595 5596 5597 5598 5599 5600 | 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 | - + - + - + - - - - - - - - - - - - - - - + + - - + + - - + - - - - + - - - + - + - + - + - - + - - - - - - - - + + - + - - - - + + + - + - - + - - - + - - - - - + + - - + - - + - - - - - - + - + - - - - - - + - - - - + + + + - + - - - - - - - - - - - - - + + + - + - + - - - - + - - + - - + - - - - - - - - + - - - - - - + - - - - - - - + + + - - - + + + + + + + + + + + - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | return false; } else if (!screen_is_split(view)) return false; return view->active; } |
︙ | |||
5965 5966 5967 5968 5969 5970 5971 | 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 | - + - + - - + + + + + + - + + + + + + + - + - + + | case 'c': case 'i': case 'v': case 'w': if (ch == 'c') s->colour = !s->colour; if (ch == 'i') |
︙ | |||
6011 6012 6013 6014 6015 6016 6017 | 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 | - - - - - - - + - - - + - - - + - - - - - - - + + - - - + - - - - - - - - + - - - + - - + - - - - - - - - - - - - + + + - + + - + - - - + + - - - - + - - - - + - + - + - + - + - - + + - + - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + + - - + - - - + + + - - - - - + + + + + + - - - - + - - - - - - - - + + + - - - - - - - - - - + + - - - - - - - - - - - - - + - + | if (previous_selection == tlstate->selected_commit) break; if ((rc = set_selected_commit(s, tlstate->selected_commit))) break; |
︙ | |||
6272 6273 6274 6275 6276 6277 6278 | 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 | - + - - + + - + - + - - - + + | wclear(view->window); view->nlines = nlines; view->ncols = ncols; view->lines = LINES; view->cols = COLS; |
︙ | |||
6390 6391 6392 6393 6394 6395 6396 | 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 | - - - + + + - - + + - + - - - + + - + - - + - + - | exit(fcli_end_of_main(fnc_init.err)); } static void usage_timeline(void) { fsl_fprintf(fnc_init.err ? stderr : stdout, |
︙ | |||
6607 6608 6609 6610 6611 6612 6613 | 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 | - - - - - - - + | commit->type = fsl_strdup("blob"); commit->diff_type = diff_type; } rc = init_curses(); if (rc) goto end; |
︙ | |||
6644 6645 6646 6647 6648 6649 6650 | 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 | - + - + | TAILQ_FOREACH(pe, &paths, entry) free((char *)pe->path); fnc_pathlist_free(&paths); return rc; } static int |
︙ | |||
6719 6720 6721 6722 6723 6724 6725 | 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 | - - - - - - | fcli_progname()); goto end; } rc = init_curses(); if (rc) goto end; |
︙ | |||
6801 6802 6803 6804 6805 6806 6807 | 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 | - - + + | if (rc) goto end; } view->show = show_tree_view; view->input = tree_input_handler; view->close = close_tree_view; |
︙ | |||
6909 6910 6911 6912 6913 6914 6915 | 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 | - + - + - + - + | memset(ptr, 0, sizeof(struct fnc_repository_tree)); rc = fsl_deck_load_rid(f, &d, rid, FSL_SATYPE_CHECKIN); if (rc) return RC(rc, "fsl_deck_load_rid(%d) [%s]", rid, id); rc = fsl_deck_F_rewind(&d); if (rc) |
︙ | |||
7042 7043 7044 7045 7046 7047 7048 | 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 | - + | * path The repository relative pathname of the versioned file * uuid The SHA hash of the file * mtime Modification time of the file * Returns 0 on success, non-zero on error. */ static int link_tree_node(struct fnc_repository_tree *tree, const char *path, |
︙ | |||
7158 7159 7160 7161 7162 7163 7164 | 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 | - + | rc = tree_entry_path(&treepath, &s->parents, NULL); if (rc) return rc; rc = draw_tree(view, treepath); fsl_free(treepath); |
︙ | |||
7241 7242 7243 7244 7245 7246 7247 | 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 | - + - + - | static int draw_tree(struct fnc_view *view, const char *treepath) { struct fnc_tree_view_state *s = &view->state.tree; struct fnc_tree_entry *te; struct fnc_colour *c = NULL; wchar_t *wcstr; |
︙ | |||
7277 7278 7279 7280 7281 7282 7283 | 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 | - + + - + - + + - + - - + - | wattroff(view->window, A_REVERSE); fsl_free(wcstr); wcstr = NULL; if (--limit <= 0) return rc; /* Write this (sub)tree's absolute repository path subheader. */ |
︙ | |||
7362 7363 7364 7365 7366 7367 7368 | 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 | - - - - - - - - + - - - - - + + + + - - - - + + + + + + - + - + - + | } modestr = "@"; } else if (S_ISDIR(mode)) modestr = "/"; else if (mode & S_IXUSR) modestr = "*"; |
︙ | |||
7474 7475 7476 7477 7478 7479 7480 7481 | 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 | + - + - + + - - - | } static int tree_input_handler(struct fnc_view **new_view, struct fnc_view *view, int ch) { struct fnc_view *branch_view, *timeline_view; struct fnc_tree_view_state *s = &view->state.tree; struct fnc_tl_thread_cx *tcx = NULL; struct fnc_tree_entry *te; |
︙ | |||
7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 | 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 | + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - + - - + - - - - - - - - - - - - - - | } s->first_entry_onscreen = te; te = get_tree_entry(s->tree, te->idx - 1); } if (n > 0) s->selected_idx = n - 1; break; case KEY_UP: case 'k': if (s->selected_idx > 0) { --s->selected_idx; break; } tree_scroll_up(s, 1); break; case KEY_PPAGE: case CTRL('b'): if (s->tree == s->root) { if (&s->tree->entries[0] == s->first_entry_onscreen) s->selected_idx = 0; } else { if (s->first_entry_onscreen == NULL) s->selected_idx = 0; } tree_scroll_up(s, MAX(0, view->nlines - 3)); break; case KEY_DOWN: case 'j': if (s->selected_idx < s->ndisplayed - 1) { ++s->selected_idx; break; } if (get_tree_entry(s->tree, s->last_entry_onscreen->idx + 1) == NULL) break; /* Reached last entry. */ |
︙ | |||
7637 7638 7639 7640 7641 7642 7643 | 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 | - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - | TAILQ_REMOVE(&s->parents, parent, entry); fnc_object_tree_close(s->tree); s->tree = parent->tree; s->first_entry_onscreen = parent->first_entry_onscreen; s->selected_entry = parent->selected_entry; s->selected_idx = parent->selected_idx; |
︙ | |||
7741 7742 7743 7744 7745 7746 7747 | 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 | - - + + - - - + + - + - - - + + - - | break; } s->first_entry_onscreen = te; te = get_tree_entry(s->tree, te->idx - 1); } } |
︙ | |||
7789 7790 7791 7792 7793 7794 7795 | 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 | - + - + - - + + + - + - - + + - - + + - - | s->selected_idx = 0; s->first_entry_onscreen = NULL; return 0; } static int |
︙ | |||
7881 7882 7883 7884 7885 7886 7887 | 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 | - + - + - - - - - - - - - - + + - | if (match_tree_entry(te, &view->regex)) { view->search_status = SEARCH_CONTINUE; s->matched_entry = te; break; } if (view->searching == SEARCH_FORWARD) |
︙ | |||
8004 8005 8006 8007 8008 8009 8010 | 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 | - + - - - - - - - + - - - - - - - - + + - + - - - + + + - - - + + + - + - + + + + + + + - - + + - + - + - + + + + + + + - + - + - + + + + + + + + - + | } fsl_free(repo); } static int cmd_config(const fcli_command *argv) { |
︙ | |||
8132 8133 8134 8135 8136 8137 8138 | 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 | - - - - - - - - - - - + | } static void view_set_child(struct fnc_view *view, struct fnc_view *child) { view->child = child; child->parent = view; |
︙ | |||
8223 8224 8225 8226 8227 8228 8229 | 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 | - - | nitems(regexp_branch)); break; } default: rc = RC(FSL_RC_TYPE, "invalid fnc_view_id: %s", vid); } |
︙ | |||
8260 8261 8262 8263 8264 8265 8266 | 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 | - + - + | STAILQ_INSERT_HEAD(colours, colour, entries); } return rc; } static int |
︙ | |||
8302 8303 8304 8305 8306 8307 8308 | 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 | - + - + - + - - + + - - - - - - - - + + + + + + + + - + - + - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + - + + + - - - - + + + + - - + | * found, return a dynamically allocated string obtained from fsl_db_g_text() or * strdup(), which must be disposed of by the caller. Alternatively, if ls is * set, search local settings and envvars for id. If found, dynamically allocate * and return a formatted string for pretty printing the current state of id, * which the caller must free. In either case, if not found, return NULL. */ static char * |
︙ | |||
8455 8456 8457 8458 8459 8460 8461 | 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 | - + - | cmd_blame(fcli_command const *argv) { fsl_cx *const f = fcli_cx(); struct fnc_view *view; char *path = NULL; fsl_uuid_str commit_id = NULL; fsl_id_t tip = 0, rid = 0; |
︙ | |||
8495 8496 8497 8498 8499 8500 8501 | 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 | - + - - - - + - - - - - - - - | rc = fsl_sym_to_rid(f, "tip", FSL_SATYPE_CHECKIN, &tip); if (rc) goto end; } rc = fsl_sym_to_rid(f, fnc_init.sym, FSL_SATYPE_CHECKIN, &rid); if (rc) goto end; |
︙ | |||
8585 8586 8587 8588 8589 8590 8591 | 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 | - - + + | if (rc) return rc; } view->show = show_blame_view; view->input = blame_input_handler; view->close = close_blame_view; |
︙ | |||
8627 8628 8629 8630 8631 8632 8633 | 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 | - - - - | rc = RC(FSL_RC_NOT_FOUND, "'%s' not found in tree [%s]", filepath, s->blamed_commit->id); goto end; } rc = fsl_card_F_content(f, cf, &buf); if (rc) goto end; |
︙ | |||
8714 8715 8716 8717 8718 8719 8720 | 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 | - + - | s->blame_complete = false; if (s->first_line_onscreen + view->nlines - 1 > blame->nlines) { s->first_line_onscreen = 1; s->last_line_onscreen = view->nlines; s->selected_line = 1; } |
︙ | |||
8750 8751 8752 8753 8754 8755 8756 | 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 | - - + + | if (filesz) *filesz = 0; if (nlines) *nlines = 0; len = buf->used; if (len == 0) |
︙ | |||
8845 8846 8847 8848 8849 8850 8851 | 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 | - + | halfdelay(1); /* Fast refresh while annotating. */ } if (s->blame_complete) cbreak(); /* Return to blocking mode. */ rc = draw_blame(view); |
︙ | |||
8920 8921 8922 8923 8924 8925 8926 | 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 | - - - + - + - - + + + + - + + - + | /* -r can return lines with no version, so use root check-in. */ if (opt->originRid && !line->id) { line->id = fsl_strdup(cx->root_commit); line->annotated = true; } |
︙ | |||
8984 8985 8986 8987 8988 8989 8990 | 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 | - - - + + + + - + - - - - - + - - + - - - + + + | if (screen_is_shared(view)) wattroff(view->window, A_REVERSE); fsl_free(wcstr); wcstr = NULL; if (width < view->ncols - 1) waddch(view->window, '\n'); |
︙ | |||
9058 9059 9060 9061 9062 9063 9064 | 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 | - - - - - - + + + - - + + + - + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - | COLOR_PAIR(c->scheme), NULL); fsl_free(id_str); prev_id = blame_line->id; } else { waddstr(view->window, ".........."); prev_id = NULL; } |
︙ | |||
9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 | 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 | + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | s->first_line_onscreen = 1; } else { s->selected_line = view->nlines - 2; s->first_line_onscreen = s->blame.nlines - (view->nlines - 3); } break; case KEY_UP: case 'k': if (s->selected_line > 1) --s->selected_line; else if (s->selected_line == 1 && s->first_line_onscreen > 1) --s->first_line_onscreen; break; case KEY_PPAGE: case CTRL('b'): if (s->first_line_onscreen == 1) { s->selected_line = 1; break; } if (s->first_line_onscreen > view->nlines - 2) s->first_line_onscreen -= (view->nlines - 2); else s->first_line_onscreen = 1; break; case KEY_DOWN: case 'j': if (s->selected_line < view->nlines - 2 && s->first_line_onscreen + s->selected_line <= s->blame.nlines) ++s->selected_line; else if (s->last_line_onscreen < s->blame.nlines) ++s->first_line_onscreen; break; |
︙ | |||
9324 9325 9326 9327 9328 9329 9330 | 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 | + - + + + + + + + | if (fsl_deck_F_search(&d, s->path + (fnc_init.sym ? 0 : 1)) == NULL) { char *m = fsl_mprintf("-- %s not in [%.12s] --", s->path + (fnc_init.sym ? 0 : 1), pid); if (m == NULL) rc = RC(FSL_RC_ERROR, "%s", "fsl_mprintf"); wattr_on(view->window, A_BOLD, NULL); |
︙ | |||
9425 9426 9427 9428 9429 9430 9431 | 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 | - + | start_col = view_split_start_col(view->start_col); diff_view = view_open(0, 0, 0, start_col, FNC_VIEW_DIFF); if (diff_view == NULL) { fnc_commit_artifact_close(commit); rc = RC(FSL_RC_ERROR, "%s", "view_open"); break; } |
︙ | |||
9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 | 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 | + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | view->focus_child = true; } else *new_view = diff_view; if (rc) break; break; } case KEY_NPAGE: case CTRL('f'): case ' ': if (s->last_line_onscreen >= s->blame.nlines && s->selected_line >= MIN(s->blame.nlines, view->nlines - 2)) break; if (s->last_line_onscreen >= s->blame.nlines && s->selected_line < view->nlines - 2) { s->selected_line = MIN(s->blame.nlines, view->nlines - 2); break; } if (s->last_line_onscreen + view->nlines - 2 <= s->blame.nlines) s->first_line_onscreen += view->nlines - 2; else s->first_line_onscreen = s->blame.nlines - (view->nlines - 3); break; case KEY_RESIZE: if (s->selected_line > view->nlines - 2) { s->selected_line = MIN(s->blame.nlines, view->nlines - 2); } break; default: break; } return rc; } |
︙ | |||
9528 9529 9530 9531 9532 9533 9534 | 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 | - + | static int stop_blame(struct fnc_blame *blame) { int idx, rc = 0; if (blame->thread_id) { |
︙ | |||
9646 9647 9648 9649 9650 9651 9652 | 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 | - + - - - - - - - - - - - + + + + + + - + - - - + + + - - | when = fnc_init.after ? 1 : -1; rc = fnc_date_to_mtime(&dateline, d, when); if (rc) return rc; } glob = fsl_strdup(fcli_next_arg(true)); |
︙ | |||
9743 9744 9745 9746 9747 9748 9749 | 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 | - - + - - - - + + - | " FROM tmp_brlist WHERE isclosed", -1); break; } if (rc) goto end; if (s->branch_glob) { |
︙ | |||
9822 9823 9824 9825 9826 9827 9828 | 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 | - + | return rc; } static int create_tmp_branchlist_table(void) { fsl_cx *const f = fcli_cx(); |
︙ | |||
9848 9849 9850 9851 9852 9853 9854 | 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 | - + | " AND tagxref.tagtype>0" " AND tag.tagname='branch'" " AND event.objid=tagxref.rid " "GROUP BY 1;"; int rc = 0; if (!db) |
︙ | |||
9958 9959 9960 9961 9962 9963 9964 | 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 | - + | be = s->first_branch_onscreen; if ((line = fsl_mprintf("branches [%d/%d]", be->idx + s->selected + 1, s->nbranches)) == NULL) return RC(FSL_RC_ERROR, "%s", "fsl_mprintf"); |
︙ | |||
9998 9999 10000 10001 10002 10003 10004 | 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 | - + | s->show_date ? be->branch->date : 0); if (line == NULL) return RC(FSL_RC_ERROR, "%s", "fsl_mprintf"); if (s->colour) c = match_colour(&s->colours, line); |
︙ | |||
10029 10030 10031 10032 10033 10034 10035 | 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 | - + - + - + - + + - - - + + + - - - + - - + + + - - - - - + + + + - - - + | ++n; ++s->ndisplayed; --limit; s->last_branch_onscreen = be; be = TAILQ_NEXT(be, entries); } |
︙ | |||
10132 10133 10134 10135 10136 10137 10138 | 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 | - + - - - - - + + - - - - + - - + + + + + + + + + + + + + + + + + + + + + + + + + | if (s->selected < s->ndisplayed - 1) { ++s->selected; break; } if (TAILQ_NEXT(s->last_branch_onscreen, entries) == NULL) /* Reached last entry. */ break; |
︙ | |||
10218 10219 10220 10221 10222 10223 10224 | 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 | - - + + - - + - - + - - - + + + | if (be == NULL) break; s->first_branch_onscreen = be; be = TAILQ_PREV(be, fnc_branchlist_head, entries); } } |
︙ | |||
10309 10310 10311 10312 10313 10314 10315 | 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 | - - - - - - - - - + + + + - - + | if (view->searching == SEARCH_FORWARD) be = TAILQ_NEXT(be, entries); else be = TAILQ_PREV(be, fnc_branchlist_head, entries); } if (s->matched_branch) { |
︙ | |||
10480 10481 10482 10483 10484 10485 10486 | 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 | - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | static void fnc_show_version(void) { printf("%s %s\n", fcli_progname(), PRINT_VERSION); } static int |
︙ | |||
10631 10632 10633 10634 10635 10636 10637 | 9661 9662 9663 9664 9665 9666 9667 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | *ptr = token; } else *ptr = NULL; return s; } |