Mercurial > mercurial > hgweb_golang.cgi
comparison src/kaigo/Perori/bk.go @ 55:4877160411cc
bug fix.
author | pyon@macmini |
---|---|
date | Sat, 27 Jun 2020 16:19:45 +0900 |
parents | c58172a59534 |
children |
comparison
equal
deleted
inserted
replaced
54:665f92c37b72 | 55:4877160411cc |
---|---|
1 /* | 1 /* |
2 bk.go: Insert Biko & Hatsuban | 2 bk.go: Insert Biko & Hatsuban |
3 | 3 |
4 Last Change: 2020-03-10 火 15:13:54. | 4 Last Change: 2020-06-24 水 10:16:00. |
5 */ | 5 */ |
6 | 6 |
7 package main | 7 package main |
8 | 8 |
9 /* | 9 /* |
44 } | 44 } |
45 datasize[0] += nPage - 1; // for "\n" | 45 datasize[0] += nPage - 1; // for "\n" |
46 all_lpszvalue = (char*)malloc(sizeof(char)*datasize[0]); | 46 all_lpszvalue = (char*)malloc(sizeof(char)*datasize[0]); |
47 all_lpszvalue[0] = '\0'; | 47 all_lpszvalue[0] = '\0'; |
48 for (int i = 1; i <= nPage; i++) { | 48 for (int i = 1; i <= nPage; i++) { |
49 if (i<nPage) datasize[i]++; // for "\n" | 49 if (i < nPage) datasize[i]++; // for "\n" |
50 lpszvalue = (char*)malloc(sizeof(char)*(datasize[i])); | 50 lpszvalue = (char*)malloc(sizeof(char)*(datasize[i])); |
51 XDW_GetPageTextToMemory(h, i, lpszvalue, datasize[i], NULL); | 51 XDW_GetPageTextToMemory(h, i, lpszvalue, datasize[i], NULL); |
52 strcat(all_lpszvalue, lpszvalue); | 52 strcat(all_lpszvalue, lpszvalue); |
53 if (i < nPage) strcat(all_lpszvalue, "\n"); | 53 if (i < nPage) strcat(all_lpszvalue, "\n"); |
54 free(lpszvalue); | 54 free(lpszvalue); |
141 | 141 |
142 int xdweraren(const char* in_file, const char* stxt) | 142 int xdweraren(const char* in_file, const char* stxt) |
143 { | 143 { |
144 int x = 1870; | 144 int x = 1870; |
145 int y = 4680; | 145 int y = 4680; |
146 int yoff = 2825; | 146 int yoff = 2830; |
147 int sz = 90; | 147 int sz = 90; |
148 | 148 |
149 char in_path[_MAX_PATH]; | 149 char in_path[_MAX_PATH]; |
150 _fullpath(in_path, in_file, _MAX_PATH); | 150 _fullpath(in_path, in_file, _MAX_PATH); |
151 | 151 |
199 "golang.org/x/text/transform" | 199 "golang.org/x/text/transform" |
200 ) | 200 ) |
201 | 201 |
202 // Constants | 202 // Constants |
203 const ( | 203 const ( |
204 version = "0.4" | 204 version = "0.5" |
205 default_ccsvfile = "chosairai.csv" | 205 default_ccsvfile = "chosairai.csv" |
206 default_icsvfile = "ikenshoirai.csv" | 206 default_icsvfile = "ikenshoirai.csv" |
207 default_cxdwfile = "KBPC116G.xdw" | 207 default_cxdwfile = "KBPC116G.xdw" |
208 default_ixdwfile = "KBPB116G.xdw" | 208 default_ixdwfile = "KBPB116G.xdw" |
209 default_tmpxdw = "tmp.xdw" | 209 default_tmpxdw = "tmp.xdw" |
225 func init(){ | 225 func init(){ |
226 os.Remove(default_cout) | 226 os.Remove(default_cout) |
227 os.Remove(default_iout) | 227 os.Remove(default_iout) |
228 os.Remove(default_lout) | 228 os.Remove(default_lout) |
229 | 229 |
230 re_hhsno = regexp.MustCompile(`0[1238]\d{8}`) | 230 re_hhsno = regexp.MustCompile(`0[1238]00\d{6}`) |
231 re_date = regexp.MustCompile(`((明治)|(大正)|(昭和)|(平成)|(令和)).{1,2}年.\d月.\d日`) | 231 re_date = regexp.MustCompile(`((明治)|(大正)|(昭和)|(平成)|(令和)).{1,2}年.\d月.\d日`) |
232 re_city = regexp.MustCompile(`(((平成)|(令和)).{1,2}年.\d月.\d日){2}...`) | 232 re_city = regexp.MustCompile(`(((平成)|(令和)).{1,2}年.\d月.\d日){2}...`) |
233 re_name = regexp.MustCompile(`0[1238]\d{8}.*((平成)|(令和)).{1,2}年.\d月.\d日`) | 233 re_name = regexp.MustCompile(`0[1238]00\d{6}.*((平成)|(令和)).{1,2}年.\d月.\d日`) |
234 re_zensp = regexp.MustCompile(` {2,}`) | 234 re_zensp = regexp.MustCompile(` {2,}`) |
235 } | 235 } |
236 | 236 |
237 func main() { | 237 func main() { |
238 start = time.Now() | 238 start = time.Now() |