wish_app/wish_app.c
wish_app_t * wish_app_create(const char *app_name) {

    uint8_t app_wsid[WISH_ID_LEN];

    if (wish_app_get_wsid(app_name, app_wsid)) {
        WISHDEBUG(LOG_CRITICAL, "Cannot get wsid for %s", app_name);
        return NULL;
    }

    wish_debug_print_array(LOG_DEBUG, "wish_app_create", app_wsid, WISH_ID_LEN);

    wish_app_t *app = wish_app_get_new();
    if (app == NULL) {
        WISHDEBUG(LOG_CRITICAL, "Fresh app context is null!");
        return NULL;
    }

    app->occupied = true;
    memcpy(app->wsid, app_wsid, WISH_WSID_LEN);
    strncpy(app->name, app_name, WISH_APP_NAME_MAX_LEN);
    /* Ensure null termination: */
    app->name[WISH_APP_NAME_MAX_LEN-1] = 0;
    
    app->rpc_client.send = send;
    app->rpc_client.send_ctx = app;
    app->rpc_client.name = "wish_app.c:WishApp::WishCoreRpcClient";

    return app;
}
/** 
 * Create a wish application
 *
 * Returns the wish_app instance which was just created, or NULL if
 * error
 */
Create a wish application
Returns the wish_app instance which was just created, or NULL if
error
Create a wish application Returns the wish_app instance which was just created or NULL if error
wish_app_t * wish_app_create(const char *app_name) {
    uint8_t app_wsid[WISH_ID_LEN];
    if (wish_app_get_wsid(app_name, app_wsid)) {
        WISHDEBUG(LOG_CRITICAL, "Cannot get wsid for %s", app_name);
        return NULL;
    }
    wish_debug_print_array(LOG_DEBUG, "wish_app_create", app_wsid, WISH_ID_LEN);
    wish_app_t *app = wish_app_get_new();
    if (app == NULL) {
        WISHDEBUG(LOG_CRITICAL, "Fresh app context is null!");
        return NULL;
    }
    app->occupied = true;
    memcpy(app->wsid, app_wsid, WISH_WSID_LEN);
    strncpy(app->name, app_name, WISH_APP_NAME_MAX_LEN);
    app->name[WISH_APP_NAME_MAX_LEN-1] = 0;
    app->rpc_client.send = send;
    app->rpc_client.send_ctx = app;
    app->rpc_client.name = "wish_app.c:WishApp::WishCoreRpcClient";
    return app;
}
wish_app_t * wish_app_create ( const char * app_name ) { uint8_t app_wsid [ WISH_ID_LEN ] ; if ( wish_app_get_wsid ( app_name , app_wsid ) ) { WISHDEBUG ( LOG_CRITICAL , " " , app_name ) ; return NULL ; } wish_debug_print_array ( LOG_DEBUG , " " , app_wsid , WISH_ID_LEN ) ; wish_app_t * app = wish_app_get_new ( ) ; if ( app == NULL ) { WISHDEBUG ( LOG_CRITICAL , " " ) ; return NULL ; } app -> occupied = true ; memcpy ( app -> wsid , app_wsid , WISH_WSID_LEN ) ; strncpy ( app -> name , app_name , WISH_APP_NAME_MAX_LEN ) ; app -> name [ WISH_APP_NAME_MAX_LEN - 1 ] = 0 ; app -> rpc_client . send = send ; app -> rpc_client . send_ctx = app ; app -> rpc_client . name = " " ; return app ; }
Create a wish application
 Returns the wish_app instance which was just created, or NULL if
 error
Create a wish application Returns the wish_app instance which was just created or NULL if error
/* Ensure null termination: */