annotate src/of-strings-1-fixes.patch @ 3902:cc946e55afb3

of-strings: add to mxe * src/of-strings.mk: new file * src/of-strings-1-fixes.patch: new file * index.html: add strings * Makefile.in: add strings to forge packages * dist-files.mk: add src/of-strings.mk src/of-strings-1-fixes.patch
author John Donoghue
date Mon, 13 Apr 2015 13:52:59 -0400
parents
children 76247f439f51
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3902
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
1 diff -urN strings.orig/inst/strjoin.m strings/inst/strjoin.m
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
2 --- strings.orig/inst/strjoin.m 2015-04-13 21:40:26.000000000 -0400
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
3 +++ strings/inst/strjoin.m 1969-12-31 19:00:00.000000000 -0500
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
4 @@ -1,54 +0,0 @@
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
5 -## Copyright (C) 2007 Muthiah Annamalai <muthiah.annamalai@uta.edu>
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
6 -##
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
7 -## This program is free software; you can redistribute it and/or modify it under
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
8 -## the terms of the GNU General Public License as published by the Free Software
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
9 -## Foundation; either version 3 of the License, or (at your option) any later
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
10 -## version.
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
11 -##
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
12 -## This program is distributed in the hope that it will be useful, but WITHOUT
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
13 -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
14 -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
15 -## details.
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
16 -##
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
17 -## You should have received a copy of the GNU General Public License along with
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
18 -## this program; if not, see <http://www.gnu.org/licenses/>.
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
19 -
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
20 -## -*- texinfo -*-
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
21 -## @deftypefn {Function File} {@var{rval} =} strjoin (@var{prefixstr}, @var{stringcell})
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
22 -## @deftypefnx {Function File} {@var{rval} =} strjoin (@var{prefixstr}, @var{varargs})
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
23 -## Joins the strings in @var{stringcell} with the @var{prefixstr} like the list-join
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
24 -## function in Python; the second version allows usage with variable number of arguments.
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
25 -## Note that, if using cell-array as a second argument, only 2 arguments are accepted.
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
26 -## Also note that, both the arguments are strings or containers of strings (cells).
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
27 -##
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
28 -## @example
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
29 -## @group
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
30 -## strjoin(' loves-> ','marie','amy','beth')
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
31 -## ##returns 'marie loves-> amy loves-> beth'
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
32 -##
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
33 -## strjoin('*',@{'Octave','Scilab','Lush','Yorick'@})
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
34 -## ##returns 'Octave*Scilab*Lush*Yorick'
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
35 -## @end group
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
36 -## @end example
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
37 -## @seealso {strcmp}
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
38 -## @end deftypefn
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
39 -
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
40 -function rval = strjoin (spacer, varargin)
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
41 - if (nargin < 2) || (nargin > 2 && iscell(varargin{1}) )
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
42 - print_usage();
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
43 - end
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
44 -
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
45 - if iscell(varargin{1})
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
46 - varargin=varargin{1};
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
47 - end
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
48 -
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
49 - rval="";
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
50 - L=length(varargin);
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
51 - for idx=1:(L-1)
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
52 - rval=strcat(rval,sprintf('%s%s',varargin{idx},spacer));
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
53 - end
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
54 - rval=strcat(rval,varargin{L});
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
55 -endfunction
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
56 -
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
57 -%!assert(strjoin("-","hello"),"hello")
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
58 -%!assert(strjoin('*',{'Octave','Scilab','Lush','Yorick'}),'Octave*Scilab*Lush*Yorick')
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
59 diff -urN strings.orig/src/Makefile strings/src/Makefile
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
60 --- strings.orig/src/Makefile 2015-04-13 21:40:26.000000000 -0400
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
61 +++ strings/src/Makefile 2015-04-13 21:40:48.000000000 -0400
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
62 @@ -1,9 +1,10 @@
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
63 MKOCTFILE = mkoctfile -Wall
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
64 +PCRE_LIBS := $(shell pcre-config --libs)
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
65
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
66 all: pcregexp.oct
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
67
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
68 %.oct: %.cc
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
69 - $(MKOCTFILE) $<
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
70 + $(MKOCTFILE) $< $(PCRE_LIBS)
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
71
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
72 clean:
cc946e55afb3 of-strings: add to mxe
John Donoghue
parents:
diff changeset
73 rm -f *.o octave-core core *.oct *~