Changeset 5856 for branches/newosd

Show
Ignore:
Timestamp:
11/23/07 21:35:11 (12 months ago)
Author:
eugene
Message:

Added dumb notification about the received signal.

Location:
branches/newosd
Files:
2 added
3 modified

Legend:

Unmodified
Added
Removed
  • branches/newosd/CMakeLists.txt

    r5775 r5856  
    2424    set(LIBRARIES ${LIBRARIES} ${AOSD_LINK_FLAGS}) 
    2525    include_directories(${AOSD_INCLUDE_DIR}) 
     26    add_definitions(${AOSD_CFLAGS}) 
    2627else (AOSD_LINK_FLAGS) 
    2728    message(FATAL_ERROR "libaosd wasn't found...") 
  • branches/newosd/src/CMakeLists.txt

    r5776 r5856  
    11set(target licq_newosd) 
    22 
    3 add_library(${target} MODULE plugin.cpp) 
     3set(SRCS 
     4    plugin.cpp 
     5    iface.cpp) 
     6 
     7add_library(${target} MODULE ${SRCS}) 
    48target_link_libraries(${target} ${LIBRARIES}) 
    59set_target_properties(${target} PROPERTIES PREFIX "") 
  • branches/newosd/src/plugin.cpp

    r5776 r5856  
    55#include <licq_icqd.h> 
    66#include <licq_plugin.h> 
     7 
     8#include "iface.h" 
    79 
    810const char* LP_Name() 
     
    5860int LP_Main(CICQDaemon* daemon) 
    5961{ 
    60   int pipe = daemon->RegisterPlugin(0UL); 
    61   bool finita = false; 
    62   char signal[3]; 
     62  int pipe = daemon->RegisterPlugin( 
     63      SIGNAL_UPDATExUSER | 
     64      SIGNAL_LOGON | 
     65      SIGNAL_LOGOFF); 
     66  bool finita = false, blocked = false; 
     67  char msg[3]; 
     68 
     69  Iface* iface = new Iface(); 
    6370 
    6471  while (!finita) 
    6572  { 
    66     read(pipe, signal, 1); 
     73    read(pipe, msg, 1); 
    6774 
    68     switch (signal[0]) 
     75    switch (msg[0]) 
    6976    { 
     77      case 'S': 
     78        { 
     79          CICQSignal* sig = daemon->PopPluginSignal(); 
     80          if (sig != NULL) 
     81          { 
     82            if (!blocked) 
     83              iface->processSignal(sig); 
     84            delete sig; 
     85            sig = NULL; 
     86          } 
     87        } 
     88        break; 
     89 
    7090      case 'X': 
    71     finita = true; 
    72     break; 
     91        finita = true; 
     92        break; 
     93 
     94      case '0': 
     95        blocked = true; 
     96        break; 
     97 
     98      case '1': 
     99        blocked = false; 
     100        break; 
    73101 
    74102      default: 
    75     break; 
     103        break; 
    76104    } 
    77105  } 
     
    79107  daemon->UnregisterPlugin(); 
    80108 
     109  delete iface; 
     110 
    81111  return 0; 
    82112} 
     113 
     114/* vim: set ts=2 sw=2 et : */