Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  mark_pgdllimport.pl

  Sprache: Shell
 

#!/usr/bin/perl

#----------------------------------------------------------------------
#
# mark_pgdllimport.pl
# Perl script that tries to add PGDLLIMPORT markings to PostgreSQL
# header files.
#
# This relies on a few idiosyncrasies of the PostgreSQL coding style,
# such as the fact that we always use "extern" in function
# declarations, and that we don't use // comments. It's not very
# smart and may not catch all cases.
#
# It's probably a good idea to run pgindent on any files that this
# script modifies before committing.  This script uses as arguments
# a list of the header files to scan for the markings.
#
# Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# src/tools/mark_pgdllimport.pl
#
#----------------------------------------------------------------------

use strict;
use warnings FATAL => 'all';

for my $include_file (@ARGV)
{
 open(my $rfh, '<', $include_file) || die "$include_file: $!";
 my $buffer = '';
 my $num_pgdllimport_added = 0;

 while (my $raw_line = <$rfh>)
 {
  my $needs_pgdllimport = 1;

  # By convention we declare global variables explicitly extern. We're
  # looking for those not already marked with PGDLLIMPORT.
  $needs_pgdllimport = 0
    if $raw_line !~ /^extern\s+/
    || $raw_line =~ /PGDLLIMPORT/;

  # Make a copy of the line and perform a simple-minded comment strip.
  # Also strip trailing whitespace.
  my $stripped_line = $raw_line;
  $stripped_line =~ s/\/\*.*\*\///g;
  $stripped_line =~ s/\s+$//;

  # Variable declarations should end in a semicolon. If we see an
  # opening parenthesis, it's probably a function declaration.
  $needs_pgdllimport = 0
    if $stripped_line !~ /;$/
    || $stripped_line =~ /\(/;

  # Add PGDLLIMPORT marker, if required.
  if ($needs_pgdllimport)
  {
   $raw_line =~ s/^extern/extern PGDLLIMPORT/;
   ++$num_pgdllimport_added;
  }

  # Add line to buffer.
  $buffer .= $raw_line;
 }

 close($rfh);

 # If we added any PGDLLIMPORT markers, rewrite the file.
 if ($num_pgdllimport_added > 0)
 {
  printf "%s: adding %d PGDLLIMPORT markers\n",
    $include_file, $num_pgdllimport_added;
  open(my $wfh, '>', $include_file) || die "$include_file: $!";
  print $wfh $buffer;
  close($wfh);
 }
}

Messung V0.5 in Prozent
C=61 H=34 G=48

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002