<commit_before>/******************************************************************
 *
 * Round for C
 *
 * Copyright (C) <NAME> 2015
 *
 * This is licensed under BSD-style license, see file COPYING.
 *
 ******************************************************************/

#ifndef _ROUNDC_UPNP_SERVER_H_
#define _ROUNDC_UPNP_SERVER_H_

#include <round/typedef.h>
#include <mupnp/device.h>

#ifdef  __cplusplus
extern "C" {
#endif

/****************************************
 * Define
 ****************************************/
  
typedef void(*ROUND_UPNP_SERVER_JSON_RPC_REQUEST_LISTENER)(mUpnpHttpRequest *httpReq);

/****************************************
 * Data Type
 ****************************************/
  
typedef struct {
  mUpnpDevice *dev;
  ROUND_UPNP_SERVER_JSON_RPC_REQUEST_LISTENER rpcReqListener;
  void *rpcServer;
} RoundUpnpServer;
  
/****************************************
 * Function
 ****************************************/
  
RoundUpnpServer *round_upnp_server_new(void);
bool round_upnp_server_delete(RoundUpnpServer *server);

#define round_upnp_server_setrpcrequestlistener(server,func) (server->rpcReqListener = func)
#define round_upnp_server_setrpcserver(server,func) (server->rpcReqListener = func)
#define round_upnp_server_postrpcrequest(server,httpReq) server->rpcReqListener(httpReq)

#define round_upnp_server_start(server) mupnp_device_start(server->dev)
#define round_upnp_server_stop(server) mupnp_device_stop(server->dev)
#define round_upnp_server_isrunning(server) mupnp_device_isrunning(server->dev)
  
#ifdef  __cplusplus
} /* extern C */
#endif

#endif<commit_msg>* Updated UPnP Server functions.<commit_after>/******************************************************************
 *
 * Round for C
 *
 * Copyright (C) <NAME> 2015
 *
 * This is licensed under BSD-style license, see file COPYING.
 *
 ******************************************************************/

#ifndef _ROUNDC_UPNP_SERVER_H_
#define _ROUNDC_UPNP_SERVER_H_

#include <round/typedef.h>
#include <mupnp/device.h>

#ifdef  __cplusplus
extern "C" {
#endif

/****************************************
 * Define
 ****************************************/
  
typedef void(*ROUND_UPNP_SERVER_JSON_RPC_REQUEST_LISTENER)(mUpnpHttpRequest *httpReq);

/****************************************
 * Data Type
 ****************************************/
  
typedef struct {
  mUpnpDevice *dev;
  ROUND_UPNP_SERVER_JSON_RPC_REQUEST_LISTENER rpcReqListener;
  void *rpcServer;
} RoundUpnpServer;
  
/****************************************
 * Function
 ****************************************/
  
RoundUpnpServer *round_upnp_server_new(void);
bool round_upnp_server_delete(RoundUpnpServer *server);

#define round_upnp_server_setrpcrequestlistener(server,func) (server->rpcReqListener = func)
//#define round_upnp_server_setrpcserver(server,func) (server->rpcReqListener = func)
//#define round_upnp_server_getrpcserver(server) server->rpcReqListener
#define round_upnp_server_postrpcrequest(server,httpReq) server->rpcReqListener(httpReq)

#define round_upnp_server_start(server) mupnp_device_start(server->dev)
#define round_upnp_server_stop(server) mupnp_device_stop(server->dev)
#define round_upnp_server_isrunning(server) mupnp_device_isrunning(server->dev)

#define round_upnp_server_setrpcserver(server,rpcSrv) mupnp_device_setuserdata(server->dev, rpcSrv)
#define round_upnp_device_getrpcserver(dev) ((RoundRpcServer *)mupnp_device_getuserdata(dev))
  
#ifdef  __cplusplus
} /* extern C */
#endif

#endif
{'fraction_non_alphanumeric': 0.289937464468448, 'fraction_numerical': 0.0022740193291642978, 'mean_word_length': 8.775, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7221653', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1059, 'n_words': 168}