webengine/wmlengine/src/script/include/scr_context.h
changeset 74 91031d3aab7d
parent 68 92a765b5b3e7
child 85 e358f2276d3f
equal deleted inserted replaced
68:92a765b5b3e7 74:91031d3aab7d
     1 /*
       
     2 * Copyright (c) 1999 - 2001 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18  /*
       
    19     $Workfile: scr_context.h $
       
    20 
       
    21     Purpose:
       
    22 
       
    23         This file is used by the scr_context.h.  It defines the scr_context 
       
    24         structure and the prototypes for all the functions used by the ScriptServer
       
    25         context.
       
    26 
       
    27  */
       
    28 
       
    29 #ifndef SCR_CONTEXT_H
       
    30 #define SCR_CONTEXT_H
       
    31 
       
    32 #include "scr_estack.h"
       
    33 #include "scr_frstack.h"
       
    34 #include "scr_fcns.h"
       
    35 #include "scr_constpool.h"
       
    36 #include "nwx_http_header.h"
       
    37 
       
    38 typedef enum 
       
    39 { 
       
    40   RUNNING,
       
    41   IDLE,
       
    42   SUSPEND,
       
    43   URL_REQ,
       
    44   RELOAD,
       
    45   LOADSTRING_REQ
       
    46 } ctx_state_e;
       
    47 
       
    48 
       
    49 typedef struct {
       
    50 
       
    51   NW_Ucs2 *fname;
       
    52   NW_Uint8 args;
       
    53 } call_str;
       
    54   
       
    55 typedef struct {
       
    56 
       
    57   call_str *cs;
       
    58 
       
    59   estack_t *es;
       
    60   frstack_t *fs;
       
    61 
       
    62   constpool_t *cp;
       
    63   funcpool_t *fp;
       
    64   fname_table_t *fn;
       
    65 
       
    66   NW_Uint16 access_path;
       
    67   NW_Uint16 access_domain;
       
    68   NW_Bool access_public;
       
    69 
       
    70   NW_Byte errorCode;
       
    71   ctx_state_e state;
       
    72   NW_Http_ContentTypeString_t loadStringMime;
       
    73   NW_Ucs2* msg;
       
    74   
       
    75   NW_Uint16 suspend_counter;
       
    76   
       
    77 } context_t;
       
    78 
       
    79 /* clear the context associated with the application */
       
    80 void clear_url_context(context_t *ctx);
       
    81 
       
    82 constpool_t *get_ctx_constpool(context_t *ctx);
       
    83 void set_ctx_constpool(context_t *ctx, constpool_t *cp);
       
    84 
       
    85 funcpool_t *get_ctx_funcpool(context_t *ctx);
       
    86 void set_ctx_funcpool(context_t *ctx, funcpool_t *fp);
       
    87 
       
    88 fname_table_t *get_ctx_fname_table(context_t *ctx);
       
    89 void set_ctx_fname_table(context_t *ctx, fname_table_t *fn);
       
    90 
       
    91 estack_t *get_ctx_estack(context_t *ctx);
       
    92 void set_ctx_estack(context_t *ctx, estack_t *es);
       
    93 
       
    94 frstack_t *get_ctx_frstack(context_t *ctx);
       
    95 void set_ctx_frstack(context_t *ctx, frstack_t *fs);
       
    96 
       
    97 NW_Bool set_ctx_call_str(context_t *ctx, NW_Ucs2 *fname, NW_Byte args);
       
    98 
       
    99 NW_Uint8 get_ctx_args_no(context_t *ctx);
       
   100 NW_Ucs2 *get_ctx_fname(context_t *ctx);
       
   101 
       
   102 NW_Bool was_calling(context_t *ctx);
       
   103 void delete_call_str(context_t *ctx);
       
   104 
       
   105 void clear_context(context_t *ctx);
       
   106 
       
   107 void set_ctx_state(context_t *ctx, ctx_state_e state);
       
   108 ctx_state_e get_ctx_state(context_t *ctx);
       
   109 
       
   110 void set_ctx_error_code(context_t *ctx, NW_Byte b);
       
   111 NW_Byte get_ctx_error_code(context_t *ctx);
       
   112 
       
   113 void set_ctx_error_msg(context_t *ctx, NW_Ucs2* msg);
       
   114 NW_Ucs2* get_ctx_error_msg(context_t *ctx);
       
   115 
       
   116 NW_Bool find_function_index(context_t *ctx, NW_Ucs2 *fname, NW_Byte *index);
       
   117 
       
   118 NW_Bool should_suspend(context_t *ctx);
       
   119 
       
   120 #endif  /* SCR_CONSTPOOL_H */