xlsxwriter 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +40 -0
- data/ext/xlsxwriter/chart.c +105 -0
- data/ext/xlsxwriter/chart.h +27 -0
- data/ext/xlsxwriter/extconf.rb +14 -0
- data/ext/xlsxwriter/format.c +67 -0
- data/ext/xlsxwriter/format.h +9 -0
- data/ext/xlsxwriter/libxlsxwriter/LICENSE.txt +89 -0
- data/ext/xlsxwriter/libxlsxwriter/Makefile +141 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter.h +23 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/app.h +79 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/chart.h +1093 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/common.h +336 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/content_types.h +74 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/core.h +51 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/custom.h +52 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/drawing.h +111 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/format.h +1214 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/hash_table.h +76 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/packager.h +80 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/relationships.h +77 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/shared_strings.h +83 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/styles.h +77 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/theme.h +47 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/third_party/ioapi.h +215 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/third_party/queue.h +694 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/third_party/tmpfileplus.h +53 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/third_party/tree.h +801 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/third_party/zip.h +375 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/utility.h +166 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/workbook.h +751 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/worksheet.h +2641 -0
- data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/xmlwriter.h +178 -0
- data/ext/xlsxwriter/libxlsxwriter/lib/.gitignore +0 -0
- data/ext/xlsxwriter/libxlsxwriter/src/Makefile +125 -0
- data/ext/xlsxwriter/libxlsxwriter/src/app.c +439 -0
- data/ext/xlsxwriter/libxlsxwriter/src/chart.c +3420 -0
- data/ext/xlsxwriter/libxlsxwriter/src/content_types.c +341 -0
- data/ext/xlsxwriter/libxlsxwriter/src/core.c +293 -0
- data/ext/xlsxwriter/libxlsxwriter/src/custom.c +224 -0
- data/ext/xlsxwriter/libxlsxwriter/src/drawing.c +746 -0
- data/ext/xlsxwriter/libxlsxwriter/src/format.c +728 -0
- data/ext/xlsxwriter/libxlsxwriter/src/hash_table.c +223 -0
- data/ext/xlsxwriter/libxlsxwriter/src/packager.c +877 -0
- data/ext/xlsxwriter/libxlsxwriter/src/relationships.c +242 -0
- data/ext/xlsxwriter/libxlsxwriter/src/shared_strings.c +264 -0
- data/ext/xlsxwriter/libxlsxwriter/src/styles.c +1086 -0
- data/ext/xlsxwriter/libxlsxwriter/src/theme.c +348 -0
- data/ext/xlsxwriter/libxlsxwriter/src/utility.c +512 -0
- data/ext/xlsxwriter/libxlsxwriter/src/workbook.c +1895 -0
- data/ext/xlsxwriter/libxlsxwriter/src/worksheet.c +4992 -0
- data/ext/xlsxwriter/libxlsxwriter/src/xmlwriter.c +355 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/Makefile +44 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/crypt.h +131 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/ioapi.c +247 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/ioapi.h +209 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/iowin32.c +456 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/iowin32.h +28 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/miniunz.c +660 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/minizip.c +520 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/mztools.c +291 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/mztools.h +37 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/unzip.c +2125 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/unzip.h +437 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/zip.c +2007 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/minizip/zip.h +367 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/tmpfileplus/Makefile +42 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c +342 -0
- data/ext/xlsxwriter/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.h +53 -0
- data/ext/xlsxwriter/workbook.c +257 -0
- data/ext/xlsxwriter/workbook.h +42 -0
- data/ext/xlsxwriter/workbook_properties.c +103 -0
- data/ext/xlsxwriter/workbook_properties.h +10 -0
- data/ext/xlsxwriter/worksheet.c +1064 -0
- data/ext/xlsxwriter/worksheet.h +74 -0
- data/ext/xlsxwriter/xlsxwriter.c +239 -0
- data/lib/xlsxwriter.rb +6 -0
- data/lib/xlsxwriter/version.rb +3 -0
- data/lib/xlsxwriter/worksheet.rb +72 -0
- data/test/run-test.rb +11 -0
- data/test/support/xlsx_comparable.rb +109 -0
- data/test/test-array-formula.rb +33 -0
- data/test/test-autofilter.rb +70 -0
- data/test/test-chart-area.rb +25 -0
- data/test/test-data.rb +65 -0
- data/test/test-default-row.rb +25 -0
- data/test/test-defined-name.rb +46 -0
- data/test/test-escapes.rb +33 -0
- data/test/test-fit-to-pages.rb +21 -0
- data/test/test-formatting.rb +137 -0
- data/test/test-gridlines.rb +15 -0
- data/test/test-hyperlink.rb +67 -0
- data/test/test-image.rb +84 -0
- data/test/test-merge-range.rb +18 -0
- data/test/test-misc.rb +29 -0
- data/test/test-optimize.rb +32 -0
- data/test/test-page-breaks.rb +13 -0
- data/test/test-page-setup.rb +28 -0
- data/test/test-panes.rb +45 -0
- data/test/test-print-area.rb +19 -0
- data/test/test-print-options.rb +61 -0
- data/test/test-print-scale.rb +12 -0
- data/test/test-properties.rb +51 -0
- data/test/test-protect.rb +27 -0
- data/test/test-repeat.rb +23 -0
- data/test/test-row-col-format.rb +35 -0
- data/test/test-set-selection.rb +13 -0
- data/test/test-set-start-page.rb +13 -0
- data/test/test-simple.rb +62 -0
- data/test/test-types.rb +17 -0
- data/test/xlsx-func-testcase.rb +36 -0
- metadata +228 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9d204426791a93175f4a17f4e81369067b14de83
|
4
|
+
data.tar.gz: 4ce86fadb8ad88e46578dddda1e216e4fb9a5be5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 68ea67e8de2d0b9ebced09bff5fde5e7eedb5a1e278190e826a106bf21e2ba0193a5edf37a5254703e6b63f339e11ea508feac4c90498ae4230ab57ca9a3c557
|
7
|
+
data.tar.gz: 7a6f557d3683cc02f9e3a20b3426aba916a2700fd8508b2a64ab0b0e20210cebabbecb1c98d897f450905a1cd548ee17fd441f5ef0878712625a0aac1a48d629
|
data/Rakefile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'rake/extensiontask'
|
2
|
+
|
3
|
+
task default: :test
|
4
|
+
|
5
|
+
spec = Gem::Specification.load('xlsxwriter.gemspec')
|
6
|
+
Rake::ExtensionTask.new('xlsxwriter', spec) do |ext|
|
7
|
+
ext.lib_dir = 'lib/xlsxwriter'
|
8
|
+
end
|
9
|
+
task compile: :fetch_dep
|
10
|
+
|
11
|
+
Gem::PackageTask.new(spec) do |pkg|
|
12
|
+
end
|
13
|
+
|
14
|
+
DEP_DIR='ext/xlsxwriter/libxlsxwriter'
|
15
|
+
|
16
|
+
desc "Checkout xlsxwriter C library"
|
17
|
+
task :fetch_dep do
|
18
|
+
rev = File.read('.dep_revision').chomp if File.exist?('.dep_revision')
|
19
|
+
|
20
|
+
unless File.exist?('./ext/xlsxwriter/libxlsxwriter')
|
21
|
+
`git clone https://github.com/jmcnamara/libxlsxwriter.git #{DEP_DIR}`
|
22
|
+
else
|
23
|
+
`cd #{DEP_DIR} && git fetch`
|
24
|
+
end
|
25
|
+
|
26
|
+
if rev
|
27
|
+
`cd #{DEP_DIR} && git reset --hard #{rev}`
|
28
|
+
else
|
29
|
+
`(cd #{DEP_DIR} && git rev-parse HEAD) > .dep_revision`
|
30
|
+
end
|
31
|
+
|
32
|
+
Dir['./dep_patches/*.patch'].each do |patch|
|
33
|
+
`(cd #{DEP_DIR} && patch -p1) <#{patch}`
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
desc 'Run specs'
|
38
|
+
task test: :compile do
|
39
|
+
ruby('test/run-test.rb')
|
40
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
#include "chart.h"
|
2
|
+
#include "workbook.h"
|
3
|
+
|
4
|
+
VALUE
|
5
|
+
chart_alloc(VALUE klass) {
|
6
|
+
VALUE obj;
|
7
|
+
struct chart *ptr;
|
8
|
+
|
9
|
+
obj = Data_Make_Struct(klass, struct chart, NULL, NULL, ptr);
|
10
|
+
|
11
|
+
ptr->chart = NULL;
|
12
|
+
|
13
|
+
return obj;
|
14
|
+
}
|
15
|
+
|
16
|
+
VALUE
|
17
|
+
chart_init(VALUE self, VALUE workbook, VALUE type) {
|
18
|
+
struct chart *ptr;
|
19
|
+
struct workbook *wb_ptr;
|
20
|
+
|
21
|
+
Data_Get_Struct(workbook, struct workbook, wb_ptr);
|
22
|
+
Data_Get_Struct(self, struct chart, ptr);
|
23
|
+
if (wb_ptr && wb_ptr->workbook) {
|
24
|
+
ptr->chart = workbook_add_chart(wb_ptr->workbook, NUM2INT(type));
|
25
|
+
}
|
26
|
+
|
27
|
+
rb_iv_set(self, "@workbook", workbook);
|
28
|
+
|
29
|
+
return self;
|
30
|
+
}
|
31
|
+
|
32
|
+
VALUE
|
33
|
+
chart_series_alloc(VALUE klass) {
|
34
|
+
VALUE obj;
|
35
|
+
struct chart_series *ptr;
|
36
|
+
|
37
|
+
obj = Data_Make_Struct(klass, struct chart_series, NULL, NULL, ptr);
|
38
|
+
|
39
|
+
ptr->series = NULL;
|
40
|
+
|
41
|
+
return obj;
|
42
|
+
}
|
43
|
+
|
44
|
+
VALUE
|
45
|
+
chart_series_init(int argc, VALUE *argv, VALUE self) {
|
46
|
+
struct chart_series *ptr;
|
47
|
+
struct chart *c_ptr;
|
48
|
+
char *cats = NULL, *vals = NULL;
|
49
|
+
rb_check_arity(argc, 2, 3);
|
50
|
+
|
51
|
+
Data_Get_Struct(argv[0], struct chart, c_ptr);
|
52
|
+
Data_Get_Struct(self, struct chart_series, ptr);
|
53
|
+
|
54
|
+
if (argc > 2) {
|
55
|
+
cats = StringValueCStr(argv[1]);
|
56
|
+
vals = StringValueCStr(argv[2]);
|
57
|
+
} else {
|
58
|
+
vals = StringValueCStr(argv[1]);
|
59
|
+
}
|
60
|
+
if (c_ptr && c_ptr->chart) {
|
61
|
+
ptr->series = chart_add_series(c_ptr->chart, cats, vals);
|
62
|
+
}
|
63
|
+
|
64
|
+
return self;
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
VALUE
|
69
|
+
chart_add_series_(int argc, VALUE *argv, VALUE self) {
|
70
|
+
rb_check_arity(argc, 1, 2);
|
71
|
+
|
72
|
+
VALUE series = rb_funcall(cChartSeries, rb_intern("new"), argc+1, self, argv[0], argv[1]);
|
73
|
+
return series;
|
74
|
+
}
|
75
|
+
|
76
|
+
|
77
|
+
VALUE
|
78
|
+
chart_get_axis_id_1_(VALUE self) {
|
79
|
+
struct chart *ptr;
|
80
|
+
Data_Get_Struct(self, struct chart, ptr);
|
81
|
+
return UINT2NUM(ptr->chart->axis_id_1);
|
82
|
+
}
|
83
|
+
|
84
|
+
VALUE
|
85
|
+
chart_set_axis_id_1_(VALUE self, VALUE val) {
|
86
|
+
struct chart *ptr;
|
87
|
+
Data_Get_Struct(self, struct chart, ptr);
|
88
|
+
ptr->chart->axis_id_1 = NUM2UINT(val);
|
89
|
+
return val;
|
90
|
+
}
|
91
|
+
|
92
|
+
VALUE
|
93
|
+
chart_get_axis_id_2_(VALUE self) {
|
94
|
+
struct chart *ptr;
|
95
|
+
Data_Get_Struct(self, struct chart, ptr);
|
96
|
+
return UINT2NUM(ptr->chart->axis_id_2);
|
97
|
+
}
|
98
|
+
|
99
|
+
VALUE
|
100
|
+
chart_set_axis_id_2_(VALUE self, VALUE val) {
|
101
|
+
struct chart *ptr;
|
102
|
+
Data_Get_Struct(self, struct chart, ptr);
|
103
|
+
ptr->chart->axis_id_2 = NUM2UINT(val);
|
104
|
+
return val;
|
105
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#include <ruby.h>
|
2
|
+
#include "xlsxwriter.h"
|
3
|
+
|
4
|
+
#ifndef __CHART__
|
5
|
+
#define __CHART__
|
6
|
+
|
7
|
+
struct chart {
|
8
|
+
lxw_chart *chart;
|
9
|
+
};
|
10
|
+
|
11
|
+
struct chart_series {
|
12
|
+
lxw_chart_series *series;
|
13
|
+
};
|
14
|
+
|
15
|
+
VALUE chart_alloc(VALUE klass);
|
16
|
+
VALUE chart_init(VALUE self, VALUE worksheet, VALUE type);
|
17
|
+
VALUE chart_series_alloc(VALUE klass);
|
18
|
+
VALUE chart_series_init(int argc, VALUE *argv, VALUE self);
|
19
|
+
|
20
|
+
VALUE chart_add_series_(int argc, VALUE *argv, VALUE self);
|
21
|
+
|
22
|
+
VALUE chart_get_axis_id_1_(VALUE self);
|
23
|
+
VALUE chart_set_axis_id_1_(VALUE self, VALUE val);
|
24
|
+
VALUE chart_get_axis_id_2_(VALUE self);
|
25
|
+
VALUE chart_set_axis_id_2_(VALUE self, VALUE val);
|
26
|
+
|
27
|
+
#endif // __CHART__
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
|
3
|
+
libxlsxwriter_dir = File.expand_path('../libxlsxwriter', __FILE__)
|
4
|
+
make_pid = spawn({'CFLAGS' => '-fPIC'}, $make, chdir: libxlsxwriter_dir)
|
5
|
+
Process.wait(make_pid)
|
6
|
+
raise 'Make failed for xlsxwriter' unless $? == 0
|
7
|
+
|
8
|
+
# enable_config('static', true)
|
9
|
+
# find_library('xlsxwriter', 'workbook_new', File.expand_path('../libxlsxwriter/lib', __FILE__))
|
10
|
+
$CFLAGS="-I'#{libxlsxwriter_dir}/include' -g -Wall -std=c99"
|
11
|
+
# $LDFLAGS="-L./libxlsxwriter/lib/ -Wl,-Bstatic -lxlsxwriter -Wl,-Bdynamic"
|
12
|
+
$LDFLAGS="-lz #{libxlsxwriter_dir}/lib/libxlsxwriter.a"
|
13
|
+
|
14
|
+
create_makefile 'xlsxwriter/xlsxwriter'
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#include "format.h"
|
2
|
+
|
3
|
+
#define STR2SYM(x) ID2SYM(rb_intern(x))
|
4
|
+
|
5
|
+
#define MAP_FORMAT(fmt_name, ...) { \
|
6
|
+
value = rb_hash_aref(opts, STR2SYM(#fmt_name)); \
|
7
|
+
if (!NIL_P(value)) \
|
8
|
+
format_set_##fmt_name(format, __VA_ARGS__); \
|
9
|
+
}
|
10
|
+
|
11
|
+
#define MAP_FORMATB(fmt_name) { \
|
12
|
+
value = rb_hash_aref(opts, STR2SYM(#fmt_name)); \
|
13
|
+
if (!NIL_P(value) && value) \
|
14
|
+
format_set_##fmt_name(format); \
|
15
|
+
}
|
16
|
+
|
17
|
+
void format_apply_opts(lxw_format *format, VALUE opts) {
|
18
|
+
VALUE value;
|
19
|
+
|
20
|
+
MAP_FORMAT(font_name, StringValueCStr(value));
|
21
|
+
MAP_FORMAT(font_size, NUM2INT(value))
|
22
|
+
MAP_FORMAT(font_color, NUM2LONG(value));
|
23
|
+
MAP_FORMATB(bold);
|
24
|
+
MAP_FORMATB(italic);
|
25
|
+
MAP_FORMAT(underline, NUM2LONG(value));
|
26
|
+
MAP_FORMATB(font_strikeout);
|
27
|
+
MAP_FORMAT(font_script, NUM2INT(value));
|
28
|
+
MAP_FORMAT(num_format, StringValueCStr(value));
|
29
|
+
MAP_FORMAT(num_format_index, NUM2INT(value));
|
30
|
+
MAP_FORMATB(unlocked);
|
31
|
+
MAP_FORMATB(hidden);
|
32
|
+
MAP_FORMAT(align, NUM2INT(value));
|
33
|
+
|
34
|
+
value = rb_hash_aref(opts, STR2SYM("vertical_align"));
|
35
|
+
if (value != Qnil)
|
36
|
+
format_set_align(format, NUM2INT(value));
|
37
|
+
|
38
|
+
MAP_FORMATB(text_wrap);
|
39
|
+
MAP_FORMAT(rotation, NUM2INT(value));
|
40
|
+
MAP_FORMAT(indent, NUM2INT(value));
|
41
|
+
MAP_FORMATB(shrink);
|
42
|
+
MAP_FORMAT(pattern, NUM2INT(value));
|
43
|
+
MAP_FORMAT(bg_color, NUM2LONG(value));
|
44
|
+
MAP_FORMAT(fg_color, NUM2LONG(value));
|
45
|
+
MAP_FORMAT(border, NUM2INT(value));
|
46
|
+
MAP_FORMAT(bottom, NUM2INT(value));
|
47
|
+
MAP_FORMAT(top, NUM2INT(value));
|
48
|
+
MAP_FORMAT(left, NUM2INT(value));
|
49
|
+
MAP_FORMAT(right, NUM2INT(value));
|
50
|
+
MAP_FORMAT(border_color, NUM2LONG(value));
|
51
|
+
MAP_FORMAT(bottom_color, NUM2LONG(value));
|
52
|
+
MAP_FORMAT(top_color, NUM2LONG(value));
|
53
|
+
MAP_FORMAT(left_color, NUM2LONG(value));
|
54
|
+
MAP_FORMAT(right_color, NUM2LONG(value));
|
55
|
+
MAP_FORMAT(diag_type, NUM2INT(value));
|
56
|
+
MAP_FORMAT(diag_color, NUM2LONG(value));
|
57
|
+
MAP_FORMAT(diag_border, NUM2INT(value));
|
58
|
+
MAP_FORMATB(font_outline);
|
59
|
+
MAP_FORMATB(font_shadow);
|
60
|
+
MAP_FORMAT(font_family, NUM2INT(value));
|
61
|
+
MAP_FORMAT(font_charset, NUM2INT(value));
|
62
|
+
MAP_FORMAT(font_scheme, StringValueCStr(value));
|
63
|
+
MAP_FORMATB(font_condense);
|
64
|
+
MAP_FORMATB(font_extend);
|
65
|
+
MAP_FORMAT(reading_order, NUM2INT(value));
|
66
|
+
MAP_FORMAT(theme, NUM2INT(value));
|
67
|
+
}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
|
2
|
+
Libxlsxwriter is released under a FreeBSD license:
|
3
|
+
|
4
|
+
Copyright 2014-2017, John McNamara <jmcnamara@cpan.org>
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without
|
8
|
+
modification, are permitted provided that the following conditions are
|
9
|
+
met:
|
10
|
+
|
11
|
+
1. Redistributions of source code must retain the above copyright notice,
|
12
|
+
this list of conditions and the following disclaimer.
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright
|
14
|
+
notice, this list of conditions and the following disclaimer in the
|
15
|
+
documentation and/or other materials provided with the distribution.
|
16
|
+
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
18
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
19
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
20
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
21
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
22
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
23
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
24
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
25
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
26
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
29
|
+
The views and conclusions contained in the software and documentation are
|
30
|
+
those of the authors and should not be interpreted as representing
|
31
|
+
official policies, either expressed or implied, of the FreeBSD Project.
|
32
|
+
|
33
|
+
|
34
|
+
Libxlsxwriter includes `queue.h` from FreeBSD and the `minizip` component of
|
35
|
+
`zlib` which have the following licenses:
|
36
|
+
|
37
|
+
|
38
|
+
Queue.h from FreeBSD:
|
39
|
+
|
40
|
+
Copyright (c) 1991, 1993
|
41
|
+
The Regents of the University of California. All rights reserved.
|
42
|
+
|
43
|
+
Redistribution and use in source and binary forms, with or without
|
44
|
+
modification, are permitted provided that the following conditions
|
45
|
+
are met:
|
46
|
+
1. Redistributions of source code must retain the above copyright
|
47
|
+
notice, this list of conditions and the following disclaimer.
|
48
|
+
2. Redistributions in binary form must reproduce the above copyright
|
49
|
+
notice, this list of conditions and the following disclaimer in the
|
50
|
+
documentation and/or other materials provided with the distribution.
|
51
|
+
4. Neither the name of the University nor the names of its contributors
|
52
|
+
may be used to endorse or promote products derived from this software
|
53
|
+
without specific prior written permission.
|
54
|
+
|
55
|
+
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
56
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
57
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
58
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
59
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
60
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
61
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
62
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
63
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
64
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
65
|
+
SUCH DAMAGE.
|
66
|
+
|
67
|
+
|
68
|
+
Zlib has the following License/Copyright:
|
69
|
+
|
70
|
+
(C) 1995-2013 Jean-loup Gailly and Mark Adler
|
71
|
+
|
72
|
+
This software is provided 'as-is', without any express or implied
|
73
|
+
warranty. In no event will the authors be held liable for any damages
|
74
|
+
arising from the use of this software.
|
75
|
+
|
76
|
+
Permission is granted to anyone to use this software for any purpose,
|
77
|
+
including commercial applications, and to alter it and redistribute it
|
78
|
+
freely, subject to the following restrictions:
|
79
|
+
|
80
|
+
1. The origin of this software must not be misrepresented; you must not
|
81
|
+
claim that you wrote the original software. If you use this software
|
82
|
+
in a product, an acknowledgment in the product documentation would be
|
83
|
+
appreciated but is not required.
|
84
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
85
|
+
misrepresented as being the original software.
|
86
|
+
3. This notice may not be removed or altered from any source distribution.
|
87
|
+
|
88
|
+
Jean-loup Gailly Mark Adler
|
89
|
+
jloup@gzip.org madler@alumni.caltech.edu
|
@@ -0,0 +1,141 @@
|
|
1
|
+
###############################################################################
|
2
|
+
#
|
3
|
+
# Makefile for libxlsxwriter library.
|
4
|
+
#
|
5
|
+
# Copyright 2014-2017, John McNamara, jmcnamara@cpan.org
|
6
|
+
#
|
7
|
+
|
8
|
+
# Keep the output quiet by default.
|
9
|
+
Q=@
|
10
|
+
ifdef V
|
11
|
+
Q=
|
12
|
+
endif
|
13
|
+
|
14
|
+
.PHONY: docs tags examples
|
15
|
+
|
16
|
+
# Build the libs.
|
17
|
+
all :
|
18
|
+
$(Q)$(MAKE) -C third_party/minizip
|
19
|
+
ifndef USE_STANDARD_TMPFILE
|
20
|
+
$(Q)$(MAKE) -C third_party/tmpfileplus
|
21
|
+
endif
|
22
|
+
$(Q)$(MAKE) -C src
|
23
|
+
|
24
|
+
# Build the example programs.
|
25
|
+
examples :
|
26
|
+
$(Q)$(MAKE) -C examples
|
27
|
+
|
28
|
+
# Clean src and test directories.
|
29
|
+
clean :
|
30
|
+
$(Q)$(MAKE) clean -C src
|
31
|
+
$(Q)$(MAKE) clean -C test/unit
|
32
|
+
$(Q)$(MAKE) clean -C test/functional/src
|
33
|
+
$(Q)$(MAKE) clean -C examples
|
34
|
+
$(Q)$(MAKE) clean -C third_party/minizip
|
35
|
+
$(Q)rm -rf docs/html
|
36
|
+
$(Q)rm -rf test/functional/__pycache__
|
37
|
+
$(Q)rm -f test/functional/*.pyc
|
38
|
+
$(Q)rm -f lib/*
|
39
|
+
ifndef USE_STANDARD_TMPFILE
|
40
|
+
$(Q)$(MAKE) clean -C third_party/tmpfileplus
|
41
|
+
endif
|
42
|
+
|
43
|
+
# Run the unit tests.
|
44
|
+
test : all test_functional test_unit
|
45
|
+
|
46
|
+
# Run the functional tests.
|
47
|
+
test_functional : all
|
48
|
+
$(Q)$(MAKE) -C test/functional/src
|
49
|
+
$(Q)py.test test/functional -v
|
50
|
+
|
51
|
+
# Run all tests.
|
52
|
+
test_unit :
|
53
|
+
@echo "Compiling unit tests ..."
|
54
|
+
$(Q)$(MAKE) -C third_party/minizip
|
55
|
+
ifndef USE_STANDARD_TMPFILE
|
56
|
+
$(Q)$(MAKE) -C third_party/tmpfileplus
|
57
|
+
endif
|
58
|
+
$(Q)$(MAKE) -C src test_lib
|
59
|
+
$(Q)$(MAKE) -C test/unit test
|
60
|
+
|
61
|
+
# Test the functional test exes with valgrind (in 64bit mode only).
|
62
|
+
test_valgrind : all
|
63
|
+
ifndef NO_VALGRIND
|
64
|
+
$(Q)$(MAKE) -C test/functional/src test_valgrind
|
65
|
+
$(Q)$(MAKE) -C examples test_valgrind
|
66
|
+
endif
|
67
|
+
|
68
|
+
# Minimal target for quick compile without creating the libs.
|
69
|
+
test_compile :
|
70
|
+
$(Q)$(MAKE) -C src test_compile
|
71
|
+
|
72
|
+
# Indent the source files with the .indent.pro settings.
|
73
|
+
indent:
|
74
|
+
$(Q)gindent src/*.c include/*.h include/xlsxwriter/*.h
|
75
|
+
|
76
|
+
tags:
|
77
|
+
$(Q)rm -f TAGS
|
78
|
+
$(Q)etags src/*.c include/*.h include/xlsxwriter/*.h
|
79
|
+
|
80
|
+
# Build the doxygen docs.
|
81
|
+
doc: docs
|
82
|
+
docs:
|
83
|
+
$(Q)$(MAKE) -C docs
|
84
|
+
|
85
|
+
# Simple minded install.
|
86
|
+
install:
|
87
|
+
$(Q)cp -r include/* /usr/include
|
88
|
+
$(Q)cp lib/* /usr/lib
|
89
|
+
|
90
|
+
# Simpler minded uninstall.
|
91
|
+
uninstall:
|
92
|
+
$(Q)rm -rf /usr/include/xlsxwriter*
|
93
|
+
$(Q)rm /usr/lib/libxlsxwriter.*
|
94
|
+
|
95
|
+
# Strip the lib files.
|
96
|
+
strip:
|
97
|
+
$(Q)strip lib/*
|
98
|
+
|
99
|
+
# Run a coverity static analysis.
|
100
|
+
coverity:
|
101
|
+
$(Q)$(MAKE) -C third_party/minizip
|
102
|
+
$(Q)$(MAKE) -C src clean
|
103
|
+
$(Q)rm -f lib/*
|
104
|
+
$(Q)rm -rf cov-int
|
105
|
+
$(Q)rm -f libxlsxwriter-coverity.tgz
|
106
|
+
$(Q)../cov-analysis-macosx-7.7.0.4/bin/cov-build --dir cov-int make -C src libxlsxwriter.a
|
107
|
+
$(Q)tar -czf libxlsxwriter-coverity.tgz cov-int
|
108
|
+
$(Q)$(MAKE) -C src clean
|
109
|
+
$(Q)rm -f lib/*
|
110
|
+
|
111
|
+
spellcheck:
|
112
|
+
$(Q)for f in docs/src/*.dox; do aspell --lang=en_US --check $$f; done
|
113
|
+
$(Q)for f in include/xlsxwriter/*.h; do aspell --lang=en_US --check $$f; done
|
114
|
+
$(Q)for f in src/*.c; do aspell --lang=en_US --check $$f; done
|
115
|
+
$(Q)for f in examples/*.c; do aspell --lang=en_US --check $$f; done
|
116
|
+
$(Q)aspell --lang=en_US --check Changes.txt
|
117
|
+
$(Q)aspell --lang=en_US --check Readme.md
|
118
|
+
|
119
|
+
releasecheck:
|
120
|
+
$(Q)dev/release/release_check.sh
|
121
|
+
|
122
|
+
release: releasecheck
|
123
|
+
@echo
|
124
|
+
@echo "Pushing to git master ..."
|
125
|
+
$(Q)git push origin master
|
126
|
+
$(Q)git push --tags
|
127
|
+
|
128
|
+
@echo
|
129
|
+
@echo "Pushing updated docs ..."
|
130
|
+
$(Q)make -C ../libxlsxwriter.github.io release
|
131
|
+
|
132
|
+
@echo
|
133
|
+
@echo "Pushing the cocoapod ..."
|
134
|
+
$(Q)pod trunk push libxlsxwriter.podspec --use-libraries
|
135
|
+
|
136
|
+
@echo
|
137
|
+
@echo "Finished. Opening files."
|
138
|
+
$(Q)open http://libxlsxwriter.github.io/changes.html
|
139
|
+
$(Q)open http://cocoadocs.org/docsets/libxlsxwriter
|
140
|
+
$(Q)open https://github.com/jmcnamara/libxlsxwriter
|
141
|
+
$(Q)open https://github.com/jmcnamara/libxlsxwriter/releases
|