w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pdfdde.c File Reference
#include <afx.h>
#include <ddeml.h>
#include <dde.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <shellapi.h>
#include <getopt.h>
Include dependency graph for pdfdde.c:

Go to the source code of this file.

Macros

#define ACROBAT   "acroview"
 
#define ACROBATR10   "acroviewR10"
 
#define ACROBATA10   "acroviewA10"
 
#define ACROBATR11   "acroviewR11"
 
#define ACROBATA11   "acroviewA11"
 
#define ACROBATR15   "acroviewR15"
 
#define ACROBATA15   "acroviewA15"
 
#define SRV_NUM   7
 
#define EVAL_TOPIC   "control"
 
#define RESULT_ITEM   "Result"
 
#define ERROR_ITEM   "Error"
 
#define CONNECT_DELAY   100 /* ms */
 
#define TRANSACTION_TIMEOUT   5000 /* ms */
 
#define MAX_INPUT_IDLE_WAIT   INFINITE /* ms */
 
#define ARGUMENT_IS(a)   (_stricmp(long_options[option_index].name, a) == 0)
 
#define PROGRAM_IS(a)   (_stricmp(a, argv0) == 0)
 
#define WHITE_DELIM   " \t\n"
 

Functions

char * FindAcrobatModule ()
 
void CloseConversation (void)
 
void error (LPCTSTR fmt,...)
 
voidemalloc (size_t len)
 
HDDEDATA CALLBACK Callback (UINT uType, UINT uFmt, HCONV hconv, HSZ hsz1, HSZ hsz2, HDDEDATA hdata, DWORD dwData1, DWORD dwData2)
 
int StartServer (LPCTSTR prog)
 
HSZ DDEString (LPCTSTR str)
 
void FreeString (HSZ hsz)
 
void OpenConversation (LPCTSTR topic_name)
 
void __cdecl ExecuteCommand (LPCTSTR command,...)
 
void StartHotLink (LPCTSTR item_name)
 
LPTSTR RequestData (LPCTSTR item_name)
 
void usage ()
 
char * CheckFileName (char *p)
 
int pdfopen ()
 
int pdfclose ()
 
int pdfserver ()
 
static char * getservername (void)
 
int main (int argc, char *argv[])
 

Variables

char * SrvNam [7]
 
static DWORD DDEsession
 
static HCONV DDEconversation
 
static char * argv0 = NULL
 
static int nPage = 0
 
static char * sFileName = NULL
 
static int bAll = 0
 
static int bServer = 0
 
static int iDebug = 0
 
static char * sGoto = NULL
 
static char sLongFileName [256]
 
static int nPrefer = 0
 
static char * sServerName = NULL
 
const char * pdfdde_version_string = "0.6"
 
static struct option long_options []
 
int outstanding_requests
 

Macro Definition Documentation

◆ ACROBAT

#define ACROBAT   "acroview"

Definition at line 17 of file pdfdde.c.

◆ ACROBATA10

#define ACROBATA10   "acroviewA10"

Definition at line 19 of file pdfdde.c.

◆ ACROBATA11

#define ACROBATA11   "acroviewA11"

Definition at line 21 of file pdfdde.c.

◆ ACROBATA15

#define ACROBATA15   "acroviewA15"

Definition at line 23 of file pdfdde.c.

◆ ACROBATR10

#define ACROBATR10   "acroviewR10"

Definition at line 18 of file pdfdde.c.

◆ ACROBATR11

#define ACROBATR11   "acroviewR11"

Definition at line 20 of file pdfdde.c.

◆ ACROBATR15

#define ACROBATR15   "acroviewR15"

Definition at line 22 of file pdfdde.c.

◆ ARGUMENT_IS

#define ARGUMENT_IS (   a)    (_stricmp(long_options[option_index].name, a) == 0)

Definition at line 57 of file pdfdde.c.

◆ CONNECT_DELAY

#define CONNECT_DELAY   100 /* ms */

Definition at line 33 of file pdfdde.c.

◆ ERROR_ITEM

#define ERROR_ITEM   "Error"

Definition at line 30 of file pdfdde.c.

◆ EVAL_TOPIC

#define EVAL_TOPIC   "control"

Definition at line 28 of file pdfdde.c.

◆ MAX_INPUT_IDLE_WAIT

#define MAX_INPUT_IDLE_WAIT   INFINITE /* ms */

Definition at line 35 of file pdfdde.c.

◆ PROGRAM_IS

#define PROGRAM_IS (   a)    (_stricmp(a, argv0) == 0)

Definition at line 58 of file pdfdde.c.

◆ RESULT_ITEM

#define RESULT_ITEM   "Result"

Definition at line 29 of file pdfdde.c.

◆ SRV_NUM

#define SRV_NUM   7

Definition at line 25 of file pdfdde.c.

◆ TRANSACTION_TIMEOUT

#define TRANSACTION_TIMEOUT   5000 /* ms */

Definition at line 34 of file pdfdde.c.

◆ WHITE_DELIM

#define WHITE_DELIM   " \t\n"

Function Documentation

◆ Callback()

HDDEDATA CALLBACK Callback ( UINT  uType,
UINT  uFmt,
HCONV  hconv,
HSZ  hsz1,
HSZ  hsz2,
HDDEDATA  hdata,
DWORD  dwData1,
DWORD  dwData2 
)

Definition at line 175 of file pdfdde.c.

References buf, len, NULL, and outstanding_requests.

Referenced by OpenConversation().

◆ CheckFileName()

char* CheckFileName ( char *  p)

Definition at line 458 of file pdfdde.c.

References argv0, fp, fprintf, GetLastError(), NULL, p, sLongFileName, and strcpy().

Referenced by main(), and pdfserver().

◆ CloseConversation()

void CloseConversation ( void  )

Definition at line 141 of file pdfdde.c.

References DDEconversation, and DDEsession.

Referenced by error(), pdfclose(), pdfopen(), and pdfserver().

◆ DDEString()

HSZ DDEString ( LPCTSTR  str)

Definition at line 219 of file pdfdde.c.

References DDEsession, error(), and str.

Referenced by OpenConversation(), RequestData(), and StartHotLink().

◆ emalloc()

void* emalloc ( size_t  len)

Definition at line 162 of file pdfdde.c.

References error(), len, malloc, NULL, and p.

Referenced by RequestData().

◆ error()

void error ( LPCTSTR  fmt,
  ... 
)

◆ ExecuteCommand()

void __cdecl ExecuteCommand ( LPCTSTR  command,
  ... 
)

Definition at line 377 of file pdfdde.c.

References args, buffer, DDEconversation, DDEsession, error(), len, malloc, ret, strlen(), tp, TRANSACTION_TIMEOUT, and va_start.

Referenced by pdfclose(), pdfopen(), and pdfserver().

◆ FindAcrobatModule()

char* FindAcrobatModule ( )

Definition at line 84 of file pdfdde.c.

References argv, buf, fprintf, hInst, malloc, MAX_PATH, NULL, program, fc-lang::stdout, and strcpy().

Referenced by OpenConversation().

◆ FreeString()

void FreeString ( HSZ  hsz)

Definition at line 227 of file pdfdde.c.

References DDEsession.

Referenced by OpenConversation(), RequestData(), and StartHotLink().

◆ getservername()

static char* getservername ( void  )
static

Definition at line 623 of file pdfdde.c.

References buf, f, fclose, fgets, FILE, fname, fopen, len, NULL, p, ret, strlen(), strncmp(), and strrchr.

Referenced by main().

◆ main()

◆ OpenConversation()

◆ pdfclose()

int pdfclose ( )

Definition at line 526 of file pdfdde.c.

References bAll, buf, CloseConversation(), EVAL_TOPIC, ExecuteCommand(), EXIT_SUCCESS, fprintf, OpenConversation(), and sLongFileName.

Referenced by main().

◆ pdfopen()

◆ pdfserver()

◆ RequestData()

LPTSTR RequestData ( LPCTSTR  item_name)

◆ StartHotLink()

void StartHotLink ( LPCTSTR  item_name)

Definition at line 398 of file pdfdde.c.

References DDEconversation, DDEString(), FreeString(), item, and TRANSACTION_TIMEOUT.

◆ StartServer()

int StartServer ( LPCTSTR  prog)

Definition at line 192 of file pdfdde.c.

References error(), FALSE, MAX_INPUT_IDLE_WAIT, NULL, ClipperLib::pi, and prog.

Referenced by OpenConversation().

◆ usage()

void usage ( void  uerr)

Definition at line 424 of file pdfdde.c.

References exit(), and fprintf.

Referenced by main().

Variable Documentation

◆ argv0

char* argv0 = NULL
static

Definition at line 41 of file pdfdde.c.

Referenced by CheckFileName(), main(), pdfopen(), and pdfserver().

◆ bAll

int bAll = 0
static

Definition at line 44 of file pdfdde.c.

Referenced by main(), pdfclose(), and ZoneIterator::ZoneIterator().

◆ bServer

int bServer = 0
static

Definition at line 45 of file pdfdde.c.

◆ DDEconversation

HCONV DDEconversation
static

◆ DDEsession

DWORD DDEsession
static

Definition at line 37 of file pdfdde.c.

Referenced by CloseConversation(), DDEString(), ExecuteCommand(), FreeString(), and OpenConversation().

◆ iDebug

int iDebug = 0
static

Definition at line 46 of file pdfdde.c.

Referenced by main().

◆ long_options

struct option long_options[]
static
Initial value:
= {
{ "rx", 0, &nPrefer, 1},
{ "ax", 0, &nPrefer, 2},
{ "rxi", 0, &nPrefer, 3},
{ "axi", 0, &nPrefer, 4},
{ "rxv", 0, &nPrefer, 5},
{ "axv", 0, &nPrefer, 6},
{ "r10", 0, &nPrefer, 1},
{ "a10", 0, &nPrefer, 2},
{ "r11", 0, &nPrefer, 3},
{ "a11", 0, &nPrefer, 4},
{ "r15", 0, &nPrefer, 5},
{ "a15", 0, &nPrefer, 6},
{ "debug", 0, 0, 0},
{ "help", 0, 0, 0},
{ "version", 0, 0, 0},
{ "file", 1, 0, 0},
{ "page", 1, 0, 0},
{ "goto", 1, 0, 0},
{ "all", 0, 0, 0},
{0, 0, 0, 0}
}
static int nPrefer
Definition: pdfdde.c:49

Definition at line 52 of file pdfdde.c.

Referenced by main().

◆ nPage

int nPage = 0
static

Definition at line 42 of file pdfdde.c.

Referenced by main(), pdfopen(), and pdfserver().

◆ nPrefer

int nPrefer = 0
static

Definition at line 49 of file pdfdde.c.

Referenced by OpenConversation().

◆ outstanding_requests

int outstanding_requests

Definition at line 172 of file pdfdde.c.

Referenced by Callback().

◆ pdfdde_version_string

const char* pdfdde_version_string = "0.6"

Definition at line 52 of file pdfdde.c.

Referenced by main().

◆ sFileName

char* sFileName = NULL
static

Definition at line 43 of file pdfdde.c.

◆ sGoto

char* sGoto = NULL
static

Definition at line 47 of file pdfdde.c.

Referenced by main(), pdfopen(), and pdfserver().

◆ sLongFileName

char sLongFileName[256]
static

Definition at line 48 of file pdfdde.c.

Referenced by CheckFileName(), main(), pdfclose(), pdfopen(), and pdfserver().

◆ SrvNam

char* SrvNam[7]

Definition at line 26 of file pdfdde.c.

Referenced by main(), and OpenConversation().

◆ sServerName

char* sServerName = NULL
static

Definition at line 50 of file pdfdde.c.

Referenced by main(), and OpenConversation().