Changes On Branch windowscompilers
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch windowscompilers Excluding Merge-Ins

This is equivalent to a diff from 72147afc9d to c0a530f482

2010-09-08
12:38
Merge in the latest changes from the windowscompilers branch. check-in: 8d864a7f65 user: drh tags: trunk
2010-08-31
15:51
make compilation depend on _WIN32 being defined by including allways config.h Closed-Leaf check-in: c0a530f482 user: renez tags: windowscompilers
2010-08-29
05:32
Changed mscv flags to -MT because that is what openssl is using. Removed the -Oy- for the same reason check-in: 30b8a41dc7 user: renez tags: windowscompilers
2010-08-27
17:19
Fix a typo in the popen2() implementation for windows. Ticket [cf50ea4d6914fb6d856988da7]. Also refinements on the ssh:// toward getting it working on windows. check-in: d5c934e5df user: drh tags: trunk
01:24
Create new branch named "windowscompilers" check-in: 3e3304ac44 user: renez tags: windowscompilers
2010-08-26
14:13
Show diffs on info pages even if the user lacks history privilege. check-in: 72147afc9d user: drh tags: trunk
13:29
Close pipes before killing off the child process. check-in: 360b047759 user: drh tags: trunk

Changes to src/add.c.

    51     51      || blob_compare(&pathname, pOmit)==0
    52     52     ){
    53     53       fossil_warning("cannot add %s", zPath);
    54     54     }else{
    55     55       if( !file_is_simple_pathname(zPath) ){
    56     56         fossil_fatal("filename contains illegal characters: %s", zPath);
    57     57       }
    58         -#ifdef __MINGW32__
           58  +#if defined(_WIN32)
    59     59       if( db_exists("SELECT 1 FROM vfile"
    60     60                     " WHERE pathname=%Q COLLATE nocase", zPath) ){
    61     61         db_multi_exec("UPDATE vfile SET deleted=0"
    62     62                       " WHERE pathname=%Q COLLATE nocase", zPath);
    63     63       }
    64     64   #else
    65     65       if( db_exists("SELECT 1 FROM vfile WHERE pathname=%Q", zPath) ){
................................................................................
   150    150       fossil_panic("no checkout to add to");
   151    151     }
   152    152     db_begin_transaction();
   153    153     if( !file_tree_name(g.zRepositoryName, &repo, 0) ){
   154    154       blob_zero(&repo);
   155    155     }
   156    156     db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
   157         -#ifdef __MINGW32__
          157  +#if defined(_WIN32)
   158    158     db_multi_exec(
   159    159        "CREATE INDEX IF NOT EXISTS vfile_pathname "
   160    160        "  ON vfile(pathname COLLATE nocase)"
   161    161     );
   162    162   #endif
   163    163     for(i=2; i<g.argc; i++){
   164    164       char *zName;

Changes to src/blob.c.

   658    658         zName = zBuf;
   659    659         strcpy(zName, zFilename);
   660    660       }
   661    661       nName = file_simplify_name(zName, nName);
   662    662       for(i=1; i<nName; i++){
   663    663         if( zName[i]=='/' ){
   664    664           zName[i] = 0;
   665         -#ifdef __MINGW32__
          665  +#if defined(_WIN32)
   666    666           /*
   667    667           ** On Windows, local path looks like: C:/develop/project/file.txt
   668    668           ** The if stops us from trying to create a directory of a drive letter
   669    669           ** C: in this example.
   670    670           */
   671    671           if( !(i==2 && zName[1]==':') ){
   672    672   #endif
   673    673             if( file_mkdir(zName, 1) ){
   674    674               fossil_fatal_recursive("unable to create directory %s", zName);
   675    675               return 0;
   676    676             }
   677         -#ifdef __MINGW32__
          677  +#if defined(_WIN32)
   678    678           }
   679    679   #endif
   680    680           zName[i] = '/';
   681    681         }
   682    682       }
   683    683       out = fopen(zName, "wb");
   684    684       if( out==0 ){
................................................................................
   854    854       blob_reset(&b1);
   855    855       blob_reset(&b2);
   856    856       blob_reset(&b3);
   857    857     }
   858    858     printf("ok\n");
   859    859   }
   860    860   
   861         -#ifdef __MINGW32__
          861  +#if defined(_WIN32)
   862    862   /*
   863    863   ** Convert every \n character in the given blob into \r\n.
   864    864   */
   865    865   void blob_add_cr(Blob *p){
   866    866     char *z = p->aData;
   867    867     int j   = p->nUsed;
   868    868     int i, n;

Changes to src/cgi.c.

    18     18   ** This file contains C functions and procedures that provide useful
    19     19   ** services to CGI programs.  There are procedures for parsing and
    20     20   ** dispensing QUERY_STRING parameters and cookies, the "mprintf()"
    21     21   ** formatting function and its cousins, and routines to encode and
    22     22   ** decode strings in HTML or HTTP.
    23     23   */
    24     24   #include "config.h"
    25         -#ifdef __MINGW32__
           25  +#ifdef _WIN32
    26     26   # include <windows.h>           /* for Sleep once server works again */
    27         -# include <winsock2.h>          /* socket operations */
    28         -# define sleep Sleep            /* windows does not have sleep, but Sleep */
    29         -# include <ws2tcpip.h>          
           27  +#  if defined(__MINGW32__)
           28  +#    define sleep Sleep            /* windows does not have sleep, but Sleep */
           29  +#    include <ws2tcpip.h>          
           30  +#  endif
    30     31   #else
    31     32   # include <sys/socket.h>
    32     33   # include <netinet/in.h>
    33     34   # include <arpa/inet.h>
    34     35   # include <sys/times.h>
    35     36   # include <sys/time.h>
    36     37   # include <sys/wait.h>
................................................................................
  1037   1038   ** out of this procedure call.  The child will handle the request.
  1038   1039   ** The parent never returns from this procedure.
  1039   1040   **
  1040   1041   ** Return 0 to each child as it runs.  If unable to establish a
  1041   1042   ** listening socket, return non-zero.
  1042   1043   */
  1043   1044   int cgi_http_server(int mnPort, int mxPort, char *zBrowser, int flags){
  1044         -#ifdef __MINGW32__
         1045  +#if defined(_WIN32)
  1045   1046     /* Use win32_http_server() instead */
  1046   1047     fossil_exit(1);
  1047   1048   #else
  1048   1049     int listener = -1;           /* The server socket */
  1049   1050     int connection;              /* A socket for each individual connection */
  1050   1051     fd_set readfds;              /* Set of file descriptors for select() */
  1051   1052     size_t lenaddr;              /* Length of the inaddr structure */

Changes to src/checkin.c.

   399    399     if( zEditor==0 ){
   400    400       zEditor = getenv("VISUAL");
   401    401     }
   402    402     if( zEditor==0 ){
   403    403       zEditor = getenv("EDITOR");
   404    404     }
   405    405     if( zEditor==0 ){
   406         -#ifdef __MINGW32__
          406  +#if defined(_WIN32)
   407    407       zEditor = "notepad";
   408    408   #else
   409    409       zEditor = "ed";
   410    410   #endif
   411    411     }
   412    412     zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
   413    413                      g.zLocalRoot);
   414         -#ifdef __MINGW32__
          414  +#if defined(_WIN32)
   415    415     blob_add_cr(&text);
   416    416   #endif
   417    417     blob_write_to_file(&text, zFile);
   418    418     zCmd = mprintf("%s \"%s\"", zEditor, zFile);
   419    419     printf("%s\n", zCmd);
   420    420     if( portable_system(zCmd) ){
   421    421       fossil_panic("editor aborted");
................................................................................
   773    773       const char *zName = db_column_text(&q, 0);
   774    774       const char *zUuid = db_column_text(&q, 1);
   775    775       const char *zOrig = db_column_text(&q, 2);
   776    776       int frid = db_column_int(&q, 3);
   777    777       int isexe = db_column_int(&q, 4);
   778    778       const char *zPerm;
   779    779       blob_append(&filename, zName, -1);
   780         -#ifndef __MINGW32__
          780  +#if !defined(_WIN32)
   781    781       /* For unix, extract the "executable" permission bit directly from
   782    782       ** the filesystem.  On windows, the "executable" bit is retained
   783    783       ** unchanged from the original. */
   784    784       isexe = file_isexe(blob_str(&filename));
   785    785   #endif
   786    786       if( isexe ){
   787    787         zPerm = " x";

Changes to src/config.h.

    24     24   #include <unistd.h>
    25     25   #include <stdio.h>
    26     26   #include <stdlib.h>
    27     27   #include <ctype.h>
    28     28   #include <string.h>
    29     29   #include <stdarg.h>
    30     30   #include <assert.h>
    31         -#ifdef __MINGW32__
    32         -# include <windows.h>
           31  +#if defined( __MINGW32__) ||  defined(__DMC__) || defined(_MSC_VER)
           32  +#  if defined(__DMC__)  || defined(_MSC_VER)
           33  +     typedef int socklen_t;
           34  +#  endif
           35  +#  ifndef _WIN32
           36  +#    define _WIN32
           37  +#  endif
    33     38   #else
    34     39   # include <sys/types.h>
    35     40   # include <signal.h>
    36     41   # include <pwd.h>
    37     42   #endif
    38     43   
    39     44   #include "sqlite3.h"

Changes to src/db.c.

    25     25   **    (2)  The "repository" database
    26     26   **
    27     27   **    (3)  A local checkout database named "_FOSSIL_" or ".fos"
    28     28   **         and located at the root of the local copy of the source tree.
    29     29   **
    30     30   */
    31     31   #include "config.h"
           32  +#if ! defined(_WIN32)
           33  +#  include <pwd.h>
           34  +#endif
    32     35   #include <sqlite3.h>
    33     36   #include <sys/types.h>
    34     37   #include <sys/stat.h>
    35     38   #include <unistd.h>
    36     39   #include "db.h"
    37     40   
    38     41   #if INTERFACE
................................................................................
   532    535     }else{
   533    536       z = 0;
   534    537     }
   535    538     db_finalize(&s);
   536    539     return z;
   537    540   }
   538    541   
   539         -#ifdef __MINGW32__
          542  +#if defined(_WIN32)
   540    543   extern char *sqlite3_win32_mbcs_to_utf8(const char*);
   541    544   #endif
   542    545   
   543    546   /*
   544    547   ** Initialize a new database file with the given schema.  If anything
   545    548   ** goes wrong, call db_err() to exit.
   546    549   */
................................................................................
   550    553     ...                      /* Additional SQL to run.  Terminate with NULL. */
   551    554   ){
   552    555     sqlite3 *db;
   553    556     int rc;
   554    557     const char *zSql;
   555    558     va_list ap;
   556    559   
   557         -#ifdef __MINGW32__
          560  +#if defined(_WIN32)
   558    561     zFileName = sqlite3_win32_mbcs_to_utf8(zFileName);
   559    562   #endif
   560    563     rc = sqlite3_open(zFileName, &db);
   561    564     if( rc!=SQLITE_OK ){
   562    565       db_err(sqlite3_errmsg(db));
   563    566     }
   564    567     sqlite3_busy_timeout(db, 5000);
................................................................................
   585    588   */
   586    589   static sqlite3 *openDatabase(const char *zDbName){
   587    590     int rc;
   588    591     const char *zVfs;
   589    592     sqlite3 *db;
   590    593   
   591    594     zVfs = getenv("FOSSIL_VFS");
   592         -#ifdef __MINGW32__
          595  +#if defined(_WIN32)
   593    596     zDbName = sqlite3_win32_mbcs_to_utf8(zDbName);
   594    597   #endif
   595    598     rc = sqlite3_open_v2(
   596    599          zDbName, &db,
   597    600          SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
   598    601          zVfs
   599    602     );
................................................................................
   613    616   */
   614    617   void db_open_or_attach(const char *zDbName, const char *zLabel){
   615    618     if( !g.db ){
   616    619       g.db = openDatabase(zDbName);
   617    620       g.zRepoDb = "main";
   618    621       db_connection_init();
   619    622     }else{
   620         -#ifdef __MINGW32__
          623  +#if defined(_WIN32)
   621    624       zDbName = sqlite3_win32_mbcs_to_utf8(zDbName);
   622    625   #endif
   623    626       db_multi_exec("ATTACH DATABASE %Q AS %s", zDbName, zLabel);
   624    627       g.zRepoDb = mprintf("%s", zLabel);
   625    628     }
   626    629   }
   627    630   
................................................................................
   637    640   ** connection so that we can join between the various databases.  In that
   638    641   ** case, invoke this routine with useAttach as 1.
   639    642   */
   640    643   void db_open_config(int useAttach){
   641    644     char *zDbName;
   642    645     const char *zHome;
   643    646     if( g.configOpen ) return;
   644         -#ifdef __MINGW32__
          647  +#if defined(_WIN32)
   645    648     zHome = getenv("LOCALAPPDATA");
   646    649     if( zHome==0 ){
   647    650       zHome = getenv("APPDATA");
   648    651       if( zHome==0 ){
   649    652         zHome = getenv("HOMEPATH");
   650    653       }
   651    654     }
................................................................................
   665    668     }
   666    669   #ifndef __MINGW32__
   667    670     if( access(zHome, W_OK) ){
   668    671       fossil_fatal("home directory %s must be writeable", zHome);
   669    672     }
   670    673   #endif
   671    674     g.zHome = mprintf("%/", zHome);
   672         -#ifdef __MINGW32__
          675  +#if defined(_WIN32)
   673    676     /* . filenames give some window systems problems and many apps problems */
   674    677     zDbName = mprintf("%//_fossil", zHome);
   675    678   #else
   676    679     zDbName = mprintf("%s/.fossil", zHome);
   677    680   #endif
   678    681     if( file_size(zDbName)<1024*3 ){
   679    682       db_init_database(zDbName, zConfigSchema, (char*)0);
................................................................................
   942    945   void db_create_default_users(int setupUserOnly, const char *zDefaultUser){
   943    946     const char *zUser;
   944    947     zUser = db_get("default-user", 0);
   945    948     if( zUser==0 ){
   946    949       zUser = zDefaultUser;
   947    950     }
   948    951     if( zUser==0 ){
   949         -#ifdef __MINGW32__
          952  +#if defined(_WIN32)
   950    953       zUser = getenv("USERNAME");
   951    954   #else
   952    955       zUser = getenv("USER");
   953    956   #endif
   954    957     }
   955    958     if( zUser==0 ){
   956    959       zUser = "root";

Changes to src/diffcmd.c.

    43     43   }
    44     44   
    45     45   /*
    46     46   ** This function implements a cross-platform "system()" interface.
    47     47   */
    48     48   int portable_system(const char *zOrigCmd){
    49     49     int rc;
    50         -#ifdef __MINGW32__
           50  +#if defined(_WIN32)
    51     51     /* On windows, we have to put double-quotes around the entire command.
    52     52     ** Who knows why - this is just the way windows works.
    53     53     */
    54     54     char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
    55     55     rc = system(zNewCmd);
    56     56     free(zNewCmd);
    57     57   #else

Changes to src/file.c.

    81     81   
    82     82   /*
    83     83   ** Return TRUE if the named file is an executable.  Return false
    84     84   ** for directories, devices, fifos, symlinks, etc.
    85     85   */
    86     86   int file_isexe(const char *zFilename){
    87     87     if( getStat(zFilename) || !S_ISREG(fileStat.st_mode) ) return 0;
    88         -#ifdef __MINGW32__
           88  +#if defined(_WIN32)
           89  +#  if defined(__DMC__) || defined(_MSC_VER)
           90  +#    define S_IXUSR  _S_IEXEC
           91  +#  endif
    89     92     return ((S_IXUSR)&fileStat.st_mode)!=0;
    90     93   #else
    91     94     return ((S_IXUSR|S_IXGRP|S_IXOTH)&fileStat.st_mode)!=0;
    92     95   #endif
    93     96   }
    94     97   
    95     98   
................................................................................
   143    146     fclose(out);
   144    147   }
   145    148   
   146    149   /*
   147    150   ** Set or clear the execute bit on a file.
   148    151   */
   149    152   void file_setexe(const char *zFilename, int onoff){
   150         -#ifndef __MINGW32__
          153  +#if !defined(_WIN32)
   151    154     struct stat buf;
   152    155     if( stat(zFilename, &buf)!=0 ) return;
   153    156     if( onoff ){
   154    157       if( (buf.st_mode & 0111)!=0111 ){
   155    158         chmod(zFilename, buf.st_mode | 0111);
   156    159       }
   157    160     }else{
   158    161       if( (buf.st_mode & 0111)!=0 ){
   159    162         chmod(zFilename, buf.st_mode & ~0111);
   160    163       }
   161    164     }
   162         -#endif /* __MINGW32__ */
          165  +#endif /* _WIN32 */
   163    166   }
   164    167   
   165    168   /*
   166    169   ** Create the directory named in the argument, if it does not already
   167    170   ** exist.  If forceFlag is 1, delete any prior non-directory object 
   168    171   ** with the same name.
   169    172   **
................................................................................
   172    175   int file_mkdir(const char *zName, int forceFlag){
   173    176     int rc = file_isdir(zName);
   174    177     if( rc==2 ){
   175    178       if( !forceFlag ) return 1;
   176    179       unlink(zName);
   177    180     }
   178    181     if( rc!=1 ){
   179         -#ifdef __MINGW32__
          182  +#if defined(_WIN32)
   180    183       return mkdir(zName);
   181    184   #else
   182    185       return mkdir(zName, 0755);
   183    186   #endif
   184    187     }
   185    188     return 0;
   186    189   }
................................................................................
   229    232   **  * removing /A/../
   230    233   **
   231    234   ** Changes are made in-place.  Return the new name length.
   232    235   */
   233    236   int file_simplify_name(char *z, int n){
   234    237     int i, j;
   235    238     if( n<0 ) n = strlen(z);
   236         -#ifdef __MINGW32__
          239  +#if defined(_WIN32)
   237    240     for(i=0; i<n; i++){
   238    241       if( z[i]=='\\' ) z[i] = '/';
   239    242     }
   240    243   #endif
   241    244     while( n>1 && z[n-1]=='/' ){ n--; }
   242    245     for(i=j=0; i<n; i++){
   243    246       if( z[i]=='/' ){
................................................................................
   264    267   ** Make the name absolute if it is relative.
   265    268   ** Remove redundant / characters
   266    269   ** Remove all /./ path elements.
   267    270   ** Convert /A/../ to just /
   268    271   */
   269    272   void file_canonical_name(const char *zOrigName, Blob *pOut){
   270    273     if( zOrigName[0]=='/' 
   271         -#ifdef __MINGW32__
          274  +#if defined(_WIN32)
   272    275         || zOrigName[0]=='\\'
   273    276         || (strlen(zOrigName)>3 && zOrigName[1]==':'
   274    277              && (zOrigName[2]=='\\' || zOrigName[2]=='/'))
   275    278   #endif
   276    279     ){
   277    280       blob_set(pOut, zOrigName);
   278    281       blob_materialize(pOut);
................................................................................
   309    312   **
   310    313   ** Canonical names are full pathnames using "/" not "\" and which
   311    314   ** contain no "/./" or "/../" terms.
   312    315   */
   313    316   int file_is_canonical(const char *z){
   314    317     int i;
   315    318     if( z[0]!='/'
   316         -#ifdef __MINGW32__
          319  +#if defined(_WIN32)
   317    320       && (z[0]==0 || z[1]!=':' || z[2]!='/')
   318    321   #endif
   319    322     ) return 0;
   320    323   
   321    324     for(i=0; z[i]; i++){
   322    325       if( z[i]=='\\' ) return 0;
   323    326       if( z[i]=='/' ){

Changes to src/http_socket.c.

    24     24   **
    25     25   ** Low-level sockets are abstracted out into this module because they 
    26     26   ** are handled different on Unix and windows.
    27     27   */
    28     28   
    29     29   #include "config.h"
    30     30   #include "http_socket.h"
    31         -#ifdef __MINGW32__
    32         -#  include <windows.h>
    33         -#  include <winsock2.h>
           31  +#if defined(_WIN32)
           32  +#  include <windows.h>           /* for Sleep once server works again */
           33  +#  define sleep Sleep            /* windows does not have sleep, but Sleep */
           34  +#  if defined(__MINGW32__)
           35  +#    include <ws2tcpip.h>          
           36  +#  endif
    34     37   #else
    35     38   #  include <arpa/inet.h>
    36     39   #  include <sys/socket.h>
    37     40   #  include <netdb.h>
    38     41   #  include <netinet/in.h>
    39     42   #endif
    40     43   #include <assert.h>
................................................................................
    43     46   
    44     47   /*
    45     48   ** There can only be a single socket connection open at a time.
    46     49   ** State information about that socket is stored in the following
    47     50   ** local variables:
    48     51   */
    49     52   static int socketIsInit = 0;    /* True after global initialization */
    50         -#ifdef __MINGW32__
           53  +#if defined(_WIN32)
    51     54   static WSADATA socketInfo;      /* Windows socket initialize data */
    52     55   #endif
    53     56   static int iSocket = -1;        /* The socket on which we talk to the server */
    54     57   static char *socketErrMsg = 0;  /* Text of most recent socket error */
    55     58   
    56     59   
    57     60   /*
................................................................................
    82     85   
    83     86   /*
    84     87   ** Call this routine once before any other use of the socket interface.
    85     88   ** This routine does initial configuration of the socket module.
    86     89   */
    87     90   void socket_global_init(void){
    88     91     if( socketIsInit==0 ){
    89         -#ifdef __MINGW32__
           92  +#if defined(_WIN32)
    90     93       if( WSAStartup(MAKEWORD(2,0), &socketInfo)!=0 ){
    91     94         fossil_panic("can't initialize winsock");
    92     95       }
    93     96   #endif
    94     97       socketIsInit = 1;
    95     98     }
    96     99   }
................................................................................
    97    100   
    98    101   /*
    99    102   ** Call this routine to shutdown the socket module prior to program
   100    103   ** exit.
   101    104   */
   102    105   void socket_global_shutdown(void){
   103    106     if( socketIsInit ){
   104         -#ifdef __MINGW32__
          107  +#if defined(_WIN32)
   105    108       WSACleanup();
   106    109   #endif
   107    110       socket_clear_errmsg();
   108    111       socketIsInit = 0;
   109    112     }
   110    113   }
   111    114   
   112    115   /*
   113    116   ** Close the currently open socket.  If no socket is open, this routine
   114    117   ** is a no-op.
   115    118   */
   116    119   void socket_close(void){
   117    120     if( iSocket>=0 ){
   118         -#ifdef __MINGW32__
          121  +#if defined(_WIN32)
   119    122       closesocket(iSocket);
   120    123   #else
   121    124       close(iSocket);
   122    125   #endif
   123    126       iSocket = -1;
   124    127     }
   125    128   }
................................................................................
   169    172       return 1;
   170    173     }
   171    174     if( connect(iSocket,(struct sockaddr*)&addr,sizeof(addr))<0 ){
   172    175       socket_set_errmsg("cannot connect to host %s:%d", g.urlName, g.urlPort);
   173    176       socket_close();
   174    177       return 1;
   175    178     }
   176         -#ifndef __MINGW32__
          179  +#if !defined(_WIN32)
   177    180     signal(SIGPIPE, SIG_IGN);
   178    181   #endif
   179    182     return 0;
   180    183   }
   181    184   
   182    185   /*
   183    186   ** Send content out over the open socket connection.

Changes to src/http_ssl.c.

   126    126   **    g.urlPort       TCP/IP port to use.  Ex: 80
   127    127   **
   128    128   ** Return the number of errors.
   129    129   */
   130    130   int ssl_open(void){
   131    131     X509 *cert;
   132    132     int hasSavedCertificate = 0;
   133         -
          133  +char *connStr ;
   134    134     ssl_global_init();
   135    135   
   136    136     /* Get certificate for current server from global config and
   137    137      * (if we have it in config) add it to certificate store.
   138    138      */
   139    139     cert = ssl_get_certificate();
   140    140     if ( cert!=NULL ){
................................................................................
   148    148     SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
   149    149     if( iBio==NULL ) {
   150    150       ssl_set_errmsg("SSL: cannot open SSL (%s)", 
   151    151                       ERR_reason_error_string(ERR_get_error()));
   152    152       return 1;    
   153    153     }
   154    154     
   155         -  char *connStr = mprintf("%s:%d", g.urlName, g.urlPort);
          155  +  connStr = mprintf("%s:%d", g.urlName, g.urlPort);
   156    156     BIO_set_conn_hostname(iBio, connStr);
   157    157     free(connStr);
   158    158     
   159    159     if( BIO_do_connect(iBio)<=0 ){
   160    160       ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)", 
   161    161           g.urlName, g.urlPort, ERR_reason_error_string(ERR_get_error()));
   162    162       ssl_close();
................................................................................
   176    176       ssl_set_errmsg("No SSL certificate was presented by the peer");
   177    177       ssl_close();
   178    178       return 1;
   179    179     }
   180    180   
   181    181     if( SSL_get_verify_result(ssl) != X509_V_OK ){
   182    182       char *desc, *prompt;
          183  +    char *warning = "";
          184  +    Blob ans;
   183    185       BIO *mem;
   184    186       
   185    187       mem = BIO_new(BIO_s_mem());
   186    188       X509_NAME_print_ex(mem, X509_get_subject_name(cert), 2, XN_FLAG_MULTILINE);
   187    189       BIO_puts(mem, "\n\nIssued By:\n\n");
   188    190       X509_NAME_print_ex(mem, X509_get_issuer_name(cert), 2, XN_FLAG_MULTILINE);
   189    191       BIO_write(mem, "", 1); // null-terminate mem buffer
   190    192       BIO_get_mem_data(mem, &desc);
   191    193       
   192         -    char *warning = "";
   193    194       if( hasSavedCertificate ){
   194    195         warning = "WARNING: Certificate doesn't match the "
   195    196                   "saved certificate for this host!";
   196    197       }
   197    198       prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
   198    199                        "Accept certificate [a=always/y/N]? ", desc, warning);
   199    200       BIO_free(mem);
   200    201   
   201         -    Blob ans;
   202    202       prompt_user(prompt, &ans);
   203    203       free(prompt);
   204    204       if( blob_str(&ans)[0]!='y' && blob_str(&ans)[0]!='a' ) {
   205    205         X509_free(cert);
   206    206         ssl_set_errmsg("SSL certificate declined");
   207    207         ssl_close();
   208    208         return 1;

Changes to src/info.c.

   140    140     if( g.argc==2 ){
   141    141       int vid;
   142    142            /* 012345678901234 */
   143    143       db_record_repository_filename(0);
   144    144       printf("project-name: %s\n", db_get("project-name", "<unnamed>"));
   145    145       printf("repository:   %s\n", db_lget("repository", ""));
   146    146       printf("local-root:   %s\n", g.zLocalRoot);
   147         -#ifdef __MINGW32__
          147  +#if defined(_WIN32)
   148    148       if( g.zHome ){
   149    149         printf("user-home:    %s\n", g.zHome);
   150    150       }
   151    151   #endif
   152    152       printf("project-code: %s\n", db_get("project-code", ""));
   153    153       printf("server-code:  %s\n", db_get("server-code", ""));
   154    154       vid = db_lget_int("checkout", 0);

Changes to src/login.c.

    35     35   ** not really the point.  The anonymous login keeps search-engine
    36     36   ** crawlers and site download tools like wget from walking change
    37     37   ** logs and downloading diffs of very version of the archive that
    38     38   ** has ever existed, and things like that.
    39     39   */
    40     40   #include "config.h"
    41     41   #include "login.h"
    42         -#ifdef __MINGW32__
           42  +#if defined(_WIN32)  
    43     43   #  include <windows.h>           /* for Sleep */
    44         -#  define sleep Sleep            /* windows does not have sleep, but Sleep */
           44  +#  if defined(_MINGW32__) || defined(_MSC_VER)
           45  +#    define sleep Sleep            /* windows does not have sleep, but Sleep */
           46  +#  endif
    45     47   #endif
    46     48   #include <time.h>
    47     49   
    48     50   /*
    49     51   ** Return the name of the login cookie
    50     52   */
    51     53   static char *login_cookie_name(void){

Changes to src/main.c.

   630    630   ** zRepo might be a directory itself.  In that case chroot into
   631    631   ** the directory zRepo.
   632    632   **
   633    633   ** Assume the user-id and group-id of the repository, or if zRepo
   634    634   ** is a directory, of that directory.
   635    635   */
   636    636   static char *enter_chroot_jail(char *zRepo){
   637         -#if !defined(__MINGW32__)
          637  +#if !defined(_WIN32)
   638    638     if( getuid()==0 ){
   639    639       int i;
   640    640       struct stat sStat;
   641    641       Blob dir;
   642    642       char *zDir;
   643    643   
   644    644       file_canonical_name(zRepo, &dir);
................................................................................
   808    808     if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){
   809    809       zFile = g.argv[2];
   810    810     }else{
   811    811       zFile = g.argv[1];
   812    812     }
   813    813     g.httpOut = stdout;
   814    814     g.httpIn = stdin;
   815         -#ifdef __MINGW32__
          815  +#if defined(_WIN32)
   816    816     /* Set binary mode on windows to avoid undesired translations
   817    817     ** between \n and \r\n. */
   818    818     setmode(_fileno(g.httpOut), _O_BINARY);
   819    819     setmode(_fileno(g.httpIn), _O_BINARY);
   820    820   #endif
   821    821   #ifdef __EMX__
   822    822     /* Similar hack for OS/2 */
................................................................................
   951    951     find_server_repository(0);
   952    952     g.cgiOutput = 1;
   953    953     g.fullHttpReply = 1;
   954    954     cgi_handle_http_request(0);
   955    955     process_one_web_page(0);
   956    956   }
   957    957   
   958         -#ifndef __MINGW32__
          958  +#if !defined(_WIN32)
   959    959   #if !defined(__DARWIN__) && !defined(__APPLE__)
   960    960   /*
   961    961   ** Search for an executable on the PATH environment variable.
   962    962   ** Return true (1) if found and false (0) if not found.
   963    963   */
   964    964   static int binaryOnPath(const char *zBinary){
   965    965     const char *zPath = getenv("PATH");
................................................................................
  1007   1007     const char *zPort;        /* Value of the --port option */
  1008   1008     char *zBrowser;           /* Name of web browser program */
  1009   1009     char *zBrowserCmd = 0;    /* Command to launch the web browser */
  1010   1010     int isUiCmd;              /* True if command is "ui", not "server' */
  1011   1011     const char *zNotFound;    /* The --notfound option or NULL */
  1012   1012     int flags = 0;            /* Server flags */
  1013   1013   
  1014         -#ifdef __MINGW32__
         1014  +#if defined(_WIN32)
  1015   1015     const char *zStopperFile;    /* Name of file used to terminate server */
  1016   1016     zStopperFile = find_option("stopper", 0, 1);
  1017   1017   #endif
  1018   1018   
  1019   1019     g.thTrace = find_option("th-trace", 0, 0)!=0;
  1020   1020     if( g.thTrace ){
  1021   1021       blob_zero(&g.thLog);
................................................................................
  1028   1028     find_server_repository(isUiCmd);
  1029   1029     if( zPort ){
  1030   1030       iPort = mxPort = atoi(zPort);
  1031   1031     }else{
  1032   1032       iPort = db_get_int("http-port", 8080);
  1033   1033       mxPort = iPort+100;
  1034   1034     }
  1035         -#ifndef __MINGW32__
         1035  +#if !defined(_WIN32)
  1036   1036     /* Unix implementation */
  1037   1037     if( isUiCmd ){
  1038   1038   #if !defined(__DARWIN__) && !defined(__APPLE__)
  1039   1039       zBrowser = db_get("web-browser", 0);
  1040   1040       if( zBrowser==0 ){
  1041   1041         static char *azBrowserProg[] = { "xdg-open", "gnome-open", "firefox" };
  1042   1042         int i;

Changes to src/makeheaders.c.

    11     11   */
    12     12   #include <stdio.h>
    13     13   #include <stdlib.h>
    14     14   #include <ctype.h>
    15     15   #include <memory.h>
    16     16   #include <sys/stat.h>
    17     17   #include <assert.h>
    18         -#ifndef WIN32
    19         -# include <unistd.h>
    20         -#else
           18  +#if defined( __MINGW32__) ||  defined(__DMC__) || defined(_MSC_VER)
           19  +#  ifndef WIN32
           20  +#    define WIN32
           21  +#  endif
    21     22   # include <string.h>
           23  +#else
           24  +# include <unistd.h>
    22     25   #endif
    23     26   
    24     27   /*
    25     28   ** Macros for debugging.
    26     29   */
    27     30   #ifdef DEBUG
    28     31   static int debugMask = 0;

Changes to src/makemake.tcl.

    79     79     zip
    80     80     http_ssl
    81     81   }
    82     82   
    83     83   # Name of the final application
    84     84   #
    85     85   set name fossil
    86         -
           86  +if { 0 == $argc } {
    87     87   puts {# DO NOT EDIT
    88     88   #
    89     89   # This file is automatically generated.  Instead of editing this
    90     90   # file, edit "makemake.tcl" then run "tclsh makemake.tcl >main.mk"
    91     91   # to regenerate this file.
    92     92   #
    93     93   # This file is included by linux-gcc.mk or linux-mingw.mk or possible
................................................................................
   203    203   puts "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
   204    204   
   205    205   puts "\$(OBJDIR)/th.o:\t\$(SRCDIR)/th.c"
   206    206   puts "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o \$(OBJDIR)/th.o\n"
   207    207   
   208    208   puts "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c"
   209    209   puts "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n"
          210  +exit
          211  +}
          212  +if { "dmc" == [lindex $argv 0] } {
          213  +
          214  +puts {# DO NOT EDIT
          215  +#
          216  +# This file is automatically generated.  Instead of editing this
          217  +# file, edit "makemake.tcl" then run
          218  +# "tclsh src/makemake.tcl dmc > win/Makefile.dmc"
          219  +# to regenerate this file.
          220  +B      = ..
          221  +SRCDIR = $B\src
          222  +OBJDIR = .
          223  +O      = .obj
          224  +E      = .exe
          225  +
          226  +
          227  +# Maybe DMDIR, SSL or INCL needs adjustment
          228  +DMDIR  = c:\DM
          229  +INCL   = -I. -I$(SRCDIR) -I$B\win\include -I$(DMDIR)\extra\include
          230  +
          231  +#SSL   =  -DFOSSIL_ENABLE_SSL=1
          232  +SSL    =
          233  +
          234  +DMCDEF =  -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp
          235  +I18N   =  -DFOSSIL_I18N=0
          236  +
          237  +CFLAGS = -o 
          238  +BCC    = $(DMDIR)\bin\dmc $(CFLAGS)
          239  +TCC    = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(I18N) $(SSL) $(INCL)
          240  +LIBS   = $(DMDIR)\extra\lib\ zlib wsock32
          241  +}
          242  +puts -nonewline "SRC   = "
          243  +foreach s [lsort $src] {
          244  +  puts -nonewline "${s}_.c "
          245  +}
          246  +puts "\n"
          247  +puts -nonewline "OBJ   = "
          248  +foreach s [lsort $src] {
          249  +  puts -nonewline "\$(OBJDIR)\\$s\$O "
          250  +}
          251  +puts "\$(OBJDIR)\\sqlite3\$O \$(OBJDIR)\\th\$O \$(OBJDIR)\\th_lang\$O "
          252  +puts {
          253  +
          254  +APPNAME = $(OBJDIR)\fossil$(E)
          255  +
          256  +all: $(APPNAME)
          257  +
          258  +$(APPNAME) : translate$E mkindex$E headers  $(OBJ) $(OBJDIR)\link
          259  +	cd $(OBJDIR) 
          260  +	$(DMDIR)\bin\link @link
          261  +
          262  +$(OBJDIR)\link:}
          263  +puts -nonewline "\t+echo "
          264  +foreach s [lsort $src] {
          265  +  puts -nonewline "$s "
          266  +}
          267  +puts "sqlite3 th th_lang > \$@"
          268  +puts "\t+echo fossil >> \$@"
          269  +puts "\t+echo fossil >> \$@"
          270  +puts "\t+echo \$(LIBS) >> \$@\n\n"
          271  +
          272  +puts {
          273  +translate$E: $(SRCDIR)\translate.c
          274  +	$(BCC) -o$@ $**
          275  +
          276  +makeheaders$E: $(SRCDIR)\makeheaders.c
          277  +	$(BCC) -o$@ $**
          278  +
          279  +mkindex$E: $(SRCDIR)\mkindex.c
          280  +	$(BCC) -o$@ $**
          281  +
          282  +version$E: $B\win\version.c
          283  +	$(BCC) -o$@ $**
          284  +
          285  +$(OBJDIR)\sqlite3$O : $(SRCDIR)\sqlite3.c
          286  +	$(TCC) -o$@ -c -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 $**
          287  +
          288  +$(OBJDIR)\th$O : $(SRCDIR)\th.c
          289  +	$(TCC) -o$@ -c $**
          290  +
          291  +$(OBJDIR)\th_lang$O : $(SRCDIR)\th_lang.c
          292  +	$(TCC) -o$@ -c $**
          293  +
          294  +VERSION.h : version$E $B\manifest.uuid $B\manifest
          295  +	+$** > $@
          296  +
          297  +page_index.h: mkindex$E $(SRC) 
          298  +	+$** > $@
          299  +
          300  +clean:
          301  +	-del $(OBJDIR)\*.obj
          302  +	-del *.obj *_.c *.h *.map
          303  +
          304  +realclean:
          305  +	-del $(APPNAME) translate$E mkindex$E makeheaders$E version$E
          306  +
          307  +}
          308  +foreach s [lsort $src] {
          309  +  puts "\$(OBJDIR)\\$s\$O : ${s}_.c"
          310  +  puts "\t\$(TCC) -o\$@ -c \$**\n"
          311  +  puts "${s}_.c : \$(SRCDIR)\\$s.c"
          312  +  puts "\t+translate\$E \$** > \$@\n"
          313  +}
          314  +
          315  +puts -nonewline "headers: makeheaders\$E page_index.h VERSION.h\n\t +makeheaders\$E "
          316  +foreach s [lsort $src] {
          317  +  puts -nonewline "${s}_.c:$s.h "
          318  +}
          319  +puts "\$(SRCDIR)\\sqlite3.h \$(SRCDIR)\\th.h VERSION.h"
          320  +puts "\t@copy /Y nul: headers"
          321  +exit
          322  +}
          323  +
          324  +if { "msc" == [lindex $argv 0] } {
          325  +
          326  +puts {# DO NOT EDIT
          327  +#
          328  +# This file is automatically generated.  Instead of editing this
          329  +# file, edit "makemake.tcl" then run
          330  +# "tclsh src/makemake.tcl msc > win/Makefile.msc"
          331  +# to regenerate this file.
          332  +B      = ..
          333  +SRCDIR = $B\src
          334  +OBJDIR = .
          335  +O      = .obj
          336  +E      = .exe
          337  +
          338  +
          339  +# Maybe MSCDIR, SSL or INCL needs adjustment
          340  +MSCDIR = c:\msc
          341  +INCL   = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include
          342  +
          343  +#SSL   =  -DFOSSIL_ENABLE_SSL=1
          344  +SSL    =
          345  +
          346  +MSCDEF =  -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp
          347  +I18N   =  -DFOSSIL_I18N=0
          348  +
          349  +CFLAGS = -nologo -MD -O2 -Oy- -Zi
          350  +CFLAGS = -nologo -MT -O2
          351  +BCC    = $(CC) $(CFLAGS)
          352  +TCC    = $(CC) -c $(CFLAGS) $(MSCDEF) $(I18N) $(SSL) $(INCL)
          353  +LIBS   = zlib.lib ws2_32.lib
          354  +##SSL uncoment below
          355  +#LIBS   = zlib.lib ws2_32.lib ssleay32.lib libeay32.lib user32.lib gdi32.lib advapi32.lib
          356  +LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib
          357  +}
          358  +puts -nonewline "SRC   = "
          359  +foreach s [lsort $src] {
          360  +  puts -nonewline "${s}_.c "
          361  +}
          362  +puts "\n"
          363  +puts -nonewline "OBJ   = "
          364  +foreach s [lsort $src] {
          365  +  puts -nonewline "\$(OBJDIR)\\$s\$O "
          366  +}
          367  +puts "\$(OBJDIR)\\sqlite3\$O \$(OBJDIR)\\th\$O \$(OBJDIR)\\th_lang\$O "
          368  +puts {
          369  +
          370  +APPNAME = $(OBJDIR)\fossil$(E)
          371  +
          372  +all: $(OBJDIR) $(APPNAME)
          373  +
          374  +$(APPNAME) : translate$E mkindex$E headers  $(OBJ) $(OBJDIR)\link
          375  +	cd $(OBJDIR) 
          376  +	link -LINK -OUT:$@ $(LIBDIR) @link
          377  +
          378  +$(OBJDIR)\link:}
          379  +puts -nonewline "\techo "
          380  +foreach s [lsort $src] {
          381  +  puts -nonewline "$s "
          382  +}
          383  +puts "sqlite3 th th_lang > \$@"
          384  +puts "\techo \$(LIBS) >> \$@\n\n"
          385  +
          386  +puts {
          387  +
          388  +
          389  +$(OBJDIR):
          390  +	@-mkdir $@
          391  +
          392  +translate$E: $(SRCDIR)\translate.c
          393  +	$(BCC) $**
          394  +
          395  +makeheaders$E: $(SRCDIR)\makeheaders.c
          396  +	$(BCC) $**
          397  +
          398  +mkindex$E: $(SRCDIR)\mkindex.c
          399  +	$(BCC) $**
          400  +
          401  +version$E: $B\win\version.c
          402  +	$(BCC) $**
          403  +
          404  +$(OBJDIR)\sqlite3$O : $(SRCDIR)\sqlite3.c
          405  +	$(TCC) /Fo$@ -c -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 $**
          406  +
          407  +$(OBJDIR)\th$O : $(SRCDIR)\th.c
          408  +	$(TCC) /Fo$@ -c $**
          409  +
          410  +$(OBJDIR)\th_lang$O : $(SRCDIR)\th_lang.c
          411  +	$(TCC) /Fo$@ -c $**
          412  +
          413  +VERSION.h : version$E $B\manifest.uuid $B\manifest
          414  +	$** > $@
          415  +
          416  +page_index.h: mkindex$E $(SRC) 
          417  +	$** > $@
          418  +
          419  +clean:
          420  +	-del $(OBJDIR)\*.obj
          421  +	-del *.obj *_.c *.h *.map
          422  +
          423  +realclean:
          424  +	-del $(APPNAME) translate$E mkindex$E makeheaders$E version$E
          425  +
          426  +}
          427  +foreach s [lsort $src] {
          428  +  puts "\$(OBJDIR)\\$s\$O : ${s}_.c"
          429  +  puts "\t\$(TCC) /Fo\$@ -c \$**\n"
          430  +  puts "${s}_.c : \$(SRCDIR)\\$s.c"
          431  +  puts "\ttranslate\$E \$** > \$@\n"
          432  +}
          433  +
          434  +puts -nonewline "headers: makeheaders\$E page_index.h VERSION.h\n\tmakeheaders\$E "
          435  +foreach s [lsort $src] {
          436  +  puts -nonewline "${s}_.c:$s.h "
          437  +}
          438  +puts "\$(SRCDIR)\\sqlite3.h \$(SRCDIR)\\th.h VERSION.h"
          439  +puts "\t@copy /Y nul: headers"
          440  +	
          441  +}

Changes to src/popen.c.

    16     16   *******************************************************************************
    17     17   **
    18     18   ** This file contains an implementation of a bi-directional popen().
    19     19   */
    20     20   #include "config.h"
    21     21   #include "popen.h"
    22     22   
    23         -#ifdef __MINGW32__
           23  +#ifdef _WIN32
           24  +#include <windows.h>
           25  +#include <fcntl.h>
    24     26   /*
    25     27   ** Print a fatal error and quit.
    26     28   */
    27     29   static void win32_fatal_error(const char *zMsg){
    28     30     fossil_fatal("%s");
    29     31   }
    30     32   #endif
    31     33   
    32     34   
    33     35   
    34         -#ifdef __MINGW32__
           36  +#ifdef _WIN32
    35     37   /*
    36     38   ** On windows, create a child process and specify the stdin, stdout,
    37     39   ** and stderr channels for that process to use.
    38     40   **
    39     41   ** Return the number of errors.
    40     42   */
    41     43   static int win32_create_child_process(
................................................................................
    89     91   ** reads from *ppIn in order to receive input from the child.)
    90     92   ** Note that *ppIn is an unbuffered file descriptor, not a FILE.
    91     93   ** The process ID of the child is written into *pChildPid.
    92     94   **
    93     95   ** Return the number of errors.
    94     96   */
    95     97   int popen2(const char *zCmd, int *pfdIn, FILE **ppOut, int *pChildPid){
    96         -#ifdef __MINGW32__
           98  +#ifdef _WIN32
    97     99     HANDLE hStdinRd, hStdinWr, hStdoutRd, hStdoutWr, hStderr;
    98    100     SECURITY_ATTRIBUTES saAttr;    
    99    101     DWORD childPid;
   100    102     int fd;
   101    103   
   102    104     saAttr.nLength = sizeof(saAttr);
   103    105     saAttr.bInheritHandle = TRUE;
................................................................................
   112    114       win32_fatal_error("cannot create pipe for stdin");
   113    115     }
   114    116     SetHandleInformation( hStdinWr, HANDLE_FLAG_INHERIT, FALSE);
   115    117     
   116    118     win32_create_child_process((char*)zCmd, 
   117    119                                hStdinRd, hStdoutWr, hStderr,&childPid);
   118    120     *pChildPid = childPid;
   119         -  *pfdIn = _open_osfhandle(hStdoutRd, 0);
   120         -  fd = _open_osfhandle(hStdoutWr, 0);
          121  +  *pfdIn = _open_osfhandle((long)hStdoutRd, 0);
          122  +  fd = _open_osfhandle((long)hStdoutWr, 0);
   121    123     *ppOut = _fdopen(fd, "w");
   122    124     CloseHandle(hStdinRd); 
   123    125     CloseHandle(hStdoutWr);
   124    126     return 0;
   125    127   #else
   126    128     int pin[2], pout[2];
   127    129     *pfdIn = 0;
................................................................................
   169    171   }
   170    172   
   171    173   /*
   172    174   ** Close the connection to a child process previously created using
   173    175   ** popen2().  Kill off the child process, then close the pipes.
   174    176   */
   175    177   void pclose2(int fdIn, FILE *pOut, int childPid){
   176         -#ifdef __MINGW32__
          178  +#ifdef _WIN32
   177    179     /* Not implemented, yet */
   178    180   #else
   179    181     close(fdIn);
   180    182     fclose(pOut);
   181    183     kill(childPid, SIGINT);
   182    184   #endif
   183    185   }

Changes to src/rss.c.

    14     14   **   http://www.hwaci.com/drh/
    15     15   **
    16     16   *******************************************************************************
    17     17   **
    18     18   ** This file contains code used to create a RSS feed for the CGI interface.
    19     19   */
    20     20   #include "config.h"
           21  +#include <time.h>
    21     22   #include "rss.h"
    22     23   #include <assert.h>
    23         -#include <time.h>
    24     24   
    25     25   /*
    26     26   ** WEBPAGE: timeline.rss
    27     27   */
    28     28   void page_timeline_rss(void){
    29     29     Stmt q;
    30     30     int nLine=0;

Changes to src/sha1.c.

     1      1   /*
     2      2   ** This implementation of SHA1 is adapted from the example implementation
     3      3   ** contained in RFC-3174.
     4      4   */
     5         -#include <stdint.h>
     6         -#include <sys/types.h>
     7         -#include "config.h"
     8         -#include "sha1.h"
     9         -
    10      5   /*
    11      6    * If you do not have the ISO standard stdint.h header file, then you
    12      7    * must typdef the following:
    13      8    *    name              meaning
    14         - *  uint32_t         unsigned 32 bit integer
    15         - *  uint8_t          unsigned 8 bit integer (i.e., unsigned char)
    16         - *
    17         - */
            9  + *  */
           10  +#if defined(__DMC__) || defined(_MSC_VER)
           11  +  typedef  unsigned long uint32_t; //unsigned 32 bit integer
           12  +  typedef  unsigned char  uint8_t; //unsigned  8 bit integer (i.e., unsigned char)
           13  +#else
           14  +#  include <stdint.h>
           15  +#endif
           16  +#include <sys/types.h>
           17  +#include "config.h"
           18  +#include "sha1.h"
           19  +
    18     20   #define SHA1HashSize 20
    19     21   #define shaSuccess 0
    20     22   #define shaInputTooLong 1
    21     23   #define shaStateError 2
    22     24   
    23     25   /*
    24     26    *  This structure will hold context information for the SHA-1

Changes to src/style.c.

   395    395   }
   396    396   
   397    397   /*
   398    398   ** WEBPAGE: test_env
   399    399   */
   400    400   void page_test_env(void){
   401    401     style_header("Environment Test");
   402         -#if !defined(__MINGW32__)
          402  +#if !defined(_WIN32)
   403    403     @ uid=%d(getuid()), gid=%d(getgid())<br>
   404    404   #endif
   405    405     @ g.zBaseURL = %h(g.zBaseURL)<br>
   406    406     @ g.zTop = %h(g.zTop)<br>
   407         -  @ g.zRepositoryName = %h(g.zRepositoryName)<br>
   408    407     cgi_print_all();
   409    408     style_footer();
   410    409   }

Changes to src/user.c.

    37     37          break;
    38     38       }
    39     39       if( z[i]<' ' ) z[i] = ' ';
    40     40     }
    41     41     blob_append(pBlob, z, -1);
    42     42   }
    43     43   
    44         -#ifdef __MINGW32__
           44  +#if defined(_WIN32)
    45     45   /*
    46     46   ** getpass for Windows
    47     47   */
    48     48   static char *getpass(const char *prompt){
    49     49     static char pwd[64];
    50     50     size_t i;
    51     51   

Changes to src/vfile.c.

    17     17   **
    18     18   ** Procedures for managing the VFILE table.
    19     19   */
    20     20   #include "config.h"
    21     21   #include "vfile.h"
    22     22   #include <assert.h>
    23     23   #include <sys/types.h>
           24  +#if defined(__DMC__)
           25  +#include "dirent.h"
           26  +#else
    24     27   #include <dirent.h>
           28  +#endif
    25     29   
    26     30   /*
    27     31   ** Given a UUID, return the corresponding record ID.  If the UUID
    28     32   ** does not exist, then return 0.
    29     33   **
    30     34   ** For this routine, the UUID must be exact.  For a match against
    31     35   ** user input with mixed case, use resolve_uuid().

Changes to src/winhttp.c.

    14     14   **   http://www.hwaci.com/drh/
    15     15   **
    16     16   *******************************************************************************
    17     17   **
    18     18   ** This file implements a very simple (and low-performance) HTTP server
    19     19   ** for windows.
    20     20   */
    21         -#ifdef __MINGW32__           /* This code is for win32 only */
    22     21   #include "config.h"
           22  +#ifdef _WIN32
           23  +/* This code is for win32 only */
    23     24   #include "winhttp.h"
    24     25   #include <windows.h>
    25     26   
    26     27   /*
    27     28   ** The HttpRequest structure holds information about each incoming
    28     29   ** HTTP request.
    29     30   */
................................................................................
   218    219       p->zNotFound = zNotFoundOption;
   219    220       _beginthread(win32_process_one_http_request, 0, (void*)p);
   220    221     }
   221    222     closesocket(s);
   222    223     WSACleanup();
   223    224   }
   224    225   
   225         -#endif /* __MINGW32__  -- This code is for win32 only */
          226  +#endif /* _WIN32  -- This code is for win32 only */

Added win/Makefile.dmc.

            1  +# DO NOT EDIT
            2  +#
            3  +# This file is automatically generated.  Instead of editing this
            4  +# file, edit "makemake.tcl" then run
            5  +# "tclsh src/makemake.tcl dmc > win/Makefile.dmc"
            6  +# to regenerate this file.
            7  +B      = ..
            8  +SRCDIR = $B\src
            9  +OBJDIR = .
           10  +O      = .obj
           11  +E      = .exe
           12  +
           13  +
           14  +# Maybe DMDIR, SSL or INCL needs adjustment
           15  +DMDIR  = c:\DM
           16  +INCL   = -I. -I$(SRCDIR) -I$B\win\include -I$(DMDIR)\extra\include
           17  +
           18  +#SSL   =  -DFOSSIL_ENABLE_SSL=1
           19  +SSL    =
           20  +
           21  +DMCDEF =  -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp
           22  +I18N   =  -DFOSSIL_I18N=0
           23  +
           24  +CFLAGS = -o 
           25  +BCC    = $(DMDIR)\bin\dmc $(CFLAGS)
           26  +TCC    = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(I18N) $(SSL) $(INCL)
           27  +LIBS   = $(DMDIR)\extra\lib\ zlib wsock32
           28  +
           29  +SRC   = add_.c allrepo_.c attach_.c bag_.c blob_.c branch_.c browse_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c file_.c finfo_.c graph_.c http_.c http_socket_.c http_ssl_.c http_transport_.c info_.c login_.c main_.c manifest_.c md5_.c merge_.c merge3_.c name_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c stat_.c style_.c sync_.c tag_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c update_.c url_.c user_.c verify_.c vfile_.c wiki_.c wikiformat_.c winhttp_.c xfer_.c zip_.c 
           30  +
           31  +OBJ   = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\graph$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\info$O $(OBJDIR)\login$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\name$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winhttp$O $(OBJDIR)\xfer$O $(OBJDIR)\zip$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O 
           32  +
           33  +
           34  +APPNAME = $(OBJDIR)\fossil$(E)
           35  +
           36  +all: $(APPNAME)
           37  +
           38  +$(APPNAME) : translate$E mkindex$E headers  $(OBJ) $(OBJDIR)\link
           39  +	cd $(OBJDIR) 
           40  +	$(DMDIR)\bin\link @link
           41  +
           42  +$(OBJDIR)\link:
           43  +	+echo add allrepo attach bag blob branch browse captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode file finfo graph http http_socket http_ssl http_transport info login main manifest md5 merge merge3 name pivot popen pqueue printf rebuild report rss schema search setup sha1 shun skins stat style sync tag th_main timeline tkt tktsetup undo update url user verify vfile wiki wikiformat winhttp xfer zip sqlite3 th th_lang > $@
           44  +	+echo fossil >> $@
           45  +	+echo fossil >> $@
           46  +	+echo $(LIBS) >> $@
           47  +
           48  +
           49  +
           50  +translate$E: $(SRCDIR)\translate.c
           51  +	$(BCC) -o$@ $**
           52  +
           53  +makeheaders$E: $(SRCDIR)\makeheaders.c
           54  +	$(BCC) -o$@ $**
           55  +
           56  +mkindex$E: $(SRCDIR)\mkindex.c
           57  +	$(BCC) -o$@ $**
           58  +
           59  +version$E: $B\win\version.c
           60  +	$(BCC) -o$@ $**
           61  +
           62  +$(OBJDIR)\sqlite3$O : $(SRCDIR)\sqlite3.c
           63  +	$(TCC) -o$@ -c -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 $**
           64  +
           65  +$(OBJDIR)\th$O : $(SRCDIR)\th.c
           66  +	$(TCC) -o$@ -c $**
           67  +
           68  +$(OBJDIR)\th_lang$O : $(SRCDIR)\th_lang.c
           69  +	$(TCC) -o$@ -c $**
           70  +
           71  +VERSION.h : version$E $B\manifest.uuid $B\manifest
           72  +	+$** > $@
           73  +
           74  +page_index.h: mkindex$E $(SRC) 
           75  +	+$** > $@
           76  +
           77  +clean:
           78  +	-del $(OBJDIR)\*.obj
           79  +	-del *.obj *_.c *.h *.map
           80  +
           81  +realclean:
           82  +	-del $(APPNAME) translate$E mkindex$E makeheaders$E version$E
           83  +
           84  +
           85  +$(OBJDIR)\add$O : add_.c
           86  +	$(TCC) -o$@ -c $**
           87  +
           88  +add_.c : $(SRCDIR)\add.c
           89  +	+translate$E $** > $@
           90  +
           91  +$(OBJDIR)\allrepo$O : allrepo_.c
           92  +	$(TCC) -o$@ -c $**
           93  +
           94  +allrepo_.c : $(SRCDIR)\allrepo.c
           95  +	+translate$E $** > $@
           96  +
           97  +$(OBJDIR)\attach$O : attach_.c
           98  +	$(TCC) -o$@ -c $**
           99  +
          100  +attach_.c : $(SRCDIR)\attach.c
          101  +	+translate$E $** > $@
          102  +
          103  +$(OBJDIR)\bag$O : bag_.c
          104  +	$(TCC) -o$@ -c $**
          105  +
          106  +bag_.c : $(SRCDIR)\bag.c
          107  +	+translate$E $** > $@
          108  +
          109  +$(OBJDIR)\blob$O : blob_.c
          110  +	$(TCC) -o$@ -c $**
          111  +
          112  +blob_.c : $(SRCDIR)\blob.c
          113  +	+translate$E $** > $@
          114  +
          115  +$(OBJDIR)\branch$O : branch_.c
          116  +	$(TCC) -o$@ -c $**
          117  +
          118  +branch_.c : $(SRCDIR)\branch.c
          119  +	+translate$E $** > $@
          120  +
          121  +$(OBJDIR)\browse$O : browse_.c
          122  +	$(TCC) -o$@ -c $**
          123  +
          124  +browse_.c : $(SRCDIR)\browse.c
          125  +	+translate$E $** > $@
          126  +
          127  +$(OBJDIR)\captcha$O : captcha_.c
          128  +	$(TCC) -o$@ -c $**
          129  +
          130  +captcha_.c : $(SRCDIR)\captcha.c
          131  +	+translate$E $** > $@
          132  +
          133  +$(OBJDIR)\cgi$O : cgi_.c
          134  +	$(TCC) -o$@ -c $**
          135  +
          136  +cgi_.c : $(SRCDIR)\cgi.c
          137  +	+translate$E $** > $@
          138  +
          139  +$(OBJDIR)\checkin$O : checkin_.c
          140  +	$(TCC) -o$@ -c $**
          141  +
          142  +checkin_.c : $(SRCDIR)\checkin.c
          143  +	+translate$E $** > $@
          144  +
          145  +$(OBJDIR)\checkout$O : checkout_.c
          146  +	$(TCC) -o$@ -c $**
          147  +
          148  +checkout_.c : $(SRCDIR)\checkout.c
          149  +	+translate$E $** > $@
          150  +
          151  +$(OBJDIR)\clearsign$O : clearsign_.c
          152  +	$(TCC) -o$@ -c $**
          153  +
          154  +clearsign_.c : $(SRCDIR)\clearsign.c
          155  +	+translate$E $** > $@
          156  +
          157  +$(OBJDIR)\clone$O : clone_.c
          158  +	$(TCC) -o$@ -c $**
          159  +
          160  +clone_.c : $(SRCDIR)\clone.c
          161  +	+translate$E $** > $@
          162  +
          163  +$(OBJDIR)\comformat$O : comformat_.c
          164  +	$(TCC) -o$@ -c $**
          165  +
          166  +comformat_.c : $(SRCDIR)\comformat.c
          167  +	+translate$E $** > $@
          168  +
          169  +$(OBJDIR)\configure$O : configure_.c
          170  +	$(TCC) -o$@ -c $**
          171  +
          172  +configure_.c : $(SRCDIR)\configure.c
          173  +	+translate$E $** > $@
          174  +
          175  +$(OBJDIR)\content$O : content_.c
          176  +	$(TCC) -o$@ -c $**
          177  +
          178  +content_.c : $(SRCDIR)\content.c
          179  +	+translate$E $** > $@
          180  +
          181  +$(OBJDIR)\db$O : db_.c
          182  +	$(TCC) -o$@ -c $**
          183  +
          184  +db_.c : $(SRCDIR)\db.c
          185  +	+translate$E $** > $@
          186  +
          187  +$(OBJDIR)\delta$O : delta_.c
          188  +	$(TCC) -o$@ -c $**
          189  +
          190  +delta_.c : $(SRCDIR)\delta.c
          191  +	+translate$E $** > $@
          192  +
          193  +$(OBJDIR)\deltacmd$O : deltacmd_.c
          194  +	$(TCC) -o$@ -c $**
          195  +
          196  +deltacmd_.c : $(SRCDIR)\deltacmd.c
          197  +	+translate$E $** > $@
          198  +
          199  +$(OBJDIR)\descendants$O : descendants_.c
          200  +	$(TCC) -o$@ -c $**
          201  +
          202  +descendants_.c : $(SRCDIR)\descendants.c
          203  +	+translate$E $** > $@
          204  +
          205  +$(OBJDIR)\diff$O : diff_.c
          206  +	$(TCC) -o$@ -c $**
          207  +
          208  +diff_.c : $(SRCDIR)\diff.c
          209  +	+translate$E $** > $@
          210  +
          211  +$(OBJDIR)\diffcmd$O : diffcmd_.c
          212  +	$(TCC) -o$@ -c $**
          213  +
          214  +diffcmd_.c : $(SRCDIR)\diffcmd.c
          215  +	+translate$E $** > $@
          216  +
          217  +$(OBJDIR)\doc$O : doc_.c
          218  +	$(TCC) -o$@ -c $**
          219  +
          220  +doc_.c : $(SRCDIR)\doc.c
          221  +	+translate$E $** > $@
          222  +
          223  +$(OBJDIR)\encode$O : encode_.c
          224  +	$(TCC) -o$@ -c $**
          225  +
          226  +encode_.c : $(SRCDIR)\encode.c
          227  +	+translate$E $** > $@
          228  +
          229  +$(OBJDIR)\file$O : file_.c
          230  +	$(TCC) -o$@ -c $**
          231  +
          232  +file_.c : $(SRCDIR)\file.c
          233  +	+translate$E $** > $@
          234  +
          235  +$(OBJDIR)\finfo$O : finfo_.c
          236  +	$(TCC) -o$@ -c $**
          237  +
          238  +finfo_.c : $(SRCDIR)\finfo.c
          239  +	+translate$E $** > $@
          240  +
          241  +$(OBJDIR)\graph$O : graph_.c
          242  +	$(TCC) -o$@ -c $**
          243  +
          244  +graph_.c : $(SRCDIR)\graph.c
          245  +	+translate$E $** > $@
          246  +
          247  +$(OBJDIR)\http$O : http_.c
          248  +	$(TCC) -o$@ -c $**
          249  +
          250  +http_.c : $(SRCDIR)\http.c
          251  +	+translate$E $** > $@
          252  +
          253  +$(OBJDIR)\http_socket$O : http_socket_.c
          254  +	$(TCC) -o$@ -c $**
          255  +
          256  +http_socket_.c : $(SRCDIR)\http_socket.c
          257  +	+translate$E $** > $@
          258  +
          259  +$(OBJDIR)\http_ssl$O : http_ssl_.c
          260  +	$(TCC) -o$@ -c $**
          261  +
          262  +http_ssl_.c : $(SRCDIR)\http_ssl.c
          263  +	+translate$E $** > $@
          264  +
          265  +$(OBJDIR)\http_transport$O : http_transport_.c
          266  +	$(TCC) -o$@ -c $**
          267  +
          268  +http_transport_.c : $(SRCDIR)\http_transport.c
          269  +	+translate$E $** > $@
          270  +
          271  +$(OBJDIR)\info$O : info_.c
          272  +	$(TCC) -o$@ -c $**
          273  +
          274  +info_.c : $(SRCDIR)\info.c
          275  +	+translate$E $** > $@
          276  +
          277  +$(OBJDIR)\login$O : login_.c
          278  +	$(TCC) -o$@ -c $**
          279  +
          280  +login_.c : $(SRCDIR)\login.c
          281  +	+translate$E $** > $@
          282  +
          283  +$(OBJDIR)\main$O : main_.c
          284  +	$(TCC) -o$@ -c $**
          285  +
          286  +main_.c : $(SRCDIR)\main.c
          287  +	+translate$E $** > $@
          288  +
          289  +$(OBJDIR)\manifest$O : manifest_.c
          290  +	$(TCC) -o$@ -c $**
          291  +
          292  +manifest_.c : $(SRCDIR)\manifest.c
          293  +	+translate$E $** > $@
          294  +
          295  +$(OBJDIR)\md5$O : md5_.c
          296  +	$(TCC) -o$@ -c $**
          297  +
          298  +md5_.c : $(SRCDIR)\md5.c
          299  +	+translate$E $** > $@
          300  +
          301  +$(OBJDIR)\merge$O : merge_.c
          302  +	$(TCC) -o$@ -c $**
          303  +
          304  +merge_.c : $(SRCDIR)\merge.c
          305  +	+translate$E $** > $@
          306  +
          307  +$(OBJDIR)\merge3$O : merge3_.c
          308  +	$(TCC) -o$@ -c $**
          309  +
          310  +merge3_.c : $(SRCDIR)\merge3.c
          311  +	+translate$E $** > $@
          312  +
          313  +$(OBJDIR)\name$O : name_.c
          314  +	$(TCC) -o$@ -c $**
          315  +
          316  +name_.c : $(SRCDIR)\name.c
          317  +	+translate$E $** > $@
          318  +
          319  +$(OBJDIR)\pivot$O : pivot_.c
          320  +	$(TCC) -o$@ -c $**
          321  +
          322  +pivot_.c : $(SRCDIR)\pivot.c
          323  +	+translate$E $** > $@
          324  +
          325  +$(OBJDIR)\popen$O : popen_.c
          326  +	$(TCC) -o$@ -c $**
          327  +
          328  +popen_.c : $(SRCDIR)\popen.c
          329  +	+translate$E $** > $@
          330  +
          331  +$(OBJDIR)\pqueue$O : pqueue_.c
          332  +	$(TCC) -o$@ -c $**
          333  +
          334  +pqueue_.c : $(SRCDIR)\pqueue.c
          335  +	+translate$E $** > $@
          336  +
          337  +$(OBJDIR)\printf$O : printf_.c
          338  +	$(TCC) -o$@ -c $**
          339  +
          340  +printf_.c : $(SRCDIR)\printf.c
          341  +	+translate$E $** > $@
          342  +
          343  +$(OBJDIR)\rebuild$O : rebuild_.c
          344  +	$(TCC) -o$@ -c $**
          345  +
          346  +rebuild_.c : $(SRCDIR)\rebuild.c
          347  +	+translate$E $** > $@
          348  +
          349  +$(OBJDIR)\report$O : report_.c
          350  +	$(TCC) -o$@ -c $**
          351  +
          352  +report_.c : $(SRCDIR)\report.c
          353  +	+translate$E $** > $@
          354  +
          355  +$(OBJDIR)\rss$O : rss_.c
          356  +	$(TCC) -o$@ -c $**
          357  +
          358  +rss_.c : $(SRCDIR)\rss.c
          359  +	+translate$E $** > $@
          360  +
          361  +$(OBJDIR)\schema$O : schema_.c
          362  +	$(TCC) -o$@ -c $**
          363  +
          364  +schema_.c : $(SRCDIR)\schema.c
          365  +	+translate$E $** > $@
          366  +
          367  +$(OBJDIR)\search$O : search_.c
          368  +	$(TCC) -o$@ -c $**
          369  +
          370  +search_.c : $(SRCDIR)\search.c
          371  +	+translate$E $** > $@
          372  +
          373  +$(OBJDIR)\setup$O : setup_.c
          374  +	$(TCC) -o$@ -c $**
          375  +
          376  +setup_.c : $(SRCDIR)\setup.c
          377  +	+translate$E $** > $@
          378  +
          379  +$(OBJDIR)\sha1$O : sha1_.c
          380  +	$(TCC) -o$@ -c $**
          381  +
          382  +sha1_.c : $(SRCDIR)\sha1.c
          383  +	+translate$E $** > $@
          384  +
          385  +$(OBJDIR)\shun$O : shun_.c
          386  +	$(TCC) -o$@ -c $**
          387  +
          388  +shun_.c : $(SRCDIR)\shun.c
          389  +	+translate$E $** > $@
          390  +
          391  +$(OBJDIR)\skins$O : skins_.c
          392  +	$(TCC) -o$@ -c $**
          393  +
          394  +skins_.c : $(SRCDIR)\skins.c
          395  +	+translate$E $** > $@
          396  +
          397  +$(OBJDIR)\stat$O : stat_.c
          398  +	$(TCC) -o$@ -c $**
          399  +
          400  +stat_.c : $(SRCDIR)\stat.c
          401  +	+translate$E $** > $@
          402  +
          403  +$(OBJDIR)\style$O : style_.c
          404  +	$(TCC) -o$@ -c $**
          405  +
          406  +style_.c : $(SRCDIR)\style.c
          407  +	+translate$E $** > $@
          408  +
          409  +$(OBJDIR)\sync$O : sync_.c
          410  +	$(TCC) -o$@ -c $**
          411  +
          412  +sync_.c : $(SRCDIR)\sync.c
          413  +	+translate$E $** > $@
          414  +
          415  +$(OBJDIR)\tag$O : tag_.c
          416  +	$(TCC) -o$@ -c $**
          417  +
          418  +tag_.c : $(SRCDIR)\tag.c
          419  +	+translate$E $** > $@
          420  +
          421  +$(OBJDIR)\th_main$O : th_main_.c
          422  +	$(TCC) -o$@ -c $**
          423  +
          424  +th_main_.c : $(SRCDIR)\th_main.c
          425  +	+translate$E $** > $@
          426  +
          427  +$(OBJDIR)\timeline$O : timeline_.c
          428  +	$(TCC) -o$@ -c $**
          429  +
          430  +timeline_.c : $(SRCDIR)\timeline.c
          431  +	+translate$E $** > $@
          432  +
          433  +$(OBJDIR)\tkt$O : tkt_.c
          434  +	$(TCC) -o$@ -c $**
          435  +
          436  +tkt_.c : $(SRCDIR)\tkt.c
          437  +	+translate$E $** > $@
          438  +
          439  +$(OBJDIR)\tktsetup$O : tktsetup_.c
          440  +	$(TCC) -o$@ -c $**
          441  +
          442  +tktsetup_.c : $(SRCDIR)\tktsetup.c
          443  +	+translate$E $** > $@
          444  +
          445  +$(OBJDIR)\undo$O : undo_.c
          446  +	$(TCC) -o$@ -c $**
          447  +
          448  +undo_.c : $(SRCDIR)\undo.c
          449  +	+translate$E $** > $@
          450  +
          451  +$(OBJDIR)\update$O : update_.c
          452  +	$(TCC) -o$@ -c $**
          453  +
          454  +update_.c : $(SRCDIR)\update.c
          455  +	+translate$E $** > $@
          456  +
          457  +$(OBJDIR)\url$O : url_.c
          458  +	$(TCC) -o$@ -c $**
          459  +
          460  +url_.c : $(SRCDIR)\url.c
          461  +	+translate$E $** > $@
          462  +
          463  +$(OBJDIR)\user$O : user_.c
          464  +	$(TCC) -o$@ -c $**
          465  +
          466  +user_.c : $(SRCDIR)\user.c
          467  +	+translate$E $** > $@
          468  +
          469  +$(OBJDIR)\verify$O : verify_.c
          470  +	$(TCC) -o$@ -c $**
          471  +
          472  +verify_.c : $(SRCDIR)\verify.c
          473  +	+translate$E $** > $@
          474  +
          475  +$(OBJDIR)\vfile$O : vfile_.c
          476  +	$(TCC) -o$@ -c $**
          477  +
          478  +vfile_.c : $(SRCDIR)\vfile.c
          479  +	+translate$E $** > $@
          480  +
          481  +$(OBJDIR)\wiki$O : wiki_.c
          482  +	$(TCC) -o$@ -c $**
          483  +
          484  +wiki_.c : $(SRCDIR)\wiki.c
          485  +	+translate$E $** > $@
          486  +
          487  +$(OBJDIR)\wikiformat$O : wikiformat_.c
          488  +	$(TCC) -o$@ -c $**
          489  +
          490  +wikiformat_.c : $(SRCDIR)\wikiformat.c
          491  +	+translate$E $** > $@
          492  +
          493  +$(OBJDIR)\winhttp$O : winhttp_.c
          494  +	$(TCC) -o$@ -c $**
          495  +
          496  +winhttp_.c : $(SRCDIR)\winhttp.c
          497  +	+translate$E $** > $@
          498  +
          499  +$(OBJDIR)\xfer$O : xfer_.c
          500  +	$(TCC) -o$@ -c $**
          501  +
          502  +xfer_.c : $(SRCDIR)\xfer.c
          503  +	+translate$E $** > $@
          504  +
          505  +$(OBJDIR)\zip$O : zip_.c
          506  +	$(TCC) -o$@ -c $**
          507  +
          508  +zip_.c : $(SRCDIR)\zip.c
          509  +	+translate$E $** > $@
          510  +
          511  +headers: makeheaders$E page_index.h VERSION.h
          512  +	 +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h
          513  +	@copy /Y nul: headers

Added win/Makefile.msc.

            1  +# DO NOT EDIT
            2  +#
            3  +# This file is automatically generated.  Instead of editing this
            4  +# file, edit "makemake.tcl" then run
            5  +# "tclsh src/makemake.tcl msc > win/Makefile.msc"
            6  +# to regenerate this file.
            7  +B      = ..
            8  +SRCDIR = $B\src
            9  +OBJDIR = .
           10  +O      = .obj
           11  +E      = .exe
           12  +
           13  +
           14  +# Maybe MSCDIR, SSL or INCL needs adjustment
           15  +MSCDIR = c:\msc
           16  +INCL   = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include
           17  +
           18  +#SSL   =  -DFOSSIL_ENABLE_SSL=1
           19  +SSL    =
           20  +
           21  +MSCDEF =  -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp
           22  +I18N   =  -DFOSSIL_I18N=0
           23  +
           24  +CFLAGS = -nologo -MD -O2 -Oy- -Zi
           25  +CFLAGS = -nologo -MT -O2
           26  +BCC    = $(CC) $(CFLAGS)
           27  +TCC    = $(CC) -c $(CFLAGS) $(MSCDEF) $(I18N) $(SSL) $(INCL)
           28  +LIBS   = zlib.lib ws2_32.lib
           29  +##SSL uncoment below
           30  +#LIBS   = zlib.lib ws2_32.lib ssleay32.lib libeay32.lib user32.lib gdi32.lib advapi32.lib
           31  +LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib
           32  +
           33  +SRC   = add_.c allrepo_.c attach_.c bag_.c blob_.c branch_.c browse_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c file_.c finfo_.c graph_.c http_.c http_socket_.c http_ssl_.c http_transport_.c info_.c login_.c main_.c manifest_.c md5_.c merge_.c merge3_.c name_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c stat_.c style_.c sync_.c tag_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c update_.c url_.c user_.c verify_.c vfile_.c wiki_.c wikiformat_.c winhttp_.c xfer_.c zip_.c 
           34  +
           35  +OBJ   = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\graph$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\info$O $(OBJDIR)\login$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\name$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winhttp$O $(OBJDIR)\xfer$O $(OBJDIR)\zip$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O 
           36  +
           37  +
           38  +APPNAME = $(OBJDIR)\fossil$(E)
           39  +
           40  +all: $(OBJDIR) $(APPNAME)
           41  +
           42  +$(APPNAME) : translate$E mkindex$E headers  $(OBJ) $(OBJDIR)\link
           43  +	cd $(OBJDIR) 
           44  +	link -LINK -OUT:$@ $(LIBDIR) @link
           45  +
           46  +$(OBJDIR)\link:
           47  +	echo add allrepo attach bag blob branch browse captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode file finfo graph http http_socket http_ssl http_transport info login main manifest md5 merge merge3 name pivot popen pqueue printf rebuild report rss schema search setup sha1 shun skins stat style sync tag th_main timeline tkt tktsetup undo update url user verify vfile wiki wikiformat winhttp xfer zip sqlite3 th th_lang > $@
           48  +	echo $(LIBS) >> $@
           49  +
           50  +
           51  +
           52  +
           53  +
           54  +$(OBJDIR):
           55  +	@-mkdir $@
           56  +
           57  +translate$E: $(SRCDIR)\translate.c
           58  +	$(BCC) $**
           59  +
           60  +makeheaders$E: $(SRCDIR)\makeheaders.c
           61  +	$(BCC) $**
           62  +
           63  +mkindex$E: $(SRCDIR)\mkindex.c
           64  +	$(BCC) $**
           65  +
           66  +version$E: $B\win\version.c
           67  +	$(BCC) $**
           68  +
           69  +$(OBJDIR)\sqlite3$O : $(SRCDIR)\sqlite3.c
           70  +	$(TCC) /Fo$@ -c -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 $**
           71  +
           72  +$(OBJDIR)\th$O : $(SRCDIR)\th.c
           73  +	$(TCC) /Fo$@ -c $**
           74  +
           75  +$(OBJDIR)\th_lang$O : $(SRCDIR)\th_lang.c
           76  +	$(TCC) /Fo$@ -c $**
           77  +
           78  +VERSION.h : version$E $B\manifest.uuid $B\manifest
           79  +	$** > $@
           80  +
           81  +page_index.h: mkindex$E $(SRC) 
           82  +	$** > $@
           83  +
           84  +clean:
           85  +	-del $(OBJDIR)\*.obj
           86  +	-del *.obj *_.c *.h *.map
           87  +
           88  +realclean:
           89  +	-del $(APPNAME) translate$E mkindex$E makeheaders$E version$E
           90  +
           91  +
           92  +$(OBJDIR)\add$O : add_.c
           93  +	$(TCC) /Fo$@ -c $**
           94  +
           95  +add_.c : $(SRCDIR)\add.c
           96  +	translate$E $** > $@
           97  +
           98  +$(OBJDIR)\allrepo$O : allrepo_.c
           99  +	$(TCC) /Fo$@ -c $**
          100  +
          101  +allrepo_.c : $(SRCDIR)\allrepo.c
          102  +	translate$E $** > $@
          103  +
          104  +$(OBJDIR)\attach$O : attach_.c
          105  +	$(TCC) /Fo$@ -c $**
          106  +
          107  +attach_.c : $(SRCDIR)\attach.c
          108  +	translate$E $** > $@
          109  +
          110  +$(OBJDIR)\bag$O : bag_.c
          111  +	$(TCC) /Fo$@ -c $**
          112  +
          113  +bag_.c : $(SRCDIR)\bag.c
          114  +	translate$E $** > $@
          115  +
          116  +$(OBJDIR)\blob$O : blob_.c
          117  +	$(TCC) /Fo$@ -c $**
          118  +
          119  +blob_.c : $(SRCDIR)\blob.c
          120  +	translate$E $** > $@
          121  +
          122  +$(OBJDIR)\branch$O : branch_.c
          123  +	$(TCC) /Fo$@ -c $**
          124  +
          125  +branch_.c : $(SRCDIR)\branch.c
          126  +	translate$E $** > $@
          127  +
          128  +$(OBJDIR)\browse$O : browse_.c
          129  +	$(TCC) /Fo$@ -c $**
          130  +
          131  +browse_.c : $(SRCDIR)\browse.c
          132  +	translate$E $** > $@
          133  +
          134  +$(OBJDIR)\captcha$O : captcha_.c
          135  +	$(TCC) /Fo$@ -c $**
          136  +
          137  +captcha_.c : $(SRCDIR)\captcha.c
          138  +	translate$E $** > $@
          139  +
          140  +$(OBJDIR)\cgi$O : cgi_.c
          141  +	$(TCC) /Fo$@ -c $**
          142  +
          143  +cgi_.c : $(SRCDIR)\cgi.c
          144  +	translate$E $** > $@
          145  +
          146  +$(OBJDIR)\checkin$O : checkin_.c
          147  +	$(TCC) /Fo$@ -c $**
          148  +
          149  +checkin_.c : $(SRCDIR)\checkin.c
          150  +	translate$E $** > $@
          151  +
          152  +$(OBJDIR)\checkout$O : checkout_.c
          153  +	$(TCC) /Fo$@ -c $**
          154  +
          155  +checkout_.c : $(SRCDIR)\checkout.c
          156  +	translate$E $** > $@
          157  +
          158  +$(OBJDIR)\clearsign$O : clearsign_.c
          159  +	$(TCC) /Fo$@ -c $**
          160  +
          161  +clearsign_.c : $(SRCDIR)\clearsign.c
          162  +	translate$E $** > $@
          163  +
          164  +$(OBJDIR)\clone$O : clone_.c
          165  +	$(TCC) /Fo$@ -c $**
          166  +
          167  +clone_.c : $(SRCDIR)\clone.c
          168  +	translate$E $** > $@
          169  +
          170  +$(OBJDIR)\comformat$O : comformat_.c
          171  +	$(TCC) /Fo$@ -c $**
          172  +
          173  +comformat_.c : $(SRCDIR)\comformat.c
          174  +	translate$E $** > $@
          175  +
          176  +$(OBJDIR)\configure$O : configure_.c
          177  +	$(TCC) /Fo$@ -c $**
          178  +
          179  +configure_.c : $(SRCDIR)\configure.c
          180  +	translate$E $** > $@
          181  +
          182  +$(OBJDIR)\content$O : content_.c
          183  +	$(TCC) /Fo$@ -c $**
          184  +
          185  +content_.c : $(SRCDIR)\content.c
          186  +	translate$E $** > $@
          187  +
          188  +$(OBJDIR)\db$O : db_.c
          189  +	$(TCC) /Fo$@ -c $**
          190  +
          191  +db_.c : $(SRCDIR)\db.c
          192  +	translate$E $** > $@
          193  +
          194  +$(OBJDIR)\delta$O : delta_.c
          195  +	$(TCC) /Fo$@ -c $**
          196  +
          197  +delta_.c : $(SRCDIR)\delta.c
          198  +	translate$E $** > $@
          199  +
          200  +$(OBJDIR)\deltacmd$O : deltacmd_.c
          201  +	$(TCC) /Fo$@ -c $**
          202  +
          203  +deltacmd_.c : $(SRCDIR)\deltacmd.c
          204  +	translate$E $** > $@
          205  +
          206  +$(OBJDIR)\descendants$O : descendants_.c
          207  +	$(TCC) /Fo$@ -c $**
          208  +
          209  +descendants_.c : $(SRCDIR)\descendants.c
          210  +	translate$E $** > $@
          211  +
          212  +$(OBJDIR)\diff$O : diff_.c
          213  +	$(TCC) /Fo$@ -c $**
          214  +
          215  +diff_.c : $(SRCDIR)\diff.c
          216  +	translate$E $** > $@
          217  +
          218  +$(OBJDIR)\diffcmd$O : diffcmd_.c
          219  +	$(TCC) /Fo$@ -c $**
          220  +
          221  +diffcmd_.c : $(SRCDIR)\diffcmd.c
          222  +	translate$E $** > $@
          223  +
          224  +$(OBJDIR)\doc$O : doc_.c
          225  +	$(TCC) /Fo$@ -c $**
          226  +
          227  +doc_.c : $(SRCDIR)\doc.c
          228  +	translate$E $** > $@
          229  +
          230  +$(OBJDIR)\encode$O : encode_.c
          231  +	$(TCC) /Fo$@ -c $**
          232  +
          233  +encode_.c : $(SRCDIR)\encode.c
          234  +	translate$E $** > $@
          235  +
          236  +$(OBJDIR)\file$O : file_.c
          237  +	$(TCC) /Fo$@ -c $**
          238  +
          239  +file_.c : $(SRCDIR)\file.c
          240  +	translate$E $** > $@
          241  +
          242  +$(OBJDIR)\finfo$O : finfo_.c
          243  +	$(TCC) /Fo$@ -c $**
          244  +
          245  +finfo_.c : $(SRCDIR)\finfo.c
          246  +	translate$E $** > $@
          247  +
          248  +$(OBJDIR)\graph$O : graph_.c
          249  +	$(TCC) /Fo$@ -c $**
          250  +
          251  +graph_.c : $(SRCDIR)\graph.c
          252  +	translate$E $** > $@
          253  +
          254  +$(OBJDIR)\http$O : http_.c
          255  +	$(TCC) /Fo$@ -c $**
          256  +
          257  +http_.c : $(SRCDIR)\http.c
          258  +	translate$E $** > $@
          259  +
          260  +$(OBJDIR)\http_socket$O : http_socket_.c
          261  +	$(TCC) /Fo$@ -c $**
          262  +
          263  +http_socket_.c : $(SRCDIR)\http_socket.c
          264  +	translate$E $** > $@
          265  +
          266  +$(OBJDIR)\http_ssl$O : http_ssl_.c
          267  +	$(TCC) /Fo$@ -c $**
          268  +
          269  +http_ssl_.c : $(SRCDIR)\http_ssl.c
          270  +	translate$E $** > $@
          271  +
          272  +$(OBJDIR)\http_transport$O : http_transport_.c
          273  +	$(TCC) /Fo$@ -c $**
          274  +
          275  +http_transport_.c : $(SRCDIR)\http_transport.c
          276  +	translate$E $** > $@
          277  +
          278  +$(OBJDIR)\info$O : info_.c
          279  +	$(TCC) /Fo$@ -c $**
          280  +
          281  +info_.c : $(SRCDIR)\info.c
          282  +	translate$E $** > $@
          283  +
          284  +$(OBJDIR)\login$O : login_.c
          285  +	$(TCC) /Fo$@ -c $**
          286  +
          287  +login_.c : $(SRCDIR)\login.c
          288  +	translate$E $** > $@
          289  +
          290  +$(OBJDIR)\main$O : main_.c
          291  +	$(TCC) /Fo$@ -c $**
          292  +
          293  +main_.c : $(SRCDIR)\main.c
          294  +	translate$E $** > $@
          295  +
          296  +$(OBJDIR)\manifest$O : manifest_.c
          297  +	$(TCC) /Fo$@ -c $**
          298  +
          299  +manifest_.c : $(SRCDIR)\manifest.c
          300  +	translate$E $** > $@
          301  +
          302  +$(OBJDIR)\md5$O : md5_.c
          303  +	$(TCC) /Fo$@ -c $**
          304  +
          305  +md5_.c : $(SRCDIR)\md5.c
          306  +	translate$E $** > $@
          307  +
          308  +$(OBJDIR)\merge$O : merge_.c
          309  +	$(TCC) /Fo$@ -c $**
          310  +
          311  +merge_.c : $(SRCDIR)\merge.c
          312  +	translate$E $** > $@
          313  +
          314  +$(OBJDIR)\merge3$O : merge3_.c
          315  +	$(TCC) /Fo$@ -c $**
          316  +
          317  +merge3_.c : $(SRCDIR)\merge3.c
          318  +	translate$E $** > $@
          319  +
          320  +$(OBJDIR)\name$O : name_.c
          321  +	$(TCC) /Fo$@ -c $**
          322  +
          323  +name_.c : $(SRCDIR)\name.c
          324  +	translate$E $** > $@
          325  +
          326  +$(OBJDIR)\pivot$O : pivot_.c
          327  +	$(TCC) /Fo$@ -c $**
          328  +
          329  +pivot_.c : $(SRCDIR)\pivot.c
          330  +	translate$E $** > $@
          331  +
          332  +$(OBJDIR)\popen$O : popen_.c
          333  +	$(TCC) /Fo$@ -c $**
          334  +
          335  +popen_.c : $(SRCDIR)\popen.c
          336  +	translate$E $** > $@
          337  +
          338  +$(OBJDIR)\pqueue$O : pqueue_.c
          339  +	$(TCC) /Fo$@ -c $**
          340  +
          341  +pqueue_.c : $(SRCDIR)\pqueue.c
          342  +	translate$E $** > $@
          343  +
          344  +$(OBJDIR)\printf$O : printf_.c
          345  +	$(TCC) /Fo$@ -c $**
          346  +
          347  +printf_.c : $(SRCDIR)\printf.c
          348  +	translate$E $** > $@
          349  +
          350  +$(OBJDIR)\rebuild$O : rebuild_.c
          351  +	$(TCC) /Fo$@ -c $**
          352  +
          353  +rebuild_.c : $(SRCDIR)\rebuild.c
          354  +	translate$E $** > $@
          355  +
          356  +$(OBJDIR)\report$O : report_.c
          357  +	$(TCC) /Fo$@ -c $**
          358  +
          359  +report_.c : $(SRCDIR)\report.c
          360  +	translate$E $** > $@
          361  +
          362  +$(OBJDIR)\rss$O : rss_.c
          363  +	$(TCC) /Fo$@ -c $**
          364  +
          365  +rss_.c : $(SRCDIR)\rss.c
          366  +	translate$E $** > $@
          367  +
          368  +$(OBJDIR)\schema$O : schema_.c
          369  +	$(TCC) /Fo$@ -c $**
          370  +
          371  +schema_.c : $(SRCDIR)\schema.c
          372  +	translate$E $** > $@
          373  +
          374  +$(OBJDIR)\search$O : search_.c
          375  +	$(TCC) /Fo$@ -c $**
          376  +
          377  +search_.c : $(SRCDIR)\search.c
          378  +	translate$E $** > $@
          379  +
          380  +$(OBJDIR)\setup$O : setup_.c
          381  +	$(TCC) /Fo$@ -c $**
          382  +
          383  +setup_.c : $(SRCDIR)\setup.c
          384  +	translate$E $** > $@
          385  +
          386  +$(OBJDIR)\sha1$O : sha1_.c
          387  +	$(TCC) /Fo$@ -c $**
          388  +
          389  +sha1_.c : $(SRCDIR)\sha1.c
          390  +	translate$E $** > $@
          391  +
          392  +$(OBJDIR)\shun$O : shun_.c
          393  +	$(TCC) /Fo$@ -c $**
          394  +
          395  +shun_.c : $(SRCDIR)\shun.c
          396  +	translate$E $** > $@
          397  +
          398  +$(OBJDIR)\skins$O : skins_.c
          399  +	$(TCC) /Fo$@ -c $**
          400  +
          401  +skins_.c : $(SRCDIR)\skins.c
          402  +	translate$E $** > $@
          403  +
          404  +$(OBJDIR)\stat$O : stat_.c
          405  +	$(TCC) /Fo$@ -c $**
          406  +
          407  +stat_.c : $(SRCDIR)\stat.c
          408  +	translate$E $** > $@
          409  +
          410  +$(OBJDIR)\style$O : style_.c
          411  +	$(TCC) /Fo$@ -c $**
          412  +
          413  +style_.c : $(SRCDIR)\style.c
          414  +	translate$E $** > $@
          415  +
          416  +$(OBJDIR)\sync$O : sync_.c
          417  +	$(TCC) /Fo$@ -c $**
          418  +
          419  +sync_.c : $(SRCDIR)\sync.c
          420  +	translate$E $** > $@
          421  +
          422  +$(OBJDIR)\tag$O : tag_.c
          423  +	$(TCC) /Fo$@ -c $**
          424  +
          425  +tag_.c : $(SRCDIR)\tag.c
          426  +	translate$E $** > $@
          427  +
          428  +$(OBJDIR)\th_main$O : th_main_.c
          429  +	$(TCC) /Fo$@ -c $**
          430  +
          431  +th_main_.c : $(SRCDIR)\th_main.c
          432  +	translate$E $** > $@
          433  +
          434  +$(OBJDIR)\timeline$O : timeline_.c
          435  +	$(TCC) /Fo$@ -c $**
          436  +
          437  +timeline_.c : $(SRCDIR)\timeline.c
          438  +	translate$E $** > $@
          439  +
          440  +$(OBJDIR)\tkt$O : tkt_.c
          441  +	$(TCC) /Fo$@ -c $**
          442  +
          443  +tkt_.c : $(SRCDIR)\tkt.c
          444  +	translate$E $** > $@
          445  +
          446  +$(OBJDIR)\tktsetup$O : tktsetup_.c
          447  +	$(TCC) /Fo$@ -c $**
          448  +
          449  +tktsetup_.c : $(SRCDIR)\tktsetup.c
          450  +	translate$E $** > $@
          451  +
          452  +$(OBJDIR)\undo$O : undo_.c
          453  +	$(TCC) /Fo$@ -c $**
          454  +
          455  +undo_.c : $(SRCDIR)\undo.c
          456  +	translate$E $** > $@
          457  +
          458  +$(OBJDIR)\update$O : update_.c
          459  +	$(TCC) /Fo$@ -c $**
          460  +
          461  +update_.c : $(SRCDIR)\update.c
          462  +	translate$E $** > $@
          463  +
          464  +$(OBJDIR)\url$O : url_.c
          465  +	$(TCC) /Fo$@ -c $**
          466  +
          467  +url_.c : $(SRCDIR)\url.c
          468  +	translate$E $** > $@
          469  +
          470  +$(OBJDIR)\user$O : user_.c
          471  +	$(TCC) /Fo$@ -c $**
          472  +
          473  +user_.c : $(SRCDIR)\user.c
          474  +	translate$E $** > $@
          475  +
          476  +$(OBJDIR)\verify$O : verify_.c
          477  +	$(TCC) /Fo$@ -c $**
          478  +
          479  +verify_.c : $(SRCDIR)\verify.c
          480  +	translate$E $** > $@
          481  +
          482  +$(OBJDIR)\vfile$O : vfile_.c
          483  +	$(TCC) /Fo$@ -c $**
          484  +
          485  +vfile_.c : $(SRCDIR)\vfile.c
          486  +	translate$E $** > $@
          487  +
          488  +$(OBJDIR)\wiki$O : wiki_.c
          489  +	$(TCC) /Fo$@ -c $**
          490  +
          491  +wiki_.c : $(SRCDIR)\wiki.c
          492  +	translate$E $** > $@
          493  +
          494  +$(OBJDIR)\wikiformat$O : wikiformat_.c
          495  +	$(TCC) /Fo$@ -c $**
          496  +
          497  +wikiformat_.c : $(SRCDIR)\wikiformat.c
          498  +	translate$E $** > $@
          499  +
          500  +$(OBJDIR)\winhttp$O : winhttp_.c
          501  +	$(TCC) /Fo$@ -c $**
          502  +
          503  +winhttp_.c : $(SRCDIR)\winhttp.c
          504  +	translate$E $** > $@
          505  +
          506  +$(OBJDIR)\xfer$O : xfer_.c
          507  +	$(TCC) /Fo$@ -c $**
          508  +
          509  +xfer_.c : $(SRCDIR)\xfer.c
          510  +	translate$E $** > $@
          511  +
          512  +$(OBJDIR)\zip$O : zip_.c
          513  +	$(TCC) /Fo$@ -c $**
          514  +
          515  +zip_.c : $(SRCDIR)\zip.c
          516  +	translate$E $** > $@
          517  +
          518  +headers: makeheaders$E page_index.h VERSION.h
          519  +	makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h
          520  +	@copy /Y nul: headers

Added win/include/dirent.h.

            1  +/*****************************************************************************
            2  + * dirent.h - dirent API for Microsoft Visual Studio
            3  + *
            4  + * Copyright (C) 2006 Toni Ronkko
            5  + *
            6  + * Permission is hereby granted, free of charge, to any person obtaining
            7  + * a copy of this software and associated documentation files (the
            8  + * ``Software''), to deal in the Software without restriction, including
            9  + * without limitation the rights to use, copy, modify, merge, publish,
           10  + * distribute, sublicense, and/or sell copies of the Software, and to
           11  + * permit persons to whom the Software is furnished to do so, subject to
           12  + * the following conditions:
           13  + *
           14  + * The above copyright notice and this permission notice shall be included
           15  + * in all copies or substantial portions of the Software.
           16  + *
           17  + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
           18  + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
           19  + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
           20  + * IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR
           21  + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
           22  + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
           23  + * OTHER DEALINGS IN THE SOFTWARE.
           24  + *
           25  + * Dec 15, 2009, John Cunningham
           26  + * Added rewinddir member function
           27  + *
           28  + * Jan 18, 2008, Toni Ronkko
           29  + * Using FindFirstFileA and WIN32_FIND_DATAA to avoid converting string
           30  + * between multi-byte and unicode representations.  This makes the
           31  + * code simpler and also allows the code to be compiled under MingW.  Thanks
           32  + * to Azriel Fasten for the suggestion.
           33  + *
           34  + * Mar 4, 2007, Toni Ronkko
           35  + * Bug fix: due to the strncpy_s() function this file only compiled in
           36  + * Visual Studio 2005.  Using the new string functions only when the
           37  + * compiler version allows.
           38  + *
           39  + * Nov  2, 2006, Toni Ronkko
           40  + * Major update: removed support for Watcom C, MS-DOS and Turbo C to
           41  + * simplify the file, updated the code to compile cleanly on Visual
           42  + * Studio 2005 with both unicode and multi-byte character strings,
           43  + * removed rewinddir() as it had a bug.
           44  + *
           45  + * Aug 20, 2006, Toni Ronkko
           46  + * Removed all remarks about MSVC 1.0, which is antiqued now.  Simplified
           47  + * comments by removing SGML tags.
           48  + *
           49  + * May 14 2002, Toni Ronkko
           50  + * Embedded the function definitions directly to the header so that no
           51  + * source modules need to be included in the Visual Studio project.  Removed
           52  + * all the dependencies to other projects so that this very header can be
           53  + * used independently.
           54  + *
           55  + * May 28 1998, Toni Ronkko
           56  + * First version.
           57  + *****************************************************************************/
           58  +#ifndef DIRENT_H
           59  +#define DIRENT_H
           60  +
           61  +#include <windows.h>
           62  +#include <string.h>
           63  +#include <assert.h>
           64  +
           65  +
           66  +typedef struct dirent
           67  +{
           68  +   char d_name[MAX_PATH + 1]; /* current dir entry (multi-byte char string) */
           69  +   WIN32_FIND_DATAA data;     /* file attributes */
           70  +}  dirent;
           71  +
           72  +
           73  +typedef struct DIR
           74  +{
           75  +   dirent current;            /* Current directory entry */
           76  +   int    cached;             /* Indicates un-processed entry in memory */
           77  +   HANDLE search_handle;      /* File search handle */
           78  +   char   patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */
           79  +} DIR;
           80  +
           81  +
           82  +/* Forward declarations */
           83  +static DIR *opendir (const char *dirname);
           84  +static struct dirent *readdir (DIR *dirp);
           85  +static int closedir (DIR *dirp);
           86  +static void rewinddir(DIR* dirp);
           87  +
           88  +
           89  +/* Use the new safe string functions introduced in Visual Studio 2005 */
           90  +#if defined(_MSC_VER) && _MSC_VER >= 1400
           91  +# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
           92  +#else
           93  +# define STRNCPY(dest,src,size) strncpy((dest),(src),(size))
           94  +#endif
           95  +
           96  +
           97  +/*****************************************************************************
           98  + * Open directory stream DIRNAME for read and return a pointer to the
           99  + * internal working area that is used to retrieve individual directory
          100  + * entries.
          101  + */
          102  +static DIR *opendir(const char *dirname)
          103  +{
          104  +   DIR *dirp;
          105  +   assert (dirname != NULL);
          106  +   assert (strlen (dirname) < MAX_PATH);
          107  +
          108  +   /* construct new DIR structure */
          109  +   dirp = (DIR*) malloc (sizeof (struct DIR));
          110  +   if (dirp != NULL) {
          111  +      char *p;
          112  +
          113  +      /* take directory name... */
          114  +      STRNCPY (dirp->patt, dirname, sizeof(dirp->patt));
          115  +      dirp->patt[MAX_PATH] = '\0';
          116  +
          117  +      /* ... and append search pattern to it */
          118  +      p = strchr (dirp->patt, '\0');
          119  +      if (dirp->patt < p  &&  *(p-1) != '\\'  &&  *(p-1) != ':') {
          120  +         *p++ = '\\';
          121  +      }
          122  +      *p++ = '*';
          123  +      *p = '\0';
          124  +
          125  +      /* open stream and retrieve first file */
          126  +      dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
          127  +      if (dirp->search_handle == INVALID_HANDLE_VALUE) {
          128  +         /* invalid search pattern? */
          129  +         free (dirp);
          130  +         return NULL;
          131  +      }
          132  +
          133  +      /* there is an un-processed directory entry in memory now */
          134  +      dirp->cached = 1;
          135  +   }
          136  +
          137  +   return dirp;
          138  +}
          139  +
          140  +
          141  +/*****************************************************************************
          142  + * Read a directory entry, and return a pointer to a dirent structure
          143  + * containing the name of the entry in d_name field.  Individual directory
          144  + * entries returned by this very function include regular files,
          145  + * sub-directories, pseudo-directories "." and "..", but also volume labels,
          146  + * hidden files and system files may be returned.
          147  + */
          148  +static struct dirent *readdir(DIR *dirp)
          149  +{
          150  +   assert (dirp != NULL);
          151  +
          152  +   if (dirp->search_handle == INVALID_HANDLE_VALUE) {
          153  +      /* directory stream was opened/rewound incorrectly or ended normally */
          154  +      return NULL;
          155  +   }
          156  +
          157  +   /* get next directory entry */
          158  +   if (dirp->cached != 0) {
          159  +      /* a valid directory entry already in memory */
          160  +      dirp->cached = 0;
          161  +   } else {
          162  +      /* read next directory entry from disk */
          163  +      if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) {
          164  +         /* the very last file has been processed or an error occured */
          165  +         FindClose (dirp->search_handle);
          166  +         dirp->search_handle = INVALID_HANDLE_VALUE;
          167  +         return NULL;
          168  +      }
          169  +   }
          170  +
          171  +   /* copy as a multibyte character string */
          172  +   STRNCPY ( dirp->current.d_name,
          173  +             dirp->current.data.cFileName,
          174  +             sizeof(dirp->current.d_name) );
          175  +   dirp->current.d_name[MAX_PATH] = '\0';
          176  +
          177  +   return &dirp->current;
          178  +}
          179  +
          180  +
          181  +/*****************************************************************************
          182  + * Close directory stream opened by opendir() function.  Close of the
          183  + * directory stream invalidates the DIR structure as well as any previously
          184  + * read directory entry.
          185  + */
          186  +static int closedir(DIR *dirp)
          187  +{
          188  +   assert (dirp != NULL);
          189  +
          190  +   /* release search handle */
          191  +   if (dirp->search_handle != INVALID_HANDLE_VALUE) {
          192  +      FindClose (dirp->search_handle);
          193  +      dirp->search_handle = INVALID_HANDLE_VALUE;
          194  +   }
          195  +
          196  +   /* release directory handle */
          197  +   free (dirp);
          198  +   return 0;
          199  +}
          200  +
          201  +
          202  +/*****************************************************************************
          203  + * Resets the position of the directory stream to which dirp refers to the
          204  + * beginning of the directory. It also causes the directory stream to refer
          205  + * to the current state of the corresponding directory, as a call to opendir()
          206  + * would have done. If dirp does not refer to a directory stream, the effect
          207  + * is undefined.
          208  + */
          209  +static void rewinddir(DIR* dirp)
          210  +{
          211  +   /* release search handle */
          212  +   if (dirp->search_handle != INVALID_HANDLE_VALUE) {
          213  +      FindClose (dirp->search_handle);
          214  +      dirp->search_handle = INVALID_HANDLE_VALUE;
          215  +   }
          216  +
          217  +   /* open new search handle and retrieve first file */
          218  +   dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
          219  +   if (dirp->search_handle == INVALID_HANDLE_VALUE) {
          220  +      /* invalid search pattern? */
          221  +      free (dirp);
          222  +      return;
          223  +   }
          224  +
          225  +   /* there is an un-processed directory entry in memory now */
          226  +   dirp->cached = 1;
          227  +}
          228  +
          229  +
          230  +#endif /*DIRENT_H*/

Added win/include/unistd.h.

            1  +#ifndef _UNISTD_H
            2  +#define _UNISTD_H	 1
            3  +
            4  +/* This file intended to serve as a drop-in replacement for 
            5  + *  unistd.h on Windows
            6  + *  Please add functionality as neeeded 
            7  + */
            8  +
            9  +#include <stdlib.h>
           10  +#include <io.h>
           11  +#define srandom srand
           12  +#define random rand
           13  +#if defined(__DMC__)
           14  +#endif
           15  +
           16  +#if defined(_WIN32)
           17  +#define _CRT_SECURE_NO_WARNINGS 1
           18  +
           19  +#ifndef F_OK
           20  +#define F_OK 0
           21  +#endif /* not F_OK */
           22  +
           23  +#ifndef X_OK
           24  +#define X_OK 1
           25  +#endif /* not X_OK */
           26  +
           27  +#ifndef R_OK
           28  +#define R_OK 2
           29  +#endif /* not R_OK */
           30  +
           31  +#ifndef W_OK
           32  +#define W_OK 4
           33  +#endif /* not W_OK */
           34  +
           35  +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
           36  +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
           37  +
           38  +
           39  +
           40  +#endif
           41  +
           42  +#define access _access
           43  +#define ftruncate _chsize
           44  +
           45  +#define ssize_t int
           46  +
           47  +#endif /* unistd.h  */

Added win/version.c.

            1  +#include <stdio.h>
            2  +
            3  +int main(int argc, char *argv[]){
            4  +    FILE *m,*u;
            5  +    char b[10240];
            6  +    u = fopen(argv[1],"r");
            7  +    fgets(b, sizeof(b)-1,u);
            8  +    b[strlen(b)-1] =0;
            9  +    printf("#define MANIFEST_UUID \"%s\"\n",b);
           10  +    printf("#define MANIFEST_VERSION \"[%10.10s]\"\n",b);
           11  +    m = fopen(argv[2],"r");
           12  +    while(b ==  fgets(b, sizeof(b)-1,m)){
           13  +        if(0 == strncmp("D ",b,2)){
           14  +            printf("#define MANIFEST_DATE \"%.10s %.8s\"\n",b+2,b+13);
           15  +            return 0;
           16  +        }
           17  +    }
           18  +    return 1;
           19  +}