Changeset 5923cf82 in mainline


Ignore:
Timestamp:
2012-01-12T08:47:09Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
261bbdc
Parents:
d545d03
Message:

remcons: add comments

Location:
uspace/srv/hid/remcons
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/remcons/remcons.c

    rd545d03 r5923cf82  
    7474    sizeof(telnet_force_character_mode_command) / sizeof(telnet_cmd_t);
    7575
    76 
     76/** Creates new keyboard event from given char.
     77 *
     78 * @param type Event type (press / release).
     79 * @param c Pressed character.
     80 */
    7781static kbd_event_t* new_kbd_event(kbd_event_type_t type, wchar_t c) {
    7882        kbd_event_t *event = malloc(sizeof(kbd_event_t));
     
    8892}
    8993
     94/** Handling client requests (VFS and console interface).
     95 *
     96 * @param user Telnet user the requests belong to.
     97 */
    9098static void client_connection_message_loop(telnet_user_t *user)
    9199{
     
    232240}
    233241
     242/** Callback when client connects to a telnet terminal. */
    234243static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    235244{
     
    257266}
    258267
     268/** Fibril for spawning the task running after user connects.
     269 *
     270 * @param arg Corresponding @c telnet_user_t structure.
     271 */
    259272static int spawn_task_fibril(void *arg)
    260273{
     
    297310}
    298311
     312/** Tell whether given user can be destroyed (has no active clients).
     313 *
     314 * @param user The telnet user in question.
     315 */
    299316static bool user_can_be_destroyed_no_lock(telnet_user_t *user)
    300317{
     
    303320}
    304321
     322/** Fibril for each accepted socket.
     323 *
     324 * @param arg Corresponding @c telnet_user_t structure.
     325 */
    305326static int network_user_fibril(void *arg)
    306327{
  • uspace/srv/hid/remcons/user.c

    rd545d03 r5923cf82  
    5959static LIST_INITIALIZE(users);
    6060
    61 
     61/** Create new telnet user.
     62 *
     63 * @param socket Socket the user communicates through.
     64 * @return New telnet user or NULL when out of memory.
     65 */
    6266telnet_user_t *telnet_user_create(int socket)
    6367{
     
    98102}
    99103
     104/** Destroy telnet user structure.
     105 *
     106 * @param user User to be destroyed.
     107 */
    100108void telnet_user_destroy(telnet_user_t *user)
    101109{
     
    109117}
    110118
     119/** Find user by service id and increments reference counter.
     120 *
     121 * @param id Location service id of the telnet user's terminal.
     122 */
    111123telnet_user_t *telnet_user_get_for_client_connection(service_id_t id)
    112124{
     
    147159}
    148160
     161/** Notify that client disconnected from the remote terminal.
     162 *
     163 * @param user To which user the client was connected.
     164 */
    149165void telnet_user_notify_client_disconnected(telnet_user_t *user)
    150166{
  • uspace/srv/hid/remcons/user.h

    rd545d03 r5923cf82  
    4242#define BUFFER_SIZE 1024
    4343
     44/** Representation of a connected (human) user. */
    4445typedef struct {
     46        /** Internal id, used for creating locfs entries. */
    4547        int id;
     48        /** Associated socket. */
    4649        int socket;
     50        /** Location service id assigned to the virtual terminal. */
    4751        service_id_t service_id;
     52        /** Path name of the service. */
    4853        char *service_name;
     54
    4955        /** Producer-consumer of kbd_event_t. */
    5056        prodcons_t in_events;
     
    5460        size_t socket_buffer_pos;
    5561
     62        /** Task id of the launched application. */
    5663        task_id_t task_id;
    5764
     
    6976void telnet_user_notify_client_disconnected(telnet_user_t *user);
    7077
     78/** Print informational message about connected user. */
    7179#define telnet_user_log(user, fmt, ...) \
    7280        printf(NAME " [console %d (%d)]: " fmt "\n", user->id, (int) user->service_id, ##__VA_ARGS__)
    7381
     82/** Print error message associated with connected user. */
    7483#define telnet_user_error(user, fmt, ...) \
    7584        fprintf(stderr, NAME " [console %d (%d)]: ERROR: " fmt "\n", user->id, (int) user->service_id, ##__VA_ARGS__)
Note: See TracChangeset for help on using the changeset viewer.