felta  Hex Artifact Content

Artifact 4dc557b587610cf337646fa60e14accfc0a387a3:

Wiki page [felta] by stephan 2016-03-05 09:15:36.
0000: 44 20 32 30 31 36 2d 30 33 2d 30 35 54 30 39 3a  D 2016-03-05T09:
0010: 31 35 3a 33 36 2e 32 39 31 0a 4c 20 66 65 6c 74  15:36.291.L felt
0020: 61 0a 50 20 66 38 65 39 30 64 34 63 62 65 31 35  a.P f8e90d4cbe15
0030: 30 64 66 61 35 34 63 62 62 38 39 39 64 35 62 31  0dfa54cbb899d5b1
0040: 64 66 37 62 36 66 62 30 39 66 34 30 0a 55 20 73  df7b6fb09f40.U s
0050: 74 65 70 68 61 6e 0a 57 20 31 36 34 35 0a 22 46  tephan.W 1645."F
0060: 65 6c 74 61 22 20 28 46 6f 73 73 69 6c 20 44 65  elta" (Fossil De
0070: 6c 74 61 29 20 69 73 20 61 20 73 74 61 6e 64 61  lta) is a standa
0080: 6c 6f 6e 65 20 43 20 6c 69 62 72 61 72 79 20 76  lone C library v
0090: 65 72 73 69 6f 6e 20 6f 66 20 74 68 65 20 63 6f  ersion of the co
00a0: 72 65 20 66 69 6c 65 2d 64 65 6c 74 61 20 63 6f  re file-delta co
00b0: 64 65 20 66 72 6f 6d 20 5b 68 74 74 70 3a 2f 2f  de from [http://
00c0: 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 7c 46  fossil-scm.org|F
00d0: 6f 73 73 69 6c 20 53 43 4d 5d 2c 20 74 69 64 69  ossil SCM], tidi
00e0: 65 64 20 75 70 20 61 20 62 69 74 20 74 6f 20 6d  ed up a bit to m
00f0: 61 6b 65 20 69 74 20 73 75 69 74 61 62 6c 65 20  ake it suitable 
0100: 66 6f 72 20 75 73 65 20 61 73 20 61 20 73 74 61  for use as a sta
0110: 6e 64 61 6c 6f 6e 65 20 6c 69 62 72 61 72 79 2c  ndalone library,
0120: 20 61 6e 64 20 6f 70 74 69 6f 6e 61 6c 6c 79 20   and optionally 
0130: 28 6f 66 66 20 62 79 20 64 65 66 61 75 6c 74 29  (off by default)
0140: 20 65 78 74 65 6e 64 73 20 69 74 20 74 6f 20 73   extends it to s
0150: 75 70 70 6f 72 74 20 6d 75 6c 74 69 70 6c 65 20  upport multiple 
0160: 69 6e 74 65 67 65 72 20 65 6e 63 6f 64 69 6e 67  integer encoding
0170: 73 20 28 62 61 73 65 73 20 31 30 2c 20 31 36 2c  s (bases 10, 16,
0180: 20 61 6e 64 20 36 34 29 2e 20 49 74 20 63 6f 6e   and 64). It con
0190: 73 69 73 74 73 20 6f 66 20 6f 6e 6c 79 20 74 77  sists of only tw
01a0: 6f 20 66 69 6c 65 73 20 28 6f 6e 65 20 2e 63 20  o files (one .c 
01b0: 61 6e 64 20 6f 6e 65 20 2e 68 29 2c 20 68 61 73  and one .h), has
01c0: 20 61 20 73 6d 61 6c 6c 2c 20 65 61 73 79 2d 74   a small, easy-t
01d0: 6f 2d 75 73 65 20 41 50 49 2c 20 68 61 73 20 6e  o-use API, has n
01e0: 6f 20 64 65 70 65 6e 64 65 6e 63 69 65 73 20 62  o dependencies b
01f0: 65 79 6f 6e 64 20 74 68 65 20 73 74 61 6e 64 61  eyond the standa
0200: 72 64 20 43 20 6c 69 62 72 61 72 79 20 28 43 38  rd C library (C8
0210: 39 20 73 75 66 66 69 63 65 73 29 2c 20 61 6e 64  9 suffices), and
0220: 20 69 6e 20 63 6f 6d 70 69 6c 65 64 20 66 6f 72   in compiled for
0230: 6d 20 68 61 73 20 61 20 66 6f 6f 74 20 70 72 69  m has a foot pri
0240: 6e 74 20 6f 66 20 6f 6e 6c 79 20 61 62 6f 75 74  nt of only about
0250: 20 31 32 6b 62 2e 20 54 68 69 73 20 64 65 6c 74   12kb. This delt
0260: 61 20 66 6f 72 6d 61 74 20 69 73 20 6b 6e 6f 77  a format is know
0270: 6e 20 74 6f 20 70 65 72 66 6f 72 6d 20 76 65 72  n to perform ver
0280: 79 20 77 65 6c 6c 20 69 6e 20 74 68 65 20 46 6f  y well in the Fo
0290: 73 73 69 6c 20 53 43 4d 2e 0d 0a 0d 0a 54 68 65  ssil SCM.....The
02a0: 20 64 65 6c 74 61 20 66 6f 72 6d 61 74 20 69 73   delta format is
02b0: 20 64 65 73 63 72 69 62 65 64 20 68 65 72 65 3a   described here:
02c0: 0d 0a 0d 0a 5b 68 74 74 70 3a 2f 2f 66 6f 73 73  ....[http://foss
02d0: 69 6c 2d 73 63 6d 2e 6f 72 67 2f 69 6e 64 65 78  il-scm.org/index
02e0: 2e 68 74 6d 6c 2f 64 6f 63 2f 74 72 75 6e 6b 2f  .html/doc/trunk/
02f0: 77 77 77 2f 64 65 6c 74 61 5f 66 6f 72 6d 61 74  www/delta_format
0300: 2e 77 69 6b 69 5d 0d 0a 0d 0a 54 68 69 73 20 76  .wiki]....This v
0310: 65 72 73 69 6f 6e 20 73 75 70 70 6f 72 74 73 20  ersion supports 
0320: 61 6e 20 6f 70 74 69 6f 6e 20 74 6f 20 75 73 65  an option to use
0330: 20 64 69 66 66 65 72 65 6e 74 20 65 6e 63 6f 64   different encod
0340: 69 6e 67 73 20 66 6f 72 20 6e 75 6d 62 65 72 73  ings for numbers
0350: 2c 20 62 75 74 20 69 73 20 62 79 20 64 65 66 61  , but is by defa
0360: 75 6c 74 20 63 6f 6d 70 61 74 69 62 6c 65 20 77  ult compatible w
0370: 69 74 68 20 74 68 61 74 20 63 6f 64 65 2e 20 53  ith that code. S
0380: 65 65 20 3c 74 74 3e 66 65 6c 74 61 5f 63 72 65  ee <tt>felta_cre
0390: 61 74 65 28 29 3c 2f 74 74 3e 20 66 6f 72 20 74  ate()</tt> for t
03a0: 68 65 20 64 65 74 61 69 6c 73 2e 0d 0a 0d 0a 3c  he details.....<
03b0: 73 74 72 6f 6e 67 3e 4c 69 63 65 6e 73 65 3a 3c  strong>License:<
03c0: 2f 73 74 72 6f 6e 67 3e 20 53 69 6d 70 6c 69 66  /strong> Simplif
03d0: 69 65 64 20 42 53 44 20 4c 69 63 65 6e 73 65 20  ied BSD License 
03e0: 28 61 6c 73 6f 20 6b 6e 6f 77 6e 20 61 73 20 74  (also known as t
03f0: 68 65 20 22 32 2d 43 6c 61 75 73 65 20 4c 69 63  he "2-Clause Lic
0400: 65 6e 73 65 22 20 6f 72 20 22 46 72 65 65 42 53  ense" or "FreeBS
0410: 44 20 4c 69 63 65 6e 73 65 22 29 0d 0a 0d 0a 3c  D License")....<
0420: 73 74 72 6f 6e 67 3e 44 6f 77 6e 6c 6f 61 64 3a  strong>Download:
0430: 3c 2f 73 74 72 6f 6e 67 3e 20 73 65 65 20 74 68  </strong> see th
0440: 65 20 5b 64 6f 77 6e 6c 6f 61 64 5d 20 70 61 67  e [download] pag
0450: 65 2e 0d 0a 0d 0a 50 72 69 6d 61 72 79 20 70 72  e.....Primary pr
0460: 6f 70 65 72 74 69 65 73 20 6f 66 20 74 68 69 73  operties of this
0470: 20 6c 69 62 72 61 72 79 3a 0d 0a 0d 0a 20 20 20   library:....   
0480: 2a 20 20 43 61 6e 20 64 65 6c 74 69 66 79 20 74  *  Can deltify t
0490: 65 78 74 20 61 6e 64 20 62 69 6e 61 72 79 2e 0d  ext and binary..
04a0: 0a 20 20 20 2a 20 20 48 61 73 20 61 20 74 72 69  .   *  Has a tri
04b0: 76 69 61 6c 20 69 6e 74 65 72 66 61 63 65 2c 20  vial interface, 
04c0: 77 69 74 68 20 6a 75 73 74 20 61 20 73 6d 61 6c  with just a smal
04d0: 6c 20 68 61 6e 64 66 75 6c 20 6f 66 20 66 75 6e  l handful of fun
04e0: 63 74 69 6f 6e 73 2e 0d 0a 20 20 20 2a 20 20 43  ctions...   *  C
04f0: 61 6e 20 67 65 6e 65 72 61 74 65 2f 61 70 70 6c  an generate/appl
0500: 79 20 64 65 6c 74 61 20 6f 75 74 70 75 74 20 74  y delta output t
0510: 6f 20 63 6c 69 65 6e 74 2d 61 6c 6c 6f 63 61 74  o client-allocat
0520: 65 64 20 63 68 61 72 20 61 72 72 61 79 73 20 6f  ed char arrays o
0530: 72 20 74 6f 20 61 72 62 69 74 72 61 72 79 20 64  r to arbitrary d
0540: 65 73 74 69 6e 61 74 69 6f 6e 73 20 76 69 61 20  estinations via 
0550: 63 61 6c 6c 62 61 63 6b 20 66 75 6e 63 74 69 6f  callback functio
0560: 6e 73 2e 20 28 49 6e 70 75 74 73 20 6d 75 73 74  ns. (Inputs must
0570: 20 63 6f 6d 65 20 66 72 6f 6d 20 61 72 72 61 79   come from array
0580: 73 2e 29 0d 0a 20 20 20 2a 20 20 49 6e 70 75 74  s.)..   *  Input
0590: 20 6d 75 73 74 20 63 6f 6d 65 20 66 72 6f 6d 20   must come from 
05a0: 6d 65 6d 6f 72 79 20 2d 20 69 74 20 63 61 6e 6e  memory - it cann
05b0: 6f 74 20 62 65 20 73 74 72 65 61 6d 65 64 20 69  ot be streamed i
05c0: 6e 20 63 68 75 6e 6b 73 2e 20 54 68 69 73 20 63  n chunks. This c
05d0: 6f 73 74 73 20 6d 65 6d 6f 72 79 20 62 75 74 20  osts memory but 
05e0: 70 72 6f 76 69 64 65 73 20 62 65 74 74 65 72 20  provides better 
05f0: 63 6f 6d 70 72 65 73 73 69 6f 6e 20 74 68 61 6e  compression than
0600: 20 73 74 72 65 61 6d 69 6e 67 20 64 65 6c 74 61   streaming delta
0610: 20 67 65 6e 65 72 61 74 6f 72 73 20 66 6f 72 20   generators for 
0620: 73 6f 6d 65 20 63 61 73 65 73 2e 0d 0a 20 20 20  some cases...   
0630: 2a 20 20 4c 69 6d 69 74 65 64 20 74 6f 20 3c 65  *  Limited to <e
0640: 6d 3e 73 69 67 6e 65 64 3c 2f 65 6d 3e 20 33 32  m>signed</em> 32
0650: 2d 62 69 74 20 72 61 6e 67 65 73 20 28 32 47 42  -bit ranges (2GB
0660: 29 20 6f 6e 20 69 6e 70 75 74 73 20 61 6e 64 20  ) on inputs and 
0670: 6f 75 74 70 75 74 73 20 22 66 6f 72 20 68 69 73  outputs "for his
0680: 74 6f 72 69 63 61 6c 20 72 65 61 73 6f 6e 73 22  torical reasons"
0690: 20 28 61 6e 64 20 62 65 63 61 75 73 65 20 74 68   (and because th
06a0: 65 72 65 27 73 20 6e 6f 20 63 6f 6d 70 65 6c 6c  ere's no compell
06b0: 69 6e 67 20 72 65 61 73 6f 6e 20 74 6f 20 63 68  ing reason to ch
06c0: 61 6e 67 65 20 69 74 29 2e 0d 0a 0a 5a 20 32 39  ange it)....Z 29
06d0: 63 30 61 31 38 35 35 65 37 37 32 38 38 30 62 34  c0a1855e772880b4
06e0: 30 32 31 36 62 32 34 35 32 63 31 35 38 39 0a     0216b2452c1589.