cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

client-fntypes.h (2983B)


      1/*
      2 * Licensed to the Apache Software Foundation (ASF) under one
      3 * or more contributor license agreements.  See the NOTICE file
      4 * distributed with this work for additional information
      5 * regarding copyright ownership.  The ASF licenses this file
      6 * to you under the Apache License, Version 2.0 (the
      7 * "License"); you may not use this file except in compliance
      8 * with the License.  You may obtain a copy of the License at
      9 *
     10 *   http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing,
     13 * software distributed under the License is distributed on an
     14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     15 * KIND, either express or implied.  See the License for the
     16 * specific language governing permissions and limitations
     17 * under the License.
     18 */
     19
     20#ifndef _GUAC_CLIENT_FNTYPES_H
     21#define _GUAC_CLIENT_FNTYPES_H
     22
     23/**
     24 * Function type definitions related to the Guacamole client structure,
     25 * guac_client.
     26 *
     27 * @file client-fntypes.h
     28 */
     29
     30#include "client-types.h"
     31#include "object-types.h"
     32#include "protocol-types.h"
     33#include "socket.h"
     34#include "stream-types.h"
     35#include "user-fntypes.h"
     36#include "user-types.h"
     37
     38#include <stdarg.h>
     39
     40/**
     41 * Handler for freeing up any extra data allocated by the client
     42 * implementation.
     43 *
     44 * @param client
     45 *     The client whose extra data should be freed (if any).
     46 *
     47 * @return
     48 *     Zero if the data was successfully freed, non-zero if an error prevents
     49 *     the data from being freed.
     50 */
     51typedef int guac_client_free_handler(guac_client* client);
     52
     53/**
     54 * Handler that will run before immediately before pending users are promoted
     55 * to full users. The pending user socket should be used to communicate to the
     56 * pending users.
     57 *
     58 * @param client
     59 *     The client whose handler was invoked.
     60 *
     61 * @return
     62 *     Zero if the pending handler ran successfuly, or a non-zero value if an
     63 *     error occured.
     64 */
     65typedef int guac_client_join_pending_handler(guac_client* client);
     66
     67/**
     68 * Handler for logging messages related to a given guac_client instance.
     69 *
     70 * @param client
     71 *     The client related to the message being logged.
     72 *
     73 * @param level
     74 *     The log level at which to log the given message.
     75 *
     76 * @param format
     77 *     A printf-style format string, defining the message to be logged.
     78 *
     79 * @param args
     80 *     The va_list containing the arguments to be used when filling the
     81 *     conversion specifiers ("%s", "%i", etc.) within the format string.
     82 */
     83typedef void guac_client_log_handler(guac_client* client,
     84        guac_client_log_level level, const char* format, va_list args);
     85
     86/**
     87 * The entry point of a client plugin which must initialize the given
     88 * guac_client. In practice, this function will be called "guac_client_init".
     89 *
     90 * @param client
     91 *     The guac_client that must be initialized.
     92 *
     93 * @return
     94 *     Zero on success, non-zero if initialization fails for any reason.
     95 */
     96typedef int guac_client_init_handler(guac_client* client);
     97
     98#endif
     99