home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 264,006 of 264,096   
   =?UTF-8?Q?Arne_Vajh=C3=B8j?= to All   
   Re: New PHP kits available (and a progra   
   01 Jan 26 20:59:57   
   
   From: arne@vajhoej.dk   
      
   On 1/1/2026 8:51 PM, Arne Vajhøj wrote:   
   > #include    
   > #include    
   > #include    
   >   
   > #include    
   > #include    
   >   
   > int myalloc(int *siz, void **addr)   
   > {   
   >      *addr = malloc(*siz);   
   >      return 1;   
   > }   
   >   
   > struct myparam   
   > {   
   >      int iv;   
   >      char sv[100];   
   > };   
   >   
   > struct myparam *myparam_p(struct _kpb *ctx)   
   > {   
   >      return (struct myparam *)(ctx + 1);   
   > }   
   >   
   > void test(struct _kpb *ctx)   
   > {   
   >      printf("B1 (%s)\n", myparam_p(ctx)->sv);   
   >      myparam_p(ctx)->iv = 123;   
   >      exe$kp_stall_general(ctx);   
   >      printf("B2 (%s)\n", myparam_p(ctx)->sv);   
   >      myparam_p(ctx)->iv = 456;   
   >      exe$kp_stall_general(ctx);   
   >      printf("B3 (%s)\n", myparam_p(ctx)->sv);   
   >      myparam_p(ctx)->iv = 789;   
   >      exe$kp_end(ctx);   
   > }   
   >   
   > int main()   
   > {   
   >      struct _kpb *ctx;   
   >      exe$kp_user_alloc_kpb(&ctx,   
   >                            KP$M_VEST |   
   KP$M_SET_STACK_LIMITS,   
   >                            sizeof(struct myparam),   
   >                            myalloc,   
   >                            1000000,   
   >                            exe$kp_all   
   c_mem_stack_user,   
   >                            10000,   
   >                            exe$kp_all   
   c_rse_stack_p2_any,   
   >                            NULL);   
   >      printf("A1\n");   
   >      strcpy(myparam_p(ctx)->sv, "ABC");   
   >      exe$kp_start(ctx, test, KPREG$K_HLL_REG_MASK);   
   >      printf("A2 (%d)\n", myparam_p(ctx)->iv);   
   >      strcpy(myparam_p(ctx)->sv, "DEF");   
   >      exe$kp_restart(ctx, 0);   
   >      printf("A3 (%d)\n", myparam_p(ctx)->iv);   
   >      strcpy(myparam_p(ctx)->sv, "GHI");   
   >      exe$kp_restart(ctx, 0);   
   >      printf("A4 (%d)\n", myparam_p(ctx)->iv);   
   >      return 0;   
   > }   
      
   In case anyone wants to build, then it is:   
      
   $ cc kp + sys$library:sys$lib_c/libr   
   $ link kp + sys$input/opt   
   sys$loadable_images:sys$base_image/share   
   $   
      
   Arne   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca