Monday, January 21, 2013

Read all the source code in one hour - that`s a challenge


My observation from reading the code is that naming of data structures and functions are in general quite accurate and make it clean what it represents, modularization has also quite solid logical basis. However, some source code files are too huge. I think it would be good idea to split them in multiple files.

gtkmain.c - signal handlers, command line options processing, debug prints and loading the buddy window and login to accounts. And also some other interesting stuff:
  • /** ... So instead we'll do an ugly hack where we write the signal number to one end of a socket pair ... */     
  •  segfault_message = g_strdup(
            "Hi, user.  We need to talk.\n"
            "I think something's gone wrong here.  It's probably my fault.\n"
            "No, really, it's not you... it's me... no no no, I think we get along well\n"
            "it's just that.... well, I want to see other people.  I... what?!?  NO!  I \n"
            "haven't been cheating on you!!  How many times do you want me to tell you?!  And\n"
            "for the last time, it's just a rash!\n"
        );
  • /* FUCKING GET ME A TOWEL! */
    #ifdef _WIN32
    ...
gtkblist.c - creating the main window and ist menu - list of buddies, chat groups, contacts managment

gtkconv.c - conversation stuff, open/close conversation, sending messages/files/pounces

notify.c - notifications from libpurple core to pidgin UI - buddy status change, visibility, new msg/email

No comments:

Post a Comment