× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Display objects...
  • From: "Phil Hall" <hallp@xxxxxxxx>
  • Date: Tue, 13 Jun 2000 12:47:13 -0500

Here's an example code to display the 'hidden' objects in your QTEMP
library - doesn't show all of them (MATCTX probably discards stuff you're
not really meant to see ;-), but most of them...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <milib.h>
#include <mih/matctx.h>
#include <miptrnam.h>
#include <mimchobs.h>
#include <mispcobj.h>
#include <miproces.h>
#include <milock.h>

void dsp_qtemp(void);

int main(void)
{
 dsp_qtemp();
 return 0;
}

void dsp_qtemp(void)
{
 _MCTX_Options_T      options_t;
 _MCTX_Template_T     *ctx_t;
 _SYSPTR              nwi_usrq_ptr;
 char                 *ctx_data;
 char                 obj_name[32];
 int                  i;
 _SYSPTR     job_qtemp_ptr;

 job_qtemp_ptr = _QTEMPPTR();

 ctx_t = malloc(sizeof(_MCTX_Template_T));
 if (ctx_t != NULL)
 {

  printf("\n\nLooking at QTEMPPTR = %p\n\n", job_qtemp_ptr);

  ctx_t->Template_Size = sizeof(_MCTX_Template_T);
  options_t.Info   = (_MCTX_SYMBOLS ¦ _MCTX_POINTERS);
  options_t.Select = _MCTX_ALL;

  _MATCTX2(ctx_t, &job_qtemp_ptr, &options_t);
  ctx_t = realloc(ctx_t, ctx_t->Bytes_Used);
  ctx_t->Template_Size = ctx_t->Bytes_Used;

  _MATCTX2(ctx_t, &job_qtemp_ptr, &options_t);

  ctx_data = &(ctx_t->Data);

  for ( i=0; i < ctx_t->Bytes_Used; i+=48)
  {
   strncpy(obj_name, (ctx_data + 2), 30);
   obj_name[32] = '\0';
   printf("Object..: %32s\n", obj_name);
   nwi_usrq_ptr = *(_SYSPTR *)(ctx_data + 32);
   printf("Pointer.: %p\n\n", nwi_usrq_ptr);
   ctx_data += 48 ;
  }
  free(ctx_t);
 }
}



+---
| This is the C/400 Mailing List!
| To submit a new message, send your mail to C400-L@midrange.com.
| To subscribe to this list send email to C400-L-SUB@midrange.com.
| To unsubscribe from this list send email to C400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: bob@cstoneindy.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.