Skip to content
This repository was archived by the owner on Jun 13, 2018. It is now read-only.

Commit 564cda4

Browse files
author
karoto
committed
VC++6.0でコンパイルする環境整え
BMatchEx追加 git-svn-id: https://svn.code.sf.net/p/sakura-editor/code/Bregexp/trunk@6 f7ce1907-e4c7-47ca-9f76-12c87ed2c91c
1 parent 67f198e commit 564cda4

7 files changed

+537
-10
lines changed

BREGEXP.dsp

+150
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BREGEXP.dsw

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Microsoft Developer Studio Workspace File, Format Version 6.00
2+
# �x��: ����ܰ���߰� ̧�� ��ҏW�܂��͍폜���Ȃ��ł�������!
3+
4+
###############################################################################
5+
6+
Project: "BREGEXP"=".\BREGEXP.dsp" - Package Owner=<4>
7+
8+
Package=<5>
9+
{{{
10+
}}}
11+
12+
Package=<4>
13+
{{{
14+
}}}
15+
16+
###############################################################################
17+
18+
Global:
19+
20+
Package=<5>
21+
{{{
22+
}}}
23+
24+
Package=<3>
25+
{{{
26+
}}}
27+
28+
###############################################################################
29+

BREGEXP.rc

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
//Microsoft Developer Studio generated resource script.
2+
//
3+
#include "resource.h"
4+
5+
#define APSTUDIO_READONLY_SYMBOLS
6+
/////////////////////////////////////////////////////////////////////////////
7+
//
8+
// Generated from the TEXTINCLUDE 2 resource.
9+
//
10+
#include "afxres.h"
11+
12+
/////////////////////////////////////////////////////////////////////////////
13+
#undef APSTUDIO_READONLY_SYMBOLS
14+
15+
/////////////////////////////////////////////////////////////////////////////
16+
// ���{�� resources
17+
18+
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
19+
#ifdef _WIN32
20+
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
21+
#pragma code_page(932)
22+
#endif //_WIN32
23+
24+
#ifndef _MAC
25+
/////////////////////////////////////////////////////////////////////////////
26+
//
27+
// Version
28+
//
29+
30+
VS_VERSION_INFO VERSIONINFO
31+
FILEVERSION 2,0,4,29
32+
PRODUCTVERSION 2,0,4,29
33+
FILEFLAGSMASK 0x3fL
34+
#ifdef _DEBUG
35+
FILEFLAGS 0x21L
36+
#else
37+
FILEFLAGS 0x20L
38+
#endif
39+
FILEOS 0x40004L
40+
FILETYPE 0x2L
41+
FILESUBTYPE 0x0L
42+
BEGIN
43+
BLOCK "StringFileInfo"
44+
BEGIN
45+
BLOCK "041104b0"
46+
BEGIN
47+
VALUE "Comments", "Regular Expression Engine for SAKURA\0"
48+
VALUE "CompanyName", "Tatsuo Baba\0"
49+
VALUE "FileDescription", "BREGEXP\0"
50+
VALUE "FileVersion", "2, 0, 4, 29\0"
51+
VALUE "InternalName", "BREGEXP\0"
52+
VALUE "LegalCopyright", "Copyright (C) 1999-2000 Tatsuo Baba\0"
53+
VALUE "LegalTrademarks", "\0"
54+
VALUE "OriginalFilename", "BREGEXP.dll\0"
55+
VALUE "PrivateBuild", "\0"
56+
VALUE "ProductName", "Tatsuo Baba BREGEXP\0"
57+
VALUE "ProductVersion", "2, 0, 4, 29\0"
58+
VALUE "SpecialBuild", "for SAKURA-Editor by Karoto\0"
59+
END
60+
END
61+
BLOCK "VarFileInfo"
62+
BEGIN
63+
VALUE "Translation", 0x411, 1200
64+
END
65+
END
66+
67+
#endif // !_MAC
68+
69+
70+
#ifdef APSTUDIO_INVOKED
71+
/////////////////////////////////////////////////////////////////////////////
72+
//
73+
// TEXTINCLUDE
74+
//
75+
76+
1 TEXTINCLUDE DISCARDABLE
77+
BEGIN
78+
"resource.h\0"
79+
END
80+
81+
2 TEXTINCLUDE DISCARDABLE
82+
BEGIN
83+
"#include ""afxres.h""\r\n"
84+
"\0"
85+
END
86+
87+
3 TEXTINCLUDE DISCARDABLE
88+
BEGIN
89+
"\r\n"
90+
"\0"
91+
END
92+
93+
#endif // APSTUDIO_INVOKED
94+
95+
#endif // ���{�� resources
96+
/////////////////////////////////////////////////////////////////////////////
97+
98+
99+
100+
#ifndef APSTUDIO_INVOKED
101+
/////////////////////////////////////////////////////////////////////////////
102+
//
103+
// Generated from the TEXTINCLUDE 3 resource.
104+
//
105+
106+
107+
/////////////////////////////////////////////////////////////////////////////
108+
#endif // not APSTUDIO_INVOKED
109+

bregexp.def

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
LIBRARY BREGEXP
2+
EXPORTS
3+
BMatch
4+
BSubst
5+
BTrans
6+
BSplit
7+
BRegfree
8+
BRegexpVersion
9+
BMatchEx
10+
BSubstEx

main.cpp

+24-10
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,15 @@
2626
extern "C"
2727
char* BRegexpVersion(void)
2828
{
29-
static char version[] = "bregexp V1.0"
30-
__DATE__
31-
" "
32-
__TIME__;
29+
static char version[] = "Bregexp.dll V1.0 for SAKURA "
30+
__DATE__;
3331

3432
return version;
3533
}
3634

3735

3836
extern "C"
39-
int BMatch(char* str,char *target,char *targetendp,
37+
int BMatchEx(char* str, char *targetbegp, char *target,char *targetendp,
4038
BREGEXP **charrxp,char *msg)
4139
{
4240

@@ -51,7 +49,8 @@ int BMatch(char* str,char *target,char *targetendp,
5149
regexp *rx = *rxp; // same string before ?
5250
int plen;
5351

54-
if (target == NULL || targetendp == NULL
52+
if (targetbegp == NULL || targetbegp > target
53+
|| target == NULL || targetendp == NULL
5554
|| target >= targetendp) { // bad targer parameter ?
5655
strcpy(msg,"invalid target parameter");
5756
return -1;
@@ -95,7 +94,7 @@ int BMatch(char* str,char *target,char *targetendp,
9594
}
9695

9796

98-
BOOL matched = bregexec(rx, target, targetendp,target,0,1,msg);
97+
BOOL matched = bregexec(rx, target, targetendp, targetbegp , 0, 1, msg);
9998
if (matched && rx->nparens && rx->endp[1] > rx->startp[1]) {
10099
int len = rx->endp[1] - rx->startp[1];
101100
char *tp = new char[len+1];
@@ -112,9 +111,16 @@ int BMatch(char* str,char *target,char *targetendp,
112111
}
113112

114113

114+
extern "C"
115+
int BMatch(char* str,char *target,char *targetendp,
116+
BREGEXP **charrxp,char *msg)
117+
{
118+
return BMatchEx(str, target, target, targetendp, charrxp, msg);
119+
}
120+
115121

116122
extern "C"
117-
int BSubst(char* str,char *target,char *targetendp,
123+
int BSubstEx(char* str,char *targetbegp, char *target,char *targetendp,
118124
BREGEXP **charrxp,char *msg)
119125
{
120126

@@ -129,7 +135,8 @@ int BSubst(char* str,char *target,char *targetendp,
129135
regexp *rx = *rxp; // same string before ?
130136
int plen;
131137

132-
if (target == NULL || targetendp == NULL
138+
if (targetbegp == NULL || targetbegp > target
139+
|| target == NULL || targetendp == NULL
133140
|| target >= targetendp) { // bad targer parameter ?
134141
strcpy(msg,"invalid target parameter");
135142
return -1;
@@ -167,7 +174,7 @@ int BSubst(char* str,char *target,char *targetendp,
167174
if (rx->pmflags & PMf_SUBSTITUTE) {
168175
return subst(rx,target,targetendp,msg);
169176
}
170-
BOOL matched = bregexec(rx, target, targetendp,target,0,1,msg);
177+
BOOL matched = bregexec(rx, target, targetendp, targetbegp, 0, 1, msg);
171178
if (matched && rx->nparens && rx->endp[1] > rx->startp[1]) {
172179
int len = rx->endp[1] - rx->startp[1];
173180
char *tp = new char[len+1];
@@ -184,6 +191,13 @@ int BSubst(char* str,char *target,char *targetendp,
184191
}
185192

186193

194+
extern "C"
195+
int BSubst(char* str,char *target,char *targetendp,
196+
BREGEXP **charrxp,char *msg)
197+
{
198+
return BSubstEx(str, target, target, targetendp, charrxp, msg);
199+
}
200+
187201
extern "C"
188202
int BTrans(char* str,char *target,char *targetendp,
189203
BREGEXP **charrxp,char *msg)

0 commit comments

Comments
 (0)