1 | /* |
1 | /* |
2 | * Copyright (c) 2000-2003 Marc Alexander Lehmann <pcg@goof.com> |
2 | * Copyright (c) 2000-2005 Marc Alexander Lehmann <schmorp@schmorp.de> |
3 | * |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without modifica- |
4 | * Redistribution and use in source and binary forms, with or without modifica- |
5 | * tion, are permitted provided that the following conditions are met: |
5 | * tion, are permitted provided that the following conditions are met: |
6 | * |
6 | * |
7 | * 1. Redistributions of source code must retain the above copyright notice, |
7 | * 1. Redistributions of source code must retain the above copyright notice, |
… | |
… | |
54 | * of out_len bytes. |
54 | * of out_len bytes. |
55 | * |
55 | * |
56 | * If the output buffer is not large enough or any error occurs |
56 | * If the output buffer is not large enough or any error occurs |
57 | * return 0, otherwise return the number of bytes used (which might |
57 | * return 0, otherwise return the number of bytes used (which might |
58 | * be considerably larger than in_len, so it makes sense to always |
58 | * be considerably larger than in_len, so it makes sense to always |
59 | * use out_len == in_len). |
59 | * use out_len == in_len - 1), to ensure _some_ compression, and store |
|
|
60 | * the data uncompressed otherwise. |
60 | * |
61 | * |
61 | * lzf_compress might use different algorithms on different systems and |
62 | * lzf_compress might use different algorithms on different systems and |
62 | * thus might result in different compressed strings depending on the |
63 | * thus might result in different compressed strings depending on the |
63 | * phase of the moon or similar factors. However, all these strings are |
64 | * phase of the moon or similar factors. However, all these strings are |
64 | * architecture-independent and will result in the original data when |
65 | * architecture-independent and will result in the original data when |