Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | fix [ce73fc2173] <p>Restore Win9x, using unicows eliminate all #ifdef UNICODE |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | win95-unicows |
| Files: | files | file ages | folders |
| SHA1: |
9cf5056af97e9a76a7160842cb66d087 |
| User & Date: | jan.nijtmans 2012-09-17 07:34:00.962 |
Context
|
2012-09-17
| ||
| 07:34 | fix [ce73fc2173] <p>Restore Win9x, using unicows eliminate all #ifdef UNICODE Closed-Leaf check-in: 9cf5056af9 user: jan.nijtmans tags: win95-unicows | |
|
2012-09-13
| ||
| 07:12 | re-enable unicode commandline for MSVC build (previous commit accidently removed that) <p>New version of dirent.h, which supports both MBCS and UNICODE check-in: 71d46aba2e user: jan.nijtmans tags: trunk | |
Changes
Changes to src/file.c.
| ︙ | ︙ | |||
1123 1124 1125 1126 1127 1128 1129 |
** to a file, -1 is returned and nothing is written
** to the console.
*/
int fossil_utf8_to_console(const char *zUtf8, int nByte, int toStdErr){
#ifdef _WIN32
int nChar;
wchar_t *zUnicode; /* Unicode version of zUtf8 */
| < < < < < | 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 |
** to a file, -1 is returned and nothing is written
** to the console.
*/
int fossil_utf8_to_console(const char *zUtf8, int nByte, int toStdErr){
#ifdef _WIN32
int nChar;
wchar_t *zUnicode; /* Unicode version of zUtf8 */
DWORD dummy;
static int istty[2] = { -1, -1 };
if( istty[toStdErr] == -1 ){
istty[toStdErr] = _isatty(toStdErr + 1) != 0;
}
if( !istty[toStdErr] ){
/* stdout/stderr is not a console. */
|
| ︙ | ︙ | |||
1150 1151 1152 1153 1154 1155 1156 |
}
nChar = MultiByteToWideChar(CP_UTF8, 0, zUtf8, nByte, zUnicode, nChar);
if( nChar==0 ){
free(zUnicode);
return 0;
}
zUnicode[nChar] = '\0';
| < < < < < < < < < < < < < < < < < < < < | 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 |
}
nChar = MultiByteToWideChar(CP_UTF8, 0, zUtf8, nByte, zUnicode, nChar);
if( nChar==0 ){
free(zUnicode);
return 0;
}
zUnicode[nChar] = '\0';
WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE - toStdErr), zUnicode, nChar, &dummy, 0);
return nChar;
#else
return -1; /* No-op on unix */
#endif
}
/*
|
| ︙ | ︙ |
Changes to src/main.c.
| ︙ | ︙ | |||
195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
const char *azAuxName[MX_AUX]; /* Name of each aux() or option() value */
char *azAuxParam[MX_AUX]; /* Param of each aux() or option() value */
const char *azAuxVal[MX_AUX]; /* Value of each aux() or option() value */
const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
int anAuxCols[MX_AUX]; /* Number of columns for option() values */
int allowSymlinks; /* Cached "allow-symlinks" option */
#ifdef FOSSIL_ENABLE_JSON
struct FossilJsonBits {
int isJsonMode; /* True if running in JSON mode, else
false. This changes how errors are
reported. In JSON mode we try to
always output JSON-form error
| > > > | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
const char *azAuxName[MX_AUX]; /* Name of each aux() or option() value */
char *azAuxParam[MX_AUX]; /* Param of each aux() or option() value */
const char *azAuxVal[MX_AUX]; /* Value of each aux() or option() value */
const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
int anAuxCols[MX_AUX]; /* Number of columns for option() values */
int allowSymlinks; /* Cached "allow-symlinks" option */
#ifdef _WIN32
int isNT;
#endif
#ifdef FOSSIL_ENABLE_JSON
struct FossilJsonBits {
int isJsonMode; /* True if running in JSON mode, else
false. This changes how errors are
reported. In JSON mode we try to
always output JSON-form error
|
| ︙ | ︙ | |||
468 469 470 471 472 473 474 | int n; /* Number of bytes in one line */ char *z; /* General use string pointer */ char **newArgv; /* New expanded g.argv under construction */ char const * zFileName; /* input file name */ FILE * zInFile; /* input FILE */ int foundBom = -1; /* -1= not searched yet, 0 = no; 1=yes */ #ifdef _WIN32 | | | < < < < | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
int n; /* Number of bytes in one line */
char *z; /* General use string pointer */
char **newArgv; /* New expanded g.argv under construction */
char const * zFileName; /* input file name */
FILE * zInFile; /* input FILE */
int foundBom = -1; /* -1= not searched yet, 0 = no; 1=yes */
#ifdef _WIN32
TCHAR buf[MAX_PATH];
#endif
g.argc = argc;
g.argv = argv;
#ifdef _WIN32
parse_windows_command_line(&g.argc, &g.argv);
GetModuleFileName(NULL, buf, MAX_PATH);
g.argv[0] = fossil_unicode_to_utf8(buf);
for(i=1; i<g.argc; i++) g.argv[i] = fossil_unicode_to_utf8(g.argv[i]);
#endif
for(i=1; i<g.argc-1; i++){
z = g.argv[i];
if( z[0]!='-' ) continue;
z++;
if( z[0]=='-' ) z++;
if( z[0]==0 ) return; /* Stop searching at "--" */
|
| ︙ | ︙ | |||
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
** This procedure runs first.
*/
int main(int argc, char **argv)
{
const char *zCmdName = "unknown";
int idx;
int rc;
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
memset(&g, 0, sizeof(g));
g.now = time(0);
#ifdef FOSSIL_ENABLE_JSON
#if defined(NDEBUG)
g.json.errorDetailParanoia = 2 /* FIXME: make configurable
One problem we have here is that this
code is needed before the db is opened,
so we can't sql for it.*/;
| > > > > > > > > | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 |
** This procedure runs first.
*/
int main(int argc, char **argv)
{
const char *zCmdName = "unknown";
int idx;
int rc;
#ifdef _WIN32
OSVERSIONINFOA sInfo;
#endif
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
memset(&g, 0, sizeof(g));
#ifdef _WIN32
sInfo.dwOSVersionInfoSize = sizeof(sInfo);
GetVersionExA(&sInfo);
g.isNT = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT;
#endif
g.now = time(0);
#ifdef FOSSIL_ENABLE_JSON
#if defined(NDEBUG)
g.json.errorDetailParanoia = 2 /* FIXME: make configurable
One problem we have here is that this
code is needed before the db is opened,
so we can't sql for it.*/;
|
| ︙ | ︙ | |||
832 833 834 835 836 837 838 |
*/
int fossil_system(const char *zOrigCmd){
int rc;
#if defined(_WIN32)
/* On windows, we have to put double-quotes around the entire command.
** Who knows why - this is just the way windows works.
*/
| > > > > | > > > | | | | 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 |
*/
int fossil_system(const char *zOrigCmd){
int rc;
#if defined(_WIN32)
/* On windows, we have to put double-quotes around the entire command.
** Who knows why - this is just the way windows works.
*/
char *zNewCmd;
TCHAR *zUnicode;
if (g.isNT) {
zNewCmd = mprintf("\"%s\"", zOrigCmd);
} else {
zNewCmd = mprintf("%s", zOrigCmd);
}
zUnicode = fossil_utf8_to_unicode(zNewCmd);
if( g.fSystemTrace ) {
char *zOut = mprintf("SYSTEM: %s\n", zNewCmd);
fossil_puts(zOut, 1);
fossil_free(zOut);
}
rc = _tsystem(zUnicode);
fossil_mbcs_free(zUnicode);
fossil_free(zNewCmd);
#else
/* On unix, evaluate the command directly.
*/
if( g.fSystemTrace ) fprintf(stderr, "SYSTEM: %s\n", zOrigCmd);
rc = system(zOrigCmd);
#endif
return rc;
|
| ︙ | ︙ |
Changes to src/winhttp.c.
| ︙ | ︙ | |||
127 128 129 130 131 132 133 | if( in ) fclose(in); closesocket(p->s); file_delete(zRequestFName); file_delete(zReplyFName); free(p); } | < < < < < | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | if( in ) fclose(in); closesocket(p->s); file_delete(zRequestFName); file_delete(zReplyFName); free(p); } /* ** Start a listening socket and process incoming HTTP requests on ** that socket. */ void win32_http_server( int mnPort, int mxPort, /* Range of allowed TCP port numbers */ const char *zBrowser, /* Command to launch browser. (Or NULL) */ |
| ︙ | ︙ | |||
559 560 561 562 563 564 565 566 567 568 569 570 571 572 |
**
*/
void cmd_win32_service(void){
int n;
const char *zMethod;
const char *zSvcName = "Fossil-DSCM"; /* Default service name */
if( g.argc<3 ){
usage("create|delete|show|start|stop ...");
}
zMethod = g.argv[2];
n = strlen(zMethod);
if( strncmp(zMethod, "create", n)==0 ){
| > > > > > | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 |
**
*/
void cmd_win32_service(void){
int n;
const char *zMethod;
const char *zSvcName = "Fossil-DSCM"; /* Default service name */
#ifdef _WIN32
if( !g.isNT ) {
fossil_fatal("%s command not support on Windows 9x", g.argv[1]);
}
#endif
if( g.argc<3 ){
usage("create|delete|show|start|stop ...");
}
zMethod = g.argv[2];
n = strlen(zMethod);
if( strncmp(zMethod, "create", n)==0 ){
|
| ︙ | ︙ |
Changes to win/Makefile.mingw.
| ︙ | ︙ | |||
147 148 149 150 151 152 153 | TCC += -DFOSSIL_ENABLE_JSON=1 RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | TCC += -DFOSSIL_ENABLE_JSON=1 RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -municows -static # OpenSSL: Add the necessary libraries required, if enabled. ifdef FOSSIL_ENABLE_SSL LIB += -lssl -lcrypto -lgdi32 endif # Tcl: Add the necessary libraries required, if enabled. |
| ︙ | ︙ |