Changeset 1656


Ignore:
Timestamp:
Jul 20, 2012, 2:36:24 PM (11 years ago)
Author:
sam
Message:

neercs: start porting the old code to Windows; this breaks the Visual Studio
build until further fixes are made.

Location:
trunk
Files:
28 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/build/vs2010/Lol.sln

    r1643 r1656  
    324324                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Debug|PS3.ActiveCfg = Debug|PS3
    325325                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Debug|Win32.ActiveCfg = Debug|Win32
     326                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Debug|Win32.Build.0 = Debug|Win32
    326327                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Debug|x64.ActiveCfg = Debug|x64
     328                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Debug|x64.Build.0 = Debug|x64
    327329                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360
    328330                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Release|PS3.ActiveCfg = Release|PS3
    329331                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Release|Win32.ActiveCfg = Release|Win32
     332                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Release|Win32.Build.0 = Release|Win32
    330333                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Release|x64.ActiveCfg = Release|x64
     334                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Release|x64.Build.0 = Release|x64
    331335                {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233}.Release|Xbox 360.ActiveCfg = Release|Xbox 360
    332336                {EE203B88-44CF-4859-9D42-7A5F43FECB52}.Debug|PS3.ActiveCfg = Debug|PS3
     
    404408                {B92ABADC-45BE-4CC5-B724-9426053123A1} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
    405409                {7B083DA2-FE08-4F6D-BFDD-195D5C2783EB} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
     410                {1C5B8702-290C-42DA-AA9E-671348F5B747} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
    406411                {6BF81B39-EDC2-4227-9992-C2D8ABEA95AF} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
    407412                {BCEE0132-8E24-49BE-AFEB-96DAD14396BA} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
    408                 {1C5B8702-290C-42DA-AA9E-671348F5B747} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
    409413                {32F3F8CF-D22E-45E4-BEB8-AD909E8C5515} = {33704AA4-F2B5-4138-A40D-E3E77F89ED46}
    410414                {EE203B88-44CF-4859-9D42-7A5F40FECB52} = {8C77EAA8-1077-4EF7-AE53-97C6C60A3601}
  • trunk/tools/neercs/Makefile.am

    r1643 r1656  
    6262    old/widgets.c \
    6363    old/widgets.h \
    64     old/wm.c
     64    old/wm.cpp
  • trunk/tools/neercs/neercs.vcxproj

    r1639 r1656  
    3737  <ItemGroup>
    3838    <ClInclude Include="neercs.h" />
     39    <ClInclude Include="old\mygetopt.h" />
     40    <ClInclude Include="old\mytrace.h" />
     41    <ClInclude Include="old\neercs.h" />
     42    <ClInclude Include="old\python\py_module.h" />
     43    <ClInclude Include="old\widgets.h" />
    3944    <ClInclude Include="video\render.h" />
    4045    <ClInclude Include="video\text-render.h" />
     
    4247  <ItemGroup>
    4348    <ClCompile Include="neercs.cpp" />
     49    <ClCompile Include="old\actions.c" />
     50    <ClCompile Include="old\ansi.c" />
     51    <ClCompile Include="old\attach.c" />
     52    <ClCompile Include="old\client.c" />
     53    <ClCompile Include="old\configuration.c" />
     54    <ClCompile Include="old\effects.c" />
     55    <ClCompile Include="old\grab.c" />
     56    <ClCompile Include="old\help.c" />
     57    <ClCompile Include="old\input.c" />
     58    <ClCompile Include="old\lock.c" />
     59    <ClCompile Include="old\main.c" />
     60    <ClCompile Include="old\mygetopt.c" />
     61    <ClCompile Include="old\mytrace.c" />
     62    <ClCompile Include="old\python\interpreter.c" />
     63    <ClCompile Include="old\python\py_module.c" />
     64    <ClCompile Include="old\recurrent.c" />
     65    <ClCompile Include="old\screens.c" />
     66    <ClCompile Include="old\screensaver.c" />
     67    <ClCompile Include="old\screen_list.c" />
     68    <ClCompile Include="old\server.c" />
     69    <ClCompile Include="old\term.c" />
     70    <ClCompile Include="old\widgets.c" />
     71    <ClCompile Include="old\wm.cpp" />
    4472    <ClCompile Include="video\render.cpp" />
    4573    <ClCompile Include="video\text-render.cpp" />
  • trunk/tools/neercs/neercs.vcxproj.filters

    r1639 r1656  
    99      <Filter>video</Filter>
    1010    </ClCompile>
     11    <ClCompile Include="old\actions.c">
     12      <Filter>old</Filter>
     13    </ClCompile>
     14    <ClCompile Include="old\ansi.c">
     15      <Filter>old</Filter>
     16    </ClCompile>
     17    <ClCompile Include="old\attach.c">
     18      <Filter>old</Filter>
     19    </ClCompile>
     20    <ClCompile Include="old\client.c">
     21      <Filter>old</Filter>
     22    </ClCompile>
     23    <ClCompile Include="old\configuration.c">
     24      <Filter>old</Filter>
     25    </ClCompile>
     26    <ClCompile Include="old\effects.c">
     27      <Filter>old</Filter>
     28    </ClCompile>
     29    <ClCompile Include="old\grab.c">
     30      <Filter>old</Filter>
     31    </ClCompile>
     32    <ClCompile Include="old\help.c">
     33      <Filter>old</Filter>
     34    </ClCompile>
     35    <ClCompile Include="old\input.c">
     36      <Filter>old</Filter>
     37    </ClCompile>
     38    <ClCompile Include="old\lock.c">
     39      <Filter>old</Filter>
     40    </ClCompile>
     41    <ClCompile Include="old\main.c">
     42      <Filter>old</Filter>
     43    </ClCompile>
     44    <ClCompile Include="old\mygetopt.c">
     45      <Filter>old</Filter>
     46    </ClCompile>
     47    <ClCompile Include="old\mytrace.c">
     48      <Filter>old</Filter>
     49    </ClCompile>
     50    <ClCompile Include="old\recurrent.c">
     51      <Filter>old</Filter>
     52    </ClCompile>
     53    <ClCompile Include="old\screen_list.c">
     54      <Filter>old</Filter>
     55    </ClCompile>
     56    <ClCompile Include="old\screens.c">
     57      <Filter>old</Filter>
     58    </ClCompile>
     59    <ClCompile Include="old\screensaver.c">
     60      <Filter>old</Filter>
     61    </ClCompile>
     62    <ClCompile Include="old\server.c">
     63      <Filter>old</Filter>
     64    </ClCompile>
     65    <ClCompile Include="old\term.c">
     66      <Filter>old</Filter>
     67    </ClCompile>
     68    <ClCompile Include="old\widgets.c">
     69      <Filter>old</Filter>
     70    </ClCompile>
     71    <ClCompile Include="old\wm.cpp">
     72      <Filter>old</Filter>
     73    </ClCompile>
     74    <ClCompile Include="old\python\interpreter.c">
     75      <Filter>old\python</Filter>
     76    </ClCompile>
     77    <ClCompile Include="old\python\py_module.c">
     78      <Filter>old\python</Filter>
     79    </ClCompile>
    1180  </ItemGroup>
    1281  <ItemGroup>
     
    1887      <Filter>video</Filter>
    1988    </ClInclude>
     89    <ClInclude Include="old\mygetopt.h">
     90      <Filter>old</Filter>
     91    </ClInclude>
     92    <ClInclude Include="old\mytrace.h">
     93      <Filter>old</Filter>
     94    </ClInclude>
     95    <ClInclude Include="old\neercs.h">
     96      <Filter>old</Filter>
     97    </ClInclude>
     98    <ClInclude Include="old\widgets.h">
     99      <Filter>old</Filter>
     100    </ClInclude>
     101    <ClInclude Include="old\python\py_module.h">
     102      <Filter>old\python</Filter>
     103    </ClInclude>
    20104  </ItemGroup>
    21105  <ItemGroup>
    22106    <Filter Include="video">
    23107      <UniqueIdentifier>{8598edd6-ce35-4250-b16e-4237b34ebd2a}</UniqueIdentifier>
     108    </Filter>
     109    <Filter Include="old">
     110      <UniqueIdentifier>{ac200501-b60f-4451-9005-a29f3cf9bf75}</UniqueIdentifier>
     111    </Filter>
     112    <Filter Include="old\python">
     113      <UniqueIdentifier>{9140687d-c5b2-4302-8121-9b12ebf3908e}</UniqueIdentifier>
    24114    </Filter>
    25115  </ItemGroup>
  • trunk/tools/neercs/old/actions.c

    r1642 r1656  
    1313 */
    1414
    15 #include "config.h"
     15#if defined HAVE_CONFIG_H
     16#   include "config.h"
     17#endif
     18
    1619#include <caca.h>
    1720#include <errno.h>
  • trunk/tools/neercs/old/ansi.c

    r1642 r1656  
    1212 *  http://sam.zoy.org/wtfpl/COPYING for more details.
    1313 */
    14 #include "config.h"
     14
     15#if defined HAVE_CONFIG_H
     16#   include "config.h"
     17#endif
     18
     19#if defined _MSC_VER
     20#   define inline __inline
     21#endif
     22
    1523#include <string.h>
    1624#include <caca.h>
     
    534542                if (buffer[i + 2] == '?')
    535543                {
    536                     char arg[5];
     544                    char arg[5], *end;
    537545                    int a = 0;
    538                     int c, p;
     546                    int c, p, Pm;
    539547                    for (p = 0; p < 4; p++)
    540548                    {
     
    552560                        }
    553561                    }
    554                     char *end;
    555                     int Pm = strtol(arg, &end, 10);
     562                    Pm = strtol(arg, &end, 10);
    556563
    557564                    c = buffer[i + 3 + (end - arg)];
     
    879886            skip += final;
    880887
    881             string = malloc(final - (semicolon + 1) + 1);
     888            string = (char *)malloc(final - (semicolon + 1) + 1);
    882889            memcpy(string, buffer + i + (semicolon + 1),
    883890                   final - (semicolon + 1));
  • trunk/tools/neercs/old/attach.c

    r1642 r1656  
    1313 */
    1414
     15#if defined HAVE_CONFIG_H
     16#   include "config.h"
     17#endif
     18
     19#if !defined _WIN32
     20
    1521#include <errno.h>
    1622#include <fcntl.h>
     
    2834#include <caca.h>
    2935
    30 #include "config.h"
    3136#include "neercs.h"
    3237
     
    423428}
    424429
     430#endif
  • trunk/tools/neercs/old/client.c

    r1642 r1656  
    1313 */
    1414
    15 #include "config.h"
     15#if defined HAVE_CONFIG_H
     16#   include "config.h"
     17#endif
     18
     19#if !defined _WIN32
    1620
    1721#include <stdio.h>
     
    297301    return 1;
    298302}
     303
     304#endif
     305
  • trunk/tools/neercs/old/configuration.c

    r1642 r1656  
    1111 *  http://sam.zoy.org/wtfpl/COPYING for more details.
    1212 */
     13
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1319
    1420#include <fcntl.h>
     
    567573    return r;
    568574}
     575
     576#endif
     577
  • trunk/tools/neercs/old/effects.c

    r1642 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1519
    1620#include <stdio.h>
     
    277281    return 1;
    278282}
     283
     284#endif
     285
  • trunk/tools/neercs/old/grab.c

    r1642 r1656  
    1111 */
    1212
    13 #include "config.h"
     13#if defined HAVE_CONFIG_H
     14#   include "config.h"
     15#endif
     16
     17#if !defined _WIN32
    1418
    1519#define _XOPEN_SOURCE 500       /* getsid() */
     
    392396    return ret;
    393397}
     398
     399#endif
     400
  • trunk/tools/neercs/old/help.c

    r1642 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1519
    1620#include <stdio.h>
     
    7579    caca_printf(screen_list->cv, x, y, "See http://caca.zoy.org/wiki/neercs for more informations");
    7680}
     81
     82#endif
  • trunk/tools/neercs/old/input.c

    r1642 r1656  
    1212 *  http://sam.zoy.org/wtfpl/COPYING for more details.
    1313 */
    14 #include "config.h"
     14
     15#if defined HAVE_CONFIG_H
     16#   include "config.h"
     17#endif
     18
    1519#include <caca.h>
    1620#include <string.h>
  • trunk/tools/neercs/old/lock.c

    r1642 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1519
    1620#include <stdio.h>
     
    220224    return 1;
    221225}
     226
     227#endif
  • trunk/tools/neercs/old/main.c

    r1642 r1656  
    1313 */
    1414
    15 #include "config.h"
     15#if defined HAVE_CONFIG_H
     16#   include "config.h"
     17#endif
     18
     19#if !defined _WIN32
    1620
    1721#include <stdio.h>
     
    2630#include <sys/time.h>
    2731#include <time.h>
    28 
    29 
    3032
    3133#if !defined HAVE_GETOPT_LONG
     
    323325    return s;
    324326}
     327
     328#endif
     329
  • trunk/tools/neercs/old/mygetopt.c

    r1642 r1656  
    1616 */
    1717
    18 #include "config.h"
     18#if defined HAVE_CONFIG_H
     19#   include "config.h"
     20#endif
    1921
    2022#include <stdio.h>
     
    4547    if (flag[0] == '-' && flag[1] != '-')
    4648    {
    47         char *tmp;
     49        char const *tmp;
    4850        int ret = flag[1];
    4951
  • trunk/tools/neercs/old/mytrace.c

    r1642 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1519
    1620#include <errno.h>
     
    784788
    785789#endif /* USE_GRAB */
     790
     791#endif /* _WIN32 */
     792
  • trunk/tools/neercs/old/mytrace.h

    r1642 r1656  
    1010 *  http://sam.zoy.org/wtfpl/COPYING for more details.
    1111 */
     12
     13#if !defined _WIN32
    1214
    1315#include <termios.h>
     
    3234int mytrace_tcsets(struct mytrace *t, int fd, struct termios *tos);
    3335int mytrace_sctty(struct mytrace *t, int fd);
     36
     37#endif
  • trunk/tools/neercs/old/python/interpreter.c

    r1642 r1656  
    1111 */
    1212
    13 #include "config.h"
     13#if defined HAVE_CONFIG_H
     14#   include "config.h"
     15#endif
    1416
    1517#ifdef USE_PYTHON
  • trunk/tools/neercs/old/python/py_module.c

    r1642 r1656  
    1111 */
    1212
    13 #include "config.h"
     13#if defined HAVE_CONFIG_H
     14#   include "config.h"
     15#endif
    1416
    1517#ifdef USE_PYTHON
  • trunk/tools/neercs/old/recurrent.c

    r1642 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1519
    1620#include <stdio.h>
     
    111115    return 0;
    112116}
     117
     118#endif
  • trunk/tools/neercs/old/screen_list.c

    r1642 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1519
    1620#include <stdio.h>
     
    215219    free(screen_list);
    216220}
     221
     222#endif
     223
  • trunk/tools/neercs/old/screens.c

    r1642 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1519
    1620#include <stdio.h>
     
    333337    return refresh;
    334338}
     339
     340#endif
     341
  • trunk/tools/neercs/old/screensaver.c

    r1642 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if !defined _WIN32
    1519
    1620#include <stdio.h>
     
    186190    }
    187191}
     192
     193#endif
  • trunk/tools/neercs/old/server.c

    r1642 r1656  
    1313 */
    1414
    15 #include "config.h"
     15#if defined HAVE_CONFIG_H
     16#   include "config.h"
     17#endif
     18
     19#if !defined _WIN32
    1620
    1721#include <stdio.h>
     
    679683    return (tv.tv_sec * (1000000) + tv.tv_usec);
    680684}
     685
     686#endif
  • trunk/tools/neercs/old/term.c

    r1642 r1656  
    1111 */
    1212
    13 #include "config.h"
     13#if defined HAVE_CONFIG_H
     14#   include "config.h"
     15#endif
     16
     17#if !defined _WIN32
    1418
    1519#define _XOPEN_SOURCE
     
    132136    return refresh;
    133137}
     138
     139#endif
     140
  • trunk/tools/neercs/old/widgets.c

    r1642 r1656  
    1919struct input_box *widget_ibox_init(caca_canvas_t *cv, int w, int h)
    2020{
    21     struct input_box *box = malloc(sizeof(struct input_box));
     21    struct input_box *box = (struct input_box *)malloc(sizeof(struct input_box));
    2222    if (!box)
    2323        return NULL;
  • trunk/tools/neercs/old/widgets.h

    r1642 r1656  
    1111 */
    1212
    13 #include "config.h"
     13#if defined HAVE_CONFIG_H
     14#   include "config.h"
     15#endif
    1416
    1517#include <stdio.h>
  • trunk/tools/neercs/old/wm.cpp

    r1655 r1656  
    1212 */
    1313
    14 #include "config.h"
     14#if defined HAVE_CONFIG_H
     15#   include "config.h"
     16#endif
     17
     18#if defined _XBOX
     19#   define _USE_MATH_DEFINES /* for M_PI */
     20#   include <xtl.h>
     21#   undef near /* Fuck Microsoft */
     22#   undef far /* Fuck Microsoft again */
     23#elif defined _WIN32
     24#   define _USE_MATH_DEFINES /* for M_PI */
     25#   define WIN32_LEAN_AND_MEAN
     26#   include <windows.h>
     27#endif
    1528
    1629#include <stdio.h>
     
    1932#include <caca.h>
    2033
     34#include "core.h"
    2135#include "neercs.h"
    2236
     
    2438void resize_screen(struct screen *s, int w, int h)
    2539{
    26     caca_canvas_t *old, *new;
     40    caca_canvas_t *oldc, *newc;
    2741
    2842    if (w == s->w && h == s->h)
     
    4054     * hands
    4155     */
    42     old = s->cv;
    43     new = caca_create_canvas(w, h);
    44     caca_blit(new, 0, 0, old, NULL);
    45     s->cv = new;
    46     caca_gotoxy(new, caca_get_cursor_x(old), caca_get_cursor_y(old));
    47     caca_free_canvas(old);
     56    oldc = s->cv;
     57    newc = caca_create_canvas(w, h);
     58    caca_blit(newc, 0, 0, oldc, NULL);
     59    s->cv = newc;
     60    caca_gotoxy(newc, caca_get_cursor_x(oldc), caca_get_cursor_y(oldc));
     61    caca_free_canvas(oldc);
    4862    set_tty_size(s->fd, w, h);
    4963
     
    447461                angle = -angle;
    448462
    449             float sina = sin(angle);
    450             float cosa = cos(angle);
     463            float sina = lol::sin(angle);
     464            float cosa = lol::cos(angle);
    451465
    452466            for (i = 0; i < 12; i++)
Note: See TracChangeset for help on using the changeset viewer.